Android newbie here, had some quick questions:

How can you tell if your project is launching on a device?

Where do you see compilation errors? Just the event log?

How do you stop a project running on the device, and how can you tell if its stopped?

I have a Google Glass app that uses a CardScrollView to display a series of Cards.

Touch gestures work to move between cards, but I need to be able to jump to specific cards by their index. I want to use contextual voice commands (ignore its limitations for now) to do this, for example: "ok glass, go to card 25".

I was hoping to be able to do something like this...

CardScrollView mCardScrollView = new CardScrollView(this);
    // ...
    // "ok glass, go to card 25"
    // ...
mCardScrollView.setFocus(25);

...But I can't seem to find a function to do that.

I didn't find anything on Google's reference page: https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/widget/CardScrollView

And their sample code doesn't cover this either:
https://developers.google.com/glass/develop/gdk/ui-widgets#scrolling_cards_in_activities

I'd like to keep using CardScrollView if possible because I like the way it animates and scrolls compared to ViewFlipper or ViewPager. It's such a simple functionality that I believe should be there. Perhaps I'm missing something?

Hi I want to know the best way to go about this. I will put it in a simple counting app so its easier to explain.

I have 4 Buttons and 1 final Button which is the plus 1 Button. I also have 4 rows of Zero's. I want to make the first 4 Buttons like switches that change where to add the 1 to. So if button 1 is on and the plus 1 one is pressed then it would add the 1 the the zero in the first row, and if the 3rd button is then selected and the plus1 is pressed it would add the 1 the the 3rd row etc.

I also want the only one button at a time to be activated so if button 1 is on and the 4th button is pressed, it would turn off button 1 and turn on button 4 and in turn if the plus 1 is pressed it would add the 1 to the 4th row zero.

Any help would be much appreciated.

I'm trying to make an Android app that uses collision detection. To do this, I'm trying to set a rectangle to an ImageView. The only things I've found are ways to set a rectangle to a sprite or a specific point. One of the ImageViews that I need to detect moves across the screen even though it isn't a sprite. Is there a way to set a rectangle to an ImageView so I can detect when the two rectangles collide?

This is the code I used for making the ImageView move:

int x=brickimg.getRight()-brickimg.getLeft();
   int y=brickimg.getBottom()-brickimg.getTop();
   final TranslateAnimation translate = new TranslateAnimation(
           Animation.ABSOLUTE,x1, Animation.ABSOLUTE,
           -4000, Animation.ABSOLUTE,0,
           Animation.ABSOLUTE,y);//How far it goes on the axis. The first x goes left, second x goes right, first y goes up, second goes down
   translate.setDuration(1200);//speed of the animation
   translate.setFillEnabled(true);
   translate.setFillAfter(true); 

I'm trying to get familiar with RxJava. Here's the use case that i'm trying to achieve:

I have a button on my screen and i'm trying to collect the number of taps. So if a user taps the button, a click is registered and a log is produced. Now if the user clicks the button twice, then it registers both clicks, collects them and outputs 2 instead of 1.

Essentially, i'm trying to accumulate the number of clicks, over a span of time and then spit out the final results. I'm guessing "buffer" is the method that I need to be using. I whipped up a quick example in Android (code follows), but the buffer method doesn't seem to be as simple as just collect all event inputs and spit out a collection.

public class DemoFragment
    extends Fragment {

    private int _tapCount = 0;
    private Observable<List<Integer>> _bufferedObservable;
    private Observer<List<Integer>> _observer;

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        _setupLogger();

        _bufferedObservable = _getBufferedObservable();
        _observer = _getObserver();
    }


    // the library butterknife allows this
    @OnClick(R.id.btn_start_operation)
    public void onButtonTapped() {
        _log("GOT A TAP");
        _bufferedObservable.subscribeOn(Schedulers.io())
                         .observeOn(AndroidSchedulers.mainThread())
                         .subscribe(_observer);
    }

    private Observable<List<Integer>> _getBufferedObservable() {
        return Observable.create(new Observable.OnSubscribe<Integer>() {


            @Override
            public void call(Subscriber<? super Integer> subscriber) {
                subscriber.onNext(1);   // send one tap here
            }

        }).buffer(2, TimeUnit.SECONDS); // collect all taps in the last 2s
    }

    private Observer<List<Integer>> _getObserver() {
        return new Observer<List<Integer>>() {


            @Override
            public void onCompleted() {
                _log(String.format("%d taps", _tapCount));
                _tapCount = 0; // reset tap count
            }

            @Override
            public void onError(Throwable e) {}

            @Override
            public void onNext(List<Integer> integers) {
                if (integers.size() > 0) {
                    for (int i : integers) {
                        _tapCount += i;
                    }
                    onCompleted();
                } else {
                    _log("No taps received");
                }
            }
        };
    }

    // ... other method that help wiring up the example (irrelevant to RxJava)
}

Can anyone help me understand the misconception in my understanding here?

Problem 1: I'm expecting _getObserver()'s onNext to send me a list with the accumulated number of taps. So if the button was hit 5 times, then i'm expecting a List with 5 items, each of which have the value "1". I'm guessing this is incorrect at many levels

Problem 2: I basically do a console log if no events were received by checking List<Integer> integers size. If list is not empty, i throw in a console log, saying "not taps received". It appears that the Observable NEVER stops. It's almost like a timer, where it constantly keeps going on and on, even when no button tap was registered. Is there way to stop the Observable, if no event was registered in the last 10s?

Problem 3: The number of emits seem to almost exponentially increase. It's almost like its gathering the button empty taps from all previous times.

I have a fragment that contain a simple EditText and when I run my programm the EdtiText will be not Editable but if Edit it within the code it works like this :

myEditText.setText("COCO");

Also when I don't use fragment (mean in the normaly Activity) then the EditText will be Editable. So my Layout that contain the EDitText is:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <EditText
        android:id="@+id/search_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:ems="10"
        android:hint="@string/search" >

        <requestFocus />
    </EditText>

    <Button
        android:id="@+id/search_btn"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="15dp"
        android:layout_height="40dp"
        android:layout_weight="1"
        android:background="@drawable/search_setting" />

</LinearLayout>

<ListView
    android:id="@+id/list_eleuteurs"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
</ListView>

it's called search_text. and my fragment is :

public class ListElecteur extends Fragment {

private ListView listElecteurs;
private EditText search ;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {

    final View view = inflater.inflate(R.layout.list_electeurs_fragment,
            container, false);

    return view;
}

ah, I forgot, when I typed in myEditText the current Tab take the focus so any thing wrote in myEditText :(, do you have an idea. Thanks.

I am new to android and i am making listview based app. In my app i have items from Acitity_2 to Activity_1. Activity_1 has the list view. when user click on ADD button of activity1 then Activity_2 will be called. Activity_2 has the EditText. The value of EditText should update the ListView. But it only takes last value of the Edittext.

Here is the code of Activity_2:

          Intent intent = new Intent(ItemDetails.this, MainActivity.class);
          intent.putExtra("values", values);
          startActivity(intent);

Code for Activity_1

        /** Defining the ArrayAdapter to set items to ListView */
    adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_multiple_choice, list);
  // list.add("Aluminium foil");

   adapter.notifyDataSetChanged();
        String itemVal=getIntent().getStringExtra("values");
        if(itemVal==null){

        }else{
            list.add(itemVal);

        }

Please help me to solve this.Thanks in advance.

Let's say i want to write a quick app that turns on Wifi when I am near into some place and turns it off when I get out of that place.

Ok, so I am using a Geofence (150m radius) and I am getting a very, very inaccurate location:

enter image description here

However, if I turn the Wifi on or I turn "Scanning always available" (in Wifi settings) then the location gets almost perfect:

enter image description here

So I am trying to know if what I want to do is possible (only having 3G/GSM location, because I do not have Wifi neither GPS turned on).

Any ideas? Something that am I missing?

In my Listview, i want to load images while scrolling also as Pinterest app does. I know there are solutions like using UIL and Volley to stop image loading on scroll to avoid lag but then how Pinterest people are handling this situation without any lag?

Anyone has any idea about this?

I would just like to know if it is possible or not. If it is possible can you please point me where to start?

The idea: I would like to make a service that will run when my tablet boots up. This service will automatically run a remote desktop access app (from google play market) and it will establish a connection with predefined settings, so I do not have to manually start the remote desktop app and click "Connect". Is this possible even if I do not have the source code of the remote desktop app? Can you please help me?

Or is there another way to establish remote desktop connection from my Android tablet right when the tablet boots up?

PS: I am not doing this for somebody else, it is just for my needs, so please dont look at this as it is nonsense because no one will run any app like this on startup anyways. :)

Thank you

I have an Android application that needs to access data from different screens. The main problem is, each one needs to be able to modify the data, and there is quite a bit of it - 3 million integers divided among six arrays.

The options that I can think of are:

  1. Put each screen in a separate view, and use a ViewAnimator as the topmost layout, switching between the child views as necessary; this way, the arrays are defined in the main activity and are accessible (both reading and writing) by all of the screens.

  2. Put each screen in its own Activity, and pass the data from one screen to another by putting it into a Bundle that is included in the startActivityForResult call (and any changes would be passed back through the returned Intent's Extras in onActivityResult). The problem with this is, the data has to be copied quite a few times, which, it seems to be, involves quite a bit of overhead in terms of both time and memory.

  3. Create a Class to hold the data; create a variable of that Class in the main activity, and pass that variable back and forth - but is the variable itself being passed to the second activity, or a copy of it (so any changes would then not be reflected in the variable in the main activity)?

Is there a preferred method for a situation like this? Am I leaving something out?

In my Application, i tried to create a Array with multiple check boxes.My app worked when i click CheckBoxAll select all checkboxes and when i uncheck CheckBoxAll deselect all chekboxes.But, if i deselect one of the chekboxes when all of them are checked,CheckBoxAll its not un-checking..

This is my array

 ArrayList<CheckBox> boxes = new ArrayList<CheckBox>();

checkBoxAll = createCheckBox(R.id.checkBoxAll);
        boxes.add(checkBoxAll);
        checkBoxCompany = createCheckBox(R.id.checkBoxCompany);
        boxes.add(checkBoxCompany);
        checkBoxType = createCheckBox(R.id.checkBoxType);
        boxes.add(checkBoxType);
        checkBoxName = createCheckBox(R.id.checkBoxName);
        boxes.add(checkBoxName);
        checkBoxPhone = createCheckBox(R.id.checkBoxPhone);
        boxes.add(checkBoxPhone);
        checkBoxAddress = createCheckBox(R.id.checkBoxAddress);
        boxes.add(checkBoxAddress);
        checkBoxEmail = createCheckBox(R.id.checkBoxEmail);
        boxes.add(checkBoxEmail);
        checkBoxwebSite = createCheckBox(R.id.checkBox4WebSite);
        boxes.add(checkBoxwebSite);

and this is my function

 public void checkAllListener() {
        checkBoxAll.setOnCheckedChangeListener(new OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                // TODO Auto-generated method stub

                for(CheckBox chk : boxes) {
                    chk.setChecked(isChecked);
                }
            }
        });
    }

Welcome all

i need to add a onScreen Joystick to my game.

I found some code examples of joysticks but none of them moves a view on the screen, and i dont know how to move a view in the screen with the exact movement and acceleration of the joystick movement.

This is one of the examples i found:

http://www.youtube.com/watch?v=S7U_B7EDT_Q

Source code: http://goo.gl/m0bTse

I have no idea of how to move a view (my game spaceship) in the screen with the joystick movement.

Thanks a lot

I'm working with Azure Mobile Services, I need to get emails from table depending on a list of Id. I have a method that get specific item from the table by looping the list of Id and geting each item. But everithing executes beforeonComplete. This is my code:

private ArrayList<String> administratorsEmail = new ArrayList<String>();

public boolean getAdminsEmail(List<String> adminList)
{

    for(String ids : adminList)
    {
        UsersTable.lookUp(ids, new TableOperationCallback<Users>()
        {
            public void onCompleted(Users entity, Exception exception, ServiceFilterResponse response)
            {
                if (exception == null)
                {
                    administratorsEmail.add(entity.getEmail());
                }
            }
        });
    }

    //CODE HERE EXECUTES BEFORE ONCOMPLETE
}

I need to fill the administratorsEmail list. I need to execute some code after the list administratorsEmail has been filled completely. But I can't put code in onComplete method because it would execute the same times than the loop.

I need to know when OnCompleted has finished. Any body could give a better idea or some help for this?

Thank you!

I have a listview that contains a botton in each row.

The button open a dialog for single value choice when clicked.

The thing is when I move down the list, values in the buttons are moving. The first value is repeated each 8 rows.

Here is my getView() Code :

public static class ViewHolder {
    public Button listaCerrada;
}


    public View getView(final int position, View convertView, ViewGroup parent) {
    final ViewHolder holder;
    try {
        if (convertView == null) {
            holder = new ViewHolder();
            LayoutInflater vi = (LayoutInflater) ctx
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = vi.inflate(R.layout.row_lista_form, null);

            holder.listaCerrada = (Button) convertView
                    .findViewById(R.id.listaCerrada);
            }
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        holder.listaCerrada.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // Get list Values
                String datoValido = metrica.getlForms().get(position)
                        .getProducto().getDatoValido();
                AlertDialog.Builder adb = new AlertDialog.Builder(ctx);
                // HAY:HAY;NO HAY:NO HAY
                String[] parts = datoValido.split(";");
                ArrayList<String> values = new ArrayList<String>();
                for (String s : parts) {
                    String[] part2 = s.split(":");
                    values.add(part2[0]);
                }

                final CharSequence[] items = values
                        .toArray(new CharSequence[values.size()]);

                adb.setSingleChoiceItems(items, 0,
                        new DialogInterface.OnClickListener() {

                            @Override
                            public void onClick(DialogInterface dialog,
                                    int which) {
                                dialog.dismiss();

                                holder.listaCerrada.setText(items[which]);
                            }

                        });
                adb.setNegativeButton("Cancelar", null);


                adb.show();

            }
        });


    } catch (Exception e) {
        e.printStackTrace();
    }
    return convertView;
}

Recently started getting a rather odd Catlog which doesn't describe what's going wrong very well.

I have it posted here: http://pastie.org/9415113

The error seems to be this part here:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.brad.myapplication/com.example.brad.myapplication.MyActivity}: java.lang.NullPointerException
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
        at android.app.ActivityThread.access$600(ActivityThread.java:130)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4745)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
        at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.NullPointerException
        at com.example.brad.myapplication.MyActivity.onCreate(MyActivity.java:55)
        at android.app.Activity.performCreate(Activity.java:5008)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
        at android.app.ActivityThread.access$600(ActivityThread.java:130)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4745)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
        at dalvik.system.NativeStart.main(Native Method)

Line 55:

        DebugCarTxt = (EditText) findViewById(R.id.DebugCar);

        // you should  instantiate 'DatabaseHandler'  here
        DatabaseHandler db = new DatabaseHandler(this); // "this" refer to the context
        Car cars = db.getCurrentCar();

        db.createCar(new Car(cars.get_id(),cars.get_address(),cars.get_postcode(),cars.get_image()));
//this is line 55       String rows= "id : "+ cars.get_id()+ " address : "+cars.get_address() + "postcode : "+cars.get_postcode()+" image : "+cars.get_image();

I use my worklight app as a container for a server page. However, the server page prompts a window authentication challenge dialog. So basically when your enter this page, a dialog window would show to ask for your credentials. It shows on the mobile browser, but does not show inside the app for android and ios. I did some research. There is only native solution. It seems that authentication pupup does not work with UIWebView. Does worklight has a solution / workaround for this? Thanks.

I am having problems working properly with the Android File API.

Here is what I want to achieve, I am downloading videos from Amazon which should be saved locally after they have been fully downloaded. I am doing this in pretty straighforward manner (code has been shortened and I just show the essential lines):

inputStream = connection.getInputStream();
fileOutputStream = context.openFileOutput("my_video", Context.MODE_PRIVATE);
// Read bytes (and store them) until there is nothing more to read(-1)
do {
    int numread = inputStream.read(buffer);
    if (numread <= 0){
        break;                  
    }
    fileOutputStream.write(buffer, 0, numread);
} while (true);

where inputStream and fileOutputStream are instance variables.

This actually works pretty well if the video gets fully downloaded. In that case, everything is fine and I can access the video locally afterwards.

However, it can happen in the app that the video download gets interrupted and thus needs to be cancelled. If this is the case, I would like to delete the file which is there but obviously not complete.

The code to delete the file is as follows:

FileProvider fileProvider = new FileProvider();
File newFile = new File(context.getFilesDir(), "my_video");     
Uri contentUri = FileProvider.getUriForFile(context, FILE_PROVIDER, newFile);
fileProvider.delete(fileToDelete, null, null);

The last line fileProvider.delete(fileToDelete, null, null); is throwing a NullPointerException, I debugged it and saw that the fileProvider is initialized, so I strongly assume that there is an issue with the URI that I am using to call delete, but I don't know what's wrong with it. Does anyone know how to do a proper delete using the file provider?

Update: I hope this isn't too much of an overkill, I am now posting my whole VideoDownloader class:

public class VideoDownloader {

  private final int TIMEOUT_CONNECTION = 5000;//5sec
  private final int TIMEOUT_SOCKET = 30000;//30sec

  private static final String FILE_PROVIDER = "com.orangewise.fileprovider";

  private Context context;
  private String videoURL;
  private String targetFileName;

  private HttpURLConnection connection;
  private InputStream inputStream;
  private FileOutputStream fileOutputStream;

  private boolean downloadFinished;

  public VideoDownloader(Context context, String videoURL, String targetFileName) {
    this.context = context;
    this.videoURL = videoURL;
    this.targetFileName = targetFileName;
    this.downloadFinished = false;
  }

  public boolean isDownloadFinished(){
    return this.downloadFinished;
  }

  public void startDownload(){
    downloadVideoFile(this.context, this.videoURL, this.targetFileName);    
  }

  private void downloadVideoFile(Context context, String videoURL, String targetFileName) {
    URL url = null;
    try {
        url = new URL(videoURL);

        // Open a connection to that URL.
        connection = (HttpURLConnection) url.openConnection();

        connection.setReadTimeout(TIMEOUT_CONNECTION);
        connection.setConnectTimeout(TIMEOUT_SOCKET);r

        inputStream = connection.getInputStream();
        fileOutputStream = context.openFileOutput(targetFileName, Context.MODE_PRIVATE);

        byte[] buffer = new byte[3 * 1024];
        int counter = 0;

        // Read bytes (and store them) until there is nothing more to read(-1)
        do {
            int numread = inputStream.read(buffer);
            if (numread <= 0){
                break;                  
            }
            fileOutputStream.write(buffer, 0, numread);
        } while (true);
        downloadFinished = true;

        // Clean up
        closeStreams();
    } catch (Exception e) {
        Log.d(Constants.ERROR, "ERROR [" + getClass().getName() + "]: Caught exception (" + e + ") when trying to download video: " + e.getMessage());
    }
  }

  public Uri getUriForFile(){
    return getUriForFile(context, targetFileName);
  }

  private Uri getUriForFile(Context context, String fileName){

    File newFile = new File(context.getFilesDir(), fileName);       
    Uri contentUri = FileProvider.getUriForFile(context, FILE_PROVIDER, newFile);

    return contentUri;
  }

  public void cancel(){
    // 1. cancel the connection
    Log.d(Constants.LOG, "DEBUG [" + getClass().getName() + "]: Cancel connection");

    try {
        connection.disconnect();
        closeStreams();

        if(!isDownloadFinished()){              
            // Remove the file if it has not been fully downloaded
            FileProvider fileProvider = new FileProvider();
            Uri fileToDeleteUri = getUriForFile();
            fileProvider.delete(fileToDeleteUri, null, null); // returns 1 if the delete succeeds; otherwise, 0.
        }
        else{
            Log.d(Constants.LOG, "DEBUG [" + getClass().getName() + "]: Leave the file, it has been completely download");
        }
    } 
    catch (Exception e) {
        Log.d(Constants.ERROR, "Exception ( " + e + " ) caught: " +  e.getMessage() + "; ");
    }
}

private void closeStreams() throws IOException{     
    // Close the streams
    try {           
        fileOutputStream.flush();
        fileOutputStream.close();
        inputStream.close();
    } catch (NullPointerException e) {
        Log.d(Constants.ERROR, "Null pointer exception caught: " +  e.getMessage());
    }
    Log.d(Constants.LOG, "DEBUG [" + getClass().getName() + "]: Clean up performed");
  }
} 

Another update: Here is my stack trace:

07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152): java.lang.NullPointerException
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at android.support.v4.content.FileProvider.delete(FileProvider.java:497)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at com.orangewise.just4kidstv.util.VideoDownloader.cancel(VideoDownloader.java:134)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at com.orangewise.just4kidstv.util.VideoDownloadTask.cancel(VideoDownloadTask.java:20)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at com.orangewise.just4kidstv.activities.VideoPlayerActivity.onStop(VideoPlayerActivity.java:64)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1170)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at android.app.Activity.performStop(Activity.java:3873)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:2623)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:2694)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at android.app.ActivityThread.access$2100(ActivityThread.java:117)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:968)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at android.os.Looper.loop(Looper.java:130)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at android.app.ActivityThread.main(ActivityThread.java:3687)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at java.lang.reflect.Method.invokeNative(Native Method)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at java.lang.reflect.Method.invoke(Method.java:507)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
07-23 17:31:29.114: E/com.organgewise.just4kidstv.LOG(6152):    at dalvik.system.NativeStart.main(Native Method)

So i created an app with an activity and mutiple fragments. In one fragment i tried to add an menu to it, but this menu is shown as a popup menu with 3 dots and not shown as action item to be clicked immediately(like in a normal menu). The menu icon isn´t shown, too.

Here is my code:

Java:

setHasOptionsMenu(true);
    return view;
}
    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        super.onCreateOptionsMenu(menu, inflater);
        inflater.inflate(R.menu.twitter_menu, menu);
    }

xml:

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/menuitem_getBack" 
        android:title="#rutenfest2014"
        android:showAsAction="always|withText" 
        android:icon="@drawable/twitter_logo" />
</menu>

I want the menu to be shown with its icons in the actionbar.

What am i doing wrong ?

Hi Android Spotify developers. Could you please advise which API to use (LibSpotify beta or New Android SDK beta + Web API) to develop application with Spotify functionality for Android?

As I see from API description LibSpotify provides more information than Web API. I could not find search playlists and TopList in Web API (in LibSpotify it is sp_search_create and sp_toplistbrowse_create). This adds pros for using Libspotify.

On the other hand, as per Spotify API Announcements, “LibSpotify beta for Android is being deprecated and will be removed from the Spotify Developer Site”. Does it mean that there is no sense to use Libspotify? When Libspotify will be completely deprecated?

I want to implement App Licensing in my app. As we know, for that we need to install "Google Play Licensing Library" from the Extras Folder of SDK Manager. But, i was unable to import the Library Project and the Sample Project, so i deleted that package thinking that re-installation would fix that.

Now My SDK Manager is not showing me that package.

Is there any way to install it back again?

OR i have to get a new SDK.

Please Help.