"3123286","1","","","2010-06-26 08:50:25","1","297","<p>I intend to show the clock in this way</p><p><img src=""http://i48.tinypic.com/iylezo.jpg"" alt=""alt text""></p><p>I've done for the clock .. and I'm not sure how to get the small text ""PM"" like pic above. </p><p>also for the MON TUE WED ....</p><pre><code>Calendar c = new GregorianCalendar(); if(c.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY){    System.out.println(""MON"");} else if (c.get(Calendar.DAY_OF_WEEK) == Calendar.TUESDAY){        System.out.println(""TUE"");}</code></pre><p>and so forth . </p>","2438460","","2438460","","2010-06-26 09:59:06","2013-01-31 06:13:18","how do i Show a clock like this","<java><android><calendar><clock>","2","0","","",""
"3123475","1","3123526","","2010-06-26 10:11:46","0","1216","<pre><code>public class BabyName extends Activity implements View.OnClickListener, Runnable{    /** Called when the activity is first created. */    Login loginclass=new Login();    ProgressDialog dialog;    Thread t=new Thread(this, ""sample"");     AlertDialog al;     long id;     boolean flg=false;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                Button launch=(Button)findViewById(R.id.login_button);        launch.setOnClickListener(this);    }    public void onClick(View viewparam){        EditText username=(EditText)findViewById(R.id.txt_username);        EditText password=(EditText)findViewById(R.id.txt_password);        String sUserName = username.getText().toString();        String sPassword = password.getText().toString();            dialog=ProgressDialog.show(BabyName.this, """", ""Please wait for few seconds..."", true);            loginclass.setId(sUserName);            loginclass.setPassword(sPassword);                 al=new AlertDialog.Builder(this).create();            id=t.getId();                            t.start();                      message();    }    public void run(){                Get_Data getdata=new Get_Data();                    getdata.logincheck(loginclass);            dialog.dismiss();           }    public void message(){        if(loginclass.getStatus().trim().equals(""true"")){                       dialog.dismiss();            /*  Intent i = new Intent(BabyNames.this, ChoiceActivity.class);                startActivityForResult(i, SUB_ACTIVITY_REQUEST_CODE);*/            }else if(loginclass.getStatus().trim().equals(""false"")){                al.setTitle(""Error"");                al.setMessage(""Username or password incorrect!!"");                al.setButton(""OK"", new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int which) {                      return;                  } });                 al.show();            }else {                //al=new AlertDialog.Builder(this).create();                al.setTitle(""Http Error"");                al.setMessage(""Not Connected"");                al.setButton(""OK"", new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int which) {                      return;                  } });                 al.show();            }    }}</code></pre><p>This is the code of login page of android and when i enter click login button the progressdialog appears and after that alertbox must be shown if username or password incorrect but it is not showing that alert.</p><p>so is there any problem in threading or something else? please help me</p>","314426","","","","","2010-06-26 10:34:52","alert dialog not appearing in android","<java><android>","1","0","","",""
"3123545","1","5512147","","2010-06-26 10:38:24","4","3423","<p>I'm trying to obtain an instance of <code>ServiceState</code> in my <code>Activity</code>. But how am I supposed to do this? There is no static method to obtain an instance or any method on any service that returns an <code>ServiceState</code> instance.<br>There is the <code>TelephonyManager.listen()</code> call. But I want to get the <code>ServiceState</code> instance when I want, not when Android calls my listener because something changed.  </p><p>The documentation of <code>ServiceState</code> can be found here: <a href=""http://developer.android.com/reference/android/telephony/ServiceState.html"" rel=""nofollow"">http://developer.android.com/reference/android/telephony/ServiceState.html</a></p>","373138","","648313","","2012-05-17 13:51:16","2012-05-17 14:02:53","How to obtain an instance of ServiceState?","<android>","4","1","1","",""
"3123556","1","3123968","","2010-06-26 10:42:44","3","7430","<p>I would like to change text and back ground color of my Listview without building custom rows. Is this possible ?</p><p>Here is my code which is NOT working.</p><pre><code>&lt;ListView    android:id=""@android:id/list""    android:textColor=""#000000""               android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:cacheColorHint=""#000000""/&gt;</code></pre><p>Any help would be appreciated.</p><p>Thank you</p>","110287","","133802","","2011-12-19 10:23:35","2011-12-19 10:23:35","Can I Change ListView style Android without building custom listview?","<android><listview>","1","0","3","",""
"3123570","1","3123763","","2010-06-26 10:46:03","1","1457","<p>iam about to call a service from my server.Should I use Json or Soap? </p><p>My service is in asp.net</p><p>Are there not any packages in android that has to do with the service connections?</p>","371301","","","","","2010-07-10 02:38:55","Service android json or soap?","<android><json><soap>","4","1","","",""
"3123610","1","","","2010-06-26 10:56:36","0","1307","<p>The database file is identified by <a href=""http://en.wikipedia.org/wiki/Dalvik_%28software%29"" rel=""nofollow"">Dalvik</a> when I insert it via the Dalvik Debug Monitor Server (DDMS), but when I add the database to the project assest it doesn't even upload to the device (as I can see through the DDMS). How to fix it?</p>","368440","","63550","","2010-07-17 00:47:36","2010-07-17 00:47:36","How do I manually insert a database into a Android project?","<android>","1","0","","",""
"3123697","1","3123904","","2010-06-26 11:29:04","5","3445","<p>I'm trying to get a list of the available cellular network providers. Unfortunately I can't find any service or class that might help me out.  Does anyone have an idea on how to manage this?  It has to be possible since you can see the list when you go to the settings on your Android device.</p>","373138","","1288","","2012-08-04 17:16:19","2012-08-04 17:16:19","How to get a list of available network providers?","<android>","1","0","","",""
"3123701","1","3123911","","2010-06-26 11:30:55","1","5271","<p>I would like to program a image picker which should choose an image from the library. Is it possible to do this in a smooth way with the Android sdk? I'm pretty new to Android programming.</p>","617461","","","","","2013-02-10 03:58:59","How to program an image chooser in Android?","<android>","2","0","","2013-02-10 04:58:10",""
"3123734","1","","","2010-06-26 11:41:42","2","1476","<p>I wish to do the Image Switcher's Touch Event. That is when i touch it, it should wake up the zoom controls. After zoomed in, the image can able the touch scroll on the image up and down. how to do it? Is there any default zoom controls? If not, tell me your suggestion, idea and also valuable links about this? make a note the Target version is android 1.6. </p><p>Thanks.</p>","267269","","267269","","2010-07-20 13:37:01","2010-07-20 13:37:01","Zoom Controls for ImageSwitcher in Android 1.6?","<android><image><zoom><imageview>","1","0","","",""
"3123956","1","","","2010-06-26 13:03:27","1","1183","<p>I am using the new Android 2.2 API to add a contact. I am using the following code to perform the insert.</p><pre><code>ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();ops.add(ContentProviderOperation.newInsert(Data.CONTENT_URI)    .withValue(Data.RAW_CONTACT_ID, id)    .withValue(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE)    .withValue(Data.DISPLAY_NAME, first_name)    .withValue(Phone.NUMBER, pnumber)    .withValue(Phone.TYPE, Phone.TYPE_CUSTOM)    .build());try {    getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);} catch (RemoteException e) {}catch (OperationApplicationException e) {}</code></pre><p>The code executes fine without any exception. However, the new contact is not visible in the Android Contacts. I tried searching on the net but couldn't find any answer. What I might be doing wrong ?</p>","282826","","244296","","2010-06-26 14:36:36","2012-08-22 07:37:43","Adding Contact in Android 2.2 API","<android>","0","2","","",""
"3124014","1","","","2010-06-26 13:27:30","11","10690","<p>I am new to Android Development. What I want is to know how I have to begin thinking to program a neat, GUI. I guess the android.opengl API is a good starting point.</p><p>Let's say we want to create something like a simplified 3D-Pool-Billard-Game: You see the table from the top and you have on the table the balls. You want to make them realistic (shadow, gloss).</p><p>Questions on my mind are:</p><ul><li>What kind of Graphics do I need?</li><li>How to begin coding? </li><li>What kind of classes do I need? For each element (ball, table, ..)?</li><li>Where to create and encapsulate the ""3D-ness""?</li></ul><p>If you know better/additional questions, just add them or/and let me know in which direction I have to think in this case of developing.</p><p>My skills/background on Java: I've programmed a lot in Java EE and used to handle graphical output with JSP/JSF. So this mobile SE for Android is new to me. Hope to get some intersting stuff together for a smooth access.</p><p>Chris</p>","149690","","2504879","","2013-07-30 21:24:40","2013-07-30 21:24:40","How to begin creating 3D (Game-) GUIs for Android Applications (e.g. with OpenGL)?","<java><android><3d><opengl-es>","1","2","4","2013-07-31 02:02:19",""
"3124102","1","3384471","","2010-06-26 13:57:49","3","505","<p>I'm currently debugging my app which is quite complex and has up to 5 activity levels. In order to detect memory leaks (i.e. activities that aren't removed from memory even finish() is called, due to some references held somewhere) I want to check which activities are still alive in memory.</p><p>Currently I create hprof dumps, but it's not very convenient, cause every time I need to mount the sdcard, copy the hprof dump file from the sdcard to my PC, etc.</p><p>(Side note: I already tried to automate the pulling of my hprof file more easily, but I'm on an unrooted device and <code>adb pull &lt;hprof file&gt;</code> won't let me / no permission.)</p><p><strong>Therefore I am wondering, if all I want to know is IF and WHICH activities are still currently alive in my memory, is there a way through the Android API or any other way on-the-fly with which I can achieve this (list all alive activities of my app), programatically.</strong></p>","241475","","241475","","2010-06-26 16:04:23","2010-08-02 01:28:01","Is there a way to visualize the activity stack (activities in memory) on Android?","<android><debugging><memory-leaks>","2","0","","",""
"3124217","1","3124239","","2010-06-26 14:35:20","2","1823","<p>I will be making a mobile application in Android. My application is like Google Map's Get Direction feature, but a lot more complex, so I need to store data about points in the map. So I'm worried that SQLite may not be able to handle these large amount of data(or considering the limited storage of the phone). I have no background in SQLite so please bear with me.</p>","376290","","948041","","2012-04-12 13:45:30","2012-04-12 13:45:30","Can SQLite handle large amount of data","<android><sqlite><map>","3","4","","",""
"3124343","1","3149082","","2010-06-26 15:11:38","3","218","<p>Reading the users' feedbacks about my apps is really important, but in my phone I can only read those written in the language of my phone (Italian).</p><p>Is there a way to read all of them?</p><p>A program for PC or a website could be a good solution.</p><p>(Actually Cyrket and AndroLib read comments directly from the market, but sometimes they don't update or are very slow).</p><p>Thanks.</p>","252711","","","","","2010-06-30 12:09:55","How to read Android Market comments?","<android><comments><google-play>","1","1","1","",""
"3124354","1","3124425","","2010-06-26 15:15:09","1","512","<p>I am working on an android application, where there are 4 activities. Activity1 is main activity and there are different buttons on that activity which can open other activities. Other 3 activities can also open each other. There is a thread running in Activity1 which returns some counter. I need to show that counter on all activities. </p><p>At an specific time, the thread doesn't know which activity is at top. What is the right way to control this scenario, such that thread output should update on all activities, no matter which one is at top?</p>","278194","","","","","2010-06-26 15:41:13","how to send data to multiple activities in controlled manner in Android?","<android>","1","0","","",""
"3124515","1","","","2010-06-26 16:05:17","0","2439","<p>I'm trying to make a list where each row has a text at the top and bottom and another one image aligned right (like the image attached).</p><p>but I can not. Could anyone help me?</p><p>sample image:</p><p><a href=""http://www.freeimagehosting.net/uploads/fb6e2055f5.png"" rel=""nofollow"">http://www.freeimagehosting.net/uploads/fb6e2055f5.png</a></p>","376804","","","","","2010-06-26 16:52:41","ListActivity layout Custom","<android><listactivity>","1","0","1","",""
"3124516","1","3124546","","2010-06-26 16:05:40","1","1344","<p>I have a service, that requests another class, which launches an AsyncTask</p><p>Service->Weather Class->Execute Method->Asynctask->Execute</p><p>this is launched in the service by</p><pre><code>new Weather(this).execute(); // the execute is a method of the class, not of the AsyncTask</code></pre><p>how do I detect in Service that the AsyncTask finished so I can call stopSelf?</p>","243782","","243782","","2010-06-26 16:11:04","2012-10-24 15:37:24","How to stop service after AsyncTask finished?","<android><service><android-asynctask>","2","2","1","",""
"3124682","1","","","2010-06-26 16:52:25","0","384","<p>I am using MS Windows 7 Home Premium. 64 Bit OS.</p><p>I am just wondering, can I install Android Development kit on this system.</p><p>ThanksFArid</p>","377034","","","","","2010-06-26 19:31:13","ADK installation Windows 7 Home premium 64 bit OS","<android><framework-installation>","1","0","","",""
"3124693","1","","","2010-06-26 16:55:53","1","2288","<p>I am trying to add an 'Android Library project' I have created to another regular Android project.</p><p>The Library Project had a jar dependency and was also dependent on another java project in my workspace.  I had to add both of these to the my 'regular Android project' because otherwise Eclipse could not find them (Not sure if this was the right thing to do because it would mean that I will have to manually update all projects when the library gets another jar dependency).</p><p>Anyway, the errors went away and now the Regular Android Project can't find the R class, I have tried a clean but it did not work.  I checked in the /gen folder and both the R classes are there - from the library and the regular project.They have the correct strings inside them.</p><p>what is going wrong?</p>","248521","","","","","2010-06-26 18:02:14","Added Android library project and now eclipse can't find my R class","<android>","1","0","","",""
"3124803","1","3125076","","2010-06-26 17:28:19","3","312","<p>I am very very new to Android. I was encouraged to take a closer look at Android when I heard about possbility to write applications on Android in scripting languages like Python. This sounds great and in fact works great.</p><p>I did some experiments and everything looks very interesting. I have noticed that I can either write my scripts on Android or create script file on my computer and then copy them to Android ase/scripts folder. This is somehow different (as far as I know) from process of creating application for Android in Java (when you create code, compile it to .apk and install on Android).</p><p>To be more specific I want to know:</p><ol><li>what are limitations (if any) of script-based applications on Android?</li><li>is it possible to ship apps written in scripitng languages to Android Market and let other users install them without requirement to install ASE?</li><li>is there some way to create more complicated, multi-file projects in scripting languages on Android?</li></ol><p>Thanks for any hints. Also please feel free to correct me if I made any error or wrong assumption in my question - as I wrote, I am very new to Android.</p>","359665","","359665","","2010-06-26 23:15:20","2010-10-21 18:49:47","Is it possible to use Android scripts created with ASE as typical application for Android (e.g. written in Java)?","<android><scripting><ase>","2","0","","",""
"3124959","1","3125625","","2010-06-26 18:02:03","2","711","<p>I have a GridView of 9 rows of which the first one is sort of ""header"" row.</p><p>As there are 8 more rows they flow beyond the end of screen and need to be scrolled down to.However this scrolling also causes the first row to go ""off-screen"".</p><p>Was wondering if there is any way I can prevent the first row alone from being scrolled off?</p><p>I dont want to make this a separate LinearLayout as it is part of a dynamic View (the GridView) that I create at runtime.</p><p>TIA</p>","365681","","","","","2010-06-26 21:56:09","Make top row of GridView non-scrollable","<java><android>","1","1","","",""
"3124962","1","3125024","","2010-06-26 18:02:22","1","384","<p>I want to create a page with X questions (the questions are stored in a database and I read them), headline and buttons at the end.</p><p>When the user clicks on one question than the question should transform into a dialog where the user can modify the question, however the other questions above and beneath it should still display the same way.</p><p>The way ListActivity is used in the sample notepad application in the android documentation it seems like the class can only display multiple items of the same type.</p><p>Is there a straightforward way to go about this problem?</p>","25282","","25282","","2010-06-26 18:12:08","2010-06-26 18:25:05","Displaying a list with different types of information in Android","<android><android-ui>","1","0","","",""
"3124965","1","3124991","","2010-06-26 18:02:54","2","7731","<p>I am new to android. I have a loginActivity which validates a user number and then starts a ""searchactivity"".</p><p>At runtime, I see the search activity coming up (after user is validated) but then android is having problems stopping the loginActivity.</p><p>I am getting a ""java.lang.runtimeexception: Unable to stop activity {com.insruance/com.insurance.LoginActivity}: android.app.SuperNotCalledException : Activityat android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3413)""</p><p>I would really appreciate if someone could point to what I am doing wrong.</p><p>Code :</p><pre><code>public class LoginActivity extends Activity{ DatabaseWrapper myDbHelper; private String agentNumber; private OnClickListener btnClickListner = new OnClickListener()  {    @Override  public void onClick(View v)   {   // TODO Auto-generated method stub      // = new DataBaseHelper();      try {    Log.d(""LoginActivity-&gt;onClick"", ""Before findByID"");    EditText editText = (EditText)findViewById(R.id.txtUserNumber);    Log.d(""LoginActivity-&gt;onClick"", ""After findByID"");    agentNumber = editText.getText().toString();    String msg = """";    AgentDbHelper agentHelper = new AgentDbHelper(myDbHelper.getDatabaseHandle());    Log.d(""LoginActivity-&gt;onClick"", ""Before agentIDExists"");        if (agentHelper.agentIDExists(agentNumber))     msg = ""Login success"";    else     msg = ""Login failed"";    Log.d(""LoginActivity-&gt;onClick"", ""After agentByID"");    myDbHelper.closeDatabase();    myDbHelper = null;    Toast.makeText(getBaseContext(),       ""User "" + agentNumber + "" found!"",       Toast.LENGTH_LONG).show();    callSearchActivity();   }    catch(SQLException sqlEx)   {    Log.d(""login - onclick"", sqlEx.toString());   }   catch (Exception e) {    // TODO: handle exception    Log.d(""login - onclick"", e.toString());   }   } };  private void callSearchActivity() {  Intent intent = new Intent(getBaseContext(), SearchActivity.class);  Bundle bun = new Bundle();  bun.putString(""agentNumber"", agentNumber);  intent.putExtras(bun);  startActivity(intent);   } @Override public void onStop() {    try {   Log.d(""In LoginActivity-&gt;onStop"", ""about to close myDbHelper"");   if (myDbHelper != null)   {    myDbHelper.closeDatabase();    Log.d(""In LoginActivity-&gt;onStop"", ""after myDbHelper is closed"");   }  } catch (Exception e) {   // TODO Auto-generated catch block   Log.d(""In LoginActivity-&gt;onStop exeption"", e.toString());   //e.printStackTrace();  } } @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        try {                 setContentView(R.layout.login);         Button loginButton = (Button)this.findViewById(R.id.btnLogin);         loginButton.setOnClickListener(btnClickListner);         myDbHelper = new DatabaseWrapper(this);         myDbHelper.openDatabase();        }        catch(Exception e) {      Log.e(""ERROR"", ""ERROR IN CODE:""+e.toString());     }</code></pre><p>} }</p>","300352","","","","","2010-06-26 18:13:22","android : Unable to stop activity","<android><android-emulator>","1","0","1","",""
"3125009","1","3125050","","2010-06-26 18:19:40","2","2384","<p>I've got an activity which uses an AlarmManager to call a BroadcastReceiver at a particular point in time. This all works fine, except when I try to add some extra strings to the intent when calling the BroadcastReceiver, they always come up as null on the other end.</p><p>Activity code:</p><pre><code>    Intent intent = new Intent(this, ScheduleReceiver.class);    intent.putExtra(""testString"", ""I'm a string"");    PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 999, intent, 0);    AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);    alarmManager.set(AlarmManager.RTC, System.currentTimeMillis(), pendingIntent);</code></pre><p>BroadcastReceiver code</p><pre><code> public void onReceive(Context context, Intent intent) {      Log.v(TAG, ""TestString: "" + intent.getStringExtra(""testString"")); }</code></pre><p>The content of 'teststring' is always <code>null</code> in the BroadcastReceiver, what am I doing wrong?</p>","277668","","","","","2010-06-26 18:32:31","Android passing data from Activity to BroadcastReceiver shows null","<android><activity><broadcastreceiver>","1","0","","",""
"3125045","1","3125648","","2010-06-26 18:30:53","2","3188","<p>The name of my Android app is 14 characters long with no spaces, as such, the full name is not visible on the home screen when displayed under the launcher icon.</p><p>I want to use an alternate name for displaying under the launcher icon, so I can break up the name into two strings separated by a space - so that the words should wrap.</p><p>How can this be done?</p>","268648","","","","","2014-04-04 08:45:03","Android: How to customize the label under the launcer icon","<android>","3","0","","",""
"3125126","1","","","2010-06-26 18:54:06","1","8039","<p>how do I make a navigation bar like this?</p><p><a href=""http://www.freeimagehosting.net/uploads/8aa355f9ef.png"" rel=""nofollow"">http://www.freeimagehosting.net/uploads/8aa355f9ef.png</a></p>","376804","","","","","2012-06-30 20:19:14","navigation bar Android","<android>","2","0","","",""
"3125284","1","3125343","","2010-06-26 19:45:31","8","924","<p>Is there a broadcast receiver or some kind of setting that we can listen/monitor to get notified if the internet/network has been connected.</p>","243782","","243782","","2010-06-26 20:25:30","2010-06-26 20:25:30","How can we get notified if the phone has got internet access?","<android><internet>","1","0","7","",""
"3125325","1","","","2010-06-26 19:56:53","2","311","<p>I'm using android scripting environment with python (ASE), and I'd like to terminate the shell executing the script when the script terminates.Is there a good way to do this?</p><p>I have tried executing on the last line:os.system( 'kill %d' % os.getppid() )</p><p>but to no avail.</p>","377108","","","","","2010-07-21 22:17:11","Terminating android ASE shell from within the script","<python><android><ase>","2","0","","",""
"3125567","1","3126956","","2010-06-26 21:33:06","6","3465","<p>I will try to be as clear as possible.</p><p><strong>Here What I am trying to do</strong></p><p>An Image Viewer, where Image would be display as big as they can on the device screen.For this purspose and for a better user experience, I thought of a Gallery.Untill there everything is OK!</p><p><strong>The problem</strong></p><p>The problem is that in the function getView of my Adapter, it uses only the Gallery.LayoutParams of the first Image I have in my Gallery. Which means that if the first picture is a landscape and the second one a portrait the second one will be display as landscape, with the same dimension as the first one. I do reset the Gallery.LayoutParams but it does not matter, it still have the LayoutParams of the first ImageView.</p><p><strong>The code</strong></p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {        ImageView im = new ImageView(mContext);        Bitmap bm = BitmapFactory.decodeByteArray(gallery.get(position).mContent, 0, gallery.get(position).mContent.length);        im.setImageBitmap(bm);        int width = 0;        int height = 0;        if (bm.getHeight() &lt; bm.getWidth()) {            width = getWindowManager().getDefaultDisplay().getWidth();            height = bm.getHeight() * width / bm.getWidth();        }        else {            height = getWindowManager().getDefaultDisplay().getHeight();            width = bm.getWidth() * height/ bm.getHeight();                }        Gallery.LayoutParams lp = new Gallery.LayoutParams(width, height);        im.setLayoutParams(lp);        return im;}</code></pre><p>If any of you see why I would be really please to know the answer,</p>","290613","","","","","2010-06-27 09:26:23","Gallery and fullscreen ImageView, problem in putting them together","<android><layout><gallery><imageview>","1","0","2","",""
"3125647","1","","","2010-06-26 22:07:17","34","7906","<p>Like the title says, what is the difference between a dialog being dismissed or canceled in Android?</p>","377152","","","","","2012-02-19 00:12:17","What is the difference between a dialog being dismissed or canceled in Android?","<android>","2","0","7","",""
"3125737","1","","","2010-06-26 22:41:03","4","1279","<p>I heard recently that Google were to opensource the Google I/O Android application - the one which showed the next available talk, speaker info, etc. Does anyone know whether this is true, and if it is, do you know where I can access the source?</p><p>On a related note, does anyone know of a sample application which concentrates on some of the Android UI best practices. Some of them are described here: <a href=""http://developer.android.com/guide/practices/ui_guidelines/index.html"" rel=""nofollow"">http://developer.android.com/guide/practices/ui_guidelines/index.html</a>, but it'd be great to see some sample application which displays some of the best practices described in the UI talk at Google I/O this year (like the Twitter sample application they showcased)</p><p>Cheers</p><p>Sean</p>","208427","","","","","2010-06-27 20:57:47","Google I/O Android Sample Application","<android><user-interface><io>","2","1","","",""
"3125879","1","","","2010-06-26 23:50:47","6","4831","<p>I'm using a datepicker in Android to let the user to choose the date. I want it to do one thing if the user picks a date and sets it (I have that working fine) and then to clear a certain text field if the user pushes the cancel button on the datepicker (open up the datepicker but then cancel out of it).</p><p>The way I've been trying is by making a</p><pre><code>private DatePickerDialog.OnCancelListener mDateCancelListener =    new DatePickerDialog.OnCancelListener() {        public void onCancel(DialogInterface dialog) {            timeClear(); //method that clears text field        }    };</code></pre><p>then I do</p><pre><code>TimePickerDialog timeDialog = new TimePickerDialog(this,  mTimeSetListener,  c.get(Calendar.HOUR),  c.get(Calendar.MINUTE),  false);timeDialog.setOnCancelListener(mTimeCancelListener);</code></pre><p>to attach the listener.</p><p>My problem is that the listener works if the user pushes the back button, but not if they push the cancel button. I tried using a dismiss listener, and that works, except for the fact that it goes off even whether I set or cancel the datepicker!</p><p>What do I need to do so something goes off if and only if I push the cancel button on my datepicker?</p>","377186","","","","","2012-11-14 08:55:21","How to make a listener for a datepickers cancel button in Android?","<android><datepicker><cancel>","5","2","","",""
"3125946","1","3126717","","2010-06-27 00:25:46","3","1676","<p>I want to know if it is faster to load and play a small wav than a small mp3 file on android media player.  The wavs are about 30 KB and the same files as mp3s are about 20 kb.  The mp3s have the advantage to save resource space. The sound files have to be played with split second timing.</p>","293565","","","","","2010-06-27 07:40:12","For android media player mp3 vs. wav","<android><media-player>","3","0","","",""
"3126032","1","","","2010-06-27 01:17:07","3","5061","<p>I'm writing a simple budget app for myself, and I'm having trouble figuring out how to write to internal storage.  I don't seem to be writing to the file properly, and I can't find any more in depth examples than the <a href=""http://developer.android.com/guide/topics/data/data-storage.html#filesInternal"" rel=""nofollow"">Data Storage article</a> on developer.android.com</p><p>Basically, I'm trying to write a test float to the MyBalance file, then read it into balance.  In my actual code I use try/catch statements around the file in/out operations, but I skipped them to make the code more readable.</p><pre><code>float test = 55;float balance;byte[] buffer = null;FileOutputStream fos = openFileOutput( ""MyBalance"", Context.MODE_PRIVATE );fos.write(Float.floatToRawIntBits(balance));fis.read(buffer); //null pointerByteBuffer b = ByteBuffer.wrap(buffer);balance=b.getFloat();</code></pre><p>That's the gist of it, anyone see what I'm doing wrong?</p><p>Edit:Thanks for the reply, I went ahead and converted to/from String like you suggested, but I still don't think the file is being created.  I have an if statement that reads from it if it exists in onResume() and it isn't being run.  Lemme post some of my code.</p><p>Here's how I'm writing the file, (setbal is an EditText and balanceview is a TextView):</p><pre><code> balance = Float.valueOf(setbal.getText().toString()); balanceview.setText(setbal.getText()); balstring = String.valueOf(balance); for (int i = 0; i &lt; balstring.length(); ++i)     try {     fos.write((byte)balstring.charAt(i));     } catch (IOException e) {         e.printStackTrace();     }</code></pre><p>I check if the file exists in onResume() like so:</p><pre><code>File file = new File(""data/data/com.v1nsai.mibudget/balance.txt"");</code></pre><p>Is that where an internal file for that context would be stored?</p>","376844","","376844","","2010-06-27 05:02:31","2012-02-25 20:11:28","having trouble reading and writing to internal storage android","<android><file-io>","1","0","3","",""
"3126219","1","","","2010-06-27 02:55:11","4","916","<p>I am trying to get the contacts from the phone but all I can get is the name, the phone numbers return null.</p><pre><code>       Cursor cursor = getContentResolver().query(People.CONTENT_URI, null, null, null,People.NAME + "" ASC"");  startManagingCursor(cursor);  cursor.moveToFirst();  if(cursor.getCount() &gt; 0){  while(cursor.moveToNext()){    int idCol = cursor.getColumnIndex(People._ID);          int nameCol = cursor.getColumnIndex(People.NAME);          int numCol = cursor.getColumnIndex(People.NUMBER_KEY);          String name = cursor.getString(nameCol);          String number = cursor.getString(numCol);    //mDbHelper.addContact(managedCursor.getString(1),managedCursor.getString(2));    Log.v(""contact.add"",name+"" - ""+number);  }</code></pre><p>Any ideas?</p><p>After about 3 hours, I have figured it out:</p><pre><code>   ContentResolver cr = getContentResolver();        Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,                null, null, null, null);        if (cur.getCount() &gt; 0) {         cur.move(-1);     while (cur.moveToNext()) {         String id = cur.getString(                        cur.getColumnIndex(ContactsContract.Contacts._ID));  String name = cur.getString(                        cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));   if (Integer.parseInt(cur.getString(cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0) {     if (Integer.parseInt(cur.getString(                     cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0) {                  Cursor pCur = cr.query(         ContactsContract.CommonDataKinds.Phone.CONTENT_URI,          null,          ContactsContract.CommonDataKinds.Phone.CONTACT_ID +"" = ?"",          new String[]{id}, null);            while (pCur.moveToNext()) {         Log.v(""Phone"",""""+pCur.getString(pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER))+"" - ""+name);         i++;            }             pCur.close();        }          }            }  }</code></pre>","282475","","282475","","2010-06-27 04:33:09","2011-02-16 14:56:35","Android People.Number and People.Number_key return null","<android>","1","2","","",""
"3126282","1","3471884","","2010-06-27 03:22:13","1","185","<p>I might not like it, but the number of unofficial Android devices is growing and most of them have custom modifications to the Android OS or do not comply with the Android <a href=""http://source.android.com/compatibility/index.html"" rel=""nofollow"">Compatibility Definition Document</a>.</p><p>For example, the aPad/iRobot has made changes to the way the system handles screen rotations and the Eken has a virtual Menu button that disappears when the app executes on full-screen mode. </p><p>Apps that want to be compatible with these devices might need to deal with them on a case-by-case basis, using the <a href=""http://developer.android.com/reference/android/os/Build.html"" rel=""nofollow"">Build</a> class to identify them.</p><p>Unfortunately I don't have access to these devices and I don't know how to identify them. Does anybody have a list of <code>Build</code> values for unofficial Android devices, or alternatively is there a way to know if the device is an official Android device (querying for the Market app, perhaps)?</p>","143378","","143378","","2010-06-27 19:15:52","2010-08-12 20:47:49","Identifying unoficial Android devices","<android><build><compatibility>","3","0","","",""
"3126289","1","3168564","","2010-06-27 03:23:54","5","1245","<p>I have a MapActivity. If it's set to an appropriate location and zoom level to see traffic none is shown after it's first created until you interact with the map (click on it, drag, etc) at which point traffic shows up. Naturally I want traffic to show up without any user interaction after it loads but I've been unable to figure out how to trigger it. Any ideas?</p><p>From my MapActivity inherited class:</p><pre><code>private MapView mapView;@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); mapView.setTraffic(true);}</code></pre><p>And here's whats in R.layout.map</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/mainlayout""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;com.google.android.maps.MapView        android:id=""@+id/mapview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:clickable=""true""        android:apiKey=""...MY API KEY HERE...""    /&gt;&lt;/RelativeLayout&gt;</code></pre>","362076","","","","","2010-11-01 02:52:05","Android 1.6 Mapview doesn't show traffic until user interacts with the map","<android><android-mapview>","3","0","0","",""
"3126338","1","","","2010-06-27 03:51:19","0","333","<p>I use signpost-oauth do oauth in android, and after login on the web page, return to the Activity, the provider is null sometimes. </p><pre><code>public class LoginActivity extends Activity implements View.OnClickListener {private static OAuthConsumer consumer;private static OAuthProvider provider;private static final Uri CALLBACK= Uri.parse(""xxx://callback?"");...@Overrideprotected void onNewIntent(Intent intent) {        super.onNewIntent(intent);        final Uri uri = intent.getData();        if (uri != null &amp;&amp; uri.toString().startsWith(CALLBACK)) {            final String pin = uri.getQueryParameter(OAuth.OAUTH_VERIFIER);            try {                //provider.setOAuth10a(true);                provider.retrieveAccessToken(consumer, pin);                    } catch (final Exception e) {            }            }}...@Overridepublic void onClick(View v) {    switch (v.getId()) {    case R.id.oAuthLoginBtn:      new Thread(new Runnable() {        public void run() {          LoginActivity.consumer = new CommonsHttpOAuthConsumer(                            apiKey, appSecret);          LoginActivity.provider = new CommonsHttpOAuthProvider(                            oauthUrl + Data.REQUEST_TOKEN_URL, oauthUrl                                    + Data.ACCESS_TOKEN_URL, oauthUrl                                    + Data.AUTHORIZE_URL);    LoginActivity.provider.setOAuth10a(true);           try {                        final String authUrl = LoginActivity.provider                                .retrieveRequestToken(LoginActivity.consumer,                                        CALLBACK);                        final Uri uri = Uri.parse(authUrl);                        final Intent it = new Intent(Intent.ACTION_VIEW, uri);                        LoginActivity.this.startActivity(it);        } catch (final Exception e) {           }         }        }).start();        break;    }</code></pre><p>}</p><p>and the manifest.xml</p><pre><code>&lt;activity android:name="".ui.LoginActivity"" android:label=""@string/activity_login""            android:launchMode=""singleInstance"" android:configChanges=""orientation|keyboardHidden""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.VIEW"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;                &lt;data android:scheme=""xxx"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;</code></pre><p>I don't know why the provider is null sometimes.</p>","260497","","250260","","2010-07-23 15:03:09","2012-10-11 08:24:09","Provider is null when doing oauth after turning back from web page","<android><oauth>","2","0","2","",""
"3126347","1","","","2010-06-27 03:57:20","10","8738","<p>The problem I am having seems to be that if I have a view (e.g. myButton) inside a RelativeLayout set to alignParentBottom - (as per the code below) - and then wrap the RelativeLayout with a scrollview (necessary so the content will be viewable on smaller screens or when orientation changes to landscape) - then, when the parent bottom is NOT visible (for example when changed to landscape orientation) myButton is displayed at the TOP of the page - NOT the bottom.</p><p>How can you align a view to the bottom of the screen and have it remain at the bottom even if the bottom is below the scroll?</p><pre><code>&lt;ScrollViewandroid:id=""@+id/mainScrollView""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""android:fillViewport=""true""&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/topLayout"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;... lots of views and stuff&lt;Button android:layout_alignParentBottom=""true"" android:id=""@+id/myButton""  android:text=""Click Me"" /&gt;&lt;/RelativeLayout&gt;&lt;/ScrollView&gt;   </code></pre>","268648","","","","","2011-02-14 07:34:20","Android RelativeLayout : how to alignParentBottom when wrapped in a ScrollView?","<android>","2","0","","",""
"3126530","1","3126705","","2010-06-27 06:01:12","2","396","<p>Sorry if the title is kinda confusing, and if the Android tags don't really belong, I thought I would add them in since this is for an Android application.</p><p>What I want to do, is be able to access the object neoApi inside the Neoseeker class, from its inner class RunningTimer.  Now, in my code, you can see what I would think to work, but when I run my application, nothing pops up.  Nothing inside my TextView, no Toast, nothing at all.  How can I remedy this?  Thanks!</p><pre><code>package com.neoseeker.android.app;import java.util.Timer;import java.util.TimerTask;import org.json.JSONObject;import android.app.Activity;import android.app.Notification;import android.app.NotificationManager;import android.app.PendingIntent;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.widget.TextView;import android.widget.Toast;public class Neoseeker extends Activity {    NeoAPI neoApi = new NeoAPI();    Timer timer = new Timer();    TextView text;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // Set up Timer        timer.scheduleAtFixedRate(new RunningTimer(), 0, 1000 * 60 * 3); // Runs every 3 minutes        text = (TextView) findViewById(R.id.text);    }    /**     * Causes a status bar notification     * @param contentText The text to display to describe the notification     */    public void causeNotification(CharSequence contentText) {        String ns = Context.NOTIFICATION_SERVICE;        NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);        int icon = R.drawable.icon;        CharSequence tickerText = ""Neoseeker"";        long when = System.currentTimeMillis();        Notification notification = new Notification(icon, tickerText, when);        notification.defaults |= Notification.DEFAULT_ALL;        notification.defaults |= Notification.FLAG_AUTO_CANCEL;        Context context = getApplicationContext();        CharSequence contentTitle = ""Neoseeker"";        Intent notificationIntent = new Intent();        PendingIntent contentIntent = PendingIntent.getActivity(Neoseeker.this, 0, notificationIntent, 0);        notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);        int NEOSEEKER_ID = 125468131; // Random ID?        mNotificationManager.notify(NEOSEEKER_ID, notification);    }    class RunningTimer extends TimerTask {        boolean sent_notification = false;        int unread_pm_count_at_last_check = 0;        public void run() {            /*            int unread = Neoseeker.this.neoApi.getPmUnread();            if (unread &gt; 0) {                if (!sent_notification) {                    Neoseeker.this.causeNotification(""You have "" + unread + "" private message"" + ((unread &gt; 1) ? ""s."" ? "".""));                }            }            */            int unread = Neoseeker.this.neoApi.getPmUnread();            Toast.makeText(Neoseeker.this, ""new: "" + unread, Toast.LENGTH_SHORT).show();            Neoseeker.this.text.setText(""this is the text! "" + unread);        }    }}</code></pre>","362857","","","","","2010-06-29 17:53:34","Accessing Class level stuff from an inner Class","<java><android>","1","2","","",""
"3126622","1","","","2010-06-27 06:52:28","1","957","<p>Where can i find information about Windows Mobile OS or Android.I need to know, if they support SDL or not.</p><p>Does all android phone support SDL?</p>","376899","","1755","","2010-08-03 09:02:30","2010-12-11 14:56:39","SDL support on Android Based and Windows Phone","<android><windows-mobile><sdl><windows-phone-7><game-engine>","2","1","","",""
"3126727","1","","","2010-06-27 07:42:02","0","1599","<p>Hi I am new to android.From android i can send data to another port.But i am not able to receive the data using udp in android.How to receive data by using udp in android emulator?can anyone help me to receive the udp data in android?</p><p>Code is here</p><pre><code>DatagramSocket clientsocket=new DatagramSocket(4900);byte[] receivedata=new byte[1024];while(true){DatagramPacket recv_packet=new DatagramPacket(receivedata, receivedata.length);textview.setText(""UDP S: Receiving..."");clientsocket.receive(recv_packet);String rec_str=new String(recv_packet.getData());           textview.setText("" Received String ""+rec_str); }</code></pre><p>client wait to receive for a long time on ==>  clientsocket.receive(recv_packet); </p><p>how to receive udp data in android?</p>","365616","","","","","2010-06-27 09:08:20","how to receive udp data in android?","<android>","1","0","0","",""
"3126830","1","3126902","","2010-06-27 08:31:06","22","9126","<p>I have this query which does work fine in MySQL</p><pre><code>SELECT ((ACOS(SIN(12.345 * PI() / 180) * SIN(lat * PI() / 180) +         COS(12.345 * PI() / 180) * COS(lat * PI() / 180) * COS((67.89 - lon) *          PI() / 180)) * 180 / PI()) * 60 * 1.1515 * 1.609344) AS distance, poi.* FROM poiWHERE lang='eng' HAVING distance&lt;='30'</code></pre><p>distance is in Kilometers, the input is <code>lat=12.345</code> and <code>lon=67.89</code></p><p>The SQLite is 3, and I can't run custom functions with it as it's on Android. I also don't have acos() etc... as that is not part of the standard SQLite.</p><p>How would be the above query in SQLite?</p>","243782","","224671","","2010-06-27 09:02:38","2012-03-02 16:35:21","Query to get records based on Radius in SQLite?","<sql><android><sqlite>","2","5","24","",""
"3126964","1","3127451","","2010-06-27 09:34:22","2","737","<p>helloapparently in my country it's not in the companies best intrest to disconnect you from thier cellular connection (so they could charge for more)</p><p>i have read about how to in <a href=""http://developer.android.com/reference/android/provider/Settings.System.html"" rel=""nofollow"">http://developer.android.com/reference/android/provider/Settings.System.html</a> where there was an overhead of infomationi already built some apps but it seems to b something i cant really understand his concept can someone guide me ? give a link for where to read this info please . </p><p>I want to program a little app which in a click on a button will disconnect from the local internet cellular provider (just there internet ' i will still b able to phone other pep). </p>","368440","","368440","","2010-06-27 10:44:35","2010-06-27 13:19:23","how to disable android connection to local internet network","<android>","1","3","","",""
"3127186","1","","","2010-06-27 11:19:52","1","204","<p>The application is vb.net front end and sql server express backend. The networks are always cabled LANs. Installations are small with only a few users, none of whom would have any technical knowledge.Very little technical support is ever called for and I'd like to keep it that way.I don't know Java or Objective C or HTML/CSS/Javascript which as far as I can see seem to be the choices for smartphone development on Android, iphone or web based applicationI want users to be able to access as much of the functionality of the application as possible for the least effort both in terms of coding and acquiring new skills on my part.</p><p>I don't know where to start or which would provide the easiest path.I don't know how to make the database available to smartphones whilst keeping it physically secure in a small office. If all things were equal I'd probably learn towards HTML/CSS?Javascript as it seems to be the most widely applicable.On the other hand maybe I should wait for win phone 7?</p>","118049","","","","","2010-06-27 23:04:19","Choices for smartphone accessibility of pre-existing vb.net/sql server desktop crud application","<java><android><vb.net><windows-mobile><smartphone>","3","1","","",""
"3127261","1","","","2010-06-27 11:56:57","0","523","<p>I've got a problem with the basic HelloWorld program. I didn't change the basic program. But, when I want to open any *.xml in the folder ""values"" (in ""res"") an exception appears :</p><p><em>An error has occurred. See error log for more details.java.lang.NullPointerException</em></p><p>and here is the exception stack trace:</p><pre><code>java.lang.NullPointerException at org.eclipse.wst.xml.core.internal.document.ElementImpl.getDefaultValue(ElementImpl.java:259) at org.eclipse.wst.xml.core.internal.document.ElementImpl.getAttributeNS(ElementImpl.java:329) at com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode.getShortDescription(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.ui.tree.UiModelTreeLabelProvider.getText(Unknown Source) at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getText(WrappedViewerLabelProvider.java:108) at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:164) at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:152) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:934) at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:102) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1014) at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:481) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2141) at org.eclipse.jface.viewers.AbstractTreeViewer.updateChildren(AbstractTreeViewer.java:2689) at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefreshStruct(AbstractTreeViewer.java:1867) at org.eclipse.jface.viewers.TreeViewer.internalRefreshStruct(TreeViewer.java:721) at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:1842) at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:1799) at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:1785) at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1487) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1422) at org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:403) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1383) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1485) at org.eclipse.jface.viewers.ColumnViewer.refresh(ColumnViewer.java:537) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1444) at org.eclipse.jface.viewers.ContentViewer.setContentProvider(ContentViewer.java:252) at org.eclipse.jface.viewers.StructuredViewer.setContentProvider(StructuredViewer.java:1641) at org.eclipse.jface.viewers.AbstractTreeViewer.setContentProvider(AbstractTreeViewer.java:2317) at org.eclipse.jface.viewers.TreeViewer.setContentProvider(TreeViewer.java:972) at com.android.ide.eclipse.adt.internal.editors.ui.tree.UiTreeBlock.changeRootAndDescriptors(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.ui.tree.UiTreeBlock.createTreeViewer(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.ui.tree.UiTreeBlock.createMasterPart(Unknown Source) at org.eclipse.ui.forms.MasterDetailsBlock.createContent(MasterDetailsBlock.java:161) at org.eclipse.ui.forms.MasterDetailsBlock.createContent(MasterDetailsBlock.java:142) at com.android.ide.eclipse.adt.internal.editors.resources.ResourcesTreePage.createFormContent(Unknown Source) at org.eclipse.ui.forms.editor.FormPage$1.run(FormPage.java:152) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.forms.editor.FormPage.createPartControl(FormPage.java:150) at org.eclipse.ui.forms.editor.FormEditor.pageChange(FormEditor.java:471) at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.pageChange(Unknown Source) at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1067) at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:603) at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.selectDefaultPage(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.addPages(Unknown Source) at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138) at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348) at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595) at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313) at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180) at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270) at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65) at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473) at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1254) at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1207) at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1606) at org.eclipse.ui.internal.PartStack.add(PartStack.java:497) at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103) at org.eclipse.ui.internal.PartStack.add(PartStack.java:483) at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112) at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63) at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225) at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213) at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:778) at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:677) at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:638) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2860) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2768) at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2760) at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2711) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2707) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2691) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2682) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:365) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:168) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:229) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:208) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:373) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:526) at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:845) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:843) at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1131) at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1235) at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264) at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383)</code></pre><p>I don't know what I have to do.Thanks(Sorry for my bad english)</p>","377375","","224671","","2010-06-27 12:43:44","2010-06-27 12:43:44","Hello world problem","<java><android>","1","2","","",""
"3127267","1","","","2010-06-27 11:58:59","3","1586","<p>I would like to ask if i can use Asymmetric Crypto (like RSA or ECC) on android mobile phones, how, and what are the best libraries i should use.</p>","377376","","","","","2010-06-27 12:18:46","Asymmetric Crypto on Android","<android><cryptography><asymmetric>","1","0","1","",""
"3127351","1","3127419","","2010-06-27 12:40:14","7","5753","<p>I want for an event to fire every hour (at 5:00, 6:00, 7:00, etc...).I tried with a persistent background service with a thread but it wasn't the right solution because of:</p><ul><li>battery consumption</li><li>service termination, due to android memory management</li></ul><p>So I'm trying with AlarmManager. It works if I set an alarm to fire in X seconds (using ""set"" method).But how can I repeat an event (using ""setRepeating"" method) at the top of every hour, until the alarm is canceled?</p><p>Thanks!</p>","252711","","","","","2010-06-27 13:09:39","AlarmManager - How to repeat an alarm at the top of every hour?","<android><repeating><alarmmanager>","1","0","4","",""
"3127363","1","3127688","","2010-06-27 12:44:43","4","342","<p>I downloaded the Android SDK and the Eclipse Plugin and installed them. When I however use the ""Open Declaration"" in Eclipse on basic Android functions and classes such as setOnClickListener or ListActivity it gives me an ""Source not found""-Error.</p><p>The total Android source code seems to be 2.1 GB. Where do I get the source code of those functions that I call with the API to integrate it into Eclipse?</p>","25282","","","","","2011-12-30 12:12:24","Integrating basic android source code into Ecplise","<android>","3","0","3","",""
"3127489","1","3129019","","2010-06-27 13:34:33","2","1951","<p>Is there any way to determine programmatically the time at which an Android application was installed? I don't see anything in PackageInfo, etc.</p><p>--EDIT--To clarify, App A is installed at Time X. At some later time, Time Y, App B is installed. Is there any way App B can know when App A was installed? The link <a href=""http://stackoverflow.com/questions/2831333/how-to-get-app-install-time-from-android/2920310#2920310"">http://stackoverflow.com/questions/2831333/how-to-get-app-install-time-from-android/2920310#2920310</a> indicates that reading the modify time on the source dir of the App is sufficient. Is this really correct? Why? </p>","299080","","299080","","2010-06-27 21:39:31","2010-06-27 21:53:08","Install time for Android application?","<android><time><install><package>","3","1","1","",""
"3127492","1","3127517","","2010-06-27 13:35:02","2","355","<p>When I have a ListActivity and an Adapter how does Android handle a list with 200 elements.Does it try to load all of them directly how does it wait till the user scrolls and then renders those elements?</p><p>Do I have to worry with performance when a list is too long?</p>","25282","","","","","2010-06-28 03:20:52","How does android display a list with 200 elements?","<android><android-ui>","3","0","","",""
"3127539","1","3129903","","2010-06-27 13:49:15","11","12577","<p>I have a HTC Desire which i would like to debug and run my Android application on. But when i in Eclipse gets the Window where i can choose between devices my HTC Desire is listed with only questionmarks (????????). What am i doing wrong?</p><p>I have tried this:</p><p>Enabled USB Debugging on my device and enabled debugging in my application Manifest.xml file.</p><p>In Terminal i have do this:</p><ol><li>Log in as root and create this file: /etc/udev/rules.d/51-android.rules.</li><li>SUBSYSTEM==""usb"", SYSFS{idVendor}==""0bb4"", MODE=""0666""</li><li>sudo service udev restart</li></ol><p>What else could i try or have forgotten?</p>","155035","","1072468","","2014-03-26 21:15:00","2014-04-02 00:09:08","Ubuntu: Android device debug","<android><linux><ubuntu>","3","4","11","",""
"3127564","1","3127573","","2010-06-27 13:55:28","0","266","<p>Iam using Microsoft Windows 7 Home basic with 3 Gb Ram and 320 GB HDD. i want to install Android SDK. Is my configuration suitable for installation....Wat care i have to take while installation....  </p>","377404","","","","","2010-06-27 13:58:22","Android SDK Installation","<android>","2","0","","",""
"3127587","1","3130345","","2010-06-27 14:03:15","3","789","<p>I want to use the SQLite clause <strong>LIMIT</strong> and <strong>OFFSET</strong>, so that I can fetch my records in pages.But, though I can find the <strong>LIMIT</strong> clause in the <em>SQLiteQueryBuilder.query()</em> which would effectively limit the number of record in my result. Couldn't find the <strong>OFFSET</strong> clause anywhere so that I can continue fetching from the point I left.Also, can someone explain to me the exact use of <em>SelectionArgs[]</em> in the query() function, with some example?</p>","177890","","","","","2010-06-28 05:55:25","How to fetch records in pages in Android","<sql><android><database><sqlite><mobility>","2","0","","",""
"3127868","1","","","2010-06-27 15:49:36","1","745","<p>I have followed this <a href=""http://stackoverflow.com/questions/419184/how-to-delete-sms-from-inbox-in-android-programmatically"">Thread</a> . But using that, I'm not able to delete current receiving SMS. If I'm delete ALL message in in box. But currently receiving (BroadcastReceiver invoking SMS) not able to delete.</p><p>Is there any way to delete that message also.</p><p>Thank You,Chandana</p>","377438","","","","","2012-09-27 12:48:23","How to delete SMS before save inbox","<android>","1","3","","",""
"3127925","1","3128273","","2010-06-27 16:11:03","2","907","<p>I add to system a lot of POIs via <a href=""http://stackoverflow.com/questions/2993830/whats-wrong-with-this-addproximity-code"">addProximityAlert</a>.When I have got the alert, I don't know for which setting has occurred.</p><p>The only Extra that is passes is the 'entering' flag as it is described in the documentation.</p><p>How can I know that?</p><p><strong>After the answers here is the working code:</strong></p><pre><code>Intent intent = new Intent(this, PlacesProximityHandlerService.class);intent.setAction(""PlacesProximityHandlerService"");intent.putExtra(""lat"", objPlace.getLat());intent.putExtra(""lon"", objPlace.getLon());intent.putExtra(""error_m"", objPlace.getError()+ALERT_RANGE_IN_METERS);PendingIntent sender=PendingIntent.getService(this, 0, intent, 0);LocationUtils.addProximity(this, objPlace.getLat(), objPlace.getLon(),objPlace.getError()+ALERT_RANGE_IN_METERS, -1, sender);</code></pre>","243782","","243782","","2010-06-27 21:45:38","2010-06-27 21:45:38","When you get response from an addProximityAlert how do you know for which setup you got it?","<android><proximity>","1","0","","",""
"3127957","1","3128418","","2010-06-27 16:23:10","8","3508","<p>This questions somehow relates to the question when I was looking to <a href=""http://stackoverflow.com/questions/2859831/startactivityforresult-and-intents-extras-it-seams-extras-are-not-pushed-back"">get the extras back in startActivityForResult</a> but now I face another challenge.</p><p>I have subscribed to receive ProximityAlerts and I have explicitly constructed the Intent to include some Extras. But when I got the service the extras are not there.</p><p><strong>After the answers here is the working code:</strong></p><pre><code>Intent intent = new Intent(this, PlacesProximityHandlerService.class);intent.setAction(""PlacesProximityHandlerService"");intent.putExtra(""lat"", objPlace.getLat());intent.putExtra(""lon"", objPlace.getLon());intent.putExtra(""error_m"", objPlace.getError()+ALERT_RANGE_IN_METERS);PendingIntent sender=PendingIntent.getService(this, 0, intent, 0);LocationUtils.addProximity(this, objPlace.getLat(), objPlace.getLon(),objPlace.getError()+ALERT_RANGE_IN_METERS, -1, sender);</code></pre><p>The documentation says param <code>PendingIntent to be sent for each location update</code></p>","243782","","243782","","2010-06-27 21:44:13","2013-06-12 13:49:44","Why the PendingIntent doesn't send back my custom Extras setup for the Intent?","<android><android-intent><extras>","4","0","2","",""
"3128019","1","3128039","","2010-06-27 16:40:36","2","381","<p>Alice has to answer three questions. After she answered the questions she gets a dialog that lists the question and answers and there's a button to save the answers to a database.</p><p>At the moment I think that the design should be three classes: Master, Question, Summary.</p><p>Master calls Question with an intent that includes the question text of question 1.After Alice inputs her answer the Question returns the answer to master via an intent.</p><p>Repeat two times.</p><p>Then Master does processing of the questions and calls Summary via an intent.</p><p>Is this kind of design recommendable in Android? Is it possible to have such an Master activity. If so, how can I allow a running master activity to listen to intents?</p>","25282","","","","","2010-06-27 16:46:53","Design of android activity","<android>","1","0","","",""
"3128181","1","3132435","","2010-06-27 17:29:54","14","7370","<p>What is the easiest to time execution in Android?</p><p>I have looked around a bit and I found TimingLogger on the Android SDK,and instructions <a href=""http://tech.artcom.de/blog/?p=256"">here</a>. It looks very convenient.But I can't get it work. This is my code:</p><pre><code>TimingLogger timings = new TimingLogger(""TopicLogTag"", ""Parsing html"");   My code to time here...timings.dumpToLog();</code></pre><p>It's is supposed to dump the times in in LogCat. But I can't see nothing.. I What am I doing wrong? Eclipse doesn't show any varnings. I guess it has something with verbose ouput, but I have set LogCat to show Verbose.Thank you..</p>","215088","","215088","","2010-06-27 17:55:05","2013-10-16 06:23:14","Time code execution in Android","<android>","3","0","8","",""
"3128199","1","","","2010-06-27 17:36:33","8","3120","<p>I am writing an application which writes contacts in the SIM card of an Android phone. I am stuck at the point where the phone number is added: an exception occurs with no apparent reason.</p><p>Here is a snippet of code.</p><pre><code>import android.app.Activity;import android.content.ContentResolver;import android.content.ContentUris;import android.content.ContentValues;import android.provider.ContactsContract.RawContacts;import android.provider.ContactsContract.Data;import android.provider.ContactsContract.RawContactsEntity;import android.provider.ContactsContract.CommonDataKinds.Phone;import android.provider.ContactsContract.CommonDataKinds.StructuredName;import android.provider.ContactsContract.RawContacts.Entity;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.widget.TextView;[...]try{            // add a row to the RawContacts table     ContentValues values = new ContentValues();     values.put(RawContacts.ACCOUNT_TYPE, ""com.anddroid.contacts.sim"");     values.put(RawContacts.ACCOUNT_NAME, ""SIM"");     Uri rawContactUri = getContentResolver().insert(RawContacts.CONTENT_URI, values);            // get the ID of the newly-added line     long rawContactId = ContentUris.parseId(rawContactUri);            // add a ""name"" line to the Data table, linking it to the new RawContact            // with the CONTACT_ID column     values.clear();     values.put(Data.RAW_CONTACT_ID, rawContactId);     values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);     values.put(StructuredName.DISPLAY_NAME, ""Name"");     cr.insert(Data.CONTENT_URI, values);            // this insert succeeds            // add a ""phone"" line to the Data table, linking it to the new RawContact            // with the CONTACT_ID column     values.clear();     values.put(Data.CONTACT_ID, rawContactId);     values.put(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);     values.put(Phone.NUMBER, ""+12345678901"");     values.put(Phone.TYPE, Phone.TYPE_MOBILE);     cr.insert(Data.CONTENT_URI, values);            // this insert fails with a NullPointerException}catch(Exception e){    String xx=e.toString();    System.out.println(xx);}</code></pre><p>The application has permissions android.permission.READ_CONTACTS and android.permission.WRITE_CONTACTS.</p><p>The phone shows a contact with the name but no phone (incidentally, adding the phone to that contact using the normal UI results in a new contact being added, with name and phone, and the old contact with name only staying).</p><p>Any idea why the third insert (the second in the Data table) fails, while the 2 previous ones (1 in RawContacts and 1 in Data) succeed?</p>","377486","","","","","2011-06-03 10:18:45","Android: how to add a contact to the SIM using the SDK?","<java><android><contacts><sim-card>","4","2","3","",""
"3128226","1","3129010","","2010-06-27 17:44:45","2","846","<p>I am wondering if the Location.distanceTo method will use the accuracy field of the Location object when approximates the location, or do I have to add by my own the errors to these fields. The usage is to compare the distance against a proximity value.</p><pre><code>Float dist=currentLocation.distanceTo(loc2);</code></pre><p>Would this be</p><pre><code>if (dist&lt;100meters)</code></pre><p>or</p><pre><code>if (dist+currentLocation.getAccuracy()+loc2.getAccuracy()&lt;100meters)</code></pre>","243782","","","","","2010-06-27 21:48:15","Location.distanceTo uses the error parameter in approximate distance calculation?","<android><geolocation><location>","1","0","","",""
"3128236","1","3128512","","2010-06-27 17:47:38","1","821","<p>I have an application that calls AlarmManager</p><pre><code>Intent intent;intent = new Intent(context, MyEventReceiver.class);  PendingIntent appIntent = PendingIntent.getBroadcast(context, 0,intent, PendingIntent.FLAG_ONE_SHOT);AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),appIntent);</code></pre><p>and in the Manifiest I have the obligatory entry</p><pre><code>    &lt;receiver android:name="".MyEventReceiver""   android:process="":remote"" /&gt;</code></pre><p>MyEventReceiver looks like this</p><pre><code>public class MyEventReceiver extends BroadcastReceiver{    @Override    public void onReceive(Context context, Intent intent)    {        try        {            // DO SOME WORK        }        catch (Exception e)        {            Log.e(""MyEventReceiver"", e.getMessage().toString());        }    }}</code></pre><p>When the alarm is activated MyEventReceiver should be started and do something even if my application is not running. In the emulator this is the case however on the actual device this is not the case.</p><p>As an example I will start MyApplication on the emulator and in DDMS I can see the process for MyApplication running. From within MyApplication I add an alarm and then within DDMS kill the process for MyApplication. When the alarm fires MyEventReceiver does its work and in DDMS I see two processes, MyApplication, and MyApplication:remote.</p><p>On an actual device if I start MyApplication, add an alarm and then kill the process using a task killer when the time comes for the alarm to execute nothing happens. If I connect my device to the debugger and stop the process using DDMS instead of the task killer on the device then the alarm will fire and work as expected.</p><p>Can someone help me understand why this is happening? I was under the impression that once the alarm was scheduled it would persist unless the device were rebooted. The device is awake at the time the alarm should execute.</p>","312443","","925202","","2012-07-24 12:38:38","2012-07-24 12:38:38","AlarmManager firing in emulator but not on physical device","<android><broadcastreceiver><alarmmanager>","1","0","","",""
"3128305","1","","","2010-06-27 18:09:44","1","1022","<p>I have written an app that required me to create the following additional folders in order to support multiple screen sizes: layout-land, layout-small-land, and layout-small-port.</p><p>When I load an AVD for a QVGA screen, the emulator is loading the screen sizes from the HVGA settings, and I need to know how to force the emulator to load the correct files. I know it's loading the incorrect files because initially when I loaded the QVGA AVD, all of the text was too large, so I spent a few hours adding new versions of all my activiti files to the layout-small-port folder, then I retested and saw normal-sized text for the QVGA screen, and then I turned off my computer. The next time I turned on the computer and loaded the app in the QVGA AVD, suddenly all of the text on screen was super-small and barely readable. So, I proceeded to delete all of the new files I had just added to the layout-small-port folder and re-ran the QVGA AVD, and all of the text appeared correctly.</p><p>This morning I have loaded the QVGA AVD again, and once again the text is too large. Before my latest round of updates, the data in the QVGA screen had always appeared correctly, but now everything from the menu sizes to the text on screen is not being scaled to QVGA-sizes.</p><p>Do I need to re-add all of those screens for layout-small-port, or is there something going on in the emulator that I can fix?</p><p>I have set the text sizes in the affected activities using ""dip"" (i.e. 10dip). In my Android Manifest file, I set minSdkVersion=3 and targetSdkVersion=4 so that people with Android 1.5 can still download my app. My app is built against Android 1.6.</p>","377507","","","","","2012-06-08 13:54:54","Android Emulator loading wrong layout screen sizes","<android>","1","2","","",""
"3128488","1","3128626","","2010-06-27 19:01:01","3","509","<p>I have published an app on Android Market which is limited to Norway.  I'm able to find and install it myself from Market, as can several other Norwegian users.   A colleague (Android 2.1) and a friend (Android 1.6), on the other hand, cannot find it.  They both have phones bought in Norway, with SIM cards from Norwegian providers.</p><p>Why are some Norwegian users able to find it, and others not?  How does Google determine the location of Market users?</p><p>The app works on Android phones with v1.5+.</p>","13365","","","","","2010-06-27 19:36:45","Why can't some users see my location limited Android app in Market?","<android><location><google-play>","1","0","0","",""
"3128508","1","3128828","","2010-06-27 19:05:17","3","846","<p>I'm making a simple 2d game for the android platform, which works perfectly from version 2.0 and above, but when testing it on a 1.6 device, it crashes immediately. On running the debugger, it seems that I'm getting a null pointer exception in the thread class. I was just wondering if anybody has any ideas as to where the problem might be.</p><p>Here's the code for the thread class:</p><pre><code>package com.marcusortiz.burnination;import android.graphics.Canvas;import android.view.SurfaceHolder;public class GameThread extends Thread{  private SurfaceHolder sHolder;  private MainView panel;  private boolean isRunning;  public GameThread(SurfaceHolder sHolder, MainView panel)  {    this.sHolder = sHolder;    this.panel = panel;  }  public void setRunning(boolean isRunning)  {    this.isRunning = isRunning;  }  public SurfaceHolder getSurfaceHolder()  {    return sHolder;  }  @Override  public void run()  {    Canvas canvas;    while(isRunning)    {      canvas = null;      try      {        canvas = sHolder.lockCanvas(null);        synchronized(sHolder)        {          for(Sprite s : panel.getSprites())          {            s.update();          }          panel.onDraw(canvas);        }      }      finally      {        if(canvas != null)        {          sHolder.unlockCanvasAndPost(canvas);        }      }    }  }}</code></pre><p>Maybe there's some compatibility issues with this code that I'm not aware of--I'm very much a beginner when it comes to using threads.</p><p><strong>EDIT</strong>: here's the requested stack trace</p><pre><code>burnination [Android Application]     DalvikVM[localhost:8608]      Thread [&lt;3&gt; main] (Running)     Thread [&lt;15&gt; Binder Thread #3] (Running)        Thread [&lt;13&gt; Binder Thread #2] (Running)        Thread [&lt;11&gt; Binder Thread #1] (Running)        Thread [&lt;17&gt; Thread-9] (Suspended (exception NullPointerException))       GameThread.run() line: 53 </code></pre>","94751","","94751","","2010-06-27 20:30:19","2010-06-28 20:52:31","Thread issue in Android","<java><android><multithreading><compatibility>","3","5","","",""
"3128527","1","3132315","","2010-06-27 19:10:31","6","6265","<p>I have run into some trouble lately with <code>onSaveInstanceState()</code> and <code>onRestoreInstanceState()</code>. I have multiple activities that use these methods to save state in the case that they are cleaned up by the system. Most of them work, except for one, and I have no idea why.</p><p>What specifically happens is this:  </p><ul><li>I have my emulator running, and the dev tools setup to <code>destroy()</code> all activities when they are no longer visible. (So that I can prove that save/restore are working properly.)  </li><li>The Activity in question is started up, and I proceed to change some of its state.  </li><li>I start a new Activity, let it run for a moment, and then use the 'back' button to go to my previous Activity.  </li><li>Upon arriving back at the Activity in question, I notice that the default state is back, thus, it does not have the state it should.</li></ul><p>I have noticed that the <code>onSaveInstanceState()</code> is called, <code>onCreate()</code> is called, but has a null bundle, and <code>onRestoreInstanceState()</code> is never called.</p><p>Has anyone seen this before?</p>","343568","","404469","","2013-01-27 22:08:20","2013-01-27 22:08:20","onRestoreInstanceState() not being called when it is expected","<android>","3","0","2","",""
"3128617","1","","","2010-06-27 19:33:47","1","98","<p>from a list view how can I have the selected item show a static HTML file?</p>","377539","","","","","2010-06-27 22:00:19","static html file","<android>","1","0","","",""
"3128785","1","3135718","","2010-06-27 20:28:49","0","292","<p>my problem : the app I have uploaded into my cellular device is shown <strong>without the pictures I have insert to it</strong> .</p><hr><p>steps I have done in order to install:</p><ol><li>I have inserted the xxx.apk file into the device via usb</li><li>I downloaded an apps installer via the Market</li><li>I opened the app using the installer and instead of picture an white background appeared</li><li>when I opened the xxx.apk file using file system I found the pictures.</li></ol><hr><p>note: even an application icon weren't appearing.Apparently the res libary having problem to be bined to application.</p><ul><li>I might ness to add something to my appliction manifest?</li><li>I might need to change something on  my device ? (I already made a change and enabled user's not Market application  )</li><li>I would be very grateful for some life saving answer I need to show my work in a few days in this is the first time i tested her on a real devise.  </li></ul><p>I also tried an example as shown in hello android book the same example worked perfectly on the emulator where on my android device (Motorola milestone ) the picture and icon weren't shown </p><p>Please tell me what I might be doing wrong guys I need to apply my project back at uni(I was the only one in uni who did it on android and in my country most of pep don't even know what android is so getting help outside of forum's like this is not an option  ) so please please help me .</p>","368440","","368440","","2010-06-28 18:01:24","2010-06-28 20:01:11","while the apk runs without problems on emulator when installed on Motorola milestone picture and icon doesn't shown as they were on emulator","<android>","3","5","1","",""
"3128852","1","3128872","","2010-06-27 20:50:25","2","274","<p>Does anyone have any good references for designing and implementing an idea I have for an android application. </p><p>My idea is for an application that stores information and reviews about a specific location and presents this information to user.</p><p>I have gone through all the tutorials and have been reading up on anything and everything about android. Now I am ready to challenge myself with my first app.</p><p>Any suggestions on getting started would be greatly appreciated.</p>","257437","","","","","2010-06-27 20:55:22","Getting started designing and implementing an idea for Android App","<android>","1","1","","2011-11-22 16:34:02",""
"3129024","1","","","2010-06-27 21:54:28","4","2777","<p>I'm trying to create an Android app that needs to use OAuth to authenticate (with the Google Wave data API)</p><p>I've specified a custom scheme in my <code>AndroidManifest.xml</code> so that any views to a url beginning ""braindump://"" should go to my app:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""org.enigmagen.braindump""    android:versionName=""0.1""    android:versionCode=""1""&gt;    &lt;uses-sdk android:minSdkVersion=""7""&gt;&lt;/uses-sdk&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;    &lt;application        android:icon=""@drawable/icon""        android:label=""@string/app_name""        android:debuggable=""true""&gt;        &lt;activity            android:name="".BrainDump""            android:label=""@string/app_name""            android:launchMode=""singleInstance""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;                &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;                &lt;data android:scheme=""braindump"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre><p>All that happens though is that after the redirect, the browser address shows the correct URL, but the page content is</p><p>You do not have permission to open this page.   braindump://rest_of_address_here</p><p>Is there a specific permission that needs to be set to allow this sort of behaviour?</p>","138033","","","","","2012-05-24 20:35:18","Custom scheme doesn't seem to launch in the app intent","<android><oauth>","4","0","3","",""
"3129129","1","","","2010-06-27 22:29:02","3","1377","<p>This is the code I used but every time I excute it force to stop.note that I use it on android 2.1</p><pre><code>package com.arb;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import android.content.res.AssetManager;import android.graphics.Typeface;public class arabi extends Activity{AssetManager arabi_font;TextView tx;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);tx=(TextView) this.findViewById(R.id.tt);try{arabi_font.open(""DejaVuSans.ttf"");//DejaVuSans.ttf font filetx.setTypeface(Typeface.createFromAsset(arabi_font,""DejaVuSans.ttf""));tx.setText(""\uFEB3\uFE92\uFE98\uFE94"");}catch(Exception ex){} }}</code></pre>","377604","","244296","","2010-06-27 22:35:49","2011-12-20 19:41:30","Writing Arabic chars in Android","<android><arabic>","1","5","","",""
"3129396","1","","","2010-06-28 00:03:08","2","3409","<p>I followed the tutorial to the letter. I select run then the emulator starts up. Problem is that I never get to a home screen, nor does the text hello world display.</p><p>Is there a way to test my installation of the emulator?</p>","376480","","244296","","2010-06-28 00:43:38","2011-09-05 07:05:26","Hello, world and android emulator not starting all the way up!","<android><android-emulator>","5","1","","",""
"3129418","1","3130469","","2010-06-28 00:10:27","1","900","<p>I have a audio player app, where there is a Main activity that shows 3 audio sample urls. On click on one, it goes to a Details Activity, which has a play and pause button, to start and pause the audio. </p><p>My problem is that, when I start the Main activity, and say click on audio 1, I hit play on Details activity. This starts the MediaPlayer and the audio starts to play. When I go back to the Main activity, the audio is still playing, which is what I want. Now, when I click on audio 1 again, and go to Details Activity and hit play again, there seems to be a new MediaPlayer starting the audio. So I have 2 tracks playing together!</p><p>Is there a way I can have only one MediaPlayer instance at any given time?</p><p>ThanksChris</p>","321927","","","","","2010-06-28 06:32:14","Android MediaPlayer - only one instance at any given time?","<android><audio><activity><media-player>","1","0","","",""
"3129583","1","","","2010-06-28 01:14:45","4","2241","<p>I have installed the Android SDK and plugin for Eclipse and written my first test app.  I am trying to view the device in the DDMS section of Eclipse, but my Android Virtual Machine is usually not listed in the Devices section when it is running.  Occasionally it will appear for a minute only to disappear again.  I found an article recommending that I run adb kill-server to get it to restart and appear.  This works about 50% of the time, but the device just disappears again in 10-60 seconds.  </p><p>My main desire with this is to push some files to the sd card on my Android Virtual Machine, but the device doesn't stay visible long enough to push any data to it.</p><p>Thanks!</p>","377669","","","","","2010-09-24 19:36:44","Android Device Disappearing","<android><eclipse><android-emulator>","4","2","1","",""
"3129591","1","","","2010-06-28 01:18:16","3","1922","<p><strong>How am i able to Stop GPS from receiving new signals?</strong></p><p>Just use:</p><p>if you initialize a <code>LocationManager</code> Object</p><pre><code>mLocationManager_ = (LocationManager) mContext_.getSystemService(Context.LOCATION_SERVICE);</code></pre><p>add a location listener, GPS is starting to a GPS-Lock,</p><pre><code>mLocationListener_ = new MyLocationListener(mContext_);mLocationManager_.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mLocationListener_);</code></pre><p>If this lock exists, you see the GPS Signal in your status bar,now, if you press Home, you see, the GPS is still online, because your App is still having and trying to continue your GPS lock,</p><p>so use</p><pre><code>Main.mLocationManager_.removeUpdates(this);</code></pre><p>to stop your App from receiving new location updates.</p>","371749","","321731","","2014-01-19 15:01:27","2014-01-19 15:01:27","How to disable gps lookup in android again","<android><gps><listener><quit>","0","12","0","2010-06-28 22:21:22",""
"3129613","1","3129629","","2010-06-28 01:29:46","1","120","<p>I'm having trouble trying to use a list in my activity.  My XML for res/layout/main.xml is as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;&lt;ListView android:id=""@+id/ListView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;TwoLineListItem android:id=""@+id/TwoLineListItem01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;TextView android:id=""@android:id/text1""        android:layout_marginTop=""1dip""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textSize=""15sp""        android:textStyle=""bold""        android:text=""@string/text1"" /&gt;&lt;TextView android:id=""@android:id/text2""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@android:id/text1""        android:layout_alignLeft=""@android:id/text1""        android:paddingBottom=""4dip""        android:includeFontPadding=""false""        android:textSize=""15sp""        android:textStyle=""normal""        android:text=""@string/text2"" /&gt;&lt;/TwoLineListItem&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>Once I try to run it, however, my app just ""quits unexpectedly"".  It's got to be something wrong with the XML, since the activity is just the default <code>setContentView(R.layout.main);</code>  Please tell me what I'm doing wrong.</p>","346688","","346688","","2010-06-28 01:59:22","2010-06-28 01:59:22","XML layout not cooperating","<android>","1","0","0","",""
"3129672","1","3129727","","2010-06-28 01:47:57","2","1812","<p>I can access the preferences and add and change them.  How can I view the entire file that stores the keys and values for sharedpreferences in my app.  I have changed, added and removed some keys from my code and would like to see the effect on the preference file.</p>","293565","","","","","2013-03-25 15:41:51","how can i view my android app preferences in eclipse","<android><preferences>","2","0","1","",""
"3129874","1","3963780","","2010-06-28 03:16:31","2","276","<p>I have a normal SQLite database in my app, managed through my own ContentProvider and implemented via SQLiteOpenHelper.</p><p>On the Droid only, every few weeks or so, the database just disappears. I have several users who wrote me about that, and I've seen it myself too now. I added some debug info (hard to repro when you only see it every few weeks), and in one instance, it just happened inbetween widget updates - first, the widget is displayed and shows the data just fine, the next time, the SQLiteOpenHelper's onCreate is called.</p><p>The app itself does some multi-threaded shenanigans, but all ContentProvider implementations have the synchronized keyword, all access to the database is via the content provider, and in the instance described above, there is no multi-threading going on (the app itself hadn't been running, just the widget).</p><p>And again, this is only on the Droid. I've never seen it on the G1. I never close the database, but it being a content provider, it sounds like I'm not supposed to do that in the first place (I remember hackbod saying that the idea is that the OS will close the app's process when necessary, which will automatically close the database).</p><p>Any ideas?</p>","345717","","","","","2010-10-18 22:06:00","Database randomly deletes itself every so often","<android><database>","1","6","","",""
"3129895","1","3132156","","2010-06-28 03:24:08","1","692","<p>This is probably a dumb question but I can't find it anywhere... Which icon is used in your marketplace listing?  Is it always the application android:icon=""@drawable/icon"" setting from your manifest file or can you have a launch icon different from your marketplace listing?</p>","48784","","","","","2010-06-28 12:03:47","Android Marketplace icon","<android><google-play>","2","0","","",""
"3129921","1","","","2010-06-28 03:37:19","5","2189","<p>I don't have an Android phone now, but I really want to test Multi-touch or Shake feauture. How can I do this on Emulator?</p>","377717","","157882","","2010-08-06 17:00:05","2010-08-06 17:00:05","How can I test multi-touch on Android Emulator?","<android><multi-touch>","1","0","1","",""
"3129934","1","","","2010-06-28 03:42:32","28","2025","<p>With the Android SDK, the following code in a plain empty Activity fails:</p><pre><code>@Overrideprotected void onStart() {    super.onStart();    SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);}</code></pre><p>The 2.2 emulator logcat shows this exception:</p><pre><code>06-28 05:38:06.107: WARN/dalvikvm(495): threadid=1: thread exiting with uncaught exception (group=0x4001d800)06-28 05:38:06.128: ERROR/AndroidRuntime(495): FATAL EXCEPTION: main        java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.HelloWorldActivity}: java.lang.IllegalArgumentException: http://www.w3.org/2001/XMLSchema        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)        at android.app.ActivityThread.access$2300(ActivityThread.java:125)        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)        at android.os.Handler.dispatchMessage(Handler.java:99)        at android.os.Looper.loop(Looper.java:123)        at android.app.ActivityThread.main(ActivityThread.java:4627)        at java.lang.reflect.Method.invokeNative(Native Method)        at java.lang.reflect.Method.invoke(Method.java:521)        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)        at dalvik.system.NativeStart.main(Native Method)        Caused by: java.lang.IllegalArgumentException: http://www.w3.org/2001/XMLSchema        at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:194)        at com.example.HelloWorldActivity.onStart(HelloWorldActivity.java:26)        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1129)        at android.app.Activity.performStart(Activity.java:3781)        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2636)        ... 11 more</code></pre><p>The <a href=""http://developer.android.com/reference/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String)"">Javadoc of SchemaFactory</a> mentions ""Platform default SchemaFactory is located in a implementation specific way. There must be a platform default SchemaFactory for W3C XML Schema.""</p>","377721","","995926","","2012-05-05 13:34:25","2013-09-17 22:20:28","SchemaFactory doesn't support W3C XML Schema in platform level 8?","<android><xml><xml-schema><android-2.2-froyo>","2","2","1","",""
"3129996","1","","","2010-06-28 04:04:27","1","4020","<p>I am new to Android and have a question regarding protection level ""Signature"" for permissions in AndroidManifest.xml. </p><p>The Android reference document states about ""Signature"" protection level:</p><p>""A permission that the system grants only if the requesting application is signed with the same certificate as the application that declared the permission. If the certificates match, the system automatically grants the permission without notifying the user or asking for the user's explicit approval.""</p><p>This implies that permissions which have protection level ""Signature"" are not available to use by normal application and can only be used Android Dev Team.</p><p>What I am wondering about is that how many applications in Android Market or on other sites can have these permissions? Like an application which is used for recording calls has android.permission.DEVICE_POWER in addition to other permissions. Is Android system really granting this permission to this application while installation?</p><p>When I tried to use the permission ""READ_INPUT_STATE"" (new in 2.2) I got the following error in LogCat: </p><p>06-28 09:28:34.943: WARN/PackageManager(60): Not granting permission android.permission.READ_INPUT_STATE to package com.example.wheredoyoulive (protectionLevel=2 flags=0x8444)</p><p>The same is true for permissions with Protection Level ""SignatureOrSystem"". There exists a caller application which has CALL_PRIVILEGED permission in addition to other permissions.</p><p>Please help me and clear my doubts.</p><p>Regards</p><p>Abhishek</p>","344964","","","","","2013-04-24 09:34:04","Regarding Android Permissions and Signature Protection level ","<android><permissions>","2","0","","",""
"3130092","1","3135700","","2010-06-28 04:41:59","0","885","<p>I've recently purchased Samsung Galaxy Android phone after using Openmoko phone for 2 years.</p><p>One of the reasons for choosing Android was is that it's open sourced.I don't want to depend on phone maker to provide updates for my phone. I'd like to do it myself.Right now I'm in research stage if it's worth the time or not. So here are the questions:</p><ol><li><p>I found some tutorials for building ROM images from source. They tell that Android build script will ask for make of the phone before building kernel. Does it mean that all the phone specific stuff is handled by the script or I will have to do some voodoo before I can flash it onto my phone?</p></li><li><p>Drivers. How are they handled? Are they included in the source as binaries and added automatically (question 1) or will I have to dissect old firmware to get them and put in my build? I realize that would mean some problems with module/kernel versions compatibility.</p></li><li><p>Is there is something I'm not aware of that would prevent me from building my custom firmware or make it very time-consuming?</p></li></ol><p>I'm not afraid of installing SDK's and toolchains, after all I'm an Openmoko owner.</p>","219449","","648313","","2011-07-13 21:00:10","2011-07-13 21:00:13","Build android system from source","<android><android-source>","1","4","1","",""
"3130131","1","","","2010-06-28 04:51:44","1","328","<p>I am using FileBody for sending images to the server from Android. But when sending bigger images the application crashes with OutOfMemory exception. </p><p>Is there some way of overcoming this? Or has anyone faced the same problem with FileBody.</p><p>Please help me out in this regard.</p><p>Regards</p><p>Sunil</p>","261566","","","","","2010-06-28 04:51:44","OutOfMemory Exception while using FileBody for sending images to the server in Android?","<android><image><out-of-memory>","0","2","0","",""
"3130447","1","5559655","","2010-06-28 06:25:28","1","1615","<p>i'm trying to make a map loader for tiled, on android..so far i could parse the tmx file, grab all the tile data, and put them in a 2dimensional array, like this:  Bitmap tiles[x][y] ...it works and i can render tiled maps on android now, but only by interating through that tiles[][] array, like shown below..</p><p>how can i merge together in one single bitmap the content of a bitmap array ?</p><p>here's my render method: </p><pre><code>//here's what i have:for (int x = 0; x &lt; MapLoader.width; x++) {  for (int y = 0; y &lt; MapLoader.height; y++) {    g.drawBitmap( picSource[x][y], posX, posY, BitmapPaint);  }}//and here's what i'd like to have:g.drawBitmap( picDest, posX, posY, BitmapPaint);</code></pre><p>i would like to itterate through picSource[x][y] grab all the bitmaps and put them all in picDest. so i can get 1 single big pic, representing the map i've loaded and constructed from tiled tmx file..</p><p>( note that no bitmap contained in the picSource[][] array is located a the same position .. there's no bitmap on top of any other, they're just displayed in a grideach is a 32x32 bitmap in a 4x3 grid for example.. each its own spot on the grid .. )</p><p>thanks for the help</p>","377783","","","","","2011-04-05 23:12:56","android: how to merge an array of bitmap together in one bitmap?","<java><android><multidimensional-array><tiles>","1","2","","",""
"3130535","1","3130573","","2010-06-28 06:46:48","1","763","<p>I want to search Wildcard('&lt;', '>') in a string, count them and get their positions in java. My string is like below</p><blockquote>  <p>Peter &lt;5554>, John &lt;5556>,</p></blockquote><p>which function should I use? Thank you.</p>","305732","","","","","2010-06-28 08:18:50","Search Wildcard('<', '>'), count it and get the position in java","<java><android><string><wildcard>","4","0","","",""
"3130585","1","3130603","","2010-06-28 06:58:16","1","564","<p>Hi allWhen we want to pass data from an activity to a sub activity we use the </p><pre><code>intent.pushextra()</code></pre><p>method and pass the request code and any additional data.</p><p>now in the subactivity how can I get the additional data or the request code.</p><p>is there any event handler that handles this ?</p><p>thanks</p>","235123","","","","","2010-06-28 08:16:42","Android: how to use data passed from parent activity in a sub activity?","<android>","1","0","","",""
"3130654","1","3132515","","2010-06-28 07:16:29","41","22694","<p>I have an activity using an xml layout where a WebView is embedded. I am not using the WebView in my activity code at all, all it does is sitting there in my xml layout and being visible.</p><p>Now, when I finish the activity, I find that my activity is not being cleared from memory. (I check via hprof dump). The activity is entirely cleared though if I remove the WebView from the xml layout.</p><p>I already tried a </p><pre><code>webView.destroy();webView = null;</code></pre><p>in onDestroy() of my activity, but that doesn't help much.</p><p>In my hprof dump, my activity (named 'Browser') has the following remaining GC roots (after having called <code>destroy()</code> on it):</p><pre><code>com.myapp.android.activity.browser.Browser  - mContext of android.webkit.JWebCoreJavaBridge    - sJavaBridge of android.webkit.BrowserFrame [Class]  - mContext of android.webkit.PluginManager    - mInstance of android.webkit.PluginManager [Class]  </code></pre><p>I found that another developer has experienced similar thing, see the reply of Filipe Abrantes on:<a href=""http://www.curious-creature.org/2008/12/18/avoid-memory-leaks-on-android/"">http://www.curious-creature.org/2008/12/18/avoid-memory-leaks-on-android/</a></p><blockquote>  <p>Indeed a very interesting post.  Recently I had a very hard time  troubleshooting a memory leak on my  Android app. In the end it turned out  that my xml layout included a WebView  component that, even if not used, was  preventing the memory from being  g-collected after screen rotations/app  restart… is this a bug of the current  implementation, or is there something  specific that one needs to do when  using WebViews</p></blockquote><p>Now, unfortunately there has been no reply on the blog or the mailing list about this question yet. Therefore I am wondering, is that a bug in the SDK (maybe similar to the MapView bug as reported <a href=""http://code.google.com/p/android/issues/detail?id=2181"">http://code.google.com/p/android/issues/detail?id=2181</a>) or <strong>how to get the activity entirely off the memory with a webview embedded</strong>?</p>","241475","","","","","2013-11-24 18:13:44","Memory leak in WebView","<android><android-webview>","7","4","38","",""
"3130717","1","","","2010-06-28 07:34:13","1","585","<p>hi I am new to android.I need to know how to receive the udp data in android emulator.Data's are coming from the PC (UDP SERVER is running on the pc).I am using Eclipse IDE.Can anyone guide me to solve this ?</p>","351928","","","","","2010-06-28 08:19:43","Receive udp data from the system udp server on android?","<android>","1","0","1","",""
"3130971","1","3137133","","2010-06-28 08:27:36","1","270","<p>I want to receive a data which is passed using intent from another page.Can you help me?</p>","357112","","","","","2010-06-29 00:44:02","Receiving data which is passed using intents","<android><android-intent>","1","2","1","",""
"3131103","1","3965889","","2010-06-28 08:55:19","5","4534","<p>I'm changing the theme of an activity in onCreate using setTheme (I'm doing that even before calling super.onCreate(), as this is supposed to be more reliable).</p><p>It does work in the sense that it changes the background and foreground colors. However, my layout has a few elements that use styles like textAppearanceLarge. Now Android's textAppearanceLarge internally uses the textPrimaryColor - which is still unchanged by my theme.</p><p>I tried to override the primary text color in my theme, but that doesn't seem to work.</p><p>Here is the crucial part of the theme:</p><pre><code>&lt;style name=""Theme.MyApp.White""&gt;   &lt;item name=""android:background""&gt;@android:color/white&lt;/item&gt;   &lt;item name=""android:textColor""&gt;#000000&lt;/item&gt;&lt;/style&gt;</code></pre><p>The background appears white, plain TextViews appear black... but TextViews using textAppearanceLarge are white, and as such invisible (white on white).</p><p>I tried things like this:</p><pre><code>   &lt;item name=""android:ColorPrimary""&gt;#000000&lt;/item&gt;   &lt;item name=""android:textColorPrimary""&gt;#000000&lt;/item&gt;   &lt;item name=""android:attr/textColorPrimary""&gt;#000000&lt;/item&gt;</code></pre><p>But none of those do anything. What's the magic trick?</p>","345717","","","","","2011-02-10 00:28:39","How do I change the textColorPrimary in a theme?","<android><android-ui>","3","0","2","",""
"3131119","1","3183312","","2010-06-28 08:58:29","0","1428","<p>I've created a radio button menu list .. </p><pre><code>    final CharSequence[] items = { ""3 sec"", ""5 sec"", ""7 sec"" };    AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder.setTitle(""Change Wallpaper Every.."");    builder.setSingleChoiceItems(items, -1,            new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int item) {                    Toast.makeText(getApplicationContext(), items[item],                            Toast.LENGTH_SHORT).show();                }            });     AlertDialog alert = builder.create();    builder.show();</code></pre><p>what I want to do is to catch the selected value from the above Char Sequence and to put to a variable . </p>","2438460","","2438460","","2010-06-28 10:08:36","2013-04-11 14:47:38","How to catch selected value from Android Menu Radio Values","<java><android>","3","0","","",""
"3131219","1","","","2010-06-28 09:15:23","1","314","<p>I am a beginner level developer in android. I got an error in device not in emulator.I have used sony ericsson xepria x10i. my application works well but it takes more time to display the first activity.</p><pre><code>E/dun_service(15640): Unable to open external port /dev/ttyHSUSB0 : No such deviceW/ActivityManager(  958): Launch timeout has expired, giving up wake lock!</code></pre><p>How can i fix and give kind advice?</p>","302314","","","","","2010-06-28 09:15:23","Unable to open external port No such device error","<android>","0","0","","",""
"3131237","1","","","2010-06-28 09:19:45","0","497","<p>The last item of Listview is always under editText. How to fix it appearing above editText? my xml is below - </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;      &lt;ListView android:id=""@+id/android:list""         android:layout_width=""fill_parent""        android:layout_height=""fill_parent""      android:layout_above=""@+id/txtTo_e""/&gt;                &lt;EditText android:id=""@+id/txtTo_e""         android:layout_width=""230dip""         android:layout_height=""wrap_content""         android:textSize=""18sp""         android:hint=""Compose""         android:layout_alignParentBottom = ""true""         android:layout_alignParentLeft=""true""/&gt;   &lt;Button android:text=""Done""         android:id=""@+id/btnD_e""         android:layout_width=""85dip""         android:layout_height=""wrap_content""                     android:layout_alignParentBottom = ""true""         android:layout_alignParentRight=""true""/&gt;                                               &lt;/RelativeLayout&gt;</code></pre><p>Thank you.</p><p>PS: When I opened this forum, setting toolbar was invisible. Sorry. In my PC, I couldn't click comment button and see toolbar. sorry for any inconvenient to u.</p>","305732","","305732","","2010-06-29 01:33:43","2010-06-29 01:33:43","Listview item under edittext","<android><listview><layout>","1","1","","",""
"3131274","1","3132558","","2010-06-28 09:26:35","0","101","<p>Coming from an iPhone world,</p><p>Is there an equivalent of system icons, for example, the add or search icons in the options menu of Contacts. This would save developers time (and in some cases, money) if they could use the system icons used by Android. If this is not possible, is a site available where developers can download icons for android instead of using Photoshop or GIMP to make their own?</p>","200477","","200477","","2010-06-28 09:36:25","2010-06-28 13:03:18","UIBarButtonSystemItem equivalent in Android?","<java><android><icons>","1","0","","",""
"3131461","1","","","2010-06-28 10:01:03","2","1157","<p>Im trying to send an email in Android on 2.1 and I have two problems.</p><p>1) firstly, to To field does not populate</p><p>2) the type message/rfc822 creates an error: ""no applications can perform this action""</p><pre><code>    Intent msg = new Intent(Intent.ACTION_SEND);    //Two types, rfc822 doesnt seem to work in the emulator    msg.setType(""text/plain"");    //msg.setType(""message/rfc822"");      //To:    msg.putExtra(Intent.EXTRA_EMAIL, mEmailAddress);    //Body:    //msg.putExtra(Intent.EXTRA_TEXT, """");    //Subject    //msg.putExtra(Intent.EXTRA_SUBJECT, """");    mActivity.startActivity(Intent.createChooser(msg, ""chooser title""));</code></pre><p>I am running this code sample in the emulator</p><p>ThanksMark</p>","26310","","","","","2010-06-28 11:09:56","Android ACTION_SEND Intent not populating the To field","<android>","1","2","2","",""
"3131469","1","3138553","","2010-06-28 10:01:53","1","201","<p>I have a theme in my app that defines a custom color for the background. This is the green you see above the tabwidget. </p><p>In some of my Activities I'm using a Tabhost for my Layout. Now I get something like this as a result: </p><p><img src=""http://janusz.de/~janusz/tabHostStyle.png"" alt=""alt text""></p><p>My tabwidget has a black background and I'm happy with that, but the icons in the tabwidget are transparent and this leads to them showing the green background defined in my style.</p><p>How can I define the tabhost as not styled and have the transparent icons show the tabwidget the resion on instead of a solid background color?</p>","114066","","114066","","2010-06-29 06:29:06","2010-06-29 07:07:54","How to exclude some parts of my UI from an Application wide theme?","<android><layout>","2","0","","",""
"3131637","1","","","2010-06-28 10:34:37","0","484","<p>i have an android app with several activities. I need to start a timer when the first activity starts and end the timer when the last activity starts and show the elapsed time. How can i use Asynctask to do this. </p>","377941","","253056","","2010-06-28 10:36:32","2010-06-28 11:03:44","Timer across the multiple activities","<android><android-asynctask>","2","0","1","",""
"3131752","1","3132050","","2010-06-28 10:57:07","2","629","<p>My application which I built for 1.5, shows text blurry on high density screen of HTC Desire and the like. Here is a close up screen shot from my application (bad.png) and a better example (good.png)</p><p><img src=""http://taypo.com/bad.png"" alt=""alt text""> <img src=""http://taypo.com/good.png"" alt=""alt text""></p><p>Yes, I am building a soft keyboard. And the text is drawn with <code>canvas.drawText</code>. All the discussions I found online is about image resizing issues.</p>","3812","","","","","2010-06-28 11:49:02","Blurry text on high density screens","<android>","1","2","1","",""
"3131813","1","3132907","","2010-06-28 11:08:58","0","148","<p>The website <a href=""http://www.slideme.org"" rel=""nofollow"">http://www.slideme.org</a> is not accepting to upload my android project. It says that the manifest file must have a label. I m posting my manifest file it does have a label.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android"" package=""android.com.machineInfo"" android:versionCode=""1"" android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".machineInfo"" android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>Moreover when I change android:label=""@string/app_name"" to android:label=""Machine Information"" it accepts the label and shows error that your app must have an icon. plzz help. My app is working fine on emulator </p>","172543","","","","","2010-06-28 13:51:37","Website is not accepting my android application","<android><xml>","2","2","","",""
"3131930","1","","","2010-06-28 11:28:19","2","1913","<p>I'm working on a chess site and I've implemented a rule checker in PHP and I use that on my main site at <a href=""http://www.chesslords.net/"" rel=""nofollow"">http://www.chesslords.net/</a>, but, I'm working on an Android frontend in the meantime. However, after I've added the event and drawing correctly to my project, I would like to use my foo.php from my bar.java, calling the rulechecker to generate slots. Do you know how to do that? Thanks in advance for your answer.</p>","355970","","","","","2010-08-03 10:52:51","How can an Android frontend use PHP backend?","<php><android>","4","1","2","",""
"3131990","1","","","2010-06-28 11:39:28","0","281","<p>I am working with an Voice to Text Application where I need to keep Voice command Dialog in background, means I don't want to hide it again n again.</p><p>Pls shows me how can I do this.</p>","2624806","","","","","2011-06-06 08:23:46","Hide Android ""voice to Text"" Dialog Box","<android>","1","0","","",""
"3132021","1","","","2010-06-28 11:44:26","77","37369","<p><strong>What I want to do</strong>: run a background thread which calculates ListView contents and update ListView partially, while results are calculated.</p><p><strong>What I know I have to avoid</strong>: I cannot mess with ListAdapter contents from background thread, so I inherited AsyncTask and publish result (add entries to adapter) from onProgressUpdate. My Adapter uses ArrayList of result objects, all operations on those arraylists are synchronized.</p><p><strong>Research of other people</strong>: there is very valuable data <a href=""http://permalink.gmane.org/gmane.comp.handhelds.android.devel/82685"">here</a>. I also suffered from almost daily crashes for group of ~500 users, and when I added list.setVisibility(GONE)/trackList.setVisibility(VISIBLE) block in onProgressUpdate, crashes lowered by a factor of 10 but not disappeared. (it was suggested in <a href=""http://www.mailinglistarchive.com/html/android-developers@googlegroups.com/2010-04/msg01174.html"">answer</a> )</p><p><strong>What I got sometimes</strong>: please notice, it happens really rarely (once a week for one of 3.5k users). But I'd like to get rid of this bug completely. Here is partial stacktrace:</p><pre><code>java.lang.IllegalStateException: The content of the adapter has changed but ListView  did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131296334, class android.widget.ListView) with Adapter(class com.transportoid.Tracks.TrackListAdapter)]at android.widget.ListView.layoutChildren(ListView.java:1432)at android.widget.AbsListView.onTouchEvent(AbsListView.java:2062)at android.widget.ListView.onTouchEvent(ListView.java:3234)at android.view.View.dispatchTouchEvent(View.java:3709)at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:852)at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)[...]</code></pre><p><strong>Help?</strong> Not needed anymore, see below</p><p><strong>FINAL ANSWER:</strong> As it turned out, I was calling <code>notifyDataSetChanged</code> every 5 insertions to avoid flickering and sudden list changes. It cannot be done such way, always notify adapter when base list changes. This bug it long gone for me now.</p>","7162","","1083951","","2013-05-22 17:20:16","2014-04-03 11:41:30","Android, ListView IllegalStateException: ""The content of the adapter has changed but ListView did not receive a notification""","<android><exception><listview><adapter>","13","7","38","",""
"3132104","1","5253957","","2010-06-28 11:55:16","1","3200","<p>I need to send a photo from a file stored in the SDCARD to an external Api. In order to do this, i'm using the following code:</p><pre><code>String responseStr = null;    this.setMethod(request);    this.setParameters(tags, parameters, optional);    String requested = mUri.build().toString();    HttpHost host = new HttpHost(API_REST_HOST, -1,            HttpHost.DEFAULT_SCHEME_NAME);    Log.d(TAG, requested);          try {         HttpPost post = new HttpPost(requested);        File file = new File(filepath);         FileEntity fileentity;         if (filepath.substring(filepath.length()-3, filepath.length                 ()).equalsIgnoreCase(""jpg"")) {             fileentity = new FileEntity(file,""image/jpeg;"");             fileentity.setChunked(true);             post.setEntity(fileentity);        }         post.addHeader(""Content-Type"", ""image/jpeg;"");        HttpResponse response = mClient.execute(host,post);</code></pre><p>""setMethod"" and ""setParameters"" are own methods in order to build the Uri object. The external api takes well the parameters but not the photo. It's expecting the photo in a HttpBody Field.</p><p>Any idea? Thanks</p><p>Thanks</p>","258863","","","","","2011-03-10 00:10:51","Android send photo using HttpPost/HttpGet","<android><post>","1","2","1","",""
"3132207","1","3132312","","2010-06-28 12:10:27","3","100","<p>Recently I was asked if I could help someone to get quick-started to android programming.</p><p>What would you suggest to tell this person?Would you explain everything by hand or just refer to external links?Which ressources would you recommend?This whole issue should not take too much time...assuming 2-3 hours</p><p>Once my access to this issue was ""<a href=""http://www.wrox.com/WileyCDA/WroxTitle/Professional-Android-Application-Development.productCd-0470344717.html"" rel=""nofollow"">Professional android application development</a>"".Java basics are already preconditioned, so there's no need to explain ANYTHING.</p><p>For avoiding any misconceptions: This shall be just a quick start, no reference or something like this, so I just need some keywords and a hint how deeply go through it.</p>","317301","","50049","","2011-02-23 19:04:38","2011-02-23 19:04:38","Quick access to Android for a third person","<android>","2","0","0","",""
"3132237","1","3132299","","2010-06-28 12:15:11","0","230","<p>Is there any good and often visited developer Android discussion board? I saw that the Google has just an mailing list...</p>","331115","","114066","","2010-06-28 12:17:46","2010-06-28 12:23:51","Android discussion board","<android><mailing-list>","4","0","1","",""
"3132267","1","3132342","","2010-06-28 12:20:35","1","950","<p>Hello everyoneWhat would be the easiest way to parse an rss feed? Are there any already done easy(fast to implement) methods out there?All the posts I could find on the topic were many years old. Any new technologies out there that are worthy of attention? Or should I just make my own parser?</p><p>Edit: please link to a usage method/tutorial too :)</p>","373248","","373248","","2010-06-28 12:35:01","2010-06-28 12:52:49","Android rss parse - what method to use?","<android><rss><parsing>","3","0","","",""
"3132403","1","","","2010-06-28 12:39:16","0","109","<p>From different post i have concluded that insertion, deletion and updation in Calendar is only  possible by using g-data. </p><p>Therefore i am using g-data 1.41.3 with android 1.5 api level 3.</p><p>Problem is that , i am using the following code.</p><pre><code>    1    // Send the request and receive the response:    2   // the code is use for reading Calendar Content    3  // feedUrl = http://209.85.132.104/calendar/feeds/androidshma@gmail.com/allcalendars/full            4       5           CalendarFeed resultFeed = service.getFeed(feedUrl, CalendarFeed.class);    6        7           // Print the title of each calendar    8           for (int i = 0; i &lt; resultFeed.getEntries().size(); i++) {    9               CalendarEntry entry = resultFeed.getEntries().get(i);    10              System.out.println(""\t"" + entry.getTitle().getPlainText());    11          }</code></pre><p>problem is that application throwing exception on line no. 5.Exception is as follow:</p><pre><code>java.lang.VerifyError: com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory$SecureSAXParserFactory</code></pre><p>and in different forum it is mention that No XSchema support in Android 1.0. Maybe later version.</p><p>how i can read calendar contents?it is noted that without android its working fine.</p>","309990","","","","","2010-07-01 12:21:08","error in reading g-data","<android><calendar>","1","1","","",""
"3132410","1","3132968","","2010-06-28 12:40:40","0","240","<p>friends, </p><p>i am using following property to show image on full screen</p><p>android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""</p><p></p><p>in manifest file</p><pre><code>@Override    public boolean onKeyDown(int keyCode, KeyEvent event)     {        if(keyCode==KeyEvent.KEYCODE_DPAD_LEFT)        {             ShowError.setVisibility(View.GONE);                if(CurrentImageIndex + 1 &lt; mImage_URL.length )                {                    CurrentImageIndex  = CurrentImageIndex +1 ;                    Move();                }        }else if(keyCode==KeyEvent.KEYCODE_DPAD_RIGHT)        {             ShowError.setVisibility(View.GONE);                if(CurrentImageIndex &gt; 0 )                {                    CurrentImageIndex  = CurrentImageIndex -1 ;                    Move();                }        }                   return true;    }}</code></pre><p>when image is display on full screen then backbutton(Hardware button on phone) does not work.</p><p>any one guide me what is the solution?</p><p>any help would be appreciated.</p>","249991","","249991","","2010-06-28 13:58:45","2010-06-28 13:58:45","BackButton on android phone not working on fullscreen image?","<android>","1","2","","",""
"3132498","1","","","2010-06-28 12:54:19","0","1101","<p>When I press a button I would like to have a progressbar showing up so I inserted this code:</p><p>progDailog = ProgressDialog.show(this, ""Downloading data"", ""please wait...."", true);</p><p>But the progressDialog is not showing at all. Why? What more do I need to do to show it?</p><p>/M</p>","378037","","","","","2010-06-28 13:26:39","Progressbar does not show up. Why?","<android><progressdialog>","1","0","","",""
"3132532","1","","","2010-06-28 12:59:33","1","2234","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/6872970/android-how-to-pass-a-bluetooth-connection-to-another-activity"">Android: How to pass a Bluetooth connection to another Activity?</a>  </p></blockquote><p>I have an application in which I am going to be transferring data via a Bluetooth connection.</p><p>In my proof of concept app, I was able to put the Bluetooth communication in a different thread and keep all of my other work on the same activity (using ViewFlipper).</p><p>However, for my next iteration, I will need to use several different ""screens"" (activities).  The flow would go something like this: </p><p>My initial activity will connect up to the Bluetooth device I will be getting the data from.</p><p>One activity off of the ""main"" activity will be to get a list of data from the BT device and display it in a list view.  Then as I click on an item I will need to get a more detailed view of the data (which is shown in yet ANOTHER activity but also has to access the BT connection).</p><p>There will be additional, specific activities off of the ""main"" activity.</p><p>So my question is how is the best way to manage that, where I initiate the Bluetooth connection ONCE and don't have to initiate it again for each activity?</p>","319247","","2153784","","2011-08-26 17:32:16","2011-08-26 17:32:16","Keeping a Bluetooth connection across activities on Android","<android><bluetooth><activity>","2","0","","2011-08-26 19:26:03",""
"3132543","1","3794386","","2010-06-28 13:01:07","0","317","<p>I'm looking to scrape geolocation data from <a href=""http://www.trackdroid.org/locservice.html"" rel=""nofollow"">LocService</a> (a solution to track GPS pings from an Android phone) and host it in a MySQL database as a PHP cron job. The login system uses HTTPS. I'm having trouble returning anything through cURL.</p><p>Has anyone got any ideas?</p><p>Gausie</p>","214602","","214602","","2010-06-28 13:21:51","2010-09-25 15:30:29","How to scrape data from LocService (http://www.trackdroid.org/locservice.html) using PHP","<php><android><curl><web-scraping>","2","0","","",""
"3132580","1","","","2010-06-28 13:06:18","0","6405","<p>can anyone tell me where I get the icons native android?</p>","377730","","","","","2012-01-10 10:49:41","get the icons native android?","<android>","5","4","2","",""
"3132691","1","","","2010-06-28 13:22:00","0","613","<p>The online android documentation says:</p><blockquote>  <p>Everything you can do with AppWidgetProvider, you can do with a regular BroadcastReceiver.</p></blockquote><p>So, what i want to do is to register via <code>registerReceiver()</code> another event other than <code>ACTION_APPWIDGET_*</code> on my Widget. For example <code>ACTION_BATTERY_OKAY</code>, is there any way to do this? Obviously i cant register the event from the <code>onUpdate()</code> code but i should do it using a service or something else. The problem is that im not able to find any reference to the Provider (AppWidgetManager only returns AppWidgetProviderInfo objects).</p><p>Any idea?</p>","376579","","","","","2013-05-30 13:35:35","Android AppWidgetProvider and BroadcastReceivers","<android><events><widget><provider><broadcast>","1","0","","",""
"3132843","1","3133364","","2010-06-28 13:41:44","1","1757","<p>I have a similar query to the one posted <a href=""http://stackoverflow.com/questions/2443730/android-which-button-index-from-array-was-pressed"">here</a>. I create a grid consisting of a variable number of buttons, at runtime (in a TableLayout), and would like to find the index of the button pressed. The actual Button objects are currently stored in an array, although I'm not sure if that is really necessary. I tried to write the ClickListener using something along the lines of:</p><pre><code>public void onClick(View view) {       Button clickedButton = (Button) view;               int buttonID = clickedButton.getId();</code></pre><p>but this just always returns -1. Is it possible to get the id (or some other reference to the button pressed) without predefining the buttons in xml? </p><p>The solution in the other post describes cycling through the whole array of Buttons and comparing ids. Is there a more elegant way to do this?</p>","251715","","","","","2010-06-28 14:45:23","Getting id of programmatically generated grid of buttons in Android","<android><layout>","2","0","","",""
"3132853","1","3133015","","2010-06-28 13:42:40","5","8189","<p>Is putSerializable broken?</p><p>When I pass null with putSerializable the FillSummary.class starts as it should.If I however pass the a TestSerial object than Android force closes.</p><p>What do I have to do to get a custom object transfered via a Bundle? </p><pre><code>public class TestSerial implements Serializable{    private static final long serialVersionUID = 2310640779687082782L;    public int i;    public TestSerial(){        i=1;    }}private void renderSummary(){    Intent intent = new Intent(FillForm.this, FillSummary.class);    Bundle extras = new Bundle();    extras.putSerializable(""test serial"", new TestSerial());    intent.putExtras(extras);    startActivityForResult(intent, Forms.DISPLAY_SUMMARY);}</code></pre><p>Error:</p><pre><code>06-28 13:56:02.436: ERROR/AndroidRuntime(1136): Uncaught handler: thread main exiting due to uncaught exception06-28 13:56:02.784: ERROR/AndroidRuntime(1136): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent { action=Return user choice (has extras) }} to activity {com.Questionaire/com.Questionaire.FillForm}: java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.Questionaire.FillForm$TestSerial)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3005)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3047)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.app.ActivityThread.access$2300(ActivityThread.java:112)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1721)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.os.Handler.dispatchMessage(Handler.java:99)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.os.Looper.loop(Looper.java:123)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.app.ActivityThread.main(ActivityThread.java:3948)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.lang.reflect.Method.invokeNative(Native Method)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.lang.reflect.Method.invoke(Method.java:521)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at dalvik.system.NativeStart.main(Native Method)06-28 13:56:02.784: ERROR/AndroidRuntime(1136): Caused by: java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.Questionaire.FillForm$TestSerial)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.os.Parcel.writeSerializable(Parcel.java:1147)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.os.Parcel.writeValue(Parcel.java:1101)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.os.Parcel.writeMapInternal(Parcel.java:469)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.os.Parcel.writeBundle(Parcel.java:491)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.content.Intent.writeToParcel(Intent.java:4471)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1036)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1449)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.app.Activity.startActivityForResult(Activity.java:2656)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at com.Questionaire.FillForm.renderSummary(FillForm.java:206)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at com.Questionaire.FillForm.renderNext(FillForm.java:178)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at com.Questionaire.FillForm.onActivityResult(FillForm.java:86)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.app.Activity.dispatchActivityResult(Activity.java:3595)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3001)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     ... 11 more06-28 13:56:02.784: ERROR/AndroidRuntime(1136): Caused by: java.io.NotSerializableException: com.Questionaire.FillForm06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1753)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:2073)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1900)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1863)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:1354)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:421)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1456)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1789)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:2073)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1900)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1863)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     at android.os.Parcel.writeSerializable(Parcel.java:1142)06-28 13:56:02.784: ERROR/AndroidRuntime(1136):     ... 23 more</code></pre>","25282","","25282","","2010-06-28 13:57:45","2010-06-28 14:02:39","Using putSerializable in Android","<android>","1","1","2","",""
"3132867","1","3133075","","2010-06-28 13:44:20","1","999","<p>I have a project that builds against Android v2.1 . I can run it fine on a phone running 1.5 but when I try to launch it with an emulator running 1.5, the emulator doesn't show up on the list of available AVDs. I have the <code>&lt;uses-sdk android:minSdkVersion=""3""/&gt;</code> tag in my manifest but it doesn't make a difference. Any ideas?</p><p>thanks</p>","224977","","","","","2012-03-13 05:06:57","Running application on emulator running older SDK","<android><android-emulator>","5","0","2","",""
"3132889","1","","","2010-06-28 13:47:16","13","11307","<p>I am experiecing ""This action is not currrently supported"" error condition when execute the following code snippet in Android 2.1. What is wrong with the snippet?</p><pre><code>public void onClick(View v) {  Intent intent = new Intent(Intent.ACTION_SENDTO);  Uri uri = Uri.parse(""mailto:myemail@gmail.com"");  intent.setData(uri);  intent.putExtra(""subject"", ""my subject"");  intent.putExtra(""body"", ""my message"");  startActivity(intent);}</code></pre>","378079","","56285","","2014-01-17 22:34:42","2014-01-17 22:34:42","ACTION_SENDTO for sending an email","<android><email><android-intent>","4","0","5","",""
"3132891","1","3133073","","2010-06-28 13:47:46","0","145","<p>Regarding Android >= 2.0.1.</p><p>This speaks for Application type of project:</p><ul><li>The provided sample code makes it anapplication.</li><li>Easy testing in dev tools.</li></ul><p>This speaks for Library type of project:</p><ul><li>From another application wanting totrigger a sync, I would like toinclude it as a library dependency.</li></ul><p>What other benefits/drawbacks can you see with either type of project ?</p>","77115","","","","","2010-06-28 14:08:10","Should a sync provider be an Android library or application?","<android>","1","0","","",""
"3132959","1","3133219","","2010-06-28 13:55:54","0","3192","<p>I've a ListActivity with a ListView, onItemClick i start an Intent,</p><p>Oncreate of this Intent i make a getParent but it's null. if i do this.isChild() it's false.</p><pre><code>mPostList.setOnItemClickListener(new OnItemClickListener() {    public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {    Intent IntentDiscution = new Intent(parent.getContext(), EcrireMessage.class);    ....    IntentDiscution.putExtras(objetbunble);    parentClass.startActivity(IntentDiscution); }</code></pre>","144587","","","","","2010-10-01 12:10:32","Android: ListActivity with ListView start new intent and this intent don't have parent","<android><listview><listactivity>","2","0","","",""
"3132970","1","3132997","","2010-06-28 13:58:05","0","1166","<p>As the title suggest i have (sometimes) a concurrentmodificationexception while trying to create a route between two locations ...Here is my code (and in case you're wondering MyOverlay does not try to access the other Overlays in the map)</p><pre><code>    private class fillRouteTask extends AsyncTask&lt;Void, GeoPoint, Void&gt; {  /**   * create the url to call to get the route   *    * @param src   * @param dest   * @return   */  private StringBuilder createUrl(GeoPoint src, GeoPoint dest) {   // connect to map web service   StringBuilder urlString = new StringBuilder();   urlString.append(""http://maps.google.com/maps?f=d&amp;hl=en"");   urlString.append(""&amp;saddr="");// from   urlString.append(Double     .toString((double) src.getLatitudeE6() / 1.0E6));   urlString.append("","");   urlString.append(Double     .toString((double) src.getLongitudeE6() / 1.0E6));   urlString.append(""&amp;daddr="");// to   urlString.append(Double     .toString((double) dest.getLatitudeE6() / 1.0E6));   urlString.append("","");   urlString.append(Double     .toString((double) dest.getLongitudeE6() / 1.0E6));   urlString.append(""&amp;ie=UTF8&amp;0&amp;om=0&amp;output=kml"");   Log.d(""xxx"", ""URL="" + urlString.toString());   return urlString;  }  /**   * create the connection to google url   *    * @param src   * @param dest   * @return   */  private String connectToUrl(GeoPoint src, GeoPoint dest) {   // get the kml (XML) doc. And parse it to get the   // coordinates(direction   // route).   Document doc = null;   HttpURLConnection urlConnection = null;   URL url = null;   try {    url = new URL(createUrl(src, dest).toString());    urlConnection = (HttpURLConnection) url.openConnection();    urlConnection.setRequestMethod(""GET"");    urlConnection.setDoOutput(true);    urlConnection.setDoInput(true);    urlConnection.connect();    DocumentBuilderFactory dbf = DocumentBuilderFactory      .newInstance();    DocumentBuilder db = dbf.newDocumentBuilder();    doc = db.parse(urlConnection.getInputStream());    if (doc.getElementsByTagName(""GeometryCollection"") != null      &amp;&amp; doc.getElementsByTagName(""GeometryCollection"")        .getLength() &gt; 0) {     return doc.getElementsByTagName(""GeometryCollection"").item(       0).getFirstChild().getFirstChild().getFirstChild()       .getNodeValue();    }   } catch (MalformedURLException e) {    Log.d(""test"", e.getLocalizedMessage());   } catch (IOException e) {    Log.d(""test"", e.getLocalizedMessage());   } catch (ParserConfigurationException e) {    Log.d(""test"", e.getLocalizedMessage());   } catch (SAXException e) {    Log.d(""test"", e.getLocalizedMessage());   }   return null;  }  protected Void doInBackground(Void... arg0) {   try {    // get the current overlays present in the map    List&lt;Overlay&gt; overs = Collections.synchronizedList(mapView      .getOverlays());    String path = connectToUrl(orig, dest);    if (path != null) {     Log.d(""xxx"", ""path="" + path);     String[] pairs = path.split("" "");     String[] lngLat = pairs[0].split("","");     GeoPoint startGP = new GeoPoint((int) (Double       .parseDouble(lngLat[1]) * 1E6), (int) (Double       .parseDouble(lngLat[0]) * 1E6));     overs.add(new MyOverlay(startGP, startGP, 1));     GeoPoint gp1;     GeoPoint gp2 = startGP;     for (int i = 1; i &lt; pairs.length; i++) // the last one would     // be     // crash     {      lngLat = pairs[i].split("","");      gp1 = gp2;      // watch out! For GeoPoint, first:latitude,      // second:longitude      gp2 = new GeoPoint(        (int) (Double.parseDouble(lngLat[1]) * 1E6),        (int) (Double.parseDouble(lngLat[0]) * 1E6));      Log.d(""xxx"", ""pair:"" + pairs[i]);      publishProgress(gp1, gp2);     }     overs.add(new MyOverlay(dest, dest, 3)); // use     // the     // default     // color     drawn = false;    } else {     m_handler.post(new Runnable() {      public void run() {       Toast.makeText(getApplicationContext(),         ""Problem in getting the directions"",         Toast.LENGTH_SHORT).show();      }     });    }   } catch (Exception e) {    m_handler.post(new Runnable() {     public void run() {      Toast.makeText(getApplicationContext(),        R.string.errorrouteLoad, Toast.LENGTH_LONG)        .show();     }    });   }   return null;  }  /*   * (non-Javadoc)   *    * @see android.os.AsyncTask#onProgressUpdate(Progress[])   */  @Override  protected void onProgressUpdate(GeoPoint... values) {   // TODO Auto-generated method stub   List&lt;Overlay&gt; overs = Collections.synchronizedList(mapView     .getOverlays());   overs.add(new MyOverlay(values[0], values[1], 2, 0x0000ff));  }  /*   * (non-Javadoc)   *    * @see android.os.AsyncTask#onPostExecute(java.lang.Object)   */  @Override  protected void onPostExecute(Void result) {   // TODO Auto-generated method stub   Log.d(""routing"", ""done"");   mapView.postInvalidate();  } }</code></pre>","378082","","","","","2010-06-28 14:00:50","MapView ConcurrentModificationException","<android><exception><concurrency><android-mapview>","1","1","1","",""
"3133064","1","","","2010-06-28 14:07:04","1","3086","<p><br/>I have a strange situation I can't explain myself.<br/>The following code works well:<br/><code>solo.sleep(1000);<br/>assertTrue(solo.searchText(""Banking""));</code><br/><br/>but the following code fails:<br/><code>assertTrue(solo.waitForText(""Banking"", 1, 1000));</code><br/></p><p>Can someone can explain me this?</p><p>Kind regards,<br/>Alban.</p>","306839","","","","","2010-09-26 17:53:34","Robotium: searchText","<android><unit-testing><robotium>","2","0","","",""
"3133067","1","","","2010-06-28 14:07:12","0","1597","<p>hi im trying to use the smack api to send/receive messages in facebook chat. im using:</p><pre><code>host: chat.facebook.comport: 5222service: chat.facebook.comusername: my facebook username@chat.facebook.compassword: my facebook password</code></pre><p>logcat says im getting a ""503 service unavailable error"" but i cant work out why. my username/password work when logging into the facebook website, and the smack api works when using google talk, but it wont let me log in to chat.facebook.com (allthough it seems to connect to the server fine). any ideas on whats wrong?</p><p>cheers for any help,ng93</p>","364727","","364727","","2010-06-28 16:26:13","2011-03-01 07:09:06","android use smack api with facebook chat","<android><facebook><smack>","1","1","","",""
"3133080","1","3149369","","2010-06-28 14:09:07","2","217","<p>I know that with the telephony manager listen, you can listen for 3 different states.  Iknow that CALL_STATE_OFFHOOK indicates that there is at least one call that is dialing, active, etc.  My question is- with the telephony manager, is there a way to determine what number the phone is off hook with?  I thought getLine1Number() might return that phone number that is being dialed, but it is not what I expect.  I am working with 2 emulators, and added a log line so that I could see what that method is doing.  When dialing another emulator, I expected getLine1Number() to return 5554, but it was 15555218135.  Perhaps there is another method I should be using instead?  Do I need to be into the source code to get the information I want?</p>","364734","","","","","2010-06-30 12:50:00","Determining what # is being dialed on Android","<android><android-emulator>","1","0","","",""
"3133098","1","3147656","","2010-06-28 14:11:36","0","319","<p>How the Linux drivers interact with the host devices through the <a href=""http://developer.android.com/guide/developing/tools/emulator.html"" rel=""nofollow"">Android Emulator</a>? I mean for instance how a virtual sound device driver, compiled for ARM and running inside of the Emulator communicates with the actual speaker on the computer.</p><p>I heard that you need to use a special kernel image when running on top of the Emulator, so I imagine that the drivers do some magic but I couldn't find any information on the web nor locate the drivers on the <a href=""http://android.git.kernel.org/"" rel=""nofollow"">git repositories</a>.</p>","55935","","","","","2010-07-13 12:22:52","Android: how Linux interacts with host devices?","<android><linux-kernel><android-emulator><qemu>","1","0","1","",""
"3133267","1","3133321","","2010-06-28 14:34:32","1","994","<p>I'am using log to store all the transfer. How can I check the logged data?</p><pre><code>Log.i(""login"", ""recevied "" + getResponse(response.getEntity()));</code></pre>","371301","","244296","","2010-06-28 14:40:35","2010-06-28 14:40:40","Android Log data","<android>","3","0","1","",""
"3133318","1","","","2010-06-28 14:40:08","28","18595","<p>I would like to open the optionsMenu programmatically without a click on the menu key from the user. How would I do that?</p>","377730","","114066","","2012-02-06 10:24:06","2014-01-07 07:51:48","How to open the options menu programmatically?","<android><button><menu><activity>","5","1","5","",""
"3133500","1","","","2010-06-28 14:58:36","2","538","<p>Are there any means of debugging JS code, or at least get errors, on Android devices?</p>","138606","","","","","2011-05-30 15:32:46","Any way to debug javascript on Android devices?","<javascript><android><debugging>","3","0","","",""
"3133650","1","","","2010-06-28 15:16:27","10","8022","<p>I've been trying to find out how to create an intent that will open the user's preferred browser without specifying the URL. I know how to open it by giving a specific URL like this:</p><pre><code>Intent intent = new Intent();intent.setAction(Intent.ACTION_VIEW);intent.setData(android.net.Uri.parse(""http://www.google.com""));context.startActivity(intent);</code></pre><p>I don't want to open the browser to any page in particular, just the set homepage or whatever page the user was on last. I've thought about looking up the homepage set within the app but you can't do it with the default Browser app because it is private. Does anybody know of a way to do this?</p>","201939","","","","","2013-06-06 06:02:08","Android intent to open user's preferred browser","<android><browser><android-intent>","4","0","3","",""
"3133887","1","3136920","","2010-06-28 15:47:55","3","9037","<p>I'm trying to have my application display my login activity when a user selects <em>""Add account""</em> in <em>""Accounts&nbsp;&amp;&nbsp;Sync""</em> or wants to use the application and isn't logged in yet. I've followed the example <a href=""http://developer.android.com/resources/samples/SampleSyncAdapter/index.html"" rel=""nofollow"">SampleSyncAdapter</a> fairly closely, but can't get it to work and receive the following exception instead:</p><p><code>No Activity found to handle Intent { act=android.accounts.AccountAuthenticator }</code>  </p><p>My auth service contains: </p><pre><code>public IBinder onBind(Intent intent) {    IBinder ret = null;    if (intent.getAction().equals(android.accounts.AccountManager.ACTION_AUTHENTICATOR_INTENT)){        ret = getAuthenticator().getIBinder();    }    return ret;}</code></pre><p>My <code>AndroidManifest.xml</code>:</p><pre><code>&lt;service android:name="".auth.MyAuthService""         android:exported=""true""          android:process="":auth""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.accounts.AccountAuthenticator"" /&gt;    &lt;/intent-filter&gt;    &lt;meta-data android:name=""android.accounts.AccountAuthenticator""               android:resource=""@xml/authenticator""     /&gt;</code></pre><p>My main activity: </p><pre><code>startActivity(new Intent(android.accounts.AccountManager.ACTION_AUTHENTICATOR_INTENT));</code></pre><p>I've tried doing both: </p><pre><code>Intent svc = new Intent(this, CreazaAuthService.class);startService(svc);</code></pre><p>and: </p><pre><code>bindService(new Intent(android.accounts.AccountManager.ACTION_AUTHENTICATOR_INTENT), null, BIND_AUTO_CREATE);</code></pre><p>before the <code>startActivity()</code> call, but it still can't find an activity for that intent. If I try to add an account via accounts&amp;sync my application crashes with the same <code>ActivityNotFoundException</code>.</p><p>What am I doing wrong? </p><p><strong>EDIT</strong><br>I've examined c99's last.fm app, which defines a custom action and uses intents based on that action rather than <code>android.accounts.AccountManager.ACTION_AUTHENTICATOR_INTENT</code>. Is that a better approach? Is there a way to make it work with Accounts &amp; Sync? </p>","378158","","648313","","2012-01-16 00:55:10","2012-01-16 00:55:10","No Activity found to handle Intent { act=android.accounts.AccountAuthenticator } even though I have one","<android><android-syncadapter>","1","0","","",""
"3133947","1","3134045","","2010-06-28 15:55:42","2","2372","<p>is there any way to have an html file (i.e. an html template) be a resource in android?  I'd like to reference it in a similar way that i store strings in the res/values/strings.xml.  However, when i do this, it appears the HTML is not getting rendered correctly when i use <code>myTextView.setText(Html.fromHtml(MessageFormat                    .format(getResources().getString(R.string.myHtmlFile), ...)</code></p>","372405","","","","","2010-06-28 16:05:35","android HTML template as resource","<html><android><resources>","1","1","","",""
"3134040","1","","","2010-06-28 16:04:55","0","1169","<p>Is there a way to change styles for Gallery? For example, borders, animation speed. Maybe there is list of predefined themes?</p><p>Thanks for any help.</p>","331565","","","","","2010-06-28 20:18:54","How to change styles for Gallery widget on Android?","<android><themes><gallery>","1","1","1","",""
"3134056","1","3134139","","2010-06-28 16:06:36","0","381","<p>My activity has a simple menuItem that start a counter...the counter is stored in a field of the activitythe problem is with the ""back button""after closing the activity (back button), the timer (as in my intention) continues, and restarting the activity behave correctly by reshowing the timer...but I lost the reference to the counter and so I cannot stop itAny ideas?</p><p>following there is a part of the code of the functionboolean onOptionsItemSelected(MenuItem item) </p><pre><code>switch (item.getItemId()) {    case R.id.STARTSTOP:        running = !running;        if (!running) {            item.setTitle(""START"");            if (counter!=null) {                counter.cancel();                counter = null;            }        }        else {            item.setTitle(""STOP"");            counter = new CountDownTimer(1000*60*20/*20min*/,1000){                @Override                public void onFinish() {                    TextView tv = (TextView) findViewById(R.id.counter);                    tv.setText(""done!"");                }                @Override                public void onTick(long millisUntilFinished) {                    TextView tv = (TextView) findViewById(R.id.counter);                    tv.setText(millisUntilFinished);                    Log.d(""XXXDEBUGXXX"",millisUntilFinished);                }            };            counter.start();    }</code></pre><p>}</p>","290302","","","","","2010-06-28 16:17:34","Retrieve a reference to CountDownTimer after Closed activuty","<android><timer>","1","0","","",""
"3134155","1","3134181","","2010-06-28 16:18:46","0","77","<p>Please help me with this code - I am basically going through a book and trying to create the examples myself but I can't get past this error. I've checked my LogCat and it says ""java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'"". I know there is probably some small detail I'm omitting that is causing this but I can't put my finger on it - it is almost an exact copy of a working program example given by the book. I am trying to create a simple ArrayAdapter and feed it a dummy list. Here are the three files of interest:</p><pre><code>package com.example.bwett.SimpleList;import android.app.ListActivity;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;public class SimpleList extends ListActivity {String[] item = {""Item1"", ""Item2"", ""Item3"", ""Item4"",                 ""Item5"", ""Item6"", ""Item7"", ""Item8""};TextView mainLabel; @Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    setListAdapter(new ArrayAdapter&lt;String&gt; (this,                                             R.layout.row,                                             R.id.label,                                             item));    mainLabel = (TextView)findViewById(R.id.mainLabel);}public void onListItemClick(ListView parent, View v,                            int position, long id){    mainLabel.setText(item[position]);}</code></pre><p>}</p><p>MAIN.XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextView    android:id=""@+id/mainLabel""       android:layout_width=""fill_parent""     android:layout_height=""wrap_content""/&gt;&lt;ListView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:drawSelectorOnTop=""false""/&gt;&lt;/LinearLayout&gt;</code></pre><p>ROW.XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""horizontal""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;&lt;ImageView    android:id=""@+id/ok""    android:layout_width=""22px""    android:layout_height=""fill_parent""    android:padding=""2px""    android:src=""@drawable/icon""/&gt;&lt;TextView    android:id=""@+id/label""    android:layout_width=""wrap_content""    android:layout_height=""fill_parent""    android:textSize=""44sp""/&gt;&lt;/LinearLayout&gt;</code></pre>","369706","","244296","","2010-06-28 16:44:42","2010-06-28 16:44:42","Can't figure out the source of this RuntimeException when trying to create a simple list","<android><listview>","1","0","","",""
"3134366","1","3134436","","2010-06-28 16:49:46","3","1762","<p>Hi is it possible to run java SE or Java ME app on android ???</p>","377983","","12423","","2010-06-28 17:07:08","2012-12-26 08:36:00","run j2me app on android?","<java><android><java-me>","4","0","","",""
"3134389","1","3134609","","2010-06-28 16:52:27","14","15028","<p>Is there a way to view the http response headers in an Activity once a web page has been loaded in a WebView? Seems like this should be possible, but I can't find any methods that expose the headers.</p>","244104","","","","","2014-02-12 12:31:10","Access the http response headers in a WebView?","<android>","2","2","11","",""
"3134683","1","3134720","","2010-06-28 17:31:48","38","26383","<p>How can I display <a href=""http://developer.android.com/guide/topics/ui/notifiers/toasts.html"">Toast</a> messages from a thread? </p>","164460","","1919641","","2013-06-03 03:23:15","2013-11-19 13:32:43","Android: Toast in a thread","<android><multithreading><toast>","4","1","20","",""
"3134741","1","","","2010-06-28 17:40:32","3","3503","<p>can it be determined that where a person is i.e is he walking ? is he in elevator ? or is he climbing up the stairs ?</p><p>using android's accelerometer or is there any other way to calculate such in android ?</p>","378288","","","","","2010-06-30 11:59:25","using Android Accelerometer to calculate distance , eleveation?","<android><accelerometer><elevation>","1","0","2","",""
"3134783","1","3134932","","2010-06-28 17:45:27","3","6085","<p>I am trying to figure out the best practice of communication between a TabActivity and the child activity embedded in this TabActivity.</p><p>In my TabActivity, there is a button. When the button is clicked, I want the child activity embedded in this TabActivity to be updated. I wrote the code like below, and just wonder whether it is a good practice. Thanks.</p><p>MyTabActivity.java</p><pre><code>public class MyTabActivity extends TabActivity implements OnClickListener {    private TabHost m_tabHost;  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.ff_tab_activity);    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);    m_tabHost = getTabHost();     TabHost.TabSpec spec;     Intent intent;     intent = new Intent().setClass(this, ChildActivity.class);    spec = m_tabHost.newTabSpec(""Tab 1"");    spec.setContent(intent);    tabView = (TextView) inflater.inflate(R.layout.tab_indicator, null);    spec.setIndicator(tabView);    m_tabHost.addTab(spec);    m_tabHost.setCurrentTab(0);    ImageView nextButtonIv = (ImageView) findViewById(R.id.next_button);    nextButtonIv.setOnClickListener(this);  }  @Override  public void onClick(View v) {    switch (v.getId()) {    case R.id.next_button:        synchronized (ChildActivity.class) {            if (null != ChildActivity.s_childActivity) {                ChildActivity.s_childActivity.changeUI();            }        }        break;    }}</code></pre><p>ChildActivity.java</p><pre><code>public class ChildActivity extends Activity {    public static ChildActivity s_childActivity;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        synchronized (MatchupsActivity.class) {            s_childActivity = this;        }        setContentView(R.layout.child_activity);    }    public void changeUi() {        code that changes UI    }    protected void onDestroy() {        super.onDestroy();        synchronized (MatchupsActivity.class) {            s_childActivity = null;        }}</code></pre>","256239","","256239","","2010-06-28 18:15:01","2011-08-20 04:56:26","Communication between TabActivity and the embedded activity","<android>","5","0","2","",""
"3134793","1","","","2010-06-28 17:46:26","0","2653","<p>I am developing part of an Android application that needs to use a WebView to open a password protected site. I am using SharedPreferences to provide the username and password from when the user logs in the app for the first time. I've tested the credentials it's returning, so I know that those are correct. When I run this in the emulator, the site says that I'm unauthorized (even though I am). Here's the code:</p><pre><code>  setContentView(R.layout.browser);  WebView browser = (WebView) findViewById(R.id.browser);  browser.getSettings().setJavaScriptEnabled(true);  SharedPreferences credentials = getSharedPreferences(""credentials"", 0);  browser.setHttpAuthUsernamePassword(""example.com"", """", credentials.getString(""username"", """"), credentials.getString(""password"", """"));  browser.loadUrl(""http://example.com"");</code></pre><p>So does anyone know why this wouldn't be authenticating me? Should the realm string that I put """" for actually be something?</p>","378272","","","","","2013-12-09 19:44:30","WebView.setHttpAuthUsernamePassword() not working?","<android><authentication><webview><http-authentication><unauthorized>","2","2","","",""
"3135023","1","3136218","","2010-06-28 18:16:58","0","1546","<p>I would like to define each tab's content in a different XML file so the visual editor in Eclipse can be used. That is, without all of the tabs being laid over each other. The visual editor doesn't even seem to work with the XML example provided here: [link text][1]  [1]: <a href=""http://developer.android.com/guide/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/views/hello-tabwidget.html</a> ""Here"", It just has a Null pointer exception.</p><p>I have tried to define each tap in it's own file, for example:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;&lt;TextView android:text=""@+id/TextView01"" android:id=""@+id/TextView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;/RelativeLayout&gt;</code></pre><p>And when adding the tab I use:</p><pre><code>mTabHost.addTab(mTabHost.newTabSpec(""tab_in"").setIndicator(""Input"").setContent(R.layout.input));</code></pre><p>But this causes the application to crash on launch. Is there any way to do this?</p><p>Thanks</p>","368845","","","","","2010-06-28 21:21:39","Is it possible to define each tab's content in a separate XML file?","<android>","4","0","1","",""
"3135112","1","5983743","","2010-06-28 18:31:17","16","9812","<p>is it possible/advisable to have a nested listview?</p><p>i.e. a listView that's contained within a row of another listview?</p><p>an example would be where my main list is displaying blog posts, and then in each row, you'd have another list view for the comments for each post (that would be collapsible) </p>","372405","","","","","2011-05-12 20:00:12","android nested listview","<android><listview><nested>","3","0","6","",""
"3135279","1","3135420","","2010-06-28 18:55:21","0","623","<p>When I have an layout test.xml file open and click on Run Android creates an empty test.out.xml file and creates an ""Unparsed appt error"".</p><p>Even when I delete the newly created file the ""Unparsed appt error"" doesn't disappear.What happens here?How can I fix the error? Is there a way to prevent this from happen when I accidentally click on run while in a .xml file instead of being in a .java file?</p>","25282","","","","","2010-06-28 19:38:28","aapt error on android","<android>","1","0","","",""
"3135293","1","3135383","","2010-06-28 18:57:12","0","1416","<p>I'm familiar with C++ but never used Java. I've just started learning Android development. In most of the basic tutorials I've gone through mentioned packages names like org.example.hello. I know they are some sort of unique identifiers but</p><ol><li>How should I choose these packages names? Are there any guidelines?</li><li>Is there anything special I need to keep in mind if I'm developing a commercial application?</li><li>How can I make separate re-usable libraries and pack them in different packages/applications?</li></ol><p>thanks.</p>","189618","","","","","2010-06-28 19:10:12","what's in the (package) name org.example.hello?","<android>","3","0","1","",""
"3135336","1","","","2010-06-28 19:04:11","0","818","<p>I'm developing a tab-based layout, one tab should show a google maps view. my unsolved problem ist that my app is crashing when i change to the google map tab.</p><p>in my manifest i've set the permissions:</p><pre><code>uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""uses-permission android:name=""android.permission.ACCESS_MOCK_LOCATION""uses-permission android:name=""android.permission.INTERNET""</code></pre><p>Additionally I defined the maps lib under my application-tag:</p><pre><code>uses-library android:name=""com.google.android.maps""</code></pre><p>Furthermore I obtained an api maps key for my certificate md5-key and use this in my layout:</p><pre><code>&lt;com.google.android.maps.MapView    android:id=""@+id/mapview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:clickable=""true""    android:apiKey=""3431231dasadasdmnn54545s3323""/&gt;</code></pre><p>I have an runtime error if I switch to my google maps tab running the app in emulator - unfortunatly I cannot see anything in logcat. The only thing I see in debug view ist the message:</p><pre><code>ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,Intent) line 2663: Source not found.</code></pre><p>Can anybody explain me what's the problem could be? </p><p>I needed the source is provided here: <a href=""http://www.marcusegger.de/examples/QuickPortfolio.zip"" rel=""nofollow"">http://www.marcusegger.de/examples/QuickPortfolio.zip</a>please feel free to have look :-)</p>","216569","","216569","","2010-06-29 15:46:52","2010-06-29 15:46:52","tab-layout with a google maps tab","<android><android-emulator>","0","3","1","",""
"3135468","1","3135490","","2010-06-28 19:22:21","5","3098","<p>I have been working on a Android Web Services program that uses a number of classes from Sun's javax libraries.  The eclipse IDE is barking ""Attempt to include a core class (java.* or javax.* ) in something other than a core library.""  My application is an Android application and I am not creating a core library.  I am using several .jars; javax.xml.ws, javax.xml.bind, javax.xml.soap, javax.xml.rpc, and javax.jws.  I believe I cannot use these java bytecode .jars directly.  I will have to use the dx tool to convert them to delvik bytecode or .dex files.  I have done some additional research and have found that use of any javax.* classes in an android application are forbidden.  Can someone explain why?  Are their practical programming work arounds?</p><p>Thanks,Steve</p>","365435","","9167","","2010-06-28 19:25:01","2012-08-21 17:09:42","Having Android Problems with Sun javax jars","<android>","3","0","1","",""
"3135476","1","","","2010-06-28 19:23:50","7","799","<p>If I make changes in my Android Library project I have to manually refresh, and sometimes clean all projects that use the Library.  Is this normal?  Is there a way around this?</p>","248521","","","","","2013-02-19 22:56:42","Android Library projects and having to manually refresh","<android>","4","1","4","",""
"3135556","1","","","2010-06-28 19:36:47","1","304","<p>I would like to restrict my application which uses Tabs to portrait orientation. I have 4 tabs and I set the  ""android:configChanges=""orientation"" for all 4 tabs but the orientation still changes when i rotate the phone. Seem pretty straight forward. Am I missing something?</p><p>Thanks</p>","362608","","21234","","2010-06-28 19:54:27","2011-01-26 00:57:48","For portrait orientation on Tabs","<android><orientation><tabs><android-tabhost>","1","1","","",""
"3135642","1","","","2010-06-28 19:47:54","2","538","<p>Do they just scrape or are there APIs?</p>","305466","","","","","2011-10-09 11:31:49","How do websites like appcomments.com or androlib.com get data, particulary the reviews?","<iphone><android><scrape>","2","1","1","",""
"3135679","1","3136980","","2010-06-28 19:52:53","14","15680","<p>I'm using HttpClient on Android to connect to <a href=""https://someUrl.com/somePath"">https://someUrl.com/somePath</a>. The problem is that the site's certificate is for *.someUrl.com, not someUrl.com, so I get an SSLException. Lame on the part of the site, yes, but unless I can get it fixed, I'm stuck. Is there a way I can get HttpClient to relax and accept the certificate?</p>","12034","","87990","","2012-03-20 06:42:24","2012-03-20 06:42:24","Android HttpClient - hostname in certificate didn't match <example.com> != <*.example.com>","<java><android><ssl><httpclient><wildcard-subdomain>","5","0","16","",""
"3135742","1","","","2010-06-28 20:05:02","3","1580","<p>I had gotten reports from a few users that they couldn't login to our app (which makes HTTP calls to our site) or visit our website in their browser, so I added some code to our latest build to check what IP our host name is resolving to.  I've gotten reports from several different users now that they get 127.0.0.1 for our hostname when the app starts, which obviously isn't going to work.</p><p>They claim they aren't running any proxy software, and this happens on both 2.1 and 2.2.  This also happens on both wifi &amp; 3g, which makes me suspect it is some piece of software on their phone that is interfering with DNS resolution somehow.  Does anyone know of any popular software that might do that?  Or does anyone have any ideas about how to identify which software might be doing it?  </p><p>Thanks,</p>","23524","","","","","2013-07-29 09:58:49","DNS problems on Android","<android><dns>","3","3","","",""
"3135837","1","3137495","","2010-06-28 20:18:35","2","1671","<p>I've done plenty of iPhone work, never anything with Android. On iPhone, it was a few months in before I discovered the Three20 library (which is awesome) and began moving my code over. I don't want to make the same mistakes moving to Android, so my question:</p><p>Do android developers commonly use 3rd-party UI/networking libraries like Three20 on iPhone, or do they take the ones out of the box? I realize that there is an effort to port Three20 to Android, but that's not my goal per se. I just want to know if the out-of-the-box UI/networking/navigation libs you get with android are considered sufficient for most android apps.</p><p>Thanks!</p>","61072","","","","","2010-06-29 02:32:35","Do android developers commonly use 3rd-party UI/networking libraries like Three20 on iPhone?","<android><three20>","1","2","3","",""
"3136013","1","3136157","","2010-06-28 20:48:55","5","308","<p>There are many intents an Android developer can use - <a href=""http://developer.android.com/reference/android/content/Intent.html"">the ones that arrive with the OS</a>, <a href=""http://code.google.com/p/openintents/"">OpenIntents</a>, and several others.</p><p>Is there a site that lists all possible intents and their parameters?</p>","82804","","","","","2011-06-08 16:26:38","Android intents repository","<android><repository><android-intent>","2","0","1","",""
"3136187","1","3136408","","2010-06-28 21:16:27","19","20937","<p>I would like to launch an intent when any of my activity is visible, otherwise I will put it up as a notification, and will be fired by the user. </p><p>To decide this, I need to know if any of my activity is front-most, how do I that?</p>","243782","","","","","2013-04-17 07:24:38","How to detect if any of my activity is front-most and visible to user?","<android><activity>","5","0","4","",""
"3136288","1","3136347","","2010-06-28 21:29:35","5","2178","<p>what should be the best approach to make strings for different languages? I have this problem, I am trying to display strings such as 'month', 'months', 'year', 'years'. Currently I am working on 3 languages I know: spanish, english and polish. For english and spanish this is straight forward. But for instance, in polish 'years' can become 'lata' (after numbers 2 - 4) or 'lat' (after numbers from 5). I was thinking on adding an extra string for this, and making it empty in the other languages. However this made me think about the other languages I don't know, which might have even more differences. Which should be the best approach in this case, if I am considering adding more languages in the future?</p>","265375","","","","","2011-08-15 13:27:54","How to do an app with truly multilingual strings?","<java><android><multilingual>","4","2","6","",""
"3136555","1","3136784","","2010-06-28 22:18:44","3","287","<p>I have a service that produces as result a <code>SortedSet</code> object. I need to pass it to another <code>Intent</code> that will use it. First is put in the notification area, then when the user actions it it will need to fire the activity.</p><p>As it it's own SortedSet is not <code>Parcelable</code> nor <code>Serializable</code> so it won't work. One single item in <code>SortedSet</code> is already parcelable and it's used fine, but I need the whole set.</p><p>How to pass a <code>SortedSet</code> as an Intent's extra?</p>","243782","","844882","","2012-03-22 05:00:50","2012-03-22 05:00:50","How to pass a SortedSet as an Intent's extra?","<android>","1","1","","",""
"3136672","1","3338257","","2010-06-28 22:41:41","1","333","<p>I have been looking at Android's javax.net.ssl package, but am still confused as to how it works with the underlying JNI glue in place.</p><p>From what I see, all of the classes under the javax.net.ssl package (/libcore/x-net/src/main/java/javax/net/ssl) are abstract and do not directly implement functionality.  </p><p>All of the functionality of the above is implemented in the org.apache.harmony.xnet.provider.jsse folder (/libcore/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse), and this implementation makes calls to the underlying JNI C code.</p><p>Would anyone be able to tell me how the provider is linked to the abstract classes, given that the user calls the abstract classes directly from their code.  I thought that usually the user would call the subclass, but in this case it seems to be the opposite.</p><p>Thanks,<br/>Chris</p>","175280","","","","","2010-07-26 19:27:54","Android SSL JNI structure?","<java><c><android><jni>","1","1","","",""
"3136769","1","3137050","","2010-06-28 23:03:43","0","884","<p>I have this resource for a <code>Button</code></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_pressed=""true""&gt;        &lt;shape&gt;            &lt;solid android:color=""@color/CLR_GREEN"" /&gt;            &lt;corners android:radius=""5dp"" /&gt;            &lt;padding android:left=""10dp"" android:top=""10dp""                android:right=""10dp"" android:bottom=""10dp"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;    &lt;item&gt;        &lt;shape&gt;            &lt;solid android:color=""@color/CLR_GREEN_DARK"" /&gt;            &lt;corners android:radius=""5dp"" /&gt;            &lt;padding android:left=""10dp"" android:top=""10dp""                android:right=""10dp"" android:bottom=""10dp"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;&lt;/selector&gt;</code></pre><p>And I refer to this button in code as <code>greenBtn</code></p><p>How do I simulate its pressure without firing its <code>onClick</code> event? i.e. how do I make it change its background color as if it was pressed, stay in this state for half a second and then be back in its original state?</p>","133203","","","","","2010-06-29 02:52:36","Simulate button press","<android>","1","2","","",""
"3136774","1","3136846","","2010-06-28 23:05:38","1","491","<p>I get frequently SQLiteDoneException,</p><pre><code>06-29 02:03:34.816: WARN/System.err(30470): android.database.sqlite.SQLiteDoneException: not an error06-29 02:03:34.816: WARN/System.err(30470):     at android.database.sqlite.SQLiteStatement.native_1x1_string(Native Method)06-29 02:03:34.816: WARN/System.err(30470):     at android.database.sqlite.SQLiteStatement.simpleQueryForString(SQLiteStatement.java:154)06-29 02:03:34.826: WARN/System.err(30470):     at android.database.DatabaseUtils.stringForQuery(DatabaseUtils.java:669)06-29 02:03:34.826: WARN/System.err(30470):     at android.database.DatabaseUtils.stringForQuery(DatabaseUtils.java:652)</code></pre><p>I am doing something wrong?</p>","243782","","301832","","2010-08-09 09:15:12","2010-08-09 09:15:12","I get frequently SQLiteDoneException when querying one value, why?","<android><exception><sqlite>","1","0","","",""
"3136794","1","3136872","","2010-06-28 23:10:01","1","928","<p>aka, what is wrong with this code:-</p><pre><code>package com.mez.appofjaq;import com.mez.appofjaq.RssParser.RssFeed;import android.app.Activity;import android.app.ProgressDialog;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.webkit.WebView;public class AppOfJaq extends Activity {    protected static final int REFRESH = 0;    String streamTitle = """";    protected ProgressDialog pd;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        pd.show(this, ""Loading.."", ""Loading Feed"");        setContentView(R.layout.main);        new Thread(new Runnable(){            public void run() {                loadFeed();                pd.dismiss();            }        }).start();    }    private void loadFeed()    {        RssParser rp = new RssParser(""http://shotofjaq.org/feed"");        rp.parse();        RssFeed feed = rp.getFeed();        if (feed.getItems() != null)        {            streamTitle = feed.getItems().get(0).content;        }        WebView result = (WebView)findViewById(R.id.result);        result.loadData(streamTitle, ""text/html"", ""utf-8"");    }}</code></pre>","20010","","","","","2010-06-29 14:04:55","How do I get a ProgressDialog to show on application Startup?","<android>","3","0","","",""
"3136991","1","3137042","","2010-06-28 23:57:16","2","2042","<p>I have an app that has two buttons – one for email &amp; one for SMS. Depending on the button pressed I want to email or else SMS a certain text. I have coded the email button and it is working fine. The problem is that the dialog box that pops-up gives an option of e-mail or Messaging the text. I want to separate out the two, so that when the user presses email, only the options of email is there, and when the user presses SMS, only the option of Messaging is there.</p><p>Here is the code that I have tried.</p><pre><code>private void sendEmail(){    Intent i = new Intent(Intent.ACTION_SEND);     i.setType(""text/plain"");     i.putExtra(Intent.EXTRA_EMAIL  , new String[]{""recipient@example.com""});     i.putExtra(Intent.EXTRA_SUBJECT, ""Subject of the message"");     i.putExtra(Intent.EXTRA_TEXT   , ""Body of the message"");     try {         startActivity(Intent.createChooser(i, ""Send mail...""));     } catch (android.content.ActivityNotFoundException ex) {         Toast.makeText(this, ""There are no email clients installed."", Toast.LENGTH_SHORT).show();     } }</code></pre><p>Basically there seems to be a single intent  Intent.ACTION_SEND for both emails &amp; Messaging.   </p><p>Any way to separate them out?</p>","289918","","","","","2013-06-05 12:44:02","Android: Separate intents for email & SMS","<android>","2","0","","",""
"3137183","1","3137442","","2010-06-29 01:03:35","1","570","<p>I have about 25 pictures in my <code>res/drawables</code>.I want to loop through them, setting the next one as the background everytime the user hits a button on the screen. </p><p>Of course the drawables folder also has other pictures like droid icon etc which I don't want to use.</p><p>Cannot think of a good way of doing it. I thought of naming my pictures back1.jpg, back2.jpg... back25.jpg, and somehow looping through but this doesn't work. Can someone suggest a way/ sample code? </p>","289918","","119895","","2010-06-29 01:08:14","2010-06-29 02:17:37","Android: Looping through pictures and setting each as background","<android>","1","0","","",""
"3137223","1","3137243","","2010-06-29 01:17:34","5","3322","<p>How to pass socket, inputstream, outputstream objects between activities</p>","357349","","","","","2010-06-29 01:25:38","How to pass socket, inputstream, outputstream objects between activities","<android>","1","1","","",""
"3137270","1","3138109","","2010-06-29 01:33:16","1","454","<p>I am curious about the safety of this method I have considered using for passing touch events in my Android application (and testing my understanding of concurrency in Java). Here's the basics: </p><p>I have a SurfaceView hooked up to SurfaceHolder.Callback to get user input events, mainly the <code>onTouchEvent</code> callback. After the <code>onTouchEvent</code> method is invoked, I see if <code>event.getAction() == MotionEvent.ACTION_UP</code> and, if so, call a method I have named <code>postTouchEvent</code> which is a member method of my app thread that updates the application's state and draws to the canvas.</p><p>SurfaceView</p><pre><code>@Overridepublic boolean onTouchEvent(final MotionEvent event){    mAppThread.postTouchEvent(event);}</code></pre><p>AppThread</p><pre><code>private volatile MotionEvent mInputEvent;public void postTouchEvent(final MotionEvent event){    this.mInputEvent = event;}@Overridepublic void run(){    // while loop ...    if (this.mInputEvent != null)    {        final MotionEvent inputEvent = this.mInputEvent;        this.mInputEvent == null;        // update state based on inputEvent (not this.mInputEvent)    }    // draw to canvas}</code></pre><p>Now I understand that it is certainly not atomic, but since I treat it as immutable after receiving it from framework, won't this work? (Instead of synchronizing the post method and the if statement, which I have no problem doing, but I'm asking to learn.)</p><p>Here are my thoughts. I know I will have a valid reference to the object but I am unsure in what state I will actually see the object. While testing everything is working out just fine but I am aware of how uncommon threading exceptions can be, even if something is broken.</p><p>Also, I can see one problem with this: If another MotionEvent comes though, it's possible that inputEvent in the <code>run()</code> method will be set to a different event than the one that was referenced when <code>this.mInputEvent != null</code> was checked, but this really isn't an issue.</p><p>So, is there anything I am missing or, for my purposes, should this be ok?</p>","2053380","","","","","2010-06-29 05:37:53","Is a volatile reference a safe way to pass MotionEvents between threads?","<java><android><multithreading>","2","0","","",""
"3137306","1","3137342","","2010-06-29 01:45:28","1","630","<p>I'm just getting my toes wet.  Using Eclipse, and am not far beyond HelloAndroid.  If I have a gallery image loaded onto the screen, and I want to play around with getPixel, where do I send the resulting RGB value output so that I can read it?</p><p>Thanks.</p>","225626","","","","","2014-03-23 16:34:47","printf equivalent for Android dev?","<android>","2","0","","",""
"3137387","1","3137446","","2010-06-29 02:06:16","0","393","<pre><code>06-29 01:24:15.882: ERROR/AndroidRuntime(747): Uncaught handler: thread main exiting due to uncaught exception06-29 01:24:15.922: ERROR/AndroidRuntime(747): java.lang.RuntimeException: Unable to start activity ComponentInfo{one.two/one.two.Arrival}: java.lang.NullPointerException06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at android.os.Handler.dispatchMessage(Handler.java:99)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at android.os.Looper.loop(Looper.java:123)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at android.app.ActivityThread.main(ActivityThread.java:3948)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at java.lang.reflect.Method.invokeNative(Native Method)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at java.lang.reflect.Method.invoke(Method.java:521)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at dalvik.system.NativeStart.main(Native Method)06-29 01:24:15.922: ERROR/AndroidRuntime(747): Caused by: java.lang.NullPointerException06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at one.two.DBAdapter.getAllTitles(DBAdapter.java:167)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at one.two.Arrival.getData(Arrival.java:35)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at one.two.Arrival.onCreate(Arrival.java:21)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)06-29 01:24:15.922: ERROR/AndroidRuntime(747):     ... 11 more</code></pre><p>My Class to call the database </p><pre><code>package one.two;import java.util.ArrayList;import java.util.List;import android.app.ListActivity;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.ListView;public class Arrival extends ListActivity{    private ListView listView;    DBAdapter db = new DBAdapter(this);    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        getData();        // db.open();        listView = (ListView) findViewById(android.R.id.list);        // db.close();    }    private void getData()    {        // show some display that you are going to open db        db.open();        // show some display that you have opened        // redundant see below statement ---- List&lt;String&gt; items = new ArrayList&lt;String&gt;();        // call the DBAdapter method to getAllTitles()        List&lt;String&gt; items = DBAdapter.getAllTitles();        // iterate through the items one by one thru display statement or show        // on layout        // check how to do that        ArrayAdapter&lt;String&gt; titles = new ArrayAdapter&lt;String&gt;(this,                R.layout.main, items);        db.close();    }}</code></pre><p>My DBAdapter.java</p><pre><code>package one.two;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.util.List;import android.app.ListActivity;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteException;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;import java.util.ArrayList;public class DBAdapter extends ListActivity{    private static String DB_PATH = ""/data/data/one.two/databases/"";    private static final String DATABASE_NAME = ""ferry.db"";    private static final String DATABASE_TABLE = ""port"";    public static Context context;    public String status = ""status"";    public String id = ""id"";    public String arrival = ""arrival"";    public String destination = ""destination"";    public String ferry = ""ferry"";    //null constructor    public DBAdapter()    {    }    //overloaded non-null constructor    public DBAdapter(Context context)    {    }    public class DatabaseHelper extends SQLiteOpenHelper    {        Context context;        DatabaseHelper(Context context)        {            super(context, DATABASE_NAME, null, DATABASE_VERSION);            this.context = context;        }//end constructor DatabaseHelper        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion,                int newVersion)        {        }//end onUpgrade()        @Override        public void onCreate(SQLiteDatabase db)        {            boolean dbExist = checkDatabase();            if (dbExist)            {            }            else            {                this.getReadableDatabase();                try                {                    copyDataBase();                }                catch (IOException e)                {                    throw new Error(""Error copying database"");                }            }        }//end onCreate()    }// end class DatabaseHelper    private static DatabaseHelper DBHelper;    private static SQLiteDatabase db;    private static final int DATABASE_VERSION = 1;    //// context brought up /////////////    //private final Context context;        private boolean checkDatabase()        {            SQLiteDatabase checkDB = null;            try            {                String myPath = DB_PATH + DATABASE_NAME;                checkDB = SQLiteDatabase.openDatabase(myPath, null,                        SQLiteDatabase.OPEN_READONLY);            }            catch (SQLiteException e)            {                // database doesn't exist yet            }            if (checkDB != null)            {                checkDB.close();            }            return checkDB != null ? true : false;        }//end checkDatabase()        private void copyDataBase() throws IOException        {            // Open your local db as the input stream            InputStream myInput = context.getAssets().open(DATABASE_NAME);            // Path to the just created empty db            String outFileName = DB_PATH + DATABASE_NAME;            // Open the empty db as the output stream            OutputStream myOutput = new FileOutputStream(outFileName);            // transfer bytes from the inputfile to the outputfile            byte[] buffer = new byte[1024];            int length;            while ((length = myInput.read(buffer)) &gt; 0)            {                myOutput.write(buffer, 0, length);            }            // Close the streams            myOutput.flush();            myOutput.close();            myInput.close();        }//end copyDataBase()        public void DBAdapter() throws SQLException        {            String myPath = DB_PATH + DATABASE_NAME;            db = SQLiteDatabase.openDatabase(myPath, null,                    SQLiteDatabase.OPEN_READONLY);        }//end DBAdapter()        public void open()        {            //Open the database            String myPath = DB_PATH + DATABASE_NAME;            db = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);        }        // ---closes the database---        public void close()        {            DBHelper.close();        }//end close()        public static List&lt;String&gt; getAllTitles()        {            List&lt;String&gt; titles = new ArrayList&lt;String&gt;();                Cursor c=null;                c = db.query(""port"",                        new String[] { ""status"", ""id"", ""arrival"",                                ""destination"", ""ferry"" }, null, null,                        null, null, null);                try {                    if (c!=null) {                        for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext())                         {                            DBAdapter title = new DBAdapter(context);                            title.status = c.getString(0);                            title.id = c.getString(1);                            title.arrival = c.getString(2);                            title.destination = c.getString(3);                            title.ferry = c.getString(4);                        }                    }                } finally {                    if (c!=null) {                    c.close();                }        }            return titles;        }//end getAllTitles()    }//end class DBAdapter</code></pre>","358218","","","","","2010-06-29 03:05:12","Error with android database program","<android><database><eclipse><sqlite>","1","0","","",""
"3137399","1","","","2010-06-29 02:09:09","1","284","<p>So I've been playing around with android app and widgets. have a few things running. but one thing i cant seem to figure out is how to package more than 1 widget. say i wanted to release my set of widgets?</p><p>where in the manifests can i do this?thanks</p>","146637","","","","","2010-07-06 18:27:20","Package more than 1 widget in a Android App","<java><android><android-widget>","1","0","","",""
"3137490","1","3137510","","2010-06-29 02:31:58","15","7383","<p>I have written the following to spin my icon on the center of the screen and instead it rotates around the upper-left corner (i.e., origin x=0, y=0 of the ImageView).  It should be simple to set some attributes of the ImageView or the RotateAnimation, but I can't figure it out.</p><pre><code>public class IconPromoActivity extends Activity {    private static final float ROTATE_FROM = 0.0f;    private static final float ROTATE_TO = -10.0f * 360.0f;// 3.141592654f * 32.0f; /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ImageView favicon = (ImageView) findViewById(R.id.favicon);  RotateAnimation r; // = new RotateAnimation(ROTATE_FROM, ROTATE_TO);  r = new RotateAnimation(ROTATE_FROM, ROTATE_TO, 0, 0, 40, 0);  r.setDuration((long) 2*1500);  r.setRepeatCount(0);  favicon.startAnimation(r);    }}</code></pre>","157804","","","","","2014-02-13 20:12:37","How to spin an android icon on its center point?","<android><animation><rotation>","2","0","6","",""
"3137526","1","8919733","","2010-06-29 02:48:15","0","329","<p>in Android the system does not scan flac lossless audio files, so I write a scanner to scan them, put into Audio.Media.EXTERNAL_CONTENT_URI, and it works well - until the MediaScanner activates and delete the entries I have inserted.Is there a way to prevent MediaScanner deletes them, or some trick to know when MediaScanner is done, so I can call my scanner up to scan and insert again?Thanks!</p>","290163","","","","","2012-01-19 00:54:12","How to avoid MediaScanner delete database entries?","<android>","2","0","2","",""
"3137582","1","3137689","","2010-06-29 03:05:39","1","5362","<p>Does anybody know if there is any event to handle incoming calls?? I'm developing an app that streams audio from the microphone and I would like to have a listener that stops the recording, etc when there is an incoming call...and that restarts the procress when the telephone call is over.</p>","353261","","759866","","2014-02-05 20:05:50","2014-02-05 20:05:50","how to handle incoming call events in Android","<android><events><phonecalls>","1","0","1","",""
"3137587","1","3139368","","2010-06-29 03:06:13","1","412","<p>The default tab that is displayed in my app is tab 0. I would like when Preference uso is clicked, to change the currentTab to 1, as well as the next time the app opens, tab 1 is displayed instead of tab 0.</p><p>This is the Preferences.java contents:</p><pre><code>package com.fbisoft.uowt;import android.os.Bundle;import android.preference.Preference;import android.preference.PreferenceActivity;import android.preference.Preference.OnPreferenceClickListener;import android.widget.TabHost;import android.widget.Toast;public class Preferences extends PreferenceActivity {   /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      addPreferencesFromResource(R.xml.preferences);      getPreferenceManager().findPreference(""uso"").setOnPreferenceClickListener(new OnPreferenceClickListener() {         @Override         public boolean onPreferenceClick(Preference preference) {            TabHost.setCurrentTab(1);            return true;         }      });   }}</code></pre><p>The <code>TabHost.setCurrentTab(1);</code> gives me an error:</p><pre class=""lang-none prettyprint-override""><code>Cannot make a static reference to the non-static method setCurrentTab(int)from the type TabHost</code></pre>","365372","","321366","","2011-12-02 13:54:31","2011-12-02 13:54:31","setcurrenttab from preference","<android><android-preferences>","1","0","","",""
"3137696","1","3137750","","2010-06-29 03:39:24","2","804","<p>I would like to know if it is possible to get 'leftover' calls to <code>AsyncTask#onProgressUpdate</code> after <code>AsyncTask#onPostExecute</code> has been called? I am setting text on the same <code>TextView</code> using both of them, and I don't want to set text such as ""Done!"" and then have it overwritten at a later point by text such as ""Almost there - 90%""</p><p>Also, I am assuming that the <code>onProgressUpdate</code> method works similar to a <code>SwingWorker</code> method in that multiple calls to <code>publishProgress</code> may stack up before a call to <code>onProgressUpdate</code> occurs. I would really like to know where the ""newer"" and ""older"" progress updates are on the parameter - aka are the newest updates at position 0 in the parameter, or at position <code>progress.length</code>?</p>","119592","","","","","2011-10-29 18:31:44","AsyncTask: Is onPostExecute guaranteed to run after all calls to onProgressUpdate?","<android><background><backgroundworker><android-asynctask>","2","0","","",""
"3137782","1","","","2010-06-29 04:06:08","0","785","<p>Say if I decided to support only normal 320X480 screen resolution for the first release of my app, </p><p>Will these lines, hide the app from the high and small resolution screens on android market ?</p><p>&lt;<strong><em>supports-screens android:smallScreens=""false""      android:largeScreens=""false""      android:resizeable=""false""      android:normalScreens=""true""      android:anyDensity=""false""></em></strong></p><p>If not can some one point in the right direction as to how to make sure that the app is not visible or available for download for rest of the screens ?</p><p>Thanks in advance.</p>","372446","","","","","2010-06-29 04:39:29","Supporting /restricting android app only for normal resolution?","<android>","2","0","","",""
"3137883","1","","","2010-06-29 04:35:39","2","517","<p>If I use:</p><pre><code> allNetworksInfo = connectivityManager.getAllNetworkInfo();</code></pre><p>It will display </p><pre><code>type :MOBILE subtype :UNKNOWN state :UNKNOWN isAvailable :falsetype :WIFI subtype : state :DISCONNECTED isAvailable :truetype :MOBILE subtype :3G state :CONNECTED isAvailable :true</code></pre><p>But if I use:</p><pre><code>mobileNetworkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);</code></pre><p>It will always display my mobile state </p><pre><code>   type :MOBILE subtype :UNKNOWN state :UNKNOWN isAvailable :false</code></pre><ol><li><p>I am using 3G connection for BT.How to get the status of my Mobile by using ContentManager.If i use TYPE_MOBILE it displays ordinary mobile connection info.But i need 3G connection info.How to display my 3G connection status?</p></li><li><p>If I use statements in Global , I am not getting updated status from the ContentManager.If I need current status of MOBILE or WIFI ,need to write getNetwork method repeatedly?Currently iam using repeated statements whenver I require status? How can I used ContentManager for updated status of WIFI and MOBILE(3G)?</p></li><li><p>WifiManager.connect()/reconnect() takes time to connecting to the wifi. I used enableNetwork(netId) method for enable the selected WiFi accesspoint. Still it will take time. But my requirements is connect the wifi network immediately. If I am observing the WiFi Settins it dispayes Obtaining Addresss and after few seconds connected status. It takes time for obtaining the IP. How to remedy this one or get connect wifi immediately?</p></li></ol>","362544","","3800","","2011-08-31 19:18:51","2011-08-31 19:18:51","How to monitor ContentManager for my Mobile(3G) connection status Android?","<android><mobile><wifi>","0","0","","",""
"3138006","1","","","2010-06-29 05:08:33","1","882","<p>I try to send udp data from PC and receive the data in android emulator. If we send data from android to PC it’s working perfectly. But android emulator not receives the udp data .How to receive data in android.</p><p>This is my UDP sending code :</p><pre><code>class WriteSender {public static void main(String args[]) throws Exception {int serverPort = 998;int buffer_size = 1024;byte buffer[] = new byte[buffer_size];System.out.println(""Enter String to send "");DatagramSocket ds = new DatagramSocket(serverPort);  int pos = 0;  while (true) {    int c = System.in.read();    switch (c) {    case -1:      System.out.println(""Server Quits."");      return;    case '\r':      break;    case '\n':     ds.send(new DatagramPacket(buffer, pos, InetAddress.getByName(""10.0.2.15""), 5757));      pos = 0;      break;    default:      buffer[pos++] = (byte) c;    }  }}}</code></pre><p>This is my UDP Receive code:</p><pre><code>public class Server implements Runnable {   public static final String SERVERIP=""10.0.2.15"";public static final int SERVERPORT = 5757;private DatagramSocket ds;@Overridepublic void run() {    int buffer_size = 1024;    byte buffer[] = new byte[buffer_size];    Log.d(""MY UDP "",""Before create"");           try {        ds = new DatagramSocket(SERVERPORT);        while (true) {            DatagramPacket p = new DatagramPacket(buffer, buffer.length);            ds.receive(p);            Log.d(""MY UDP "",new String(p.getData(), 0, p.getLength()));            }        }    catch(Exception e){        Log.e(""MY UDP "", "" Error"", e);        }}}</code></pre><p>Redirect :</p><pre><code>telnet localhost 5554redir add udp:998:5757</code></pre><p>How to receive udp data? Am I did anything wrong in my code ?</p>","370334","","370334","","2010-06-29 05:18:14","2012-12-20 09:16:39","android udp receive is not working?","<android>","2","0","","",""
"3138342","1","","","2010-06-29 06:32:03","0","846","<p><br>I set my android emulator to wait for the debugger for my application, so when it starts, the emulator waits writing in output log ""<code>waiting for debugger on port 8100</code>"".</p><p>But, I can't find a way to attach the Netbeans debugger to this port nor to the emulator in general...</p><p>Please help,<br>Alban.</p>","306839","","","","","2010-06-29 14:27:38","Netbeans & Android emulator","<android><netbeans><debugging>","1","0","","",""
"3138348","1","","","2010-06-29 06:33:45","8","14045","<p>I'm extending the CountDownTimer class to obtain some custom functionality .In onTick() in case some conditions are met I call cancel() , expecting that will be the end of it, however the onTick() callback gets call until the the count down is reached . So how to prevent this from happening ?</p>","304866","","","","","2010-11-21 11:59:59","how to stop/cancel android CountDownTimer","<android>","2","0","4","",""
"3138427","1","3138935","","2010-06-29 06:46:54","1","3617","<p>I am using Tabhost for project Tabs. I changed the color of the tab to blue but there is 2px line bellow the tab. Can any one help me to change the white color to blue.<a href=""http://img816.imageshack.us/img816/228/device.png"" rel=""nofollow"">http://img816.imageshack.us/img816/228/device.png</a></p>","286831","","286831","","2010-07-30 06:51:34","2010-07-30 06:51:34","android tabhost custom color","<android><android-style-tabhost>","2","1","","",""
"3138508","1","","","2010-06-29 07:01:35","3","771","<p>I want to create a full-screen page that looks like this:</p><pre><code> ---------------------------------------  | --------  --------------------------- |  ||        ||          TextView         ||  ||        | --------------------------- |  || Image  | -----------------  -------- |  || View   ||                 ||        ||  ||        ||    TextView     ||        ||  ||        ||                 || Image  ||  ||        ||                 || View   ||  | --------  ----------------- |        ||  | --------------------------- |        ||  ||          TextView         ||        ||  | ---------------------------  -------- |   ---------------------------------------  </code></pre><p>where each ImageView takes up at most 20% of the parent layout's width.</p><p>Primary question: Really...what is the best way to do this? After hours of searching, the best idea I can come up with is to get the screen's width and simply set the views' widths to be a max of 20% of that. However, this intuitively does not seem like a best-practice solution. (Eg. if the application wasn't running in full screen, this solution wouldn't work.) A LinearLayout won't work with the way the page is laid out (appears I have to use a RelativeLayout). And I think it would be preferable to set the views' widths based on the parent view's width (as opposed to the screen's width), but I'm not clear on how to do that either, because at the time that I'm trying to set up the widths of my children views, parentView.getWidth() returns 0. Does anyone have any good, clean solutions for how to create a page as shown above?</p><p>Secondary question: Does anyone know how to wrap text around images as shown above? After still more hours of searching, I couldn't find a solution for this; seems like you need to stitch together a couple of TextViews. Is there a better way that I'm missing?</p><p>Thanks for any info anyone can provide.</p>","378716","","","","","2013-03-19 14:26:08","Most effecient way to create proportional views","<android>","5","2","3","",""
"3138724","1","3154589","","2010-06-29 07:35:29","5","4458","<p>With the stencil buffer in opengl-es for Android, I'm simply trying to mask out drawing part of the screen. I think I have it set up right, but it is not masking out the non-stenciled parts. Below is an extraction of code for what I'm doing.</p><pre><code>gl.glEnable(GL10.GL_STENCIL_TEST);gl.glClearStencil(0);gl.glClear(GL10.GL_STENCIL_BUFFER_BIT);gl.glColorMask(false, false, false, false);gl.glDepthMask(false);gl.glStencilFunc(GL10.GL_ALWAYS, 1, 1);gl.glStencilOp(GL10.GL_REPLACE, GL10.GL_REPLACE, GL10.GL_REPLACE);drawMask(); //I have confirmed this draws to the correct location by allowing colour to show. Trust that this draws the mask to the correct location.gl.glColorMask(true, true, true, true);gl.glDepthMask(true);gl.glStencilFunc(GL10.GL_EQUAL, 1, 1);gl.glStencilOp(GL10.GL_KEEP, GL10.GL_KEEP, GL10.GL_KEEP);drawItems(); //Draw everything. Only items inside the masked area should be drawn. But everything is drawn with this code...gl.glDisable(GL10.GL_STENCIL_TEST);</code></pre><p>Anyone spot anything wrong with this? What it does basically is draw a box for say, half the screen (this works if I had colour enabled) which is setting the stencil buffer to 1 for that area. And at the end I draw to the whole screen. I want it to draw to the top half only, but it draws everything.</p><p>Thanks in advanced.</p>","255605","","","","","2012-06-21 00:38:26","Getting the OpenGL-ES Stencil Buffer Working","<java><android><opengl-es><stencil-buffer>","3","2","2","",""
"3138847","1","","","2010-06-29 07:58:56","1","222","<p>I have the contact and I would like the user to choose from his phones or emails. Is that already provided by some picker or shall I implement my own?</p>","243782","","","","","2011-10-25 03:25:07","Is there a contact number or email chooser/picker for a specific contact?","<android><contacts>","1","0","","",""
"3138960","1","","","2010-06-29 08:22:33","1","758","<p>I have a continuous frame animation which runs 24 frames per X seconds, which is working fine, Now when i run another two animations ( Alpha animation ) at the same time , i notice  performance drop , that is frame animation slows down.</p><p>Any idea why this is happening, and is there any work around for this?</p><p>Thanks in advance.</p>","226946","","","","","2010-12-20 14:45:51","Android animation slows down","<android><animation><performance>","1","0","","",""
"3139040","1","3139665","","2010-06-29 08:32:48","0","240","<p>I'm having trouble getting my app to work properly on older devices.</p><p>I've ready the ""Backward Compatibility"" tutorial, I'm working for performance - and it suggestions using .invoke is considerably slower than using a wrapper class.</p><p>But it seems the wrapper class only works for if a class is not available on older devices.</p><p>I'm compiling with 2.2, but minSDK is 1.5</p><p>I'm working with multitouch, I assumed that if I checked against Build.Version.SDK, and didn't call getPointerCount() - then it wouldn't raise an error.</p><p>But when I create an instance of the class which has my methods in, I get this:</p><p>06-29 08:17:28.263: ERROR/dalvikvm(255): Could not find method android.view.MotionEvent.getPointerCount, referenced from method com.myPackage.myClass</p><p>Despite not actually calling it. Is this normal?</p><p>How do I get around this?</p>","310455","","","","","2010-06-29 10:08:18","Proper backwards compatability, java.lang.VerifyError","<android>","1","0","","",""
"3139150","1","","","2010-06-29 08:51:39","1","2381","<pre><code>WifiConfiguration conf = new WifiConfiguration();conf.SSID = ""ssid"";conf.preSharedKey = ""\""password\"""";conf.status = WifiConfiguration.Status.ENABLED;        conf.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40); conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP104);conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);conf.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);conf.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);conf.allowedProtocols.set(WifiConfiguration.Protocol.WPA);conf.allowedProtocols.set(WifiConfiguration.Protocol.RSN);int res = wifi.addNetwork(conf);boolean b = wifi.enableNetwork(res, true);</code></pre><hr><p>This wifi access point need a username + password to connect to, but I can't find any way to set the password to it. I think this is the problem so that I can't create it successfully.</p><p>Please help me on this. Thanks a lot.</p>","378814","","133203","","2010-06-29 09:03:07","2012-01-08 01:54:39","How to create a Android WifiConfiguration and access wifi with username/password","<android><configuration><wifi><account>","1","0","1","",""
"3139205","1","","","2010-06-29 09:01:12","0","5000","<p>I use Alert Dialog as Login. So after closing this dialog, any value assigned at dialog show() is lost. how to get back this value? my code is below</p><pre><code>private void accessPinCode(){    LayoutInflater factory = LayoutInflater.from(this);    final View textEntryView = factory.inflate(R.layout.dialog_login, null);    AlertDialog.Builder alert = new AlertDialog.Builder(this);                     alert.setTitle(""Title"");      alert.setMessage(""Enter Pin :"");                    alert.setView(textEntryView);           alert.setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {          public void onClick(DialogInterface dialog, int whichButton) {                      EditText mUserText;            mUserText = (EditText) textEntryView.findViewById(R.id.txt_password);            //String strPinCode = mUserText.getText().toString();            Log.d( TAG, ""Pin Value 1 : "" + mUserText.getText().toString());                           strPIN = mUserText.getText().toString();            Log.d( TAG, ""strPIN inside accessPinCode : "" + strPIN);            fPIN= checkPINCode();            Log.d( TAG, ""fPass : "" + fPIN);            return;                          }      });      alert.setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int which) {            // TODO Auto-generated method stub            return;           }    });    alert.show();    Log.d( TAG, ""strPIN outside Alert Show : "" + strPIN);}</code></pre><p>Based on my code, strPIN and FPIN values are lost. I wanna use those value outside accessPinCode function. how to get?</p><p>Actually, I call this function at tabchanged event. If login pass, the user could access another tab. But all've already worked in tab changed event before clicking AlertDialog's Ok button. My tab event like below</p><pre><code>tabHost.setOnTabChangedListener(new OnTabChangeListener() {            public void onTabChanged(String tabId) {                // TODO Auto-generated method stub                if (tabId.equals(""index""))                {                    tabHost.setCurrentTab(1);                    accessPinCode();                }                Log.d( TAG, ""tabId : ""+ tabId );                }        });</code></pre><p>Is there any type of Dialog suitable for Login? How to solve?</p><p>Thank you.</p>","305732","","305732","","2010-06-30 01:59:20","2011-07-25 07:01:12","wanna get back any value after closing Alert Dialog","<android><alertdialog>","2","3","0","",""
"3139337","1","3139667","","2010-06-29 09:18:04","1","466","<p>I am coding an Android client that talks to some web services via XML packets.A typical packet looks like this..</p><pre><code>&lt;Packet service=""login""&gt;  &lt;username&gt;&lt;/username&gt;  &lt;password&gt;&lt;/password&gt;&lt;/Packet&gt;</code></pre><p>I have about 20 of these packets and would like to store them in my resources maybe in res/xml or res/raw</p><p>I want to store these 'empty' packets and load them using XML DOM and then fill in the content between the tags or attributes but am unsure how to do this.</p><p>Once the DOM packet has been filled in I want to get that back as a String so that I can send the packet to the server.</p><p>So to summarize my questions are..</p><p>(1) How do I load an XML resource using DOM?</p><p>(2) How do I convert the DOM object to a String?</p>","358338","","","","","2010-06-29 10:08:35","XML -> DOM -> Modify -> String","<java><android>","2","0","","",""
"3139449","1","3149079","","2010-06-29 09:38:26","1","689","<p>I have a listview with a customized ArrayAdapter. When the in the ArrayAdapter has changed the gui is supposed to update. However, when it's supposed to update, it won't unless you press a key on the emulator. The clickable rows are not clickable either unless i have clicked on an arbitrary button on the emulator. The underlying data for the listview is changed somewhere else and then notifying the observer (the listview in this case)</p><pre><code>public void update(java.util.Observable arg0, Object arg1)     {        Log.e(""Supposed"",""to update"");        ad.notifyDataSetChanged(); //Ad is the arrayadapter                             }</code></pre><p>The data is presented properly after the magic touch on the buttons. But why?Any thoughts?When i inspect the ArrayAdapter's items-reference it shows the updated values, but the gui wont.Plz help</p><p>edit:</p><pre><code>private class MustAdapter extends ArrayAdapter&lt;Item&gt;     {        public MustAdapter(Context context, int textViewResourceId, ArrayList&lt;Item&gt; items)        {            super(context,textViewResourceId,items);        }        public View getView(int position, View convertView, ViewGroup parent) {                View v = convertView;                if (v == null) {                    LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                    v = vi.inflate(R.layout.row, null);                }                Item o = items.get(position);                if (o != null) {                        TextView tt = (TextView) v.findViewById(R.id.text1);                         TextView bt = (TextView) v.findViewById(R.id.text2);                        ImageView iv= (ImageView) v.findViewById(R.id.img);                        ImageView ib = (ImageView)v.findViewById(R.id.OnOffButt);                        if (ib != null) {                            ib.setTag(position);                            if (((Ventilation)o).enabled ==0 ) {                                ib.setImageResource(android.R.drawable.ic_input_delete);                            }                            else                                ib.setImageResource(android.R.drawable.ic_input_add);                            ib.setOnClickListener(new OnClickListener() {                            public void onClick(View arg0) {                                int index=((Integer)arg0.getTag()).intValue();                                Ventilation v= (Ventilation)items.get(index);                                v.enabled=v.enabled != 0 ? 0 : 1;                                //ad.notifyDataSetChanged();                                DU.toggle(v);                            }                        });                        }                        if (iv !=null){                            iv.setImageResource(R.drawable.fan);                        }                        if (tt != null) {                              tt.setText(""""+((Ventilation)o).actual);                            }                        if(bt != null){                              bt.setText(""""+((Ventilation)o).setPoint);                        }                }                return v;        }</code></pre><p>Even when i use arrayadapter.add(item) i have to press somewhere else for it to reload</p>","351036","","351036","","2010-06-29 11:02:34","2012-05-07 10:48:15","ListView won't update","<android><android-emulator>","2","1","","",""
"3139490","1","","","2010-06-29 09:43:26","1","5873","<p>Hai,I am new to Android.I need the sample code of an mp3 player in android to play more than one file.i.e Song should be played one after the other from a particular folder in our system</p><p>Can any one post some sample code.</p><p>Thanks.</p>","378851","","","","","2013-06-21 02:01:04","Android mp3 player","<android>","4","2","2","",""
"3139676","1","3140172","","2010-06-29 10:09:47","9","9662","<p>How to reduce <code>EditText</code> Hint size?</p>","366300","","119895","","2010-06-29 11:21:24","2014-01-16 11:17:51","Android Edittext Hint Size","<android>","8","2","2","",""
"3139746","1","3140520","","2010-06-29 10:20:19","0","1190","<p>How can I create custom android virtual device, using my own images? I've been trying to change default *.img-s on my own in sdk\platforms\android\images but it didn't help - the emulator didn't launch or frozen.</p><p>Thank's in advance!</p>","378882","","32502","","2010-07-02 20:07:23","2010-07-02 20:07:23","How can I create custom android virtual device, using my own images?","<android><android-emulator>","1","3","","",""
"3140072","1","3140371","","2010-06-29 11:12:53","36","9223","<p>A few days ago I was struggling to find a way to use custom intents for my alarms. Although I got clear answer that I have to customize the Intents based on some unique ID eg. <code>setAction()</code> still have some problems.</p><p>I define a PendingIntent this way:</p><pre><code>Intent intent = new Intent(this, viewContactQuick.class);intent.setAction(""newmessage""+objContact.getId());//unique per contactintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK ).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP );intent.putExtra(""id"", Long.parseLong(objContact.getId()));intent.putExtra(""results"", result.toArray());PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, 0);</code></pre><p>then this is used by a notification manager</p><pre><code>NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns);// first try to clear any active notification with this contact IDmNotificationManager.cancel(Integer.parseInt(objContact.getId()));// then raise a new notification for this contact IDmNotificationManager.notify(Integer.parseInt(objContact.getId()), notification);</code></pre><p>This works like this:</p><ul><li>application creates a message for a contact</li><li>an intent is provided with the contact id and details about the message</li><li>notification is raised with the message</li><li>user actiones on the notification and the app displays the message passed by the intent</li></ul><p><strong>The problem</strong></p><p>This can happen more than once for a contact. And when the second message is generated, the notification is raised well (message is fine there) but the intent when the user actions the notification it uses old data, so previous message is passed and not the brand new message.</p><p>So someway the intent is caching and reusing previous extras. How can I make it unique per contact and per action?</p>","243782","","","","","2013-12-23 13:30:07","Android keeps caching my intents Extras, how to declare a pending intent that keeps fresh extras?","<android><android-intent><extras>","2","2","9","",""
"3140073","1","","","2010-06-29 11:12:58","0","6020","<p>This should be simple, but driving my crazy.</p><p>I have the following in my layout, not problems.</p><pre><code>&lt;TextView    android:id=""@+id/birdinfo""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textColor=""#00009c""    android:text=""The Robin is a popular bird""/&gt;</code></pre><p>Then I have these arrays which are set up with the list of string resources I have</p><pre><code> private Integer[] DetailIds = {                     R.string.barnaclegoose,         R.string.barnowl,         R.string.bewicksswan,         R.string.blackbird,         R.string.blackcap_male};</code></pre><p>So I simply want to do this!</p><pre><code>    TextView detail = (TextView)findViewById(R.id.birdinfo);    detail.setText(DetailIds[0]);    setContentView(R.layout.main);</code></pre><p>But this causes a force close error.</p><p>The string resource looks like this ( without header and footer info of course</p><pre><code>&lt;string name=""barnaclegoose""&gt;What a wonderful goose!&lt;/string&gt;</code></pre><p>Added to this problem is if I use the resource directly to the resource</p><pre><code>detail.setText(R.string.barnaclegoose);</code></pre><p>For example, I still get a null exception! I'm sure I've done this before, but maybe I'm missing the obvious???</p><p>Any ideas appreciated. </p><p>( Eclipse, Android 1.5, Emulator with 1.5 )</p>","378923","","","","","2014-04-11 05:12:34","Setting textview text from a string resource held in an array problem","<android><eclipse><textview>","2","1","","",""
"3140230","1","3143265","","2010-06-29 11:35:20","10","6499","<p>I'm developing Application which storing user sensitive data. My issue is using other application user can view that store data. Then i need to provide better security for data.</p><p>is their any way to provide better security for sqlite database and table? I'm really appreciate your comments.</p><p>Thanks,<br/> Chandana</p>","377438","","","","","2012-12-14 11:26:16","Sqlite database security","<android>","6","0","2","",""
"3140488","1","3509373","","2010-06-29 12:14:54","0","355","<p>I need to parse an UTF-8 encoded input stream, so I think the most appropriate method is to use </p><pre><code>    XMLReader reader = new ExpatReader();    InputSource source = new InputSource(in);    source.setEncoding(encoding.expatName);    reader.parse(source);</code></pre><p>For that I need to import <code>org.apache.harmony.xml.ExpatReader</code> but I cannot figure out how, I mean which Java package must I install from <a href=""http://harmony.apache.org/download.cgi"" rel=""nofollow"">http://harmony.apache.org/download.cgi</a>?</p><p>Or is there an alternative method to accomplish the same goal?</p><p>Thank you for helping.</p>","364420","","","","","2010-08-18 06:06:53","Android: can not import org.apache.harmony.xml.ExpatReader","<android><encoding><parsing>","1","1","","",""
"3140524","1","3419118","","2010-06-29 12:20:33","6","16035","<p>When I am going from one intent to another intent, I am getting this warning :</p><p>""Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy""</p><p>and the view stays on the old intent.</p><p>the code is :</p><pre><code>   btnCatalog.setOnClickListener(new OnClickListener() {   private ProgressDialog myProgressDialog;   @Override   public void onClick(View v) {    // TODO Auto-generated method stub    myProgressDialog = ProgressDialog.show(introPage.this,      ""Please wait..."", ""Doing Extreme Calculations..."", true);    new Thread() {     public void run() {      try{       fetchAndStoreData();       Intent toMainPage = new Intent(introPage.this, mainPage.class);       startActivity(toMainPage);       sleep(5000);      } catch (Exception e) { }      myProgressDialog.dismiss();     }    }.start();   }  });</code></pre><p>but when I comment the fetchandStoreData() method, then the intent moves to another intent.the fetchAndStoreData() method is reading XML reading data from files and also saving data into SQLLite database.</p><p>so far I am having no idea why this warning is occurring.</p><p>need urgent help</p><p>Thanks</p>","328518","","135946","","2011-05-25 18:47:42","2012-04-05 11:36:19","Geting ""Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy"" in Android ","<android><android-intent><warnings>","5","2","","",""
"3140606","1","3157301","","2010-06-29 12:33:01","4","1027","<p>I have a custom view (extends View) that is going to be a game board. What I'd like to do now is create an object (well, a bunch of them, but I can start with one) at a specific location on the board and then have the user be able to move it around by dragging it. I have the board view down, but am at a loss on how to code up the ""pieces."" Thanks for any help and/or pointing to the right place here.</p>","121356","","","","","2010-07-01 11:29:07","Animation/dragging of an object in Android","<android>","1","0","1","",""
"3140650","1","3145858","","2010-06-29 12:39:13","1","3884","<p>I am new in this Field!I have this Message and Key also i want HMAC MD5 using this two so how it is possible if possible then give some example or sample code of this.The Given link display the overall functionality i want such kind of code.Please help me.</p><p>Messgae = POSTuserMon,28Jun201010:18:33GMT7FF4471B-13C0-5A9F-BB7B-7309F1AB7F08</p><p>key = d6fc3a4a06ed55d24fecde188aaa9161</p><p>Link = <a href=""http://hash.online-convert.com/md5-generator"" rel=""nofollow"">http://hash.online-convert.com/md5-generator</a></p>","198680","","152148","","2010-06-29 12:47:29","2012-04-15 01:24:21","How to Generate HMAC MD5 In Android?","<android><cryptography>","2","0","1","",""
"3140966","1","3141234","","2010-06-29 13:17:05","1","1560","<p>I am making a Glossary of legal terms and I would like to be able to narrow the results in the list by typing in an edit box, I have tried finding a solution but none of them have worked for me.</p>","379016","","","","","2010-06-29 13:42:53","How to filter a listview with and edit box - Android","<android><listview><filter><editbox>","1","2","","",""
"3141118","1","3141633","","2010-06-29 13:32:44","6","2098","<p>I have the localized strings file that is used in the Iphone app that I work on to port to Android. Are there any tools that go through the file taken from the xcode project and build the xml needed to use the strings in android? </p><p>As the apple file is a simple key value file is there a tool that converts string in this format</p><blockquote>  <p>""key""=""value""</p></blockquote><p>to this:</p><p><code>&lt;string name=""key""&gt; value &lt;/string&gt;</code></p><p>This tool should be easy to build but I appreciate any pointers to already working tools. </p>","114066","","","","","2013-09-08 14:49:51","Are there any tools to convert an Iphone localized string file to a string resources file that can be used in Android?","<android><localization><port>","7","2","4","",""
"3141127","1","3141789","","2010-06-29 13:33:11","0","286","<p>So, I'm writing a game engine.</p><p>I have a little example (see <a href=""http://qrcode.kaywa.com/img.php?s=8&amp;d=http://rokonandroid.com/rd.apk"" rel=""nofollow"">http://qrcode.kaywa.com/img.php?s=8&amp;d=http://rokonandroid.com/rd.apk</a>), that seems to work fine on every device except Droid / Milestone.</p><p>It displays a blue screen (due to glClearColor being set to blue), and nothing more.</p><p>I have tried with/without textures, and with/without VBOs. Yet still all blue screens on Droid.</p><p>What is unique about Droid and how it handles OpenGL, and why is it doing this?</p>","310455","","44729","","2010-06-29 15:07:31","2010-06-29 15:07:31","OpenGL doesn't render on Droid / Milestone","<android><opengl-es>","1","0","","",""
"3141144","1","","","2010-06-29 13:35:08","7","17477","<p>How to drag and drop items in Listview for reordering in android?</p>","379040","","","","","2012-11-07 18:19:07","reordering of listview items by drag and drop using android","<android>","4","0","9","",""
"3141264","1","","","2010-06-29 13:45:42","0","12119","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2600581/dateformat-conversion-problem-in-java"">DateFormat conversion problem in java?</a>  </p></blockquote><p>I am trying to convert string to date, but getting error.</p><p>I am getting date using :</p><pre><code>URL xmlUrl = new URL(path);URLConnection urlconn = xmlUrl.openConnection();Date =  new Date(urlconn.getLastModified());</code></pre><p>and then I ma saving this date in a file , which saves in the following format : </p><pre><code>Mon Jun 21 16:31:24 Asia/Karachi 2010</code></pre><p>and then when later I read this date from file as a String, I again want to save it to a Date, but I am getting error.</p><p>I tried :</p><pre><code>DateFormat format = DateFormat.getDateInstance();date =  format.parse(fileDate);</code></pre><p>but I am getting error :</p><pre><code>java.text.ParseException: Unparseable date: Mon Jun 21 16:31:24 Asia/Karachi 2010</code></pre><p>Is there any way i can retrieve back the date.</p><p>Thanks</p>","328518","","","","","2012-03-21 13:47:41","How to convert date saved in String format to Date format","<android><date>","2","1","","2012-12-14 12:14:14",""
"3141479","1","3141511","","2010-06-29 14:11:12","0","1415","<p>I am new to writing Android Applications, and I need to be able to implement the following functionality. When a user clicks a specific button, I want a customized ""prompt"" box to appear, containing several fields (a textfield, a password field, and a checkbox field). I would also be nice if I could add an image inside this box.</p><p>How would I go about implementing this sort of functionality?</p><p>Thanks</p>","122105","","297762","","2010-06-29 14:24:25","2010-06-29 17:54:30","Android Prompt Box","<android><dialog>","2","0","","",""
"3141494","1","","","2010-06-29 14:12:56","0","7820","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1083527/how-to-block-calls-in-android"">How to block calls in android</a>  </p></blockquote><p>You can intercept a call on Android?</p>","377730","","","","","2010-06-29 14:59:04","Intercept incoming calls","<android>","1","1","","2011-08-25 10:59:40",""
"3141632","1","3142021","","2010-06-29 14:29:03","5","7003","<p>I'm trying to refactor/redesign an Android app. Currently, I've one UI activity (<code>Activity 1</code>) that creates a <code>DataThread</code>. This thread is responsible for network I/O and interacts (provides data) with the UI activity via a <code>handler</code>. </p><p>Now, I want to add another activity (a new UI screen with Video) - <code>Activity 2</code>. <code>Activity 1</code> is still the main activity. <code>Activity 2</code> will be invoked when the user clicks a button on <code>Activity 1</code>. <code>Activity 2</code>'s data also comes from the  <code>DataThread</code>. </p><p>My idea is to put the logic of my <code>DataThread</code> inside an Android <code>Service</code> (<code>DataService</code>). My question is - can more than on activity <em>bind</em> to my <code>DataService</code> at the same time? Is there a way to tell the service to provide data to a specific activity only? </p><p>Any other ideas are welcome?</p><p>Thanks in advance.</p>","306346","","","","","2013-11-13 02:02:50","Android Service interacting with multiple activities","<android><service><activity><android-service>","2","0","6","",""
"3141684","1","","","2010-06-29 14:34:52","3","891","<p>is there any type of 'repeater' type functionality in android?  I have a relative layout (inside a row in a listview) and inside that I'd like to have a series of TextViews be displayed one after the other (as if they are child rows in the listview row).  The issue is that the number of those ""child rows"" will vary.  is there any way to do this, or should i just create the TextView objects in code, and programatically add them to a linear or table layout?</p>","372405","","","","","2010-09-15 09:49:19","android repeater-like functionality","<android><layout><repeater><row>","2","0","1","",""
"3141807","1","3142590","","2010-06-29 14:45:28","3","4052","<p>I want to create an Android service, which notifies the main activity whenever disconnects and when internet reconnects again. I have following function for checking internet connectivity:.</p><pre><code>private boolean haveInternet(){        NetworkInfo info=(NetworkInfo)((ConnectivityManager)this.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();        if(info==null || !info.isConnected()){            return false;        }        if(info.isRoaming()){            //here is the roaming option you can change it if you want to disable internet while roaming, just return false            return true;        }        return true;    }</code></pre><p>But I want to know, how to use it in a service.</p>","278194","","","","","2010-06-29 16:15:22","Android service to check internet connectivity?","<android>","1","0","6","",""
"3141906","1","","","2010-06-29 14:56:29","1","946","<p>I am developing a game that uses box2d engine in android. I create the physics world by definitions coming out a xml defined for 320X480 resolution.</p><p>Now in box2d I have considered that 1 unit is 30 Pixels. The question is , is there any other option other than defining a separate xml for each resolution  to scale this properly for all screens ?</p><p>I have tried to get screen density from Display metrics and adjust the scale that box2d uses but the physics world does not look the same.</p><p>Anybody ran into this situation and resolved it ?</p><p>Thanks in advance.</p>","372446","","","","","2011-03-23 13:48:19","Scaling for multiple resolutions in Box2d and Android","<android><box2d>","2","0","","",""
"3141996","1","3142471","","2010-06-29 15:05:07","74","99426","<p>I currently have an Activity that when it gets displayed a Notification will also get displayed in the Notification bar.</p><p>This is so that when the User presses home and the Activity gets pushed to the background they can get back to the Activity via the Notification.</p><p>The problem arises when a User presses the back button, my Activity gets destroyed but the Notification remains as I want the user to be able to press back but still be able to get to the Activity via the Notification. But when a USER tries this I get Null Pointers as its trying to start a new activity rather than bringing back the old one.</p><p>So essentially I want the Back button to act the exact same as the Home button and here is how I have tried so far:</p><hr><pre><code>        @Override        public boolean onKeyDown(int keyCode, KeyEvent event)  {            if (Integer.parseInt(android.os.Build.VERSION.SDK) &lt; 5                    &amp;&amp; keyCode == KeyEvent.KEYCODE_BACK                    &amp;&amp; event.getRepeatCount() == 0) {                Log.d(""CDA"", ""onKeyDown Called"");                onBackPressed();            }            return super.onKeyDown(keyCode, event);        }        public void onBackPressed() {            Log.d(""CDA"", ""onBackPressed Called"");            Intent setIntent = new Intent(Intent.ACTION_MAIN);            setIntent.addCategory(Intent.CATEGORY_HOME);            setIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);            startActivity(setIntent);             return;        }   </code></pre><hr><p>However the above code still seems to allow my Activity to be destroyed, How can I stop my Activity from being destroyed when the back button is pressed?</p>","243999","","243999","","2010-06-29 15:31:35","2014-04-11 14:01:12","Android - How To Override the ""Back"" button so it doesn't Finish() my Activity?","<android><activity><nullpointerexception><back-button><onkeypress>","3","1","21","",""
"3142067","1","5488652","","2010-06-29 15:13:37","85","53398","<p>I'm trying to use the TextView constructor with style like this:</p><p><code>TextView myText = new TextView(MyActivity.this, null, R.style.my_style );</code></p><p>however, when i do this, the text view does not appear to take the style (I verified the style by setting it on a static object).</p><p>I've also tried using <code>myText.setTextAppearance(MyActivity.this, R.style.my_style)</code> but it also doesn't work</p>","372405","","372405","","2010-06-29 15:30:16","2014-01-10 22:47:04","android set style in code","<android><coding-style>","7","0","31","",""
"3142231","1","","","2010-06-29 15:33:04","1","234","<p>I have this markup:</p><pre><code>&lt;LinearLayout   android:id=""@+id/authorDetails""   style=""@style/authorDetails""&gt;&lt;ImageView     android:id=""@+id/authorPic""   style=""@style/authorPic"" /&gt;   &lt;TextView     android:id=""@+id/authorName""   style=""@style/authorName""   android:text=""author name"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>and this style:</p><pre><code> &lt;style name=""authorDetails""&gt;      &lt;item name=""android:layout_below""&gt;@id/header&lt;/item&gt;      &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;      &lt;item name=""android:layout_height""&gt;89dip&lt;/item&gt;      &lt;item name=""android:orientation""&gt;horizontal&lt;/item&gt;            &lt;item name=""android:background""&gt;@drawable/bg&lt;/item&gt;           &lt;/style&gt;     &lt;style name=""authorPic""&gt;      &lt;item name=""android:layout_width""&gt;wrap_content&lt;/item&gt;      &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;      &lt;item name=""android:src""&gt;@drawable/xxx&lt;/item&gt;   &lt;/style&gt;   &lt;style name=""authorName""&gt;      &lt;item name=""android:layout_width""&gt;wrap_content&lt;/item&gt;      &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;   &lt;/style&gt;     </code></pre><p>and u know what?</p><p>the background of the LinearLayout covers the content (ImageView and TextView). Why is that? I dont get it! if I take out the declaration about the LinearLayout bg the content re-appears. </p><p>help please!  </p>","87624","","","","","2013-08-06 12:52:33","background of a LinearLayout covering its content","<android>","1","2","2","",""
"3142285","1","","","2010-06-29 15:39:13","10","11682","<p>I've been working with SQLite on android and I would like to add an arraylist to a column in a table, and then fetch the data back as an arraylist. The arraylist is a list of Longs. I've noticed that SQL has an option for storing BLOBS, however it looks like I need to convert the arraylist to a byte[] first before being able to store it as a blob in my SQLite database.</p><p>If anyone has a solution on how to save arraylists into an SQLite database that would be greatly appreciated. Or is there any other option for saving my array of data, i should consider?</p>","373362","","","","","2012-10-31 01:58:31","Saving ArrayList in SQLite database in Android","<java><sql><android><sqlite><arraylist>","4","0","3","",""
"3142314","1","","","2010-06-29 15:42:19","2","282","<p>I'm trying to use NyARToolkit for android to get the rotation of a marker. </p><p>I am trying to automatically straighten a document that has been photographed using the camera.</p><p>Does anyone know how I would go about this, using NyARtoolkit or another if necessary?</p>","335786","","","","","2010-06-29 15:42:19","Getting the rotation of an object using NyARToolkit","<java><android><augmented-reality>","0","0","","",""
"3142517","1","5164075","","2010-06-29 16:05:59","4","1414","<p>I want to display a bitmap read from the SD card at <strong>actual pixel size</strong> in Android.</p><p>I can't assume anything about the bitmap, other than Android supports its image format. The bitmap might be huge.</p><p>Seems simple enough, but when you factor Android memory limitations it gets much more complicated.</p><p>Any ideas?</p><p><strong>Edit</strong>: Attempting to load a large bitmap gives an out of memory error because Android is not able to allocate enough memory to decode it. You can load a scaled down version of the bitmap, but this is not useful to show the bitmap at actual pixel size. The question is about how to show a large bitmap on Android while staying within the app's memory constraints (most likely by loading it in chunks).</p><p><strong>Edit 2</strong>: The bitmap might be huge, but within the realm of reasonable. I'm talking about user images, not HD Nasa pictures.</p>","143378","","143378","","2010-06-29 20:15:00","2011-03-02 06:24:43","Display bitmap of any size in Android","<android><bitmap>","2","11","2","",""
"3142601","1","","","2010-06-29 16:16:08","0","397","<p>I would like to know if there is a way of preventing a duplicate launch of browser/activity, while the user is already focused on it.</p><p>mybe there is a way to detect before if the user's current screen is already focused on the same activity/browser i intent to launch?</p><p>thanks,</p><p>ray.</p>","260511","","","","","2010-07-05 14:41:13","prevent duplicate Browser/Activity launching","<android>","2","0","1","",""
"3142663","1","3143132","","2010-06-29 16:22:36","0","374","<p>I have a site where, via Android, a user needs to:</p><ol><li>fill in a document (simple html I think).</li><li>the next step would be to sign on the Android.</li><li>the data should be saved into a database inside the site.</li></ol><p>Points I should mention:</p><ul><li>the UI should be as simple as it gets</li><li>I am the one who should build the web database</li></ul><p>So therefore my idea was :</p><ol><li>the application would open an browser where the user will insert all his stuff into the html.</li><li>the html will save automatically all the data into a class called data.</li><li>the next intent of the application would be the surfaceView (where like a painter the user will sign).</li><li>the surfaceView will be saved into png and with data both will be stored in another class which will be inserted into the server.so in this class would be two files the png one and one contain all the info that was on the html as strings (Jonathan Leffler  I hope this one solves my misleading)</li><li>the server will take this class and parse it and save it into tables.</li></ol><p>Someone has another idea?</p><p>In which language should I write it? I thought Java and Android where the database would be MySQL.  Does anyone have another idea?</p><p>another idea I have is to change this html file into Android sheetso all the information would be stored on the device and by clicking upload all the information would be sent to the internet site where a server will store it in his database </p><p>Can someone point what would be a better solution </p><p>note:in my second solution no internet availability is needed so it can work offline where in the first case its needed. </p><p>I would like to hear more then on solution on to pick the best who fits my qualities</p>","368440","","1399920","","2013-03-25 22:19:18","2013-03-25 22:19:18","Architecture for Java, Android, Database Application? what should the app look like","<java><javascript><android>","1","2","1","",""
"3142670","1","3143190","","2010-06-29 16:23:40","1","14474","<p>Right now all I am trying to do is detect when the screen is pressed and then display a log message to confirm it happened. My code so far is modified off of the CameraPreview sample code (it will eventually take a picture) so the bulk of the code is in a class that extends SurfaceView. API for the example code from the SDK is 7. </p>","379220","","","","","2013-06-26 09:15:02","How do I detect touch input on the Android","<android><events><input><touch>","3","0","","",""
"3142708","1","","","2010-06-29 16:29:06","2","802","<p>What is the easiest way for a user to send me the output from 'adb bugreport'?  Asking them to install the sdk and hook up USB debugging is too hard.  Is there an app that will just dump that out and email it, or some other trick?</p><p>Thanks</p>","23524","","","","","2012-12-20 15:07:37","Debugging android - how to get bugreport output from a user?","<android><debugging><adb>","2","0","","",""
"3143004","1","","","2010-06-29 17:06:20","2","1145","<p>When using the ""selector"" to specify different images for buttons for different states, such as pressed, focused etc, do I have to write an xml file for each button? I have about 15-20 buttons in my app, so was wondering if there is a way to write just one xml and refer to parts of it?</p><p>ThanksChris</p>","334802","","","","","2010-08-12 17:43:56","Android ImageButton selector - one xml per button?","<android><xml><selector><imagebutton>","2","0","","",""
"3143213","1","","","2010-06-29 17:31:59","6","751","<p>what is maximum  size of thick/thin client application(to d/w through OTA) in both Android &amp; Samsung Bada platform ?</p>","205929","","205929","","2010-06-29 17:48:10","2010-10-29 08:01:02","Maximum application size of android & BADA platform","<android><client><size><bada>","2","1","1","",""
"3143440","1","","","2010-06-29 18:01:51","0","2443","<p>I'm having great difficulty getting basic textures to work in an OpenGL ES app on my Droid (2.1-update1).   I trying to render a simple textured quad - four vertices, two faces, with normals and texture coords.    When rendered, the texture is garbled and full of static, similar to TV noise.    </p><p>Here's a pic showing the original texture map image, and then a screencap from my droid of the rendered textured quad : <a href=""http://img686.imageshack.us/img686/6342/texturedquad.png"" rel=""nofollow"">http://img686.imageshack.us/img686/6342/texturedquad.png</a></p><p>The basic colors are there, but obviously the texture isn't being read or applied correctly.</p><p>My texture load sequence is simple : </p><pre><code>int[] textures = new int[1];gl.glGenTextures(1, textures, 0);Bitmap bmp = BitmapFactory.decodeResource(cx.getResources(), R.drawable.img);gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bmp, 0);</code></pre><p>I've tried setting various parameters for glTexParameterf at texture load time, but to no avail : </p><pre><code>gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_REPLACE);</code></pre><p>My render sequence is also very simple : </p><p>(setup)</p><pre><code>gl.glEnable(GL10.GL_DEPTH_TEST);gl.glDepthFunc(GL10.GL_LEQUAL);gl.glDisable(GL10.GL_DITHER);gl.glDisable(GL10.GL_FOG);gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);gl.glDisable(GL10.GL_COLOR_MATERIAL);gl.glShadeModel(GL10.GL_SMOOTH);</code></pre><p>(render)</p><pre><code>gl.glEnable(GL10.GL_TEXTURE_2D);gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);gl.glVertexPointer(3, GL10.GL_FIXED, 0, vertices);gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);gl.glTexCoordPointer(2, GL10.GL_SHORT, 0, textureCoords);gl.glBindTexture(GL10.GL_TEXTURE_2D, textureName);gl.glDrawElements(GL10.GL_TRIANGLES, numIndices, GL10.GL_UNSIGNED_SHORT, indices);</code></pre><p>...</p><p>I've tried various texture image file formats, all sized ^2, placed under the drawable-nodpi folder.   PNG, BMP, GIF, JPEG all give me the same result.   I've also tried 8 and 16 bit color depths.   I'm running this on top of GLSurfaceView with the default EGL config.    </p><p>Can anyone shed some light on why my texture is coming through garbled?</p><p>Below is my index/vertex/normal/texcoord data.   I've been over it a dozen times but perhaps I missed something.  </p><pre><code>Adding vertex (vIndex 1) Vector3F(77.0492, 0.0, 0)Adding vertex (vIndex 2) Vector3F(478.1715, 0.0, 0)Adding vertex (vIndex 3) Vector3F(478.1715, 227.0969, 0)Adding vertex (vIndex 4) Vector3F(77.0492, 227.0969, 0)Adding normal Vector3F(0.0, 0.0, 1.0)Adding normal Vector3F(0.0, 0.0, 1.0)Adding normal Vector3F(0.0, 0.0, 1.0)Adding normal Vector3F(0.0, 0.0, 1.0)Adding textureCoords Vector3F(0.0, 0.0)Adding textureCoords Vector3F(1.0, 0.0)Adding textureCoords Vector3F(1.0, 1.0)Adding textureCoords Vector3F(0.0, 1.0)Adding face indexes 1,2,3Adding face indexes 3,4,1</code></pre>","379296","","44729","","2010-06-29 18:09:46","2010-06-29 21:07:31","Basic OpenGL ES Texture problem / Android","<android><opengl-es><textures>","1","1","","",""
"3143571","1","3143654","","2010-06-29 18:22:44","0","683","<p>So I have a TextSwitcher that I want to update every second with the number of seconds it has been since the activity opened. Here is my code</p><pre>public class SecondActivity extends Activity implements ViewFactory{       private TextSwitcher counter;    private Timer secondCounter;    int elapsedTime = 0;    @Override    public void onCreate(Bundle savedInstanceState)    {        // Create the layout        super.onCreate(savedInstanceState);        setContentView(R.layout.event);        // Timer that keeps track of elapsed time        counter = (TextSwitcher) findViewById(R.id.timeswitcher);        Animation in = AnimationUtils.loadAnimation(this,                android.R.anim.fade_in);        Animation out = AnimationUtils.loadAnimation(this,                android.R.anim.fade_out);        counter.setFactory(this);        counter.setInAnimation(in);        counter.setOutAnimation(out);        secondCounter = new Timer();        secondCounter.schedule(new TimerUpdate(), 0, 1000);    }    /**     * Updates the clock timer every second     */    public void updateClock()    {                //Update time        elapsedTime++;        int hours = elapsedTime/360;        int minutes = elapsedTime/60;        int seconds = elapsedTime%60;        // Format the string based on the number of hours, minutes and seconds        String time = """";        if (!hours >= 10)        {            time += ""0"";        }        time += hours + "":"";        if (!minutes >= 10)        {            time += ""0"";        }        time += minutes + "":"";        if (!seconds >= 10)        {            time += ""0"";        }        time += seconds;        // Set the text to the textview        counter.setText(time);    }    private class TimerUpdate extends TimerTask    {        @Override        public void run()        {            updateClock();          }    }    @Override    public View makeView()     {        Log.d(""MakeView"");        TextView t = new TextView(this);        t.setTextSize(40);        return t;    }}</pre><p>So basically, I have a Timer that every second adds another second and them formats the way I want to be displayed and set the text of the TextSwitcher, which I thought called makeView, but makeView only gets called once and the time stays as 00:00:01. Did I miss a step, I dont think this UI object is very well documented.</p><p>Thanks, Jake</p>","399306","","","","","2011-03-15 09:32:30","TextSwitcher not updating","<android>","1","0","","",""
"3143640","1","","","2010-06-29 18:29:02","1","452","<p>In the Lunar Lander example (Provided by Google's Android site), there is a main loop in a method called ""run()"". Here it is below:</p><pre><code>        @Override        public void run() {            while (mRun) {                Canvas c = null;                try {                    c = mSurfaceHolder.lockCanvas(null);                    synchronized (mSurfaceHolder) {                        if (mMode == STATE_RUNNING) updatePhysics();                        doDraw(c);                    }                } finally {                    // do this in a finally so that if an exception is thrown                    // during the above, we don't leave the Surface in an                    // inconsistent state                    if (c != null) {                        mSurfaceHolder.unlockCanvasAndPost(c);                    }                }            }        }</code></pre><p>So now, my question is this: Isn't it bad to keep nulling c every loop and thereby causing more garbage collection? Maybe I don't understand this well enough, but why must it be nulled?</p>","379325","","","","","2010-06-29 18:44:45","Android Garbage Collection in Lunar Lander","<java><android>","3","0","","",""
"3143785","1","","","2010-06-29 18:51:29","0","246","<p>I have a spinner on my main view and I want to add and remove items from it's array from another view. Is this possible?</p><p>Thanks,</p><p>Boyd</p>","379344","","","","","2010-06-29 19:31:12","How do I update a spinner list from another class/view?","<android>","1","1","","",""
"3143807","1","3143829","","2010-06-29 18:54:30","1","906","<p>could you explain me steps for android app distribution.I can sign it and publish to Android market. But can I offer clients to load this application without market? e.g from company web site? if yes, can I still use self-signed certificate?</p><p>thank you</p>","349302","","","","","2013-01-25 06:14:55","Android application distribution","<android><distribution>","2","0","1","",""
"3144100","1","3144155","","2010-06-29 19:38:53","26","12482","<p>I am working on a mobile app on the Android platform (and going forward for the iPhone) and am evaluating the <a href=""http://www.flurry.com/product/analytics/index.html"" rel=""nofollow"">Flurry Analytics</a> and <a href=""http://code.google.com/apis/analytics/docs/mobile/overview.html"" rel=""nofollow"">Google Analytics</a> platforms for the app. Both platforms have SDKs for the Android and the iPhone and seem very similar in most ways. </p><p>Do any of you have experience with both or either and could you highlight some of the noticeable differences between the two?</p><p>thanks!</p>","19633","","1480438","","2014-01-31 16:00:20","2014-01-31 16:00:20","Flurry Analytics vs Google Analytics on the mobile platform","<iphone><android><mobile><analytics>","6","2","11","2012-07-30 11:42:39",""
"3144303","1","","","2010-06-29 20:05:09","0","445","<p>I have a URL to a cfm file that contains the API for a application that I am making a mobile version of.  On my end of the application, I need to supply that file with all of the variables it needs (all of which are URLs).  How would I take take these variables created in my application - all of them currently Strings - and give them to the api.cfm file so it use them as needed?</p>","379409","","","","","2010-06-30 17:28:58","How to call API's from a URL in Android","<android>","1","0","","",""
"3144310","1","","","2010-06-29 20:06:12","2","3265","<p>I would like to insert a new raw contact. I'm sure this involve some sort of getContentProvider().insert using a ContactsContract uri of some sort. Can anyone show an example using a ContentValues to to insert a brand new contact?</p><p>(Update)There is an excellent example in the SDK</p><p><a href=""http://developer.android.com/resources/samples/ContactManager/index.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ContactManager/index.html</a></p>","371532","","371532","","2010-06-29 20:47:49","2011-09-15 07:21:15","Android: insert new raw contact","<android><contactscontract>","2","0","","",""
"3144384","1","3144421","","2010-06-29 20:14:40","0","56","<p>Alright, this might be simple but I dunno how to do it!  I have my menu defined through XML, as shown below.  It loads and everything.</p><pre><code>&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:id=""@+id/home""          android:title=""Home"" /&gt;    &lt;item android:id=""@+id/about""          android:title=""About"" /&gt;    &lt;item android:id=""@+id/quit""          android:title=""Quit"" /&gt;&lt;/menu&gt;</code></pre><p>Now, going through <code>onOptionsItemSelected()</code>, how do I tell which menu item is selected?</p><p>This is from an example... What would the case's be?</p><pre><code>public boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case 1:        Toast.makeText(this, ""Home"", Toast.LENGTH_LONG).show();        return true;    case 2:        Toast.makeText(this, ""About"", Toast.LENGTH_LONG).show();        return true;    case 3:        Toast.makeText(this, ""Quit"", Toast.LENGTH_LONG).show();        return true;    }    return false;}</code></pre>","362857","","","","","2010-06-29 20:20:17","Getting menu clicks","<android>","1","0","","",""
"3144555","1","3149170","","2010-06-29 20:41:58","2","699","<p>Is there a way to make a list with different views?I mean that row in posiotion X will have layout ""X.xml""and row number Z will have layout ""Y.xml""?</p><p>I've tried to manipulate ListRowAdapter() and getView() in a few ways but with no success...</p>","379425","","","","","2010-06-30 12:22:30","different views on a single list ( Android )","<android><list><layout>","3","1","1","",""
"3144940","1","5257851","","2010-06-29 21:36:28","138","95199","<p>How can I set an <code>ImageView</code>'s width and height programmatically?</p>","341443","","85950","","2013-01-31 01:25:05","2013-01-31 01:25:05","Set ImageView width and height programmatically?","<android><android-emulator><android-widget>","5","1","23","",""
"3144953","1","3145751","","2010-06-29 21:37:47","0","442","<p>my app keeps force closing before it starts... eclipse returns no errors in my code and my xml is good. can anybody give me some insight?</p><pre><code>package com.mhe.test.scan;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;public class main extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button myScanButton = (Button) findViewById(R.id.myScanButton);                   myScanButton.setOnClickListener(new Button.OnClickListener() {            public void onClick(View v) {                Intent intent = new Intent(""com.google.zxing.client.android.SCAN"");                intent.putExtra(""SCAN_MODE"", ""PRODUCT_MODE"");                startActivityForResult(intent, 0);               }            });    }    EditText totalbox = (EditText) findViewById(R.id.totalbox);        public void onActivityResult(int requestCode, int resultCode, Intent intent) {            if (requestCode == 0) {                if (resultCode == RESULT_OK) {                    String contents = intent.getStringExtra(""SCAN_RESULT"");                    // Handle successful scan                    totalbox.setText(contents);                } else if (resultCode == RESULT_CANCELED) {                    // Handle cancel                    totalbox.setText(""@string/bummer"");                }            }               }    }</code></pre><p>essentially it is supposed to call zxing Barcode Scanner to scan a barcode on a button click and return the result into an EditText field... i'm a total newbie at this... </p>","379048","","","","","2010-06-30 00:39:41","Why does this force close before the activity screen is drawn? (android)","<android>","1","5","0","",""
"3144998","1","4842078","","2010-06-29 21:45:20","0","591","<p>In my Android app, I start a new activity with <code>startActivityForResult()</code>. I get the result in <code>onActivityResult()</code> perfectly. My problem is that there is a small bit of data that I know before I start the activity and I need that value to be available in <code>onActivityResult()</code>, too. I tried attaching it to my intent as an extra, but it wasn't attached to the intent that is available when the activity returns the result. I made it work by storing the data in a global variable, but I really don't like that approach. Is there a better, right way to pass data through an activity (instead of just to it)?</p>","65180","","","","","2011-01-30 09:09:47","Can I pass data through a new Activity?","<android><activity><android-intent>","2","3","","",""
"3145018","1","","","2010-06-29 21:48:11","1","648","<p>Is there a way that a Service can report back to the calling activity when the Service has reached a particular stage of processing? </p><p>For eg: Consider a music player activity that initiates the actual music playing in the background as an Android Service. I want to detect and inform the Activity when the Service has reached the Mediaplayer's onPrepared. Is there a way that the Service can tell the calling Activity when the MediaPlayer's onPrepared is called, to let the Activity know that the audio is prepared and ready to play?</p><p>I am basically looking to see if there is work around, rather than having a thread in the activity, pinging constantly to check if the Service has reached onPrepared.</p><p>ThanksChris</p>","334802","","","","","2013-01-02 13:56:54","Android - Can a Service report back to calling Activity with status","<android><service><activity><media-player>","3","0","","",""
"3145072","1","3145521","","2010-06-29 21:56:52","0","336","<p>I'm going for a tabbed layout for my application, and I'm having a little trouble.  I have the main Activity, and then I have the sub activities (one for each tab).  In one sub activity, I have a TextView set as a public member of the activity.  Using the main activity, how could I call <code>.setText()</code> on the TextView in the sub activity?  Thanks!</p>","362857","","","","","2010-06-29 23:31:48","Accessing members in one Activity from another","<android>","2","0","","",""
"3145089","1","3145655","","2010-06-29 21:59:25","362","154416","<p>The LocationManager API in android seems like it's a bit of a pain to use for an application that only needs an occasional and rough approximation of the user's location.</p><p>The app I'm working on isn't really a location app per se, but it does need to get the user's location in order to display a list of nearby businesses.  It doesn't need to worry about if the user is moving around or anything like that.</p><p>Here's what I'd like to do:</p><ol><li>Show the user a list of nearby locations.</li><li>Preload the user's location so that by the time I need it in Activity X, it will be available.  </li><li>Don't particularly care about accuracy or frequency of update.  Just grabbing one location is sufficient as long as it's not way off.  Maybe if I want to be fancy I'll update the location once every few mins or so, but it's not a huge priority.</li><li>Work for any device as long as it has either a GPS or a Network Location provider.</li></ol><p>It seems like it shouldn't be that hard, but it appears to me that I have to spin up two different location providers (GPS and NETWORK) and manage each's lifecycle.  Not only that, but I have to duplicate the same code in multiple activities to satisfy #2.  I've tried using getBestProvider() in the past to cut the solution down to just using one location provider, but that seems to only give you the best ""theoretical"" provider rather than the provider that's actually going to give you the best results.</p><p>Is there a simpler way to accomplish this?</p>","82156","","","","","2014-04-15 20:59:37","What is the simplest and most robust way to get the user's current location in Android?","<android><geolocation>","17","1","443","",""
"3145115","1","3145931","","2010-06-29 22:03:29","0","5568","<p>I am calling intents alot in my program and I thought that I could write a public class that would have all of my intents so I can just call something like intents.testIntent(params) and then have it fire off the intent. </p><p>I tried it out but am getting a force close with a null pointer exception. This is my whole class. I know it is probably sloppy but I have just been learning java for 2 months so I still am an amateur.</p><p>Any way, my code is below and I would much appreciate your help.</p><pre><code>    public class intents extends Activity{     String classpkg = ""com.MyApp"";     public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);     }      public void testIntent(String name, String match){      Log.v(""AI"",""made It"");      Intent myIntent = new Intent();      myIntent.setClassName(classpkg, classpkg+"".Search"");      Log.v(""AI"",""Launching Intent""); //This is where it dies      startActivity(myIntent);      Log.v(""AI"",""Launced Intent"");     }}</code></pre><p>Log</p><pre><code>  /AI      (17056): made ItV/AI      (17056): Launching IntentD/AndroidRuntime(17056): Shutting down VMW/dalvikvm(17056): threadid=3: thread exiting with uncaught exception (group=0x4001b180)E/AndroidRuntime(17056): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(17056): java.lang.NullPointerExceptionE/AndroidRuntime(17056): at android.app.Activity.startActivityForResult(Activity.java:2749)E/AndroidRuntime(17056): at android.app.Activity.startActivity(Activity.java:2855)E/AndroidRuntime(17056): at com.MyApp.intents.testIntent(intents.java:26)E/AndroidRuntime(17056): at com.MyApp.Starting$1.onClick(Starting.java:52)E/AndroidRuntime(17056): at android.view.View.performClick(View.java:2364)E/AndroidRuntime(17056): at android.view.View.onTouchEvent(View.java:4179)E/AndroidRuntime(17056): at android.widget.TextView.onTouchEvent(TextView.java:6541)E/AndroidRuntime(17056): at android.view.View.dispatchTouchEvent(View.java:3709)E/AndroidRuntime(17056): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(17056): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(17056): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(17056): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(17056): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(17056): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(17056): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)E/AndroidRuntime(17056): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)E/AndroidRuntime(17056): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)E/AndroidRuntime(17056): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)E/AndroidRuntime(17056): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)E/AndroidRuntime(17056): at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(17056): at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(17056): at android.app.ActivityThread.main(ActivityThread.java:4363)E/AndroidRuntime(17056): at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(17056): at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(17056): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime(17056): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime(17056): at dalvik.system.NativeStart.main(Native Method)</code></pre><p>SOLUTION:A solution, maybe not THE solution. Was to build the intent in the intents class(renamed MyIntents) and then start it from my other class.</p><pre><code>MyIntents intents1  = new MyIntents();Intent arIntent = intents1.testIntent(""fe"", ""feet"");startActivity(arIntent);</code></pre><p>This will make my life alot easier. :)</p>","282475","","282475","","2010-06-29 23:13:08","2010-06-30 01:34:37","Android Calling Intent from another class","<android><android-intent>","1","3","","",""
"3145259","1","","","2010-06-29 22:31:42","6","2267","<p>We have a simple client server architecture between our mobile device and our server both written in Java. An extremely simple ServerSocket and Socket implementation. However one problem is that when the client terminates abruptly (without closing the socket properly) the server does not know that it is disconnected. Furthermore, the server can continue to write to this socket without getting any exceptions. Why? </p><p>According to documentation Java sockets should throw exceptions if you try to write to a socket that is not reachable on the other end!</p>","56952","","56952","","2010-06-29 22:42:49","2010-09-01 22:53:09","Java socket not throwing exceptions on a dead socket?","<java><android><networking><blackberry><sockets>","5","0","2","",""
"3145303","1","3150656","","2010-06-29 22:40:20","0","933","<p>How to bring up a constantly appearing screen in android, user should not be able to get rid of it unless he enters the correct password. None of the keypad,touch screen window should be enabled for user to get rid of this screen. I am trying to develop app for user security. Once User will starts this app. no one else can access his personal data. Thank you. any small hint , pointers are appreciated. </p>","357349","","","","","2010-06-30 15:19:04","Screen personal lock","<android>","1","3","1","",""
"3145324","1","","","2010-06-29 22:44:36","3","1122","<p>In a similar approach to <a href=""http://stackoverflow.com/questions/424752/any-good-graphing-packages-for-android"">this question</a>, I am looking for a way to plot data points on to a view in Android. Preferably, a library which will do this for arbitrary-ranged input, as well as allow panning and zooming (via pinch or zoom bar).</p><p>Right now, I have subclass-ed a view which does the following normalization:</p><pre><code>            final int width = View.MeasureSpec.getSize(this.widthMeasureSpec);            final int height = View.MeasureSpec.getSize(this.heightMeasureSpec);            final float factorA = width / (maxA - minA);            final float factorS = height / (maxS - minS);            final float constFactorA = factorA * minA;            final float constFactorS = factorS * minS;            final int dataLength = data.length;            for (int i = 0; i &lt; dataLength; ++i) {                    if (i % 2 == 0)                            _data[i] = _data[i] * factorA - constFactorA;                    else                            _data[i] = _data[i] * factorS - constFactorS;            }</code></pre><p>and a call in onDraw() to the drawPoints method of a canvas (also, I update this.widthMeasureSpec and this.heightMeasureSpec in onMeasure()).</p><p>This is with minA/maxA as the bounds for my independent variable and minS/maxS as the bounds for my dependent variable.</p><p>This works fine for displaying the data, but I am hoping someone else has solved the problem of drawing the axes and panning/zooming.</p><p>I have ~150,000 data points, and I would prefer to keep these as floats to save half the memory. I don't know how big decimal numbers are in JavaScript, but I really don't want to resort to passing data in through JavaScript for the Google Charts API or an HTML-based solution for memory's sake.</p><p>I'm running this on a MyTouch 3g (the original, before 3.5mm jack and it's RAM upgrade), so performance is an issue. I'd like to release the final project under the GPLv3, so this excludes <a href=""http://android.arnodenhond.com/components/graphview"" rel=""nofollow"">GraphView</a>.</p><p>The graphs are of the same type as <a href=""http://en.wikipedia.org/wiki/File:LogisticMap_BifurcationDiagram.png"" rel=""nofollow"">this</a>, so any optimization by excluding points that are too close together to show up on screen would definitely make a difference.</p>","239003","","239003","","2011-01-22 15:18:40","2011-07-28 10:12:01","GPL-compatable graphing library for Android","<android><graphing>","3","4","1","",""
"3145673","1","4677600","","2010-06-30 00:11:53","0","137","<p>Im using Relative layout for designing UI. Please give me guidelines to follow.</p><p>Thanks in advance..</p>","341443","","","","","2011-01-13 07:04:29","Is there any design issues i need to follow while designing UI in android","<android><android-emulator><android-widget>","3","0","","",""
"3145754","1","6343438","","2010-06-30 00:35:08","5","4598","<p>I'm writing an application that requires the user to choose a contact from the contact list in order to send an SMS to that contact. Is there any way I can query the contact list for just those contacts with a phone number (i.e. not the ones with just e-mail addresses)? Currently my code looks like the following, but this shows all contacts - I then have to do the logic in my activity to inform the user if they've chosen a contact with no associated number and prompt them to choose another.</p><pre><code>Intent i = new Intent(Intent.ACTION_PICK, People.CONTENT_URI);</code></pre><p>A second thing, I realise the contact API changed from 2.0 onwards so what is the best practise for choosing contacts to cover all versions of the Android OS? Am I right in assuming the new contact API doesn't relate to pre 2.0?</p>","277668","","","","","2011-06-14 12:26:41","Android contact picking - only contacts with numbers?","<android><contacts>","2","2","1","",""
"3146117","1","3146149","","2010-06-30 02:34:16","0","329","<p>The Android settings menu is a list of options, each with some subtext (in the vanilla Google implementation; not in Sense UI) and an image (a down arrow in vanilla, custom icons in Sense UI). They are selectable and open a sub menu (Activity?) when clicked, like a button.</p><p>What is this widget? Is it available in the <code>android.widget</code> package somewhere? Is there a way to simulate it?</p>","47493","","","","","2010-06-30 03:18:44","What is the Android widget type used in e.g. the Settings menu?","<android>","2","0","","",""
"3146266","1","3146861","","2010-06-30 03:25:22","0","441","<p>Is there a way that I can color the TabWidget View?  Both the idle and selected colors?  That way my app can look a little more personalized, ya know.</p><p>Thanks!</p>","362857","","","","","2010-06-30 06:14:14","Color TabWidget","<android>","1","0","","",""
"3146269","1","3148692","","2010-06-30 03:25:46","0","658","<p>I want to show the details of a list item in another activity when clicks on a button.Can you help me?</p>","357112","","","","","2010-06-30 11:34:28","View an activity on button click","<android><buttonclick>","2","0","","",""
"3146271","1","3146951","","2010-06-30 03:26:19","0","1123","<p>Currently I am trying to add a preference activity into my applicationbut found out that I couldn't make it works.Every time, I tried to start the preference activity but it just crash before showing anything.</p><p>Here is the manifest</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""keysquare.android""      android:versionCode=""1""      android:versionName=""0.9""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/ime_name"" android:debuggable=""true""&gt;        &lt;service android:name=""KeysquareAndroid"" android:permission=""android.permission.BIND_INPUT_METHOD""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.view.InputMethod"" /&gt;            &lt;/intent-filter&gt;            &lt;meta-data android:name=""android.view.im"" android:resource=""@xml/method"" /&gt;        &lt;/service&gt;        &lt;activity android:label=""KeysquareAndroidSettings"" android:name=""KeysquareAndroidSettings"" android:exported=""true"" android:enabled=""true""&gt;&lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;/manifest&gt; </code></pre><p>And the preference xml, which I have tried my best to trim it down.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;/PreferenceScreen&gt;</code></pre><p>And finally the preference activity class, which also looks normal to me...</p><pre><code>package keysquare.android;import android.os.Bundle;import android.preference.PreferenceActivity;public class KeysquareAndroidSettings extends PreferenceActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.preferences);    }}</code></pre><p>Thanks in advance if anyone can help.</p><p>Jeanno</p>","379643","","","","","2010-06-30 06:39:20","Failed to start my preference activity","<android><crash><preferenceactivity>","1","1","0","",""
"3146334","1","3146391","","2010-06-30 03:45:59","2","3926","<p>I am trying to search this string:</p><pre><code>,""tt"" : ""ABC"",""r"" : ""+725.00"",""a"" : ""55.30"",</code></pre><p>For:</p><pre><code>""r"" : ""725.00""</code></pre><p>And here is my current code:</p><pre><code>Pattern p = Pattern.compile(""([r]\"".:.\""[+|-][0-9]+.[0-9][0-9]\"")"");Matcher m = p.matcher(raw_string);</code></pre><p>I've been trying multiple variations of the pattern, and a match is never found.  A second set of eyes would be great!</p>","234967","","20938","","2010-06-30 04:19:35","2010-06-30 05:17:33","Problem matching regex pattern in Android","<java><android><regex>","3","0","0","",""
"3146363","1","","","2010-06-30 03:54:38","1","627","<p>If there's a better way I am all for it. But I wanna detect a smartphone user on my site.</p><p>Whether they be a webOS, Android, or iPhone OS phone. I have a flash video on my site, but when I detect a smartphone users I want it to be a HTML5 video on the site instead.</p>","379656","","","","","2010-09-22 06:15:22","Javascript, Smartphone detection for videos?","<javascript><iphone><html><android><html5-video>","2","0","","",""
"3146375","1","","","2010-06-30 03:57:31","0","670","<p>public class List2 extends ListActivity {</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Get a cursor with all people    Cursor c = getContentResolver().query(People.CONTENT_URI, null, null, null, null);    startManagingCursor(c);    ListAdapter adapter = new SimpleCursorAdapter(this,             // Use a template that displays a text view            android.R.layout.simple_list_item_1,             // Give the cursor to the list adatper            c,             // Map the NAME column in the people database to...            new String[] {People.NAME} ,            // The ""text1"" view defined in the XML template            new int[] {android.R.id.text1});     setListAdapter(adapter);}</code></pre><p>}</p><p>If I want to place my own database and columns, i have to replace the People.CONTENT_URI. But ive already replaced it but there's still a force close for my application. How can I solve this problem? </p><p>This is my DBAdapter.java</p><p>public class DBAdapter {<br> //values for the login table    public static final String KEY_ROWID = ""_id"";    public static final String KEY_USER = ""user"";    public static final String KEY_PASSWORD = ""pass"";    public static final String KEY_NUMBER =""no"";    public static final String KEY_STATUS=""status"";</p><pre><code>//Values for the entry tablepublic static final String KEY_ROWID2 = ""_id2"";public static final String KEY_TITLE = ""title"";public static final String KEY_ENTRY = ""entry"";public static final String KEY_DATE = ""date"";public static final String KEY_TIME = ""time"";private static final String TAG = ""DBAdapter"";//declare Database name, tables namesprivate static final String DATABASE_NAME = ""789"";private static final String DATABASE_TABLE = ""Login"";private static final String DATABASE_TABLE_2 = ""Entry"";private static final int DATABASE_VERSION = 1;//declares the rules for the database tablesprivate static final String DATABASE_CREATE =    ""create table login (_id integer primary key autoincrement, ""    + ""user text not null, pass text not null,""     + "" no integer not null, status text not null);"";private static final String DATABASE_CREATE_2 =    ""create table entry (_id2 integer primary key autoincrement, ""    + ""title text,entry text, mood text, date text not null, ""    + ""time text not null);"";</code></pre><p>public static final Uri CONTENT_URI = null;</p><pre><code>private final Context context; private DatabaseHelper DBHelper;private SQLiteDatabase db;public DBAdapter(Context ctx) {    this.context = ctx;    DBHelper = new DatabaseHelper(context);}private static class DatabaseHelper extends SQLiteOpenHelper {    DatabaseHelper(Context context)     {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    //Create the tables with the rules we set.    @Override    public void onCreate(SQLiteDatabase db)     {        db.execSQL(DATABASE_CREATE);        db.execSQL(DATABASE_CREATE_2);    }    //OnUpgrade is only for use when u changed the database's version to 2 etc.    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion,     int newVersion)     {        Log.w(TAG, ""Upgrading database from version "" + oldVersion                 + "" to ""                + newVersion + "", which will destroy all old data"");        db.execSQL(""DROP TABLE IF EXISTS titles"");        onCreate(db);    }}    //---opens the database---public DBAdapter open() throws SQLException {    db = DBHelper.getWritableDatabase();    return this;}//---closes the database---    public void close() {    DBHelper.close();}//Method for inserting login details, can be used in other java files when DBAdapter is//declared in the java file. e.g. DBAdapter db = new DBAdapter(this);public long insertLogin(String user, String pass, String no, String status) {    ContentValues initialValues = new ContentValues();    initialValues.put(KEY_USER, user);    initialValues.put(KEY_PASSWORD, pass);    initialValues.put(KEY_NUMBER, no);    initialValues.put(KEY_STATUS, status);    return db.insert(DATABASE_TABLE, null, initialValues);}public long insertEntry(String title, String entry, String date, String time) {    ContentValues initialValues = new ContentValues();    initialValues.put(KEY_TITLE, title);    initialValues.put(KEY_ENTRY, entry);    initialValues.put(KEY_DATE, date);    initialValues.put(KEY_TIME, time);    return db.insert(DATABASE_TABLE_2, null, initialValues);}//---deletes a particular title---public boolean deleteLogin(long rowId) {    return db.delete(DATABASE_TABLE, KEY_ROWID +       ""="" + rowId, null) &gt; 0;}public boolean deleteEntry(long rowId2) {    return db.delete(DATABASE_TABLE_2, KEY_ROWID2 +       ""="" + rowId2, null) &gt; 0;}//method for retrieving all the inputs from databasepublic Cursor getAllLogin() {    return db.query(DATABASE_TABLE, new String[] {      KEY_ROWID,       KEY_USER,      KEY_PASSWORD,               KEY_NUMBER,      KEY_STATUS,},            null,             null,             null,             null,             null,             null);}   public Cursor getAllEntry() {    return db.query(DATABASE_TABLE_2, new String[] {      KEY_ROWID2,      KEY_TITLE,      KEY_ENTRY,      KEY_DATE,      KEY_TIME},            null,             null,             null,             null,             null,             null);}//---retrieves a particular title---public Cursor getLogin(long rowId) throws SQLException {    Cursor mCursor =            db.query(true, DATABASE_TABLE, new String[] {              KEY_ROWID,              KEY_USER,               KEY_PASSWORD,              KEY_NUMBER,              KEY_STATUS,},               KEY_ROWID + ""="" + rowId,               null,              null,               null,               null,               null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}public Cursor getEntry(long rowId2) throws SQLException {    Cursor mCursor =            db.query(true, DATABASE_TABLE_2, new String[] {              KEY_ROWID2,              KEY_TITLE,              KEY_ENTRY,              KEY_DATE,              KEY_TIME},               KEY_ROWID2 + ""="" + rowId2,               null,              null,               null,               null,               null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}//---updates a title---public boolean updateLogin(long rowId, String user, String pass, String no, String status) {    ContentValues args = new ContentValues();    args.put(KEY_USER, user);    args.put(KEY_PASSWORD, pass);    args.put(KEY_NUMBER, no);    args.put(KEY_STATUS, status);    return db.update(DATABASE_TABLE, args,                      KEY_ROWID + ""="" + rowId, null) &gt; 0;}public boolean updateEntry(long rowId, String title, String entry, String date, String time)      {         ContentValues args = new ContentValues();         args.put(KEY_TITLE, title);         args.put(KEY_ENTRY, entry);         args.put(KEY_DATE, date);         args.put(KEY_TIME, time);         return db.update(DATABASE_TABLE_2, args,                           KEY_ROWID2 + ""="" + rowId, null) &gt; 0;     }</code></pre><p>}</p>","372750","","","","","2010-06-30 03:57:31","SimpleCursorAdapter and ListView","<android><listview>","0","5","","",""
"3146377","1","","","2010-06-30 03:57:35","3","2870","<p>Is there a way similar to ACTION_PICK to select multiple contacts from the address book and then return to previous activity?Thanks in advance for any help. </p>","376182","","","","","2011-06-23 06:36:54","Selecting multiple contacts in Android","<android>","1","1","2","",""
"3146513","1","3147965","","2010-06-30 04:40:59","1","4347","<p>I installed my app on the emulator with 2.2 and onto the sdcard. When I browse via adb shell, I can see that the encrypted app file lies under /mnt/secure/asec/com.myapp-1.asec but it also lies as plain apk file unencrypted at /mnt/asec/com.myapp-1/pkg.apk as well and I can do a 'adb pull' without special permissions and unzip it to see it's content.</p><p>Unfortuntately my N1 is in repair and I cannot check on a real device right now - but wondering, why can I still access the plain apk so easily (at least on the emulator)?</p><p>(Not sure if this question is supposed to be asked on StackOverflow or on ForceClose.com, but I figured it's more related to development and how to secure/encrypt your app as a developer, therefore I'm posting it here.)</p>","241475","","","","","2010-06-30 09:27:51","Question on .asec (encryption) on Froyo 2.2 / installing app onto sdcard","<android>","1","0","1","",""
"3146567","1","3146685","","2010-06-30 04:54:57","36","7915","<p>I have added the 'gen' folder to svn:ignore, are there any others I should be ignoring?</p><p><em><strong>Update:</em></strong></p><p>There are some I am unsure about</p><pre><code>.classpath.projectThe .settings folder</code></pre><p>And also, to ignore a folder I am just typing <strong>gen</strong> into the ignore list in subclipse, is this correct?  How would it know if gen is a folder or file?</p>","248521","","750613","","2012-07-04 16:40:19","2013-09-22 15:04:21","What files should I ignore in an Android Project on SVN","<android><svn>","4","0","9","",""
"3146599","1","","","2010-06-30 05:03:02","0","912","<p>I have one application. I need to display map view when we click on map button. Actually this map button is in one class and google map is in another class. Now How can we call one map activity class from another activity class.</p><p>Please help me!</p>","437612","","750613","","2012-07-04 16:39:48","2012-07-04 16:39:48","how to call google map class from another activity class in android?","<android><google-maps>","1","0","","",""
"3146724","1","3194630","","2010-06-30 05:41:02","2","393","<p>I want to do screen optimization. That means once I develop the UI in android it should fit exactly the same in all android enabled phones.</p><p>So how do i do it?</p>","379693","","112671","","2010-07-07 12:29:04","2010-07-07 12:29:04","Screen optimization in android","<android><screen><android-widget>","1","2","1","",""
"3146881","1","3146888","","2010-06-30 06:19:53","0","533","<p>Here's a snip that successfully reads off, to Eclipse LogCat, the height and width of the .PNG on the SD card:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Environment;//...        Bitmap bmp = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory().getAbsolutePath() + ""/sample.png"");         int width = bmp.getWidth();         int height = bmp.getHeight();        int[] pix = new int[width * height];         bmp.getPixels(pix, 0, width, 0, 0, width, height);         int R, G, B;         for (int y = 0; y &lt; height; y++){            for (int x = 0; x &lt; width; x++)             {                               int index = y * width + x;                R = (pix[index] &gt;&gt; 16) &amp; 0xff;     //bitwise shifting                G = (pix[index] &gt;&gt; 8) &amp; 0xff;                B = pix[index] &amp; 0xff;    // [This is where I'd put it.  But I can't get a red line off the editor when I do anything.]              }        }        Log.v(TAG, width + ""  "" + height); </code></pre><p>My problem:  I can't for the life of me use Log.v() to report the value of R or G or B.  Everything I'm doing draws a red line under <code>v</code> or something when I try.  I've tried toString() and everything.  Help please.  Thanks.</p>","225626","","225626","","2010-06-30 06:33:14","2010-06-30 06:59:38","I can't LogCat this value. Why?","<android>","2","0","","",""
"3146883","1","3227687","","2010-06-30 06:20:32","0","1599","<p>I have an intent which i need to set it, two flags:</p><p>FLAG_ACTIVITY_SINGLE_TOP -> coz i wanna keep the instance of the current activity in case it' already focused.</p><p>FLAG_ACTIVITY_NEW_TASK -> coz i launch the intent outside of it's activity(contexnt.startactivity(..))</p><p>problem is that i cant <strong>combine</strong> both of them.. any other solution? </p><p>this is my exception:</p><p><code>06-30 09:12:48.577: ERROR/AndroidRuntime(2460): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag.</code> </p><p>Is this really what you want?</p><p>thanks,</p><p>ray.</p>","260511","","750613","","2012-07-04 16:38:25","2012-07-04 16:38:25","Combine two intent flags","<android><activity>","2","1","","",""
"3147061","1","3147394","","2010-06-30 07:01:40","0","743","<p>I'm using google moderator as a simple way to collect feedback for my application. There's a google moderator app on the market that provides a better interface than the website for mobile users. </p><p>Getting to the point: Is there a way to get it to install along with your application or a reasonable way to identify if another package is available so I can direct users to the market to download it? </p>","362076","","","","","2010-06-30 07:58:58","How can I load an apk dependency from the android market?","<java><android>","1","0","","",""
"3147141","1","","","2010-06-30 07:15:43","1","624","<p>I retrieved and saved the call history details in the file format. However, I would like to know if we have an option to convert the file format to <code>.csv or .xls</code> or any other format.</p><p>Thanks &amp; Regards,Serenity.</p>","373247","","750613","","2012-07-04 16:38:46","2012-07-04 16:38:46","Is there an option to convert file to .csv format in Android?","<android>","2","0","","",""
"3147179","1","3147407","","2010-06-30 07:24:13","4","6784","<p>Is it by any chance possible to get a list of alarms saved in the alarm application of android ? I am making an application which just needs to show the alarms set in the Alarm application.</p><p>Thanx</p>","238071","","","","","2013-03-09 21:21:03","android - get all alarms saved in the alarm application","<android><alarms>","2","1","5","",""
"3147201","1","","","2010-06-30 07:28:08","0","2871","<pre><code>Spinner spin1 = (Spinner) findViewById(R.id.spinner1);spin1.setOnItemSelectedListener(this);spin2 = (Spinner) findViewById(R.id.spinner2);spin2.setOnItemSelectedListener(this);ArrayAdapter&lt;String&gt; choice1 = new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_spinner_item, data1);    choice1            .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    choice2 = new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_spinner_item, data2);    choice2            .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);</code></pre><p>In this code i am creating two drop downs and now my requirement is when i select the item from first combo the data in the second combo must be changed according to the selected item of first combo.</p><p>now in onItemSelected property how to code specially for first dropdown?</p>","314426","","","","","2012-07-26 02:00:37","onItemSelected property of spinner in android","<java><android>","2","1","","",""
"3147299","1","3147825","","2010-06-30 07:43:49","3","3771","<p>Is there a way I can find what resource a particular ImageButton is set to, at any given time?</p><p>For eg: I have an ImageButton that I set to <code>R.drawable.btn_on</code> onCreate. Later, at some point, the ImageButton gets set to <code>R.drawable.btn_off</code>. I want to be able to check what resource the ImageButton is set to in my code.</p><p>ThanksChris</p>","321927","","750613","","2012-07-04 16:36:41","2013-03-06 03:51:41","Android ImageButton - determine what resource is currently set","<android><resources><imagebutton><drawable>","4","0","","",""
"3147353","1","","","2010-06-30 07:51:47","0","917","<p>I learned that Google Map has a Get Direction feature that let users find the shortest path from one point to another. What search algorithm did Google used for this search? Is this algorithm can be implemented in the Android platform, knowing that it has low memory and it's running in Java(tend to be slow)? Thanks in advance!</p>","376290","","","","","2010-06-30 10:23:46","Google Map Get Direction Search Algorithm","<android><algorithm><search><google-maps><shortest-path>","1","0","","",""
"3147382","1","","","2010-06-30 07:56:59","7","3787","<p>I need to write a dynamic link library in C++ that is used by Java on Android.As I get, it should be .so library, but I don't know how to do that.I tried Cygwin, but it crashes:</p><blockquote>  <p>$ gcc 1.cpp</p>    <p>/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: cannot find  -luser32 collect2: ld  returned 1 exit status</p></blockquote><pre><code>1.cpp:int main(int, char**){   return 0;}</code></pre><p>Can anyone help me with that?</p><p><strong>P.S.</strong> I'm not good at *nix, so it should be better done under Windows</p><p><strong>UPD:</strong> I've installed both Android NDK and Cygwin and added them to PATH environment variable</p><p><strong>UPD2</strong>: Thanks for helping. The problem was with Cygwin itself. Reinstalling it and NDK solved the problem.</p>","312291","","750613","","2012-07-04 16:32:45","2012-07-04 16:32:45","How to create native C++ library on Android?","<java><c++><android><jni><nativelibrary>","3","0","3","",""
"3147543","1","3147841","","2010-06-30 08:23:09","2","1443","<p>I have found various topics here and elsewhere on creating an intent for sending e-mail and that seems to be pretty straightforward. I'm looking for an intent to just launch any e-mail client the user might have.</p><p>Here is the code I've seen for sending an e-mail (<strong>posted just for reference, this doesn't serve my needs as I don't want to send a new message</strong>):</p><pre><code>Intent i = new Intent(Intent.ACTION_SEND); i.setType(""text/plain""); i.putExtra(Intent.EXTRA_EMAIL  , new String[]{""recipient@example.com""}); i.putExtra(Intent.EXTRA_SUBJECT, ""Subject of the message""); i.putExtra(Intent.EXTRA_TEXT   , ""Body of the message""); </code></pre><p>Here is the code I put together for specifically launching the Gmail client by package name:</p><pre><code>PackageManager pm = getPackageManager();Intent intent = pm.getLaunchIntentForPackage(""com.google.android.gm"");startActivity(intent);</code></pre><p>The code above works but isn't flexible in that a user might not be using Gmail but the other built-in e-mail application or a 3rd party e-mail app. I'm looking for an intent that would bring up the chooser in this case so the user can decide which app to launch to read e-mail.</p><p>Does anyone know how to accomplish this?</p>","309885","","168868","","2012-07-04 18:07:55","2012-07-04 18:07:55","How do I create an intent to launch any e-mail app?","<android><android-package-managers>","3","0","2","",""
"3147644","1","3148248","","2010-06-30 08:41:16","0","572","<p>I would like to add a music controller to my app so the user could pause the music and start it again. It would also be great if the user could jump between songs.</p><p>I haven't found anything in the API but I want the same behavior that is available in any headset so there must be some API right? </p><p>Anyone who has an idea on how to control the default media app?</p>","265023","","","","","2014-02-08 18:39:18","Android, any way to controll the default music player","<android><media>","2","0","","",""
"3147659","1","3147729","","2010-06-30 08:43:36","2","3824","<p>I want to do some cleanup in a view when the activity is being destroyed. Is there any way to get a callback in the View when the activity is being destroyed? I tried using <code>onDetachedFromWindow</code>, but I'm not sure whether it is correct thing to do.</p>","195802","","","","","2013-07-07 13:29:24","How to detect if view's parent activity is being destroyed","<android><view><callback><activity>","2","0","1","",""
"3147672","1","","","2010-06-30 08:45:05","1","448","<p>I have a problem with creating a kml file locally on android. I know how to create xml file in java, but it seems that android doesn't support ""transform"" java methods libraries. Any idea on that? Help greatly appreciated! </p>","359656","","","","","2010-06-30 08:45:05","Android - how to create kml file locally on android platform?","<android>","0","0","","",""
"3147734","1","3147819","","2010-06-30 08:53:09","0","350","<p>In my application I entered value into editText field into 2 ways one is Depending on the spinner selection value will be changed and other way is through softkeyboard. Now problem is when i  entered value into the edittext through key board and orientation is changed at that time edittext field contain the value depending on the spinner.but i want whatevet i enter value into the edittext filed that value is appeared in thta edit text field if the orientation is changed.For this what can i do ,Give me some suggestions.Thanks in  advance</p>","454808","","","","","2010-10-12 17:59:04","Edit Text value is not updated","<android>","1","0","","",""
"3148048","1","3166157","","2010-06-30 09:38:28","3","1921","<p>How can i know if a BluetoothSocket is still connected to the endpoint? How can i detect if the socket has been disconnected by the endpoint?</p><p>Thanks</p>","302798","","","","","2010-07-02 13:39:46","Bluetooth socket connection","<android><sockets><connection><bluetooth>","1","0","3","",""
"3148067","1","","","2010-06-30 09:42:07","37","1127","<p>I have noticed a problem on various handsets that if you save gestures while the stroketype is set to single and then change the stroketype to multi and add some multi-stroke gestures, the multi ones are often not recognized by the GesturesOverlayView when you draw them. These can be very simple gestures such as a + or an X. What happens is that the gesture you draw stays faded as if it has not been recognized even though it can be a perfect match.</p><p>I know that multi-stroke works okay so I am wondering if the problem is caused by having mixed ones in the library and changing the stroke-type of the view on the fly. Is it possibly confusing it with a single-stroke gesture in the same library but because the match is not close enough, just giving up?</p><p>Has anyone had a similar experience or a theory as to what might be happening?</p>","81317","","","","","2012-07-11 11:49:47","Android single- and multi-stroke gestures in the same library confuses the GesturesOverlayView?","<android><gestures>","1","3","7","",""
"3148087","1","3148212","","2010-06-30 09:45:25","0","1515","<p>Give me an example on how to parse a custom xml file using DOM</p>","357112","","357112","","2010-07-02 07:50:29","2010-07-02 07:50:29","To parse an xml file","<android><domparser>","3","0","","",""
"3148186","1","3148285","","2010-06-30 10:05:32","5","7149","<p>Here is my situation:I am building a game for android and my game's activity is composed of a custom surfaceView which has a thread for the game logic and rendering. The architecture is similar to the LunarLander demo from Google's website.</p><p>When the activity starts it creates the surfaceView and calls this method:</p><pre><code>    @Override    public void surfaceCreated(SurfaceHolder holder)    {           renderThread.start();    }</code></pre><p>When I press the home button to exit the game, the onPause() method is called, which calls surfaceDestroyed(). In surfaceDestroyed I stop the game Thread by calling:</p><pre><code>    @Override    public void surfaceDestroyed(SurfaceHolder holder)    {        synchronized(holder)        {            renderThread.stop();        }    }       </code></pre><p>The app goes to background fine. Then, when I relaunch the app by pressing the icon, I get a ""Thread already started"" message in the log along with a ""force close"" popup on the screen. This message happens when the activity enters the ""surfaceCreated"" method when it calls start() on the render thread.</p><p>Now I've looked into it for hours and can't figure out why this is. I believe my thread is stopped when I close the app so I don't understand why it says it has already started.</p>","376373","","114066","","2011-11-15 11:17:20","2011-11-15 11:17:20","""Thread already started"" when resuming the activity","<java><android><multithreading><android-lifecycle>","3","0","1","",""
"3148381","1","3149595","","2010-06-30 10:34:52","0","837","<p>I have a ListView, which can either have a context menu, or not. I am using <code>registerForContextMenu</code> and <code>unregisterForContextMenu</code> respectively and have no problems with the registration itself or anything related to the context menu showing up/working.</p><p>When a view is registered for a context menu, when the user clicks it, its background changes gradually from orange through yellow and then to white. This does not happen when a view has never been registered for a context menu (it stays the same color). However, when I use <code>unregisterForContextMenu</code> to unregister the view in question, this effect is still active and may confuse the user - he/she will expect a context menu because of the effect. This shows that <code>unregisterForContextMenu</code> does not completely reverse the effect of <code>registerForContextMenu</code>.</p><p><strong>My question is</strong>: Is there a way to <em>completely</em> unregister a View from getting a context menu?</p><p>If someone has a clearer idea of how <code>(un)registerForContextMenu</code> works internally, please share your thoughts.</p><p><strong>Edit:</strong> I just saw that this does not apply to HTC's sense interface, as there the 'whitening' effect is not implemented. So the question applies only to the default Android interface.</p>","361230","","361230","","2010-06-30 12:41:48","2010-06-30 14:59:46","Can unregisterForContextMenu completely unregister a View?","<android><contextmenu>","1","2","","",""
"3148418","1","3148729","","2010-06-30 10:41:29","8","2069","<p>At the beginning Activity is launched by an Intent and something  is done with this Intent. </p><p>When I change orientation of my Activity, it's reloaded again and Intent is passed to the Activity. </p><p>How can I clear that Intent to prevent Activity from using it again? </p><p>I've tried <code>setIntent(null)</code>, but with no result.</p>","296427","","296427","","2010-11-08 18:58:38","2014-01-17 20:24:49","How to clear Intent that started Activity?","<android><activity><android-intent>","5","0","2","",""
"3148486","1","3148926","","2010-06-30 10:50:38","1","3962","<p>Is it possible to programatically embed an image in the body of an email sent by the Mail app in Android? </p><p>Can I use the ACTION_SEND intent to do this, or should I compose the email myself?</p>","143378","","","","","2011-12-06 09:14:07","Embedding image in email in Android","<android><email><html-email>","2","0","1","",""
"3148555","1","3149349","","2010-06-30 11:02:06","0","338","<p>some1 post the code for accessing .txt file available in my res folder</p><p>the code for which can be written in .java file!!!</p><hr><p>This is the LogCat output when i get that error!!</p><p>07-01 14:50:20.886: ERROR/AndroidRuntime(257): FATAL EXCEPTION: main07-01 14:50:20.886: ERROR/AndroidRuntime(257): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{de.vogella.android.test/de.vogella.android.test.test}: java.lang.NullPointerException07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at android.os.Handler.dispatchMessage(Handler.java:99)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at android.os.Looper.loop(Looper.java:123)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at java.lang.reflect.Method.invokeNative(Native Method)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at java.lang.reflect.Method.invoke(Method.java:521)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at dalvik.system.NativeStart.main(Native Method)07-01 14:50:20.886: ERROR/AndroidRuntime(257): Caused by: java.lang.NullPointerException07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at de.vogella.android.test.test.(test.java:55)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at java.lang.Class.newInstanceImpl(Native Method)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at java.lang.Class.newInstance(Class.java:1429)07-01 14:50:20.886: ERROR/AndroidRuntime(257):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)</p>","379749","","1288","","2011-09-13 03:47:41","2011-09-13 03:47:41","how to access TextView content in xml file to java file in Android","<android>","3","0","","",""
"3148603","1","3150486","","2010-06-30 11:09:14","9","5146","<p>I am looking at doing speech recognition in android. The program needs to have continuous speech recognition. The library only needs to be about 10 words. I have considered using Googles api, but I don't think it will work. (I cannot have anything covering the screen). I have been looking into other ways but nothing seems like it will work. Is it possible to use java's speech recognition library, or is there any other way of going about this?</p><p>In summary<br>1. Need continuous speech input<br>2. 10 words at max<br>3. can train if necessary<br>4. overview of program - display screen, wait for voice input or touch input, update screen repeat<br>5. cannot cover what is being displayed on the screen  </p><p>Any help would be appreciated.<br>Thanks in advance</p>","379968","","379968","","2010-07-21 13:55:08","2012-11-01 15:06:22","Continuous Speech Recognition Android","<android><speech-recognition>","2","3","6","",""
"3148708","1","3149410","","2010-06-30 11:23:11","0","1165","<p>I'm looking to draw a cube at specific co-ordinates. I've got all 4 corners and the centers x/y value. I now want to construct a cube at those co-ordinates. Does anyone know of any tutorials or have any information on how I would go about said task?</p><p>Ive got the following code. I'd like to map each of its corners to a specific x/y co-ord</p><pre><code>import java.nio.ByteBuffer;import java.nio.ByteOrder;import java.nio.IntBuffer;import javax.microedition.khronos.opengles.GL10;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.opengl.GLUtils; class GLCube {    private final IntBuffer mVertexBuffer;  private final IntBuffer mTextureBuffer;   public GLCube() {  int one = 65536;  int half = one / 2;  int vertices[] = {        // FRONT        -half, -half, half, half, -half, half,        -half, half, half, half, half, half,        // BACK        -half, -half, -half, -half, half, -half,        half, -half, -half, half, half, -half,        // LEFT        -half, -half, half, -half, half, half,        -half, -half, -half, -half, half, -half,        // RIGHT        half, -half, -half, half, half, -half,        half, -half, half, half, half, half,        // TOP        -half, half, half, half, half, half,        -half, half, -half, half, half, -half,        // BOTTOM        -half, -half, half, -half, -half, -half,        half, -half, half, half, -half, -half, };  int texCoords[] = {        // FRONT        0, one, one, one, 0, 0, one, 0,        // BACK        one, one, one, 0, 0, one, 0, 0,        // LEFT        one, one, one, 0, 0, one, 0, 0,        // RIGHT        one, one, one, 0, 0, one, 0, 0,        // TOP        one, 0, 0, 0, one, one, 0, one,        // BOTTOM        0, 0, 0, one, one, 0, one, one, };  // Buffers to be passed to gl*Pointer() functions must be  // direct, i.e., they must be placed on the native heap  // where the garbage collector cannot move them.  //  // Buffers with multi-byte data types (e.g., short, int,  // float) must have their byte order set to native order  ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);  vbb.order(ByteOrder.nativeOrder());  mVertexBuffer = vbb.asIntBuffer();  mVertexBuffer.put(vertices);  mVertexBuffer.position(0);  // ...  ByteBuffer tbb = ByteBuffer.allocateDirect(texCoords.length * 4);  tbb.order(ByteOrder.nativeOrder());  mTextureBuffer = tbb.asIntBuffer();  mTextureBuffer.put(texCoords);  mTextureBuffer.position(0); } public void draw(GL10 gl) {  gl.glVertexPointer(3, GL10.GL_FIXED, 0, mVertexBuffer);  gl.glEnable(GL10.GL_TEXTURE_2D); // workaround bug 3623  gl.glTexCoordPointer(2, GL10.GL_FIXED, 0, mTextureBuffer);  gl.glColor4f(1, 1, 1, 1);  gl.glNormal3f(0, 0, 1);  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);  gl.glNormal3f(0, 0, -1);  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 4, 4);  gl.glColor4f(1, 1, 1, 1);  gl.glNormal3f(-1, 0, 0);  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 8, 4);  gl.glNormal3f(1, 0, 0);  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 12, 4);  gl.glColor4f(1, 1, 1, 1);  gl.glNormal3f(0, 1, 0);  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 16, 4);  gl.glNormal3f(0, -1, 0);  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 20, 4); }  static void loadTexture(GL10 gl, Context context, int resource) {  Bitmap bmp = BitmapFactory.decodeResource(        context.getResources(), resource);  GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bmp, 0);  gl.glTexParameterx(GL10.GL_TEXTURE_2D,        GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);  gl.glTexParameterx(GL10.GL_TEXTURE_2D,        GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);  bmp.recycle(); }}</code></pre>","358438","","358438","","2010-06-30 11:47:43","2010-06-30 12:55:46","draw a cube at specific co-ordinates?","<java><android><opengl-es>","1","0","1","",""
"3148713","1","","","2010-06-30 11:23:33","0","1331","<p>I saw this questions unanswered on some forums and wonder if anyone have a clue on how to answer.</p><p>Let's say for instance a button is needed with a picture and a text. It would seem natural to create an xml view and then inflate it into the Button. Is this possible? </p><p>At the moment I don't need the button to look clickable or change it's color at click, but it could also be interesting to consider how this will be affected by making the inflate.</p><p>Btw, I found this one tutorial describing a solution to the same problem, but they were writing a class extending View to obtain the goal. That seems a bit overklill to me.<a href=""http://kahdev.wordpress.com/2008/09/13/making-a-custom-android-button-using-a-custom-view/"" rel=""nofollow"">http://kahdev.wordpress.com/2008/09/13/making-a-custom-android-button-using-a-custom-view/</a></p><p>Thanks in advance!Anna</p>","364256","","","","","2010-06-30 12:05:45","Inflating a view into Button?","<android><button><inflate>","1","0","1","",""
"3148741","1","3151831","","2010-06-30 11:27:19","12","9892","<p>I want to capture the finger movement direction on Android touch phone. If a user slides his finger in up/down/left/right direction, I want to capture this direction. How can I find this? Thanks.</p>","189618","","","","","2012-10-31 01:47:08","How to capture finger movement direction in android phone?","<android>","2","0","2","",""
"3148784","1","3148871","","2010-06-30 11:31:41","1","1751","<p>A question about the internal storage that's private to each application (especially when storing files with Context.MODE_PRIVATE). </p><p>How is that storage actually assigned to the application? Just by package name or also somehow bound to the sign key of the app?</p><p>Let's say I have installed application 1 and then write another application 2 with the same name and package name (just differently signed with different keys) and install it (app 2 replacing app 1), would that application 2 get access to the /data/data/[app]/files ?</p><p>Or would I not even be able to replace app1 with app2 due to different sign keys in the first place?</p>","241475","","","","","2010-06-30 13:25:00","Application access permission to files on internal storage","<android>","2","0","2","",""
"3148917","1","3149105","","2010-06-30 11:49:57","2","1151","<p>I am trying to do something similar to the ""SpeechSynthesis Data"" app in the market. After installation it automagically starts itself, downloads the speech data to the sdcard, then uninstalls itself.</p><p>Does anyone know how you can have an app automatically start after installation? I can't find any info on that.</p>","177019","","","","","2010-06-30 12:12:39","Automatic start/uninstall of an app","<android>","1","0","","",""
"3149216","1","3149260","","2010-06-30 12:28:26","94","62242","<p>I have a webview that is loading a page from the Internet. I want to show a progressbar until the loading is complete. </p><p>How do I listen for the completion of page loading of a <a href=""http://developer.android.com/reference/android/webkit/WebView.html"">WebView</a>?</p>","114066","","","","","2014-03-19 13:06:34","How to listen for a Webview finishing loading a URL in Android?","<android><webview>","9","1","35","",""
"3149339","1","3149392","","2010-06-30 12:45:21","0","1069","<p>I've a service that is receiving UDP data from the network. I want to <em>push</em> this data from the service to a UI activity. </p><p>One way to do it is using  <em>broadcast Intents</em>. What is the <em>performance overhead</em> of sending broadcasts frequently from the service to the activities?</p><p>Are there any other alternatives for doing this ? </p><p>Thanks.</p>","306346","","","","","2010-06-30 12:53:04","Alternatives for Pushing data from an Android Service to an Activity","<android><performance><android-intent><broadcast>","1","0","","",""
"3149398","1","3149667","","2010-06-30 12:53:44","2","1097","<p>I would like to know if I can launch a program via incoming MMS/SMS? More on the MMS side of things. </p><p>Workflow:</p><ul><li>MMS sent to Android device</li><li>self executable MMS</li></ul><p>Any thoughts?</p>","93966","","","","","2010-06-30 13:38:05","Can I launch an Android app from incoming SMS/MMS messages?","<android><sms><mms><self-extracting>","2","0","2","",""
"3149414","1","3149461","","2010-06-30 12:56:08","11","18919","<p>what would be the correct way of receiving and sending a event when a check box get's enable or disable. In c# i could just easily double click and all the code would be done for me. but in android it appears to be a bit more obscure. i thought of using the touch event handlers but then if the user has a keyboard it wont detect the change since it's not touch. I figure android should have a native event for check box state change.</p>","2021317","","","","","2012-03-28 20:43:41","How to receive a event on android checkbox check change?","<android><events><checkbox>","1","0","4","",""
"3149558","1","3149603","","2010-06-30 13:14:22","1","267","<p>I have a ListView with a Button below it.  When I fill the list with more content than the screen size allows, so that the scroll bar appears, the Button is not part of the scrollable area.  That is, the Button disappears.  How do I make the Button part of the scrollable area?</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;ListView android:id=""@+id/ListView"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_above=""@+id/AddButton"" /&gt;    &lt;Button android:id=""@+id/AddButton"" android:layout_width=""fill_parent""         android:layout_height=""wrap_content"" android:text=""@string/add_title"" /&gt;&lt;/RelativeLayout&gt;</code></pre>","13365","","","","","2010-06-30 13:22:11","How do I make a Button a part of a scrollable ListView?","<android><listview><relativelayout>","2","0","","",""
"3149670","1","","","2010-06-30 13:27:36","5","1047","<p>I'm inspecting memory trying to find eventual memory leaks via hprof dumps.</p><p>I find that sometimes when I leave an activity via back button (which would finish the activity), the activity would still remain in memory but it would only have two GC root, which don't seem to be very 'strong' though.</p><p>This is my activity flow / the way I click and test:</p><p>A, B, C being activities.</p><p><strong>1) A -> B -> (back to) A</strong></p><p><strong>2) do a hprof dump</strong> with the following result:</p><p><em><strong>B is still in memory</em></strong>, the only elements in GC root of B activity are: </p><p>com.myapp.android.activity.directory.B</p><ul><li><p>mContext of <strong>com.android.internal.policy.impl.PhoneLayoutInflater</strong></p><ul><li><p>mLayoutInflater of android.app.ContextImpl [Stack Local]</p><ul><li>[local variable] of java.lang.Thread [Thread]  ""main""</li></ul></li></ul></li><li><p>mOuterContext <strong>of android.app.ContextImpl [Stack Local]</strong></p><ul><li>[local variable] of java.lang.Thread [Thread]  ""main""</li></ul></li></ul><p>(Thread ""main"" seems to be the UI thread)</p><p>continue from A:</p><p><strong>3) A -> C -> (back to) A</strong></p><p><strong>4) do a hprof dump</strong> with the following result (as expected):</p><p><strong>B is not in memory anymore</strong>, C is not in memory anymore, only A</p><p><strong>Now my question is:where does this PhoneLayoutInflater come from / why does it remain in memory when I return from B to A, but it would be gone after went further on to C and return back to A.</strong></p><p>Obviously the PhoneLayoutInflater is for inflating views, I'm aware of it's purpose. I just don't see why it would be kept in memory via the GC root from the main UI thread.</p><p>When I check the GC roots of above listed </p><blockquote>  <p>[local variable] of java.lang.Thread  [Thread] ""main</p></blockquote><p>it would have the following:</p><ul><li>mUiThread of com.myapp.android.activity.main.<strong>A</strong> [Stack Local]<ul><li>....<ul><li>this$0 of android.view.inputmethod.InputMethodManager$ControlledInputConnectionWrapper <strong>[JNI Global]</strong></li></ul></li></ul></li></ul><p>The way I call the activities B and C from A is via a regular <code>startActivity(intent)</code></p><p><strong>Why would the main UI thread of activity A somehow be related and referenced from activity B?</strong></p>","241475","","241475","","2010-06-30 13:50:43","2011-03-16 14:45:13","com.android.internal.policy.impl.PhoneLayoutInflater sometimes remaining in memory (hprof dumps)","<android>","2","3","2","",""
"3149820","1","3153837","","2010-06-30 13:43:44","2","8506","<p>I'm trying to write a game engine in Android, but I don't have much familiarity with threads.</p><p>My thread has an attribute, mSurfaceHolder, which holds the surface that I'll be drawing to. The run() method for my thread looks like this:</p><pre><code>public void run() {    // We're running now    setState(STATE_RUNNING);    // Keep looping while the game is running or paused    while (mState == STATE_RUNNING || mState == STATE_PAUSED) {        synchronized (mSurfaceHolder) {            // If the game is running, update physics etc.            if (mState == STATE_RUNNING) {                updateGame();            }            // Draw the game even if it's paused            drawGame();        }    }}</code></pre><p><code>STATE_RUNNING</code> represents the state when the activity is in the foreground and the game should be running.<code>STATE_PAUSED</code> represents the state when another activity has come into the foreground. I'm not completely sure why I need to still draw while it's paused, but that's what I seem to have gathered from the <a href=""http://developer.android.com/resources/samples/LunarLander/src/com/example/android/lunarlander/index.html"" rel=""nofollow"">LunarLander example</a>.</p><p>What I'm hoping is that while I'm looking at the activity, the game will update and draw (which I test by using LogCat). And then when I go back to the home screen or another activity appears over the top, it will just draw.</p><p>Well it <em>does</em> draw and update while I'm watching the activity, so the game loop itself works. But when I leave the activity, it has no effect. Here is the thread's pause() method that is called from the activity's onPause():</p><pre><code>public void pause() {    Log.d(""Game"",""Here"");    synchronized (mSurfaceHolder) {        Log.d(""Game"",""There"");        // If the thread is running, pause it        if (mState == STATE_RUNNING) {            setState(STATE_PAUSED);        }    }}</code></pre><p>As you can see, to test this method I have logged some messages. Now what I find when I leave the activity is that ""Here"" is logged, but ""There"" is not. Now with my limited knowledge of threads (I hardly know what <code>synchronized</code> actually does), I believe this will happen because my thread can't get synchronized with the surface holder. But I don't know WHY it doesn't synchronize. A few seconds after I've left the activity, I see the following warning in LogCat:</p><p><code>Activity pause timeout for HistoryRecord</code></p><p>Any idea why this would happen? There are no problems if I try to start the activity again, the thread just keeps running as it was.</p><p>Thanks very mucho.</p><p><strong>EDIT</strong>: Just discovered something else. The thread pauses just fine if I leave the activity within about a second of having started it. And then it will resume and pause again with no problems at all while the same task is still running. I have no idea why for a short period of time it will work, but if I leave it too long, it won't.</p><p><strong>EDIT 2</strong>: Okay... I fixed it. But I don't think I'm <em>supposed</em> to do what I've done. I've basically removed any synchronization with <code>mSurfaceHolder</code> from both the pause() and the setState() methods (which is used by pause()). No it works as it's supposed to, but I'm thinking the synchronization is there for a reason.</p><p>Perhaps the best question for me to ask is this:WHEN should you synchronize a thread with an object by use of a synchronized block? And in this case, what is the purpose of synchronizing with the SurfaceHolder?</p>","150634","","150634","","2010-06-30 16:09:30","2010-06-30 22:58:26","Pausing a Thread - Activity pause timeout for HistoryRecord","<android><multithreading><activity><gameloop>","1","0","0","",""
"3149902","1","3150697","","2010-06-30 13:52:59","3","227","<p>I've a column in which contains numbers or strings. The type of the column is varchar.</p><p>Usually when we sort it using the string field, then all the numbers come first and then strings start. But I want all the strings first and then numbers.</p><p>TIA !</p>","288515","","","","","2010-07-05 12:19:38","Query to sort a field such that strings comes first and then numbers","<android><sqlite><sqlite3>","4","0","","",""
"3149995","1","3150132","","2010-06-30 14:03:47","0","206","<p>Programmability i want monitor IP ever connected to my Adnroid device. </p><p>My initial thought is i can write a background service which will run tcpdump command and forward its output to inputStream. By putting any regular expression i can retrieve list of connected IP to my device. </p><p>I think that would be bulky to continually run command like tcpdump.</p><p>any better solution ??</p><p><em>Edit - typo</em></p>","279990","","","","","2010-06-30 14:19:06","to find a list of connected server in android device?","<android><network-programming>","1","0","","",""
"3150115","1","","","2010-06-30 14:16:28","2","10075","<p>The type new AdapterView.OnItemClickListener(){} must implement the inherited abstract method AdapterView.OnItemClickListener.onItemClick(AdapterView, View, int, long)</p><p>Why i get this message when i tried to build the tutorial</p><pre><code>package Fedail.Hello.Layout;import android.app.Activity;import android.os.Bundle;import android.widget.*;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView.OnItemClickListener;public class Layout_Feras extends Activity {    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        GridView gridview = (GridView) findViewById(R.id.gridview);        gridview.setAdapter(new ImageAdapter(this));        gridview.setOnItemClickListener(new OnItemClickListener(){         public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, Long id){          Toast.makeText(Layout_Feras.this,"""" + position, Toast.LENGTH_SHORT).show();         }        }        );    } }</code></pre>","380158","","932225","","2012-07-13 10:42:41","2012-09-05 11:41:59","The type new AdapterView.OnItemClickListener(){} must implement the inherited abstract method AdapterView.OnItemClickListener)","<android><android-adapterview>","2","1","0","",""
"3150178","1","","","2010-06-30 14:26:13","1","417","<p>I have an Android Service that is started by my application and does some things in a threadPool using <code>Executors.newCachedThreadPool()</code></p><p>Once it has finished doing it's work I would like the service to <code>stopSelf()</code>, how can I get the service to determine when it is no longer needed (ie, there are no more Threads executing) so that it can shut itself down automatically?</p>","248521","","","","","2010-06-30 14:35:34","Stopping a service once it has finished it's work","<android>","1","1","","",""
"3150400","1","3150456","","2010-06-30 14:50:34","22","12955","<p>Html List tag not working in android TextView. This is my string content:</p><pre><code>String str=""A dressy take on classic gingham in a soft, textured weave of stripes that resembles twill.  Take a closer look at this one.&lt;ul&gt;&lt;li&gt;Trim, tailored fit for a bespoke feel&lt;/li&gt;&lt;li&gt;Medium spread collar, one-button mitered barrel cuffs&lt;/li&gt;&lt;li&gt;Applied placket with genuine mother-of-pearl buttons&lt;/li&gt;&lt;li&gt;;Split back yoke, rear side pleats&lt;/li&gt;&lt;li&gt;Made in the U.S.A. of 100% imported cotton.&lt;/li&gt;&lt;/ul&gt;"";</code></pre><p>I loaded it in a text view like this:</p><pre><code>textview.setText(Html.fromHtml(str));</code></pre><p>The output looks like a paragraph. What can I do? Is there any solution for it?</p><p>Edit:</p><pre><code>webview.loadData(str,""text/html"",""utf-8"");</code></pre>","267269","","622391","","2013-05-25 01:22:35","2014-03-04 22:49:14","Html List tag not working in android textview. what can i do?","<android>","9","1","18","",""
"3150513","1","3151720","","2010-06-30 15:01:58","8","5184","<p>I am developing an Android app that needs to receive specific informations  for each user.</p><p>I made an authentication using GET and POST methods. Now I have the cookie delivered by the server when the username and password are correct.</p><p>How do I store this data? I looked for but couldn't find the best way to store a session in Android. </p><p>How applications like Foursquare, Facebook for example keep the state of an user? How do they persist data?</p>","313721","","","","","2010-06-30 17:20:47","Keep user state in Android","<android><session>","2","0","4","",""
"3150514","1","3195511","","2010-06-30 15:02:05","7","3968","<p>I have  a specific drawable that I use as background in my app. It is not a solid color.<br>Now I want to add rounded corners to this drawable.</p><p>I only found the rounded corner available in a shape with a gradient or a solid color as a background but not another drawable. </p><p>Is there another easy way of adding rounded corners to a drawable? </p>","114066","","","","","2012-12-26 13:00:12","How to add rounded corner to a drawable I'm using as a background in Android?","<android><layout><rounded-corners>","4","1","","",""
"3150617","1","","","2010-06-30 15:13:12","2","3757","<p>I have a listview with a custom adapter for each item of the list. If my custom item is some textview everything works fine. But each item has to be some html and hence I need each item to be a webview. The problem is that the webview steals my click and thus I cannot select an item from the list anymore.</p><p>So this:</p><pre><code>    this.itemAdapter = new ItemAdapter(this, R.layout.webview, itemArrayList);    ListView lv1 = (ListView) findViewById(R.id.ListView01);    lv1.setOnItemClickListener( new ItemSelected());    lv1.setAdapter(this.itemAdapter);public class ItemSelected implements OnItemClickListener {    @Override    public void onItemClick(AdapterView av, View v, int item, long id)     {        Intent showTextIntent = new Intent(showItems, ShowItemDetails.class);         showTextIntent.putExtra(""itemID"", singleItems.get(item).getItemID());        startActivity(showTextIntent);    }}</code></pre><p>click is dead. I don't have any link in the webview or have to navigate I only use it to have a nice formatted text (fromHtml for the textview is not that nice). Any chance?</p>","363436","","119895","","2011-01-05 15:29:27","2013-11-14 17:30:52","Android: Listview where each item is a webview","<android><webview>","4","0","2","",""
"3150749","1","","","2010-06-30 15:27:54","2","8924","<p>Is it possible to detect that the viewport is being dragged by a touch event?</p><p>Using the following code I am able to get the position of where the finger touched the screen, what node started the event and where it was dragged to. Which solves one of the problems but I would really like to detect when the user has dragged the page/window/viewport down.</p><p>To attempt to be more clear as to what I am trying to do: I would like simulate the refresh activity in Tweetie 2/Twitter for iPhone but in HTML5 and JavaScript.</p><pre><code>&lt;script&gt; window.ontouchmove = function(e){  if(e.touches.length == 1){ // Only deal with one finger    var touch = e.touches[0]; // Get the information for finger #1    var node = touch.target; // Find the node the drag started from    $(""p:last"").html(        ""clienty: "" + touch.clientY + ""&lt;br/&gt;"" +        ""screenY: "" + touch.screenY + ""&lt;br/&gt;"" +        ""pageY: ""   + touch.pageY        );  }}&lt;/script&gt; </code></pre>","24802","","","","","2010-08-11 07:29:56","iPhone/Android swipe detection for mobile browser","<javascript><iphone><android><html5><swipe>","2","0","1","",""
"3150824","1","","","2010-06-30 15:34:48","0","353","<p>I am new to android application development.I have create registration  form with user name,password, email. this values should be stored in sqlite database table. retrieve the data from the table.</p><p>in <strong>login.java</strong> i have create the table and insert the values of registration form data in to the table dynamically.In <strong>databsehelper.java</strong> extends the databaseopenHelper class overwrite the oncreate and upgrade methods.this class i used this class in login.java.</p><p>In <strong>display.java</strong> i am going to display the data in on success register details.</p><p>there are no errors but it gives the error on the emulator unexpectedly stoped.please help me.I am putting code bellow.if there is anther method please give suggestion. </p><p>Thanks and RegardsJ pramod</p><pre><code>login.java</code></pre><p>package rt.prj;</p><p>import java.util.Arrays;import java.util.Locale;</p><p>import rt.prj.DatabaseHelper;import android.app.Activity;import android.content.ContentValues;import android.content.Intent;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.text.Editable;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;import android.widget.Toast;</p><p>public class realestatenew extends Activity {    /** Called when the activity is first created. */     public static final String DEBUG_TAG = ""FullDatabase Log"";     public static final int DB_version = 1;     //public static final String DB_name = ""User.db"";</p><pre><code> public static final String TABLE_NAME = ""tbl_users""; //public static final String TABLE_NAME = ""tbl_temp""; //public static final String DB_name = ""User_temp""; public static final String DB_name = ""User"";</code></pre><p>public static final String CREATE_USER_TABLE = ""CREATE TABLE""+TABLE_NAME+""(id INTEGER PRIMARY KEY AUTOINCREMENT, firstname TEXT,lastname TEXT, username TEXT, password TEXT, email TEXT);"";public static final String DROP_USER_TABLE = ""DROP TABLE tbl_users;"";     public DatabaseHelper database_helper;     public SQLiteDatabase database;     public SQLiteDatabase database_rd;</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main1);    Button register=(Button)findViewById(R.id.Button01);    //private EditText text1;    //Registration database creation    createDataBase();    register.setOnClickListener(new View.OnClickListener()    {                    @Override                    public void onClick(View v) {                            // TODO Auto-generated method stub                            realestatenew login = new realestatenew();                            Toast.makeText(login.getApplicationContext(),""In Helper executin onCreate()"", Toast.LENGTH_SHORT).show();                            String[] success = insertRecords();                            if(success[0].equalsIgnoreCase(""1""))                            {                                    Intent mIntent = new Intent(realestatenew.this,DisplayUser.class);                                    mIntent.putExtra(""username"",success[1]);                                    mIntent.putExtra(""password"",success[2]);                                    mIntent.putExtra(""email"",success[3]);                                    startActivity(mIntent);                            }                    }            });}//database create functionvoid createDataBase(){    if(Arrays.binarySearch(databaseList(), DB_name)&gt;=0)    {            deleteDatabase(DB_name);    }    database_helper = new</code></pre><p>DatabaseHelper(this.getApplicationContext(),DB_name,null,DB_version);        //database_helper.onCreate(database);        database = database_helper.getWritableDatabase();        database.setLocale(Locale.getDefault());         // Set the locale</p><pre><code>    database.setLockingEnabled(true);      database_rd = database_helper.getReadableDatabase();    Toast.makeText(this, ""created database"",</code></pre><p>Toast.LENGTH_SHORT).show();        /*        database =openOrCreateDatabase(DB_name,SQLiteDatabase.CREATE_IF_NECESSARY,null);        database.setLocale(Locale.getDefault()); // Set the locale        database.setLockingEnabled(true); // SQLiteDatabase is madethread-safe by using locks around critical sections.        database.setVersion(1);</p><pre><code>    database.execSQL(CREATE_USER_TABLE);    */}</code></pre><p>// data  insertion    String[] insertRecords()    {            Toast.makeText(this,""In insertrecords"", Toast.LENGTH_SHORT).show();            //database.openDatabase(DB_name,database.create(factory),ACCESSIBILITY_SERVICE);    final EditText username = (EditText) findViewById(R.id.EditText01);    final EditText password= (EditText) findViewById(R.id.EditText02);    final EditText email= (EditText) findViewById(R.id.EditText04);    Long newUserID = 0l;</p><pre><code>String uname  = username.getText().toString();String pwd = password.getText().toString();String emailid  = email.getText().toString();ContentValues values = new ContentValues();values.put(""username"",uname);values.put(""password"",pwd);values.put(""email"",emailid);   //StringBuilder info = new StringBuilder();String[] info = new String[10];database.beginTransaction();try{        Toast.makeText(this,""Before calling inserting values"",</code></pre><p>Toast.LENGTH_SHORT).show();            newUserID = database.insertOrThrow(TABLE_NAME, null, values);            Toast.makeText(this,""After calling inserting values"",Toast.LENGTH_SHORT).show();</p><pre><code>        info[0] = newUserID.toString();        info[1] = uname;        info[2] = pwd;        info[3] = emailid;        System.out.println(newUserID);        Toast.makeText(this, newUserID.toString(),</code></pre><p>Toast.LENGTH_SHORT).show();</p><pre><code>        Cursor c = database_rd.query(TABLE_NAME, null, null, null, null,null,null);        LogCursorInfo(c);        c.close();}catch(Exception e){        //Transaction failed;        e.printStackTrace();}finally{        database.endTransaction();        database.close();}return info;}public void LogCursorInfo(Cursor c){            Log.i(DEBUG_TAG, ""*** Cursor Begin *** "" + "" Results:"" +</code></pre><p>c.getCount() + "" Columns: "" + c.getColumnCount());</p><pre><code>            // Print column names            String rowHeaders = ""|| "";            for (int i = 0; i &lt; c.getColumnCount(); i++) {                   rowHeaders = rowHeaders.concat(c.getColumnName(i) +""||"");            }            Log.i(DEBUG_TAG, ""COLUMNS "" + rowHeaders);            //Integer rows = c.getCount();            //Toast.makeText(this, rows.toString(),         // Toast.LENGTH_SHORT).show();            // Print records            c.moveToFirst();            while (c.isAfterLast() == false) {                    String rowResults = ""|| "";                    for (int i = 0; i &lt; c.getColumnCount(); i++) {                            rowResults = rowResults.concat(c.getString(i) + </code></pre><p>"" || "");                        }                        Log.i(DEBUG_TAG, ""Row "" + c.getPosition() + "": "" + rowResults);                        Toast.makeText(this, rowResults.toString(),Toast.LENGTH_SHORT).show();                        //Toast.makeText(this, ""In LogCursorInfo"", // Toast.LENGTH_SHORT).show();                        c.moveToNext();                }                Log.i(DEBUG_TAG, ""<strong>* Cursor End *</strong>"");        }</p><p>}</p><pre><code>databasehelper.java</code></pre><p>package rt.prj;</p><p>import android.content.Context;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteDatabase.CursorFactory;import android.widget.Toast;</p><p>public class DatabaseHelper extends SQLiteOpenHelper{</p><pre><code>        public static final int DB_version = 1;        public static final String DB_name = ""realestate.db"";            public SQLiteDatabase database;            public static final String TABLE_NAME = ""tbl_users"";            //public static final String TABLE_NAME = ""tbl_temp"";         public static final String CREATE_USER_TABLE = ""CREATE TABLE""+TABLE_NAME+""(id INTEGER PRIMARY KEY AUTOINCREMENT, firstname TEXT,lastname TEXT, username TEXT, password TEXT, email TEXT);"";         realestatenew login = new realestatenew();        public DatabaseHelper(Context context, String name, CursorFactory</code></pre><p>factory,int version)            {                super(context, DB_name, factory,DB_version);                // TODO Auto-generated constructor stub            }</p><pre><code>        public void onCreate(SQLiteDatabase db)            {           Toast.makeText(login.getApplicationContext(),""In Helper executingonCreate()"", Toast.LENGTH_SHORT).show();                    // Create the table            db.execSQL(""DROP TABLE IF EXISTS tbl_users"");            db.execSQL(CREATE_USER_TABLE);            }            @Override            public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {                    // Housekeeping here.                    // Implement how ""move"" your application data during an upgrade of schema versions                    // There is no ALTER TABLE command in SQLite, so this generally involves                    // CREATING a new table, moving data if possible, or deleting the old data and starting fresh                    // Your call.                    //db.execSQL(""DROP TABLE IF EXISTS tbl_users"");                    //onCreate(database);            }            @Override            public void onOpen(SQLiteDatabase db) {                    super.onOpen(db);            }    }</code></pre><p>display.java</p><p>package rt.prj;</p><p>//import java.util.Locale;</p><p>import android.app.Activity;//import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.util.TypedValue;import android.view.View;import android.view.ViewGroup.LayoutParams;import android.widget.LinearLayout;import android.widget.TextView;import android.widget.Toast;import rt.prj.*;public class DisplayUser extends Activity{        public void onCreate(Bundle savedInstanceState)        {                super.onCreate(savedInstanceState);                //setContentView(R.layout.userinfo);</p><pre><code>            final String DB_name = ""realestate.db"";            final String TABLE_NAME = ""tbl_users"";            final int DB_version = 1;            //final  DatabaseHelper database_helper;            //final SQLiteDatabase database_wr;            /*            database =</code></pre><p>openOrCreateDatabase(DB_name,SQLiteDatabase.CREATE_IF_NECESSARY,null);        database.setLocale(Locale.getDefault()); // Set the locale        database.setLockingEnabled(true); // SQLiteDatabase is madethread-safe by using locks around critical sections.        database.setVersion(1);</p><pre><code>    if(database.isOpen())    {            Toast.makeText(this, ""Yes database is open"",</code></pre><p>Toast.LENGTH_SHORT).show();        }        if(database.isDbLockedByCurrentThread())        {                Toast.makeText(this, ""Yes database is locked"",Toast.LENGTH_SHORT).show();        }        Cursor c = database.query(TABLE_NAME, null, null, null, null,null,null);</p><pre><code>    LogIn login = new LogIn();    login.LogCursorInfo(c);            c.close();            */            //LogIn login = new LogIn();            //database_wr = login.database_helper.getWritableDatabase();            String uname= getIntent().getStringExtra(""username"");            String pwd= getIntent().getStringExtra(""password"");            String email= getIntent().getStringExtra(""email"");            Toast.makeText(this, uname, Toast.LENGTH_SHORT).show();            View infoPanel = _createInfoPanel(uname,pwd,email);            setContentView(infoPanel);    }    public View _createInfoPanel(String uname,String pwd,String</code></pre><p>email)        {                LinearLayout panel = new LinearLayout(this);                panel.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));                panel.setOrientation(LinearLayout.VERTICAL);</p><pre><code>      // user id            TextView Welcome = new TextView(this);            Welcome.setText(""Welcome ""+uname);            Welcome.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f);            Welcome.setLayoutParams(new </code></pre><p>LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));</p><pre><code>            TextView UserName = new TextView(this);            UserName.setText(""Username:""+uname);            UserName.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f);            UserName.setLayoutParams(new</code></pre><p>LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));</p><pre><code>            TextView pass = new TextView(this);            pass.setText(""password:""+pwd);            pass.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f);            pass.setLayoutParams(new </code></pre><p>LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));</p><pre><code>            TextView Email = new TextView(this);            Email.setText(""E-mailID:""+email);            Email.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f);            Email.setLayoutParams(new </code></pre><p>LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));</p><pre><code>            panel.addView(Welcome);            panel.addView(UserName);            panel.addView(pass);            panel.addView(Email);            return panel;    }</code></pre><p>}</p>","365203","","","","","2010-06-30 15:49:08","unexpectedly stoped error storing text boxes in to database table dynamically in android","<android><sqlite>","1","0","","",""
"3150830","1","3151077","","2010-06-30 15:35:12","19","17290","<p>I am working on an android application, and I need to use encryption for one aspect of it. I am really indifferent to which algorithm I use (AES, DES, RSA, etc...). I am aware that Java has a crypto package, but I am not familiar with it at all. Can someone post an example on how to do an encrypt/decrypt function?</p>","122105","","597607","","2011-12-26 18:01:17","2014-04-09 08:32:39","Android encryption","<java><android><security><cryptography>","3","4","14","",""
"3151184","1","","","2010-06-30 16:11:26","4","271","<p>I am using ScoreNinja (a high score manager) in my android game, and I want to use the subboard feature mentioned in the documentation.</p><p>But when I do this:</p><pre><code>mScoreNinjaAdapter.show(score, ""Test Title"", ""test_board"");</code></pre><p>It doesn't do anything differently. The title is still ""Global High Scores"" and it is still showing scores from the main board.</p>","63887","","","","","2011-07-15 16:55:26","ScoreNinja titleText and subboard are not doing anything","<android><scoreninja>","1","0","","",""
"3151218","1","3152866","","2010-06-30 16:15:13","2","1167","<p>I am new to Android development and I have a problem that I have been working on for hours with no success. I want to create a cross-hair in the center of my Google map that stays in the center even when the map is panned. I have a .png image of the cross-hair in my drawable directory. Additionally, I have a MapView that displays the Google map with several markers. What is the best way to approach this problem? </p><p>Any help is greatly appreciated.</p><p>Thank you,</p><p>Tuong</p>","380242","","","","","2012-03-06 02:48:11","Android - Creating a Crosshair in the Center of My Google Map","<android><google-maps>","2","0","2","",""
"3151833","1","","","2010-06-30 17:35:34","0","135","<p>I need to cancel a repeating alarm when my app terminates. The problem is I have several activities and since they can be killed at any time, how can I determine when the last activity is being shutdown so I can call my alarm canceling method?</p>","246793","","","","","2010-12-24 11:50:30","How to know when my Android app is terminating?","<android><cancel><terminate><alarm>","1","0","","",""
"3151959","1","3155697","","2010-06-30 17:51:53","0","340","<p>I have troubles with OpenGL textures on Motorola Milestone with 2.1 firmware. Each call to glGenTextures fails with error GL_INVALID_OPERATION and sets the id with random numbers. The exact same application works on G1 without any error.</p><p>Does anybody have a hands-on experience with a similar issue and knows a way around?</p>","2504283","","","","","2010-07-01 07:07:56","OpenGL textures fails on Motorola Milestone","<android><opengl-es><textures><milestone>","1","0","","",""
"3152090","1","3152185","","2010-06-30 18:10:32","2","1223","<p>The following code executes a function that retrieves a file via ftp and then displays it in an imageview. Since I'm using the main thread the UI locks up, somebody tells me I can use asynctask to make this work but I can't figure it out :&lt;</p><p>Is anybody familiar with this that could offer me some guidance?</p><pre><code>package hhh.ggg;import android.app.Activity;import android.app.AlertDialog;import android.os.Bundle;import android.os.Handler;import java.io.File;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.widget.ImageView;import android.widget.TextView;//import it.sauronsoftware.ftp4j.FTPClient;import it.sauronsoftware.ftp4j.*;public class hhh extends Activity {    /** Called when the activity is first created. */ FTPClient ftp; String host = ""ipofFTPserver"";  final Handler mHandler = new Handler();  final Runnable mUpdateResults = new Runnable() {         public void run() {             updateResultsInUi();         }     }; @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        startLongRunningOperation();    } protected void startLongRunningOperation() {        // Fire off a thread to do some work that we shouldn't do directly in the UI thread        Thread t = new Thread() {            public void run() {             try             {             ftp = new FTPClient();             ftp.connect(host);             ftp.login(""username"", ""password"");             ftp.changeDirectory(""public_ftp"");       ftp.download(""test.jpg"", new java.io.File(""/sdcard/test.jpg""));              }      catch(Exception e)      {                      }                mHandler.post(mUpdateResults);            }        };        t.start();    } private void updateResultsInUi() {        // Back in the UI thread -- update our UI elements based on the data in mResults  TextView jpgName = (TextView)findViewById(R.id.jpgname);        ImageView jpgView = (ImageView)findViewById(R.id.jpgview);  String myJpgPath = ""/sdcard/test.jpg"";                    jpgName.setText(myJpgPath);  BitmapFactory.Options options = new BitmapFactory.Options();    options.inSampleSize = 2;  Bitmap bm = BitmapFactory.decodeFile(myJpgPath, options);  jpgView.setImageBitmap(bm);    }}</code></pre>","377613","","58792","","2010-08-05 14:12:18","2010-08-05 14:12:18","Creating multiple threads to achieve ftp download and display in imageview","<android>","1","0","1","",""
"3152097","1","3152172","","2010-06-30 18:11:19","1","2239","<p>I've been trying to write a little application that recognizes custom events in Android: you hold your finger over a TextView for a certain length of time, and it changes color.  I'm using the MotionEvent coordinates and checking if they are within the bounds of a particular TextView, which is within a table.  </p><pre><code>private boolean checkBounds(TextView v, MotionEvent event) {        int[] origin = new int[2];        v.getLocationOnScreen(origin);        if ((event.getX() &gt; origin[0]) &amp;&amp; (event.getX() &lt; (origin[0] + v.getMeasuredWidth()))) {            if ((event.getY() &gt; origin[1]) &amp;&amp; (event.getY() &lt; (origin[1] + v.getMeasuredHeight()))) {                return true;            }        }        return false;    }</code></pre><p>I am just attaching the onTouch listener to the table within the activity.  But I get weird errors: the coordinates seem to be off by one view (i.e. if I touch the view below the view above reacts); or sometimes one will react, and the other will not.  Any idea what might be going on?</p>","380377","","","","","2010-06-30 18:25:46","mismatch of event coordinates and view coordinates in Android?","<android><events><coordinates><touch>","2","0","","",""
"3152229","1","3153716","","2010-06-30 18:27:10","0","197","<p>I have an app with an SMS receiver set up, but even if the sms receive function is turned off using the package manager, the app will go to the top of recent applications (when holding the home button) if a sms is received. How can I stop this behavior?</p><p>Thanks for any help in advance.</p><p>Cheers!</p>","253567","","","","","2010-06-30 21:54:11","Prevent android app from showing up in switcher","<android><sms><switching><receiver>","1","0","","",""
"3152422","1","3152441","","2010-06-30 18:54:37","36","45029","<p>I'm trying to load a html page from the assets directory. I tried this, but it fails.</p><pre><code>public class ViewWeb extends Activity {      @Override      public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          WebView wv;          wv = (WebView) findViewById(R.id.webView1);          wv.loadUrl(""file:///android_asset/aboutcertified.html"");   // fails here        setContentView(R.layout.webview);      }  }</code></pre><p>I don't really get any telling errors in LogCat...</p>","356438","","","","","2014-02-20 18:47:17","Webview load html from assets directory","<android>","3","1","15","",""
"3152507","1","3152566","","2010-06-30 19:05:09","6","14173","<p>I'm managing dialogs by <code>showDialog</code>/<code>dismissDialog</code>/<code>removeDialog</code>. </p><p>I want to:</p><p>Display several dialogs in kind of a stack:</p><p>a) First dialog is shown using <code>showDialog(DIALOG_TYPE)</code> </p><p>b) Next dialogs are shown on top of the existing dialog</p><p>Now I'm only able to display first dialog using <code>showDialog</code> and then next dialogs are ignored.</p><p>Display last dialog:</p><p>a) First dialog is shown using <code>showDialog(DIALOG_TYPE)</code> </p><p>b) Application checks if dialog is displayed, closes dialog (if it's displayed) and opens a new dialog.</p><p>Is there any possibility to achieve one of the above solutions?</p>","296427","","","","","2011-07-16 12:31:46","How to check if dialog is displayed or display multiple dialogs of the same type?","<android><dialog><showdialog>","2","0","2","",""
"3152607","1","3152649","","2010-06-30 19:16:21","2","1425","<p>I remember reading somewhere that you could make two android apps share the same user id, but I have heard conflicting information from other people. Is it possible to make two apps share the same user id and if so how is it done?</p>","340","","","","","2011-04-05 09:39:34","How do you make two Android apps share the same user id?","<java><android>","2","0","","",""
"3152623","1","3153645","","2010-06-30 19:18:07","1","332","<p>I have a Service singleton class with static methods that I call from the same process. I call startService when my Application starts. I also call bindService, but now I am wondering if that is really necessary.</p>","338981","","","","","2010-07-01 01:32:01","Is bindService necessary for a local (same process) Service?","<android><process><service><local>","1","0","","",""
"3152681","1","","","2010-06-30 19:25:32","15","14282","<p>I'm having a problem with emulator-5554, it keeps telling me it is offline. </p><p>When I do a 'adb devices' from the command line it says</p><p><strong>emulator-5554 offline</strong></p><p>Even after a fresh restart, I try that command and it still says it is offline.</p><p>The problem is when I try to install .apk files to the emulator using 'abd install <em>path</em>' from the command prompt, it tells me that it is offline, if I create another device and run that one, then try to install the .apk files, it says i have too many devices connected. So in other words, I can't install my .apk files.</p><p>How in the world can I get rid of that damn emulator-5554? I heard that if you do a restart, it should clear all the devices, but that does not seem to be working. It is like it is getting initialized when my computer starts up. Has anyone run into this issue?</p><p>Thanks</p>","67510","","","","","2014-04-05 14:37:23","Android emulator-5554 offline","<android><android-emulator>","11","4","1","",""
"3152740","1","3152855","","2010-06-30 19:32:22","0","1697","<p>I have a username as password which I need to send to a website as part of an android application (yes it is https), and once submitted to the seerver via POST, the server should return cookies. I need to be able to capture these cookies, and allow them to be accessed in a webview which I have settup.</p><p>How would I do this?</p><p>Thanks</p>","122105","","","","","2011-02-24 09:31:43","Android POST data and COOKIES","<android><cookies><webview>","2","0","","",""
"3152902","1","3155600","","2010-06-30 19:52:48","0","306","<p>My activity gets set as the default Home by the user, but I want to be able to launch the default Home from within my activity as well.  I've tried hard coding the following: </p><blockquote>  <p>Intent intent = new Intent(Intent.ACTION_MAIN);  intent.addCategory(Intent.CATEGORY_HOME);  PackageManager pm = getPackageManager();  String packageName = ""com.android.launcher"";  String className = ""com.android.launcher.Launcher"";  final ComponentName cn = new ComponentName(packageName, >className);  intent.setComponent(cn);</p></blockquote><p>This seems to work on my droid, but force closes on the HTC Ally.  I'm thinking there's an easier way to just get a list of the apps that have the category Home and Default.</p><p>For those that have used the Home Swittcher app.  I essentially want to generate that list of installed default Home activities on the phone.</p>","368542","","368542","","2010-06-30 20:17:52","2010-07-01 06:47:14","How would I go about getting the package names of the applications that can be Home on android","<android>","1","0","","",""
"3153154","1","3153223","","2010-06-30 20:30:51","3","1786","<p>What do I do if <code>tv.setText(Html.fromHtml(text));</code> takes too long, and hangs the UI?If I can do it with a thread, can you provide an example?</p>","380490","","","","","2010-08-31 07:32:50","Android Html.fromHtml takes too long","<android>","2","0","3","",""
"3153404","1","","","2010-06-30 21:05:49","0","321","<p>I'm using a SQL database to store a single float value, and I'm really having trouble getting my brain around everything that needs to be done to make it work.  I've been reading the NotePad tutorial Google provides for a few days now and Googling around but it just isn't clicking in my head.</p><p>Could anyone explain to me (no code needed) just what exactly I need to have for a simple database, and how to read the value from it into my float variable and how to write the value of the variable back to the table?</p><p>Much thanks, I think my brain is starting to seep out my ears.</p>","376844","","186035","","2010-06-30 22:10:45","2010-07-01 14:12:42","Need help with a really simple database read and write","<android><database><sqlite>","2","0","","",""
"3153422","1","","","2010-06-30 21:07:46","0","953","<p>and if this application exist does it has an open API? </p>","368440","","","","","2011-01-30 19:48:25","is there a way to open and edit word file in android?","<android>","2","1","","",""
"3153559","1","3153743","","2010-06-30 21:27:51","0","6082","<p>i am using the camera.setSmoothZoom(i) function of the Camera class but its not helping me out. i have tried out camera.getParameters().setZoom(i) function but still i am not getting any success. Does anyone know how to zoom in/zoom out on android phone camera..thanks in advance.. </p>","380536","","","","","2010-06-30 21:59:29","how to zoom in/out using android phone camera","<android>","1","0","","",""
"3153815","1","3153852","","2010-06-30 22:14:38","5","4279","<p>I am writing an app that is meant to be run during a call.  After the user makes a call, and starts my app, I want my app to be able to know if the call is dropped from bad connection.  Is this possible?  Thanks</p>","374751","","","","","2012-03-26 07:35:00","How can my android app detect a dropped call?","<android>","2","0","1","",""
"3153870","1","3154051","","2010-06-30 22:26:44","4","6720","<p>I tried to write some text on a surface view I created. It works fine, if title is false, and there is no linebreak added to the text. But if I add a title and therefore a linebreak, the linebreak isn't printed as expected, but instead there is this symbol [] printed.</p><p>Any hints why?</p><pre><code>@Overridepublic void drawObject() {String text = """";if (title) {   text = getGameBoard().getGame().getForeignProfile().getName() + ""\n"";}text = text + getScoreAsString();getGameBoard().getCanvas().drawText(text, 0, text.length(), getPosition().getX(), getPosition().getY(), getPaint());}</code></pre>","","anon","","","","2013-02-27 09:42:37","Canvas.drawText(...) does not print linebreak","<android><text><canvas>","4","0","1","",""
"3153910","1","3154027","","2010-06-30 22:36:53","6","9399","<p>I've been told it's a command line option.  But Eclipse's Run!Run Configurations...!Target!Additional Emulator Command Line Options field is already occupied with</p><pre><code>-sdcard ""C:\android-sdk-windows\tools\sd9m.img""</code></pre><p>If I wanted to write something like </p><pre><code>adb logcat -s MessageBox &gt; ""C:\Users\me\Documents\LogCatOutput.txt""</code></pre><p>then where do I write it, and how (i.e., is the syntax even correct)?  I need to output only a filtered tag, not verbose.  (""MessageBox"" is my TAG.  Again I don't know if any of this punctuation is right, or even where the command goes.)</p><p>Thanks for any help.</p>","225626","","225626","","2010-06-30 22:47:08","2013-09-18 17:08:15","Trying to output my LogCat to a file","<android>","2","0","2","",""
"3153929","1","","","2010-06-30 22:40:46","0","1500","<p>So using suggestions from the last question I asked, I figured out how to call BarCodeScanner, and return the value to a field. so now, I have a toast that says ""successful scan"" and then I want to pass the result to a new activity. when I comment out my intent, everything works (minus the passing of data/switching of screen, obviously) but when I run my project as is, it FC's... no errors reported by eclipse in code or XML. Any insights?</p><pre><code>package com.mhe.test.scan;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;public class main extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);   Button myScanButton = (Button) findViewById(R.id.myScanButton);    totalbox = (EditText) findViewById(R.id.tBox);             myScanButton.setOnClickListener(new Button.OnClickListener() {       public void onClick(View v) {         Intent intent = new Intent(""com.google.zxing.client.android.SCAN"");         intent.putExtra(""SCAN_MODE"", ""PRODUCT_MODE"");         startActivityForResult(intent, 0);      }   });  }  private EditText totalbox;  public void onActivityResult(int requestCode, int resultCode, Intent intent) {    if (requestCode == 0) {      if (resultCode == RESULT_OK) {      final String contents = intent.getStringExtra(""SCAN_RESULT"");        if ( totalbox != null )         totalbox.setText(contents);        Context context = getApplicationContext();        CharSequence text = ""Successful Scan"";        int duration = Toast.LENGTH_SHORT;        Toast toast = Toast.makeText(context, text, duration);        toast.show();    Intent i = new Intent(main.this, Result.class);        i.putExtra(""SNARP"", ""SCAN_RESULT"");        startActivityForResult(i, 0);      } else if (resultCode == RESULT_CANCELED) {        if ( totalbox != null )          totalbox.setText(""bummer"");      }    }        }}</code></pre><p>And then to handle the data being passed, in the new activity:</p><pre><code>package com.mhe.test.scan;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;public class Result extends Activity {  /** Called when the activity is first created. */  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.result);    Intent i = getIntent();    Bundle b = i.getExtras();    String foosh = b.getString(""SNARP"");    EditText box1 = (EditText) findViewById(R.id.tBox1);            box1.setText(foosh); </code></pre>","379048","","125981","","2013-04-26 14:15:42","2013-04-26 14:15:42","Switching activities/passing data between activities","<java><android>","2","0","","",""
"3154024","1","3154043","","2010-06-30 22:59:44","1","361","<p>Hi: I want to implement a http remote control for an Android application: From a browser on a computer in the local area network the application running on the Android device should be controlled.</p><p>Are there any recommendation how to implement this? I heard about i-jetty but it is not uncomplex to integrate it into an existing app.</p>","281535","","","","","2010-06-30 23:03:49","HTTP interface for Android application","<java><android><http>","1","2","","",""
"3154224","1","","","2010-06-30 23:42:56","0","917","<p>I'm developing an Android application and I'm trying to upload an image to our server from the client side. When I get onto the server to view the image it is corrupted (gray bar on bottom) sometimes. I'm not sure why this is happening. Can  anyone help me resolve this issue or point me to a guide on how to do this? Below is the code that uploads the image:</p><pre><code>try {    url = new URL(SERVER_URL);    connection = (HttpURLConnection)url.openConnection();    connection.setDoInput(true);    connection.setDoOutput(true);    connection.setUseCaches(false);    connection.setRequestMethod(""POST"");    connection.setRequestProperty(""Connection"", ""Keep-Alive"");    connection.setRequestProperty(""Content-Type"", ""image/jpeg"");    connection.setChunkedStreamingMode(STREAM_CHUNK_SIZE_KB * 1024);    connection.connect();    outputStream = new DataOutputStream(connection.getOutputStream());    // Write file header (userId; Id; contentId; MediaType; size)    outputStream.writeLong(mUserId);    outputStream.writeLong(mId);    outputStream.writeLong(file.getId());    outputStream.writeUTF(MediaType.getMediaType(file.getMediaType()));    outputStream.writeInt(file.getSize());    // Write file data to stream    int maxBufferSize = (8 * 1024);    FileInputStream fileInputStream = new FileInputStream(file.getImageFile());    int bytesAvailable = fileInputStream.available();    int bufferSize = Math.min(bytesAvailable, maxBufferSize);    byte[] buffer = new byte[bufferSize];    int bytesRead = fileInputStream.read(buffer, 0, bufferSize);    while (bytesRead &gt; 0) {        outputStream.write(buffer, 0, bufferSize);        bytesAvailable = fileInputStream.available();        bufferSize = Math.min(bytesAvailable, maxBufferSize);        bytesRead = fileInputStream.read(buffer, 0, bufferSize);    }    outputStream.writeBytes(""\r\n"");    outputStream.flush();    // Check response    int responseCode = connection.getResponseCode();    if (responseCode == HttpURLConnection.HTTP_OK) {        uploadStatus = true;        InputStream responseStream = connection.getInputStream();        BufferedReader responseReader = new BufferedReader(new             InputStreamReader(responseStream));        char[] response = new char[4];        responseReader.read(response, 0, 4);        responseReader.close();        int responseValue = 0;        for (int b = 0; b &lt; 4; b++) {            responseValue |= response[b] &amp; 0xFF;            if (b &lt; 3) {                responseValue &lt;&lt;= 8;            }        }        switch (responseValue) {            case SAVED_SUCCESSFULLY:                Log.d(""FileUploader::upload -&gt; Server response: Upload successful"");            break;            case ERROR_SAVING_FILE:                Log.d(""FileUploader::upload -&gt; Server response: Upload failed"");            break;            case FILE_MORE_THAN_ALLOWED_SIZE:                Log.d(""FileUploader::upload -&gt; Server response: Upload failed, exceeded                     allowed file size"");            break;        }    }     else {        Log.d(""FileUploader::upload -&gt; responseCode = "" + responseCode);        checkErrorStream(connection.getErrorStream());    }} catch(Exception e) {    Log.e(Log.getStackTraceString(e));} finally {    try {        if (outputStream != null) {            outputStream.close();        }    }     catch(Exception e) {        Log.e(Log.getStackTraceString(e));    }    if (connection != null) {        connection.disconnect();    }}</code></pre>","380606","","835806","","2012-06-19 19:48:31","2012-06-19 19:48:31","Android Development Image Upload Corrupted","<java><android><http><image><file>","3","0","","",""
"3154231","1","3168424","","2010-06-30 23:44:41","1","1956","<p>I have a custom Android (1.5) Title bar which includes a button. Using the custom title bar in Activity A, I am able to click the button, and have the <code>OnClickListener</code> event fire as expected. </p><p>However, when I launch Activity B for result, from Activity A, it can take 2-3 clicks for the same buttons event to fire.</p><p>This is the code to set the event listener for Activity A in the <code>onCreate</code> override</p><pre><code>setTitleNegativeActionListener(new OnClickListener() {public void onClick(View v) {  // end this activity  ActivityA.this.finish();  }});</code></pre><p>This is the code for Activity B</p><pre><code>setTitleNegativeActionListener(new OnClickListener() {  public void onClick(View v) {    setResult(RESULT_CANCELED);    EditClientAddressActivity.this.finish();  }});</code></pre><p>Button XML from layout</p><pre><code>&lt;Button   android:id=""@+id/title_button_right""   android:layout_width=""wrap_content"" android:layout_height=""wrap_content""   android:background=""@drawable/nav_button""  android:text=""Done"" android:textColor=""#fff""  android:layout_alignParentRight=""true"" android:textSize=""12dip""  android:textStyle=""bold"" android:paddingLeft=""10dip""  android:paddingRight=""10dip"" android:layout_centerVertical=""true""  android:minWidth=""40dip""   android:focusableInTouchMode=""false"" android:focusable=""false"" /&gt;</code></pre><p>It seems as though in Activity B, the first click is putting the button into focus, and the second click is actually pressing the button. However, I have set both <code>focusableInTouchMode</code> and <code>focusable</code> to be false in the buttons definition. </p><p>Is there some other property that needs to be defined to allow the <code>OnClickListener</code> event to fire in this case?</p><p><strong>EDIT</strong>:After a bit more investigation I found that the child Activity B was being started twice (or more) and each click of the button was indeed working as expected, but appeared as though nothing was happening. Full answer bellow.</p>","165467","","540776","","2011-12-05 16:11:00","2011-12-05 16:11:00","Android Button OnClick event fired after multiple clicks","<android><button><onclick>","1","0","","",""
"3154402","1","3182862","","2010-07-01 00:39:20","0","365","<p>From within my Android application, I need to make the phone 'checkin' with Google for Market updates.  This can be done manually by the user by opening the dialer and typing '<code>*#*#CHECKIN#*#*</code>'.  My app needs the ability to do the same thing.</p><p>I'm positive this done using an Intent.  Some digging shows that the Alarm Manager has this pending intent waiting:</p><pre><code>  RTC_WAKEUP #5: Alarm{44b1ee18 type 0 com.google.android.server.checkin}    type=0 when=1277981220358 repeatInterval=40212000 count=0    operation=PendingIntent{44b256c0: PendingIntentRecord{44c26a80 com.google.android.server.checkin broadcastIntent}}</code></pre><p>Now the question is, how do I get my app to broadcast this same type of Intent?  I tried this.sendBroadcast(myIntent) in the activity with no luck, so I'm rather stumped at the moment.</p><p>Any thoughts?</p>","158766","","158766","","2010-07-01 00:50:52","2010-07-06 00:35:14","Android: Programatically triggering phone checkin","<android><android-intent><broadcast>","2","1","","",""
"3154546","1","3154572","","2010-07-01 01:22:31","0","570","<p>I have a fully functioning program that worked.  However it had two dialogs that I know I'll be reusing every time I write a program, or potentially multiple times per program.  They are a EULA and an info page.  So I've moved the two activities to their own project, however I don't want to have a standard EULA and info page obviously.  So I have the resource on the projects I'm working on.  (If using Assets will work better, I could change that.)</p><p>For the EULA I have a static function checkEULA to see if it's already been accepted and that works because I pass in an activity and the resource ID.</p><p>However for the InfoActivity I am trying to do it as a pure Intent..  I can pass in the id into the bundle, but is there a way to get the activity or resources from the intent with out adding it into the bundle? </p><p>Or if not, what is there a best practice, or a smart way to pass a resource into a intent to get it out on the other end? </p>","511852","","","","","2010-07-01 01:30:56","(Android) Passing Resources/activities with intent","<android><resources><activity><android-intent>","1","0","","",""
"3154632","1","","","2010-07-01 01:49:58","7","4005","<p>I want to acquire Android Device VRAM size.</p><p>Is there a method for acquisition from the program?</p>","366851","","44729","","2011-01-28 21:01:18","2012-06-02 01:49:55","Android VRAM. check","<android><opengl-es><android-sdk-1.6>","5","2","","",""
"3154844","1","3159186","","2010-07-01 03:06:28","-2","871","<p>I'm having problems with the content provider. I'm trying to create a content provider. </p><pre><code>    public static final Uri CONTENT_URI =                Uri.parse(""content://data/data/one.two/databases"");</code></pre><p>This leads to my database as I want to extract data from it and show it in the list view. after which, I have to edit the manifest inserting the provider </p><pre><code>&lt;provider android:name=""databases789""    android:grantUriPermissions=""true""    android:enabled=""true""    android:syncable=""true""     android:authorities=""one.two.databases"" &gt;&lt;/provider&gt; </code></pre><ol><li>Have my URI been parsed correctly? </li><li>If I extend my class to Content Provider, my database file will be kinda screwed up, is there an easier way? </li></ol><p>however, it shows the error of not having the one.two.databases to exist.</p>","372750","","657487","","2013-05-10 09:11:53","2013-05-10 09:11:53","content provider","<android><listview><android-contentprovider>","1","0","","",""
"3154858","1","3154882","","2010-07-01 03:10:32","0","1649","<p>I have a series of 3 activities, and the 3rd activity binds (I'm using AIDL) to a Service. What I notice is, if I am on the 3rd activity and start the service, on clicking the back button (moving from 3rd activity to 2nd activity), the Service onDestroy() gets called, and the Service is stopped. </p><p>How can I ensure that the service runs even if the Activity is closed?</p><p>This is how I bind to the service in the 3rd activity's onCreate method:</p><p>this.bindService(new Intent(this,MyService.class), mConnection, Context.BIND_AUTO_CREATE);</p><p>ThanksChris</p>","321927","","","","","2010-07-01 03:18:13","Android Activity bind to Service","<android><service><activity><bind>","1","0","1","",""
"3154899","1","3155046","","2010-07-01 03:26:00","8","5487","<p>Is there any <em>fundamental</em> difference in binding a service to an <code>android.app.Activity</code> vs binding it to an <code>android.app.Application</code>. I want to <a href=""http://developer.android.com/resources/faq/framework.html""><em>bind</em> the service to an <code>Application</code> because I want to keep some global state/data in the Application instead of duplicating it in all my activities</a>. </p><p>Thanks.</p>","306346","","1288","","2013-07-06 14:01:37","2014-02-27 12:43:20","Binding a Service to an android.app.Activity vs Binding it to an android.app.Application","<android><binding><activity><android-service><android-application>","2","0","3","",""
"3154902","1","3154922","","2010-07-01 03:26:33","0","190","<p>I have written an Android application that I am about to release, but I would like to have a 2.1 version with multitouch and a lower API version without. However, if I simply just use the minSDK setting, the 1.6+ version would show up in the market with the 2.1 version on 2.1 phones. </p><p>Is there any way to release for a specific range of OS versions?</p><p>Thanks.</p>","118241","","","","","2010-07-01 04:21:07","What is the easiest way to release an Android application for multiple OS versions?","<android><google-play>","3","0","","",""
"3154968","1","3155064","","2010-07-01 03:48:09","0","944","<p>Is there any way to share the same object of the View across various activities? For example myApp has 4 activities, and every activity shows a Logo at the top of the screen. Now each activity will initiate 4 copies of the same Logo. So is there any way to get around this?<br> And if 3 out of 4 share the same logo?</p>","195802","","","","","2013-01-20 05:13:27","How to share a view across various activities","<android><view>","2","0","1","",""
"3154970","1","3180901","","2010-07-01 03:49:12","1","4447","<p>I thought it would be quite easy to develop a bluetooth application on Android, but it looks like the support is very bad.</p><p>While pairing works, my Nexus One with Android 2.1 can't connect to the PC. It's the same in Windows and Ubuntu. I used on my Desktop computer, in Windows, Hyperterminal and waited on an incoming bluetooth com-port.</p><p>Does anybody know a solution for this? I searched already a bit... Maybe this<a href=""http://code.google.com/p/backport-android-bluetooth/"" rel=""nofollow"">http://code.google.com/p/backport-android-bluetooth/</a>or this library<a href=""http://code.google.com/p/bluecove/"" rel=""nofollow"">http://code.google.com/p/bluecove/</a></p><p>...could be a solution, but I don't know it yet. Maybe someone else has it running on Android 2.1 already?</p><p>Thanks for some hints :)</p>","331556","","","","","2010-07-05 16:15:16","Android 2.1/2.2 Bluetooth serial connection with a desktop computer","<android><bluetooth>","2","0","4","",""
"3155165","1","3155196","","2010-07-01 04:51:59","3","1148","<p>Build.VERSION.SDK_INT was added only in API level 4 (1.6). Is it possible to determine if phone has API level 3 (1.5) ?</p>","281887","","","","","2012-04-20 20:41:44","determine API level for platforms < 1.6","<android>","4","0","1","",""
"3155179","1","3155476","","2010-07-01 04:56:48","0","10070","<p>i am developing one application in which there is an imageview...in which i want to move left or right using mouse touch...</p><p>for that i found ""android.view.MotionEvent"" but in MotionEvent there are few events among that </p><ol><li>ACTION_CANCEL     2. ACTION_DOWN  3. ACTION_UP ......etc.</li></ol><p>hence there is no such event for ""LEFT"" and ""RIGHT"" action....</p><p>so is there any other way to implement the ""LEFT"" and ""RIGHT"" move ??</p>","379693","","","","","2010-07-01 09:39:40","Android MotionEvent - Cant find Left and Right Motion Event","<android>","1","0","1","",""
"3155405","1","4022410","","2010-07-01 06:00:01","4","1941","<p>As I've heard from <a href=""http://code.google.com/events/io/2010/sessions/jit-compiler-androids-dalvik-vm.html"" rel=""nofollow"">Google IO 2010 session</a>, Dalvik JIT compiler just support ARM processor.Do this mean my own build of Android source on Linux X86 or Mac OS X can not support JIT compiler?</p><p>Should I use some target board with ARM processor to test Dalvik JIT compiler?</p><p>Thanks!</p>","212862","","","","","2010-10-26 09:40:36","Dalvik JIT compiler on Linux X86 or Mac build","<android><arm><jit><dalvik>","2","0","","",""
"3155410","1","","","2010-07-01 06:01:47","0","729","<p>I'm dealing with a problem you guys might not have faced earlier.</p><p>I'm having a use-case in my Android application where the actual screen that i want to show to user is not stored in any layout file of my application. The layout of the of the screen is designed by server in this case, based on selection made by user on first screen. </p><p>Let me elaborate here,1st Screen : List of check box with different biller names.  (Imagine i've selected 2 billers from this screen)</p><p>2nd Screen :  (The screen that server has decided how it should look like) * Header,* 1st Biller name (Label)* Amount for 1st Biller TextBox* Image (a Separator image)* 2st Biller name (Label)* Amount for 2st Biller TextBox.* Here there can be a checbox/radio/another TextBox anything.* Image (a Separator image)* Button (to submit above form back to server)</p><p>I hope makes some sense in what i'm planning to design.</p><hr><p>The current issues i'm dealing with are as below.1). How to draw this dynamic widgets?2). How to fetch user Inputs from this dynamically created widgets?</p><p>Thanks in advance.RegardsAbhishek</p>","376148","","","","","2010-07-01 06:10:52","Dynamic widget (screen) creation","<android><android-widget><android-manifest>","1","0","1","",""
"3155432","1","3155526","","2010-07-01 06:08:33","0","1426","<p>I'm new to android. I've created a database for users. The thing is i do not know how to apply on android Java file to execute the function for user to login. </p>","380770","","","","","2010-07-01 06:55:41","Login page. How to match username and password from database to allow user to login?","<android>","1","0","","",""
"3155648","1","3155735","","2010-07-01 06:56:53","0","4429","<p>I managed to create the logic for the function but I have no idea how to match it with the database. I only know how to do it the hardcoding way.</p><p>Below is how I did it. Can anyone help me with the 'guest' part which I believe an sql statement should be inserted there am I right? And I know I missed out something. Before I match the username and password, I should check whether the user exist in the database first, and then check whether the password match with the username.</p><p>So in conclusion I need help on the 'if else' statement.</p><pre><code>package one.two;import android.app.Activity;import android.content.Intent;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.GridView;import android.widget.ListView;import android.widget.TextView;public class Login extends Activity implements OnClickListener{/** Called when the activity is first created. */    private EditText etUsername;    private EditText etPassword;    private Button btnLogin;    //private Button btnRegister;    private TextView lblResult;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);     // Get the EditText and Button References        etUsername = (EditText)findViewById(R.id.usernametxt);        etPassword = (EditText)findViewById(R.id.passwordtxt);        btnLogin = (Button)findViewById(R.id.btnLogin);        //btnRegister = (Button)findViewById(R.id.btnRegister);        lblResult = (TextView)findViewById(R.id.msglbl);        Button btnArrival = (Button) findViewById(R.id.btnRegister);        btnArrival.setOnClickListener(this);    // Set Click Listener    btnLogin.setOnClickListener(new OnClickListener() {    @Override    public void onClick(View v) {        // Check Login        String username = etUsername.getText().toString();        String password = etPassword.getText().toString();        if(username.equals(""guest"") &amp;&amp; password.equals(""guest"")){            lblResult.setText(""Login successful."");        } else {            lblResult.setText(""Login failed. Username and/or password doesn't match."");        }    }});    }    public void onClick(View v)    {            Intent intent = new Intent(this, DatabaseActivity.class);            startActivity(intent);}}</code></pre>","380770","","","","","2010-07-01 07:14:25","RE: Login page. How to match username and password from database to allow user to login?","<android>","1","0","","",""
"3155920","1","3156233","","2010-07-01 07:46:30","0","858","<p>I want to start a service that has parameters</p><pre><code>public BackgroundHelperService(String name)</code></pre><p>How can I do this using </p><pre><code>Intent service = new Intent(cnx, BackgroundHelperService.class);</code></pre><p>I cannot pass the name param.</p>","248521","","","","","2010-07-01 08:45:44","Starting an Android service with parameters","<android>","1","0","","",""
"3156063","1","3156425","","2010-07-01 08:19:25","0","558","<p>scrollable meaning by the user touch he can can go up and down in the layout given </p><p>this is what i did and the emulator throw an exception null pointer somthing and i have problems figuring out from where it comes ....</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;ScrollView&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:stretchColumns=""1""&gt;&lt;LinearLayout android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt; &lt;TextView  android:text=""Country City Game(aka CCG) is an acdemic work of MTA students enjoy the game""  android:textSize=""24.5sp"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;/TextView&gt; &lt;/LinearLayout&gt;&lt;/TableLayout&gt;&lt;/ScrollView&gt;</code></pre><p>this one doesnt work but when i drop </p><pre><code>   &lt;ScrollView&gt; &lt;/ScrollView&gt; </code></pre><p>it works can some one explain to me what's wrong ?  </p>","368440","","368440","","2010-07-01 10:54:49","2010-07-01 11:04:13","it may sound like a trivial question but who i make my layout scrollable","<android>","3","2","","",""
"3156389","1","3177154","","2010-07-01 09:07:14","13","6082","<p>So I've written a Service and an Activity for the Android OS.</p><p>My service is running in it's own process, so all the communication between my Activities and the Service happens via IPC. I use the standard Android .aidl mechanism for this. </p><p>So far everything works fine. However, the AIDL generates all method stubs using ""throws RemoteException"" so I have to handle them. </p><p>I did a quick grep on the entire Android source-code and only found three cases where this exception is ever thrown. These are in a different service that I don't connect with.</p><p>I checked the C-sources as well because in theory RemoteExceptions can be generated using the JNI interface.. Nothing turned up.</p><p>I have the impression that everyone just handles them like this:</p><pre><code>  try {    mService.someMethodCall (someArguments);  } catch (RemoteException e) {    e.printStackTrace();  }</code></pre><p>This is not solid code, and I don't want something like this in my code-base. </p><p>Besides that: I tried to throw a RemoteException via IPC myself and all I got was a stack-trace and a system log message that tells me that exceptions aren't supported yet. My application never saw the exception and the services that threw the exception ended up in a very strange state (halfway working) :-(</p><p>The questions are:</p><ul><li><p>Do these exceptions ever get thrown? </p></li><li><p>Has anyone ever seen such a try-catch block catching a RemoteException?</p></li><li><p>Could it be that they don't exist and that we are just forced to deal with them because the ""throws RemoteException"" is dead code or a left-over inside the AIDL compiler?</p></li></ul><p>Disclamer: I haven't read the entire source-code. I used Grep to find the occurrences of RemoteException, so I may have missed some due to different whitespace usage.  </p>","15955","","","","","2012-05-23 16:27:57","Android RemoteExceptions and Services","<android><service><aidl><remoteexception>","2","0","1","",""
"3156399","1","3157293","","2010-07-01 09:09:22","0","208","<p>in my xml file,<br>i have same tag name used at different place (layer1 and layer2),<br>how can i differenciate tags named ""<code>&lt;tile gid =""int""&gt;</code>"" from layer1 and layer2 ?<br>i need to process them differently depending if they belong to layer1 or layer2...<br>here's a small sample of my parser and my xml file:  </p><pre><code>// =================// xml parser sample// =================XmlResourceParser xrp = (XmlResourceParser) ctx.getResources().getXml(R.xml.castle);  while (xrp.getEventType() != XmlResourceParser.END_DOCUMENT)   {    if (xrp.getEventType() == XmlResourceParser.START_TAG)     {      String s = xrp.getName();      if (s.equals(""tile""))       {        int a = xrp.getAttributeIntValue(null, ""gid"", 0);        // process a      }    }  }// ===============// xml file sample:// ===============&lt;layer name=""layer1""&gt;  &lt;data&gt;    &lt;tile gid=""1""/&gt;    &lt;tile gid=""2""/&gt;    ...  &lt;/data&gt;&lt;/layer&gt;&lt;layer name=""layer2""&gt;  &lt;data&gt;    &lt;tile gid=""1""/&gt;    &lt;tile gid=""2""/&gt;    ...  &lt;/data&gt;&lt;/layer&gt;</code></pre>","377783","","","","","2010-07-01 11:27:54","how to differentiate xml tags that belong to layer1 and those that belong layer2 if they use the same tag name?","<android><xml><parsing>","2","0","","",""
"3156407","1","","","2010-07-01 09:10:26","0","535","<p>I am developing a context aware mobile application. I  need to have information about the capabilities of terminal devices and network characteristics such as current bandwidth. My question is, are there APIs in android to access this information?</p><p>Thanks.</p>","380910","","126916","","2010-07-01 09:18:17","2010-07-01 11:56:09","Getting device characteristics and network information","<java><android><mobile-application>","1","1","","",""
"3156414","1","3157743","","2010-07-01 09:11:01","0","347","<p>i am currently using gdata vesion 1.41.3 and android api level 3.i am trying to use the Calendar feature of gdata. my source code is]</p><pre><code>try {   CalendarService myService = new CalendarService(     ""exampleCo-exampleApp-1"");   myService.setUserCredentials(""xxx@gmail.com"", ""xxx"");   // Send the request and print the response   URL feedUrl = new URL(     ""http://www.google.com/calendar/feeds/default/allcalendars/full"");   CalendarFeed resultFeed = myService.getFeed(feedUrl,     CalendarFeed.class);   System.out.println(""Your calendars:"");   System.out.println();   for (int i = 0; i &lt; resultFeed.getEntries().size(); i++) {    CalendarEntry entry = resultFeed.getEntries().get(i);    System.out.println(""\t"" + entry.getTitle().getPlainText());   }  } catch (Exception e) {   Log.e("""", e.toString());  }</code></pre><p>the code throwing following Exception:</p><pre><code>com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory$SecureSAXParserFactory</code></pre><p>need help ???</p>","309990","","","","","2011-03-08 07:22:14","SecureSAXParserFactory error in the gdata calendar sample code","<android><calendar><gdata-api>","2","2","","",""
"3156454","1","3156880","","2010-07-01 09:17:50","0","262","<p>My application requires resource and drains a battery when it is working. So, I want to know the way that user is not available on the phone.</p><p>Is there a way to use the built in power save mode on the blackberry to where if the screen dims to suspend the application works active and when the user wakes the device back up with a keypress or trackball movement to resume the application works active?  </p><p>Thanks in advance.</p>","164589","","","","","2010-07-01 10:21:02","How to detect backlight is on?","<android>","1","1","","",""
"3156458","1","","","2010-07-01 09:18:02","2","430","<p>How do you calculate the direction that your camera is pointing towards in Android? Azimuth works only if the device is vertical. How do you account for the pitch and roll? </p><p>If R is the rotation matrix, I want to find something like:</p><pre><code>getRotationMatrix(R, I, grav, mag);float[] rotated = R {0, 0, -1} ; //not sure how to do matrix multiplication float direction = Math.atan(rotated[0]/rotated[1]);</code></pre>","380907","","","","","2010-10-08 09:35:58","How to calculate the direction the screen is facing","<android><3d>","1","0","","",""
"3156479","1","3156845","","2010-07-01 09:20:48","1","992","<p>Is there any way to notify ListAdapter? Because i need to load Tab content data when user click in that Tab.</p><p>Thanks<br>Chandana</p>","377438","","","","","2010-07-01 10:16:16","How to notify ListAdapter","<android>","1","2","","",""
"3156538","1","3156606","","2010-07-01 09:29:57","1","579","<p>I m building an android application where I need these packages to import:</p><pre><code>import com.sun.cnpi.rss.elements.Item;import com.sun.cnpi.rss.elements.Rss;import com.sun.cnpi.rss.parser.RssParser;import com.sun.cnpi.rss.parser.RssParserException;import com.sun.cnpi.rss.parser.RssParserFactory;</code></pre><p>What should I do? From where can I find these packages?</p>","172543","","","","","2010-07-01 09:42:43","from where can i get com.sun.cnpi package?","<java><android><packages>","1","0","","",""
"3156701","1","3157025","","2010-07-01 09:55:05","1","4734","<p>hi i have an image which is taken from andorid by calling image _capture how do i upload it to a  windows server?</p><pre><code>        Intent intent = new Intent(""android.media.action.IMAGE_CAPTURE"");             startActivityForResult(intent, 0);      public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_CANCELED) { Toast toast = Toast.makeText(this,""camera cancelled"", 10000); toast.show(); return; }// lets check if we are really dealing with a picture if (requestCode == 0 &amp;&amp; resultCode == RESULT_OK) {     Bundle extras = data.getExtras();        Bitmap b = (Bitmap) extras.get(""data"");        //setContentView(R.layout.main);        ImageView mImg;        mImg = (ImageView) findViewById(R.id.head);        mImg.setImageBitmap(b);   // save image to gallery     String timestamp = Long.toString(System.currentTimeMillis());     MediaStore.Images.Media.insertImage(getContentResolver(), b, timestamp, timestamp); }</code></pre>","164850","","1220","","2012-04-18 15:42:04","2012-04-18 15:42:04","how to upload the image taken by calling camera activity from android phone?","<android>","2","2","1","",""
"3156781","1","3156813","","2010-07-01 10:05:45","18","11728","<p>By default android checkbox showstext at right side and checkbox at left<br>I want to show checkbox at right side with text at left  </p><p>how do I achieve this?</p>","249991","","650492","","2012-12-19 14:09:43","2014-02-26 09:58:48","How to show android checkbox at right side?","<android><layout><checkbox>","2","0","2","",""
"3156864","1","3384340","","2010-07-01 10:18:56","1","2338","<p>I have written an android app which listens to the phone signal strength using PhoneStateListener.SignalStrengthChanged(int asu). The app works perfectly with Android 1.6 and lower, but not with higher versions since onSignalStrengthChanged(int asu) has been deprecated and replaced with onSignalStrengthsChanged(SignalStrength signalStrength).</p><p>To make the app compatible with Android 2.0 and above, I have upgraded the app to use the 2.1 API and overridden PhoneStateListener.onSignalStrengthsChanged(SignalStrength signalStrength). I'm testing on a EVO with Android 2.1. The phone type (TelephonyManager.getPhoneType) is CDMA and TelephonyManager.getNetworkType returns ""EVDO_A"". On this setup, onSignalStrengthsChanged(SignalStrength signalStrength) is never called, but SignalStrengthChanged(int asu) is, but this always returns a signal strength of -1 asu because its been depecated. I need to get the onSignalStrengthsChanged(SignalStrength signalStrength) to work.... does anyone know what I'm doing wrong?</p><p>Here's the code:</p><pre><code>mSignalListener = new PhoneStateListener(){  @Override    public void onSignalStrengthChanged(int asu){      Log.d(Utils.LOGTAG, ""#1. "" + String.valueOf(asu));      if (mStrength != asu){        mStrength = asu;        NotifyUI();      }      super.onSignalStrengthChanged(asu);    }  @Override  public void onSignalStrengthsChanged(SignalStrength signalStrength) {    Log.d(Utils.LOGTAG, ""#2."");    if (signalStrength.isGsm())      mStrength = signalStrength.getGsmSignalStrength();    else{      int strength = -1;      if (signalStrength.getEvdoDbm() &lt; 0)        strength = signalStrength.getEvdoDbm();      else if (signalStrength.getCdmaDbm() &lt; 0)        strength = signalStrength.getCdmaDbm();      if (strength &lt; 0){        // convert to asu        mStrength = Math.round((strength + 113f) / 2f);      }      NotifyUI();    }                   super.onSignalStrengthsChanged(signalStrength);  }};mTelManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);mTelManager.listen(mSignalListener, PhoneStateListener.LISTEN_SIGNAL_STRENGTH);</code></pre>","220864","","","","","2010-08-02 00:48:26","Problem with PhoneStateListener.onSignalStrengthsChanged","<android>","1","0","2","",""
"3156940","1","3157236","","2010-07-01 10:29:23","1","1650","<p>I start develop application on Android!I need to show common control on the top of few screens.In Blackberry I just inherit my screens from base screen with needed controls and it inherit UI and behaviour from base type.</p><p>How can i do similar thing in Android? I mean, how can i organize it?Maybe, i need to create control or layout, which i can use on my screens?Or i need inherit one activity from another and use addContentView()?</p><p>What opportunities are there and what advantages / disadvantages of each?</p>","243232","","","","","2010-07-01 11:18:56","Activity layout inheritance","<android><inheritance><activity><visual-inheritance>","1","0","","",""
"3156975","1","3158505","","2010-07-01 10:35:11","2","7920","<p>I'm exploring to scan ssid and rssi from android and I'm able to do it, but now i have want send the data to the server, so i explore i found below code </p><pre><code>    HttpClient httpclient = new DefaultHttpClient();    HttpPost httppost = new HttpPost(""http://101.34.45.45/rawData"");    try {        List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(3);        nameValuePairs.add(new BasicNameValuePair(""userId"", ""00-22-68-E8-EC-F1""));        nameValuePairs.add(new BasicNameValuePair(""timestamp"", ""2010-07-01 11:11:11""));        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));        HttpResponse response = httpclient.execute(httppost);        textView.setText(response.toString());    } catch (ClientProtocolException e) {    } catch (IOException e) {    }</code></pre><p>but now i'm having problem when add multi wifi data, the format should as below</p><p><a href=""http://101.34.45.45/rawData?data="" rel=""nofollow"">http://101.34.45.45/rawData?data=</a>{""userId"":""guest1"",""timestamp"":""2010-07-01 08:58:23"",""wifi"":[{""ssid"":""guest"",""rssi"":""40""},{""ssid"":""guest1"",""rssi"":""80""}]}, </p><p>so how can done for the wifi parameter, can anyone help, I'm still trying for few varieties,</p><p>thanks </p>","142636","","","","","2010-07-02 04:58:34","how to send data from android to server","<android><http><httpclient><http-post>","1","0","2","",""
"3157056","1","3157110","","2010-07-01 10:48:13","0","3786","<p>Currently I have a list view within it each row has a checkbox attached. I would like that once any checkbox is checked, at the bottom of the screen a view displays, and once none of the checkboxes are checked, the view automatically disappeared.  Possible to do this?</p><p>Any help or direction is appreciated.Thank you.</p>","352812","","","","","2010-08-26 05:29:19","Android how to show another view on top of the existing ListView after checkbox is checked","<android>","2","0","1","",""
"3157123","1","3157168","","2010-07-01 11:01:28","2","2716","<p>I'm planning to develop and app that presents the users with several different screens (of different information).Was wondering what would be the best way to implement this?</p><p>Is it better to have separate XML layouts and an activity to display and allow the user to interact with each screen of data?</p><p>OR would handling all of these in the same activity be more efficient (and dynamically load / unload each layout)?</p>","365681","","","","","2010-07-01 12:53:49","Should app's with multiple layouts have multiple activities to handle each?","<android>","2","0","","",""
"3157157","1","","","2010-07-01 11:06:54","3","10859","<p>Is there anything bad with this code? </p><p>The thing is that the ""test"" is not displayed in <code>ListView</code>.</p><p>Java:</p><pre><code>private ListView namesListView;private ArrayList&lt;String&gt; names;private ArrayAdapter&lt;String&gt; namesAA;...namesListView = (ListView)findViewById(R.id.list);names = new ArrayList&lt;String&gt;();names.clear();names.add(0, ""test"");namesAA = new ArrayAdapter&lt;String&gt; ( this, android.R.layout.simple_list_item_1, names );namesListView.setAdapter(namesAA);...</code></pre><p>XML:</p><pre><code>&lt;ListView     android:id=""@+id/list""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""/&gt;</code></pre>","331115","","119895","","2010-07-01 12:45:38","2013-09-03 08:35:35","ListView and ArrayAdapter<String>","<android><arrays>","4","3","0","",""
"3157406","1","3157863","","2010-07-01 11:47:27","6","3299","<p>I have one problem using <code>ActivityGroup</code>. I have two activities inside an <code>ActivityGroup</code> and both of them use a menu (overriding the onCreateOptionMenu and onOptionsItemSelected).</p><p>Well, the problem is that the second activity in the group doesn't show the menu when I press the menu Key. The first activity works fine showing the menu.</p><p>Any idea about this issue?</p><p>I have this code in child activity:</p><pre><code>    @Overridepublic boolean onCreateOptionsMenu(Menu menu) {    boolean result = super.onCreateOptionsMenu(menu);    menu.add(0, MENU_REFRESH, 0, R.string.menu_refresh).setIcon(R.drawable.ic_menu_refresh);    return result;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case MENU_REFRESH:        Log.d(TAG,""REFRESH"");        refresh();        return true;    }    return super.onOptionsItemSelected(item);}</code></pre>","258863","","258863","","2010-07-01 16:40:28","2012-12-28 09:46:05","Android ActivityGroup Menu Problem","<android><menu><activity>","5","2","5","",""
"3157492","1","3157633","","2010-07-01 11:57:28","0","310","<p>I'm having a go at developing my first android application and have never really used databases before. Anyways I need to populate and update a database based on XML files retrieved from the web on a regular basis (say once a day). </p><p>Just thinking about it iv already run into some problems...Basically I need to display information about artists and events ordered by date. For this I plan on backing the view by the sqlite database which already has each row sorted by date. So the columns would be ""date"", ""artist"", ""venue"", etc. and I'm thinking I would need a ""row ID"" column as well as a primary key?</p><p>Now the idea I have is to do an insertion sort so that whenever I'm inserting an entry into the database it will be in order and seem fairly simple to implement. I'm basing my DB Helper class from the notepad example here <a href=""http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html</a> (NotesDbAdapter). But the way they insert new items is by using ContentValues and it just gets inserted as the next item in the database. How would I insert items somewhere in the middle so that it is in order by date? Or is it better to have the database unordered and just order it outside the database when needed?</p><p>Also basically I want to download the XML file from say last.fm once a day and then put any new entry into the database...what is the best way to do this? Would rebuilding the database be the way to go?</p><p>Thanks</p>","362476","","362476","","2010-07-01 12:05:11","2010-07-01 12:17:07","Having ordered SQlite database (based in XML feed)","<java><android><xml><database><sqlite>","1","0","","",""
"3157522","1","3157737","","2010-07-01 12:01:32","6","17023","<p>I have a custom title bar</p><pre><code> requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.activities); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);</code></pre><p>Which works basically fine. The problem is that until the above code is called the default title bar is shown. I don't want a title bar there at all, in other words before mine shows up no title shall show up.</p><p>Adding this to the manifest:</p><pre><code>&lt;application android:theme=""@android:style/Theme.NoTitleBar""&gt;</code></pre><p>leads to a force close. My manifest looks like this</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""    android:theme=""@style/My_Theme""&gt;</code></pre><p>Where I need my_Theme since it sets the background color, setting the background color in my customer theme leads to a gray area around my colored backround. So even without the force close I am not sure if the no title will help.</p><p>Any idea?</p><p>Thanks.</p>","363436","","","","","2013-11-27 12:47:43","Android: Custom Title Bar","<android><layout><titlebar>","4","0","7","",""
"3157596","1","3157703","","2010-07-01 12:12:35","1","2328","<p>I was wondering is it possible to create multiple instances of a single Activity in Android?</p><p>I currently start my own inCall screen for a Voip Test by using the following code:</p><hr><pre><code>     public void initInCallScreen(String pName, String phoneNumber, int contactID, boolean         callDirection, int lineID){    //starts in callScreen dialog    final Intent myIntent = new Intent(context, CallDialogActivity.class);    myIntent.putExtra(""NAME"", pName);    myIntent.putExtra(""NUMBER"", phoneNumber);    myIntent.putExtra(""ID"", contactID);    myIntent.putExtra(""CALLTYPE"", callDirection); //True = Incoming, False = Outgoing    myIntent.putExtra(""LINEID"", lineID);    myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    context.startActivity(myIntent);</code></pre><hr><p>This allows me to start the Activity fine.</p><p>However when I call it for a second it just returns to the Activity already created rather than creating a new Activity and placing it on the stack.</p><p>I would like to be able to create the activity multiple times so that I have two or 3 Activities on the stack and the user can switch between them, using Home, Back buttons etc...</p><p>Is this possible and if so what am I doing wrong?</p>","243999","","243999","","2010-07-01 13:08:53","2013-05-16 02:16:23","Android - How to create Multiple instances of an Activity?","<android><activity><multiple-instances>","2","3","","",""
"3157773","1","3173894","","2010-07-01 12:32:56","0","82","<p>I would like to know if there is anyway if collecting information of applications which installed on the phone?(thigns like: activities names, permissions the app using, services, etc...)</p><p>I tried to look little bit at packageManager and packageInfo.. but when i tried to use those methods i mostly got NULL.</p><p>anything you ppl know about?</p><p>Thanks,</p><p>ray.</p>","260511","","","","","2010-07-04 06:05:25","Retrieving external applications information","<android>","1","1","","",""
"3158144","1","3158977","","2010-07-01 13:19:00","1","987","<p>Here is my code for my db class:</p><pre><code>package one.two;import java.util.List;import android.app.ListActivity;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteDatabase.CursorFactory;import java.util.ArrayList;public class DBAdapter extends ListActivity{    public String status = ""status"";    public String id = ""id"";    public String arrival = ""arrival"";    public String destination = ""destination"";    public String ferry = ""ferry"";    private static String DB_PATH = ""/data/data/one.two/databases/"";    private static final String DATABASE_NAME = ""ferry.db"";    private static final String DATABASE_TABLE = ""port"";    public static Context context;    public Cursor c;    public static SQLiteDatabase DbLib;    //overloaded non-null constructor    public DBAdapter(Context context)    {        DbLib = context.openOrCreateDatabase(DATABASE_NAME,  SQLiteDatabase.CREATE_IF_NECESSARY,null);        System.out.println(""OpenOrCreateDB Done"");    }    public class DatabaseHelper extends SQLiteOpenHelper    {        Context context;        DatabaseHelper(Context context)        {            super(context, DATABASE_NAME, null, DATABASE_VERSION);            this.context = context;        }//end constructor DatabaseHelper        // ---closes the database---        public void close()        {            DBHelper.close();        }//end close()        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion,                int newVersion)        {        }//end onUpgrade()        @Override        public void onCreate(SQLiteDatabase db)        {        }//end onCreate()    }// end class DatabaseHelper    private static DatabaseHelper DBHelper;    private static final int DATABASE_VERSION = 1;        public static ArrayList&lt;String&gt; getAllTitles()        {            ArrayList&lt;String&gt; port = new ArrayList&lt;String&gt;();                Cursor c=null;                c = DbLib.query(""port"",                        new String[] { ""status"", ""id"", ""arrival"",                                ""destination"", ""ferry"" }, null, null,                        null, null, null);                try {                    if (c!=null) { // start - when there is at least 1 record                        System.out.println(""Cursor is NOT NULL"");                        int i =0;                        for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext())                         {                                    // Debug Stm                            System.out.println(""Record No. ""+i);                            System.out.println(c.getString(0));                            System.out.println(c.getString(1));                            System.out.println(c.getString(2));                            System.out.println(c.getString(3));                            System.out.println(c.getString(4));                            // Assign database cursor.records to arraylist                            port.add(i,c.getString(0));                            port.add(i,c.getString(1));                            port.add(i,c.getString(2));                            port.add(i,c.getString(3));                            port.add(i,c.getString(4));                            i = i + 1;                        }                    } // end - where there is at least 1 record                } finally {                    if (c!=null) {                    c.close();                }                }               return port;        }//end getAllTitles()        public void open() {            //Open the database            String myPath = DB_PATH + DATABASE_NAME;            DbLib = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);        }    }//end class DBAdapter</code></pre><p>My Arrival class</p><pre><code>package one.two;import java.io.IOException;import java.util.ArrayList;import java.util.List;import android.app.ListActivity;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class Arrival extends ListActivity{    private ListView listView;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        ArrayList&lt;String&gt; retList = new ArrayList&lt;String&gt;();        System.out.println(""Start onCreate Function\n"");        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        System.out.println(""In onCreate Function\n"");        System.out.println(""In of GetData\n"");        DBAdapter db = new DBAdapter(this);         System.out.println(""DB Open\n"");        db.open();        System.out.println(""DB Opened\n"");        retList = getData();        System.out.println(""Out of GetData\n"");        // force count no. of records in table        // dump to check index        int cnt = 2;        int i=0;        for (i = 0; i&lt;cnt; i++)            System.out.println(retList.toString());        listView = (ListView) findViewById(android.R.id.list);        SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this, android.R.id.list, null, null, null);        this.setListAdapter(mAdapter);        // db.close();    }    @SuppressWarnings(""static-access"")    public static ArrayList&lt;String&gt; getData()     {        ArrayList&lt;String&gt; items = DBAdapter.getAllTitles();        // titles ???? redundant        //ArrayList&lt;String&gt; titles = new ArrayList&lt;String&gt;(items);        System.out.println(""Return a LIST titles\n"");         return items;        }    }</code></pre><p>Thank you</p>","358218","","","","","2010-07-01 15:01:49","How do i import my Cursor from my database class into my current class?","<android><database><eclipse><cursor>","1","0","","",""
"3158236","1","3158295","","2010-07-01 13:30:17","0","1199","<p>I am developing an Android application, I was doing just fine then I made some changes to the code.Everything went fine, no error messages, until I ran the code. Then I get this in a popup dialog: </p><blockquote>  <p>Your project contains error(s), please fix them before running your application</p></blockquote><p>The title of the popup dialog is <code>Android Launch</code>. I know this isn't much to go on, but this is all I am getting. I get nothing in the console at the bottom of Eclipse either. </p><p>The dialog message has no Details button. =/</p>","313721","","1195594","","2013-01-01 12:33:05","2013-01-01 12:33:05","Android Launch - Inexplicable error","<android>","3","1","","",""
"3158255","1","3158368","","2010-07-01 13:31:56","1","520","<p>I am working on Anroid (with Eclipse and SDK) trying to stream video into a VideoView.  Sometimes the video works, but other times I get an error that the video cannot be displayed.  Here is the code:</p><pre><code>//video    private Uri mPath;private VideoView mVid;    mPath = Uri.parse(""android.resource://com.accuweather.wordweather/"" + R.raw.b2);    mVid.setVideoURI(mPath);    mVid.requestFocus();    mVid.start();</code></pre><p>And another class that loads different videos when a user scrolls the screen.</p><pre><code>public void onScrollViewSnap(int page) {    //change video    Log.d(DEB_TAG, ""In 'onPageCountChange: '."" + page);    //video    if(page != mOnPage){        if(page == 0){            mPath = Uri.parse(""http://www.ted.com/talks/download/video/8584/talk/761"");            //mPath = Uri.parse(""android.resource://com.accuweather.wordweather/"" + R.raw.w2);        }else if(page == 1){            mPath = Uri.parse(""android.resource://com.accuweather.wordweather/"" + R.raw.b1);        }else if(page == 2){            mPath = Uri.parse(""http://commonsware.com/misc/test2.3gp"");            //mPath = Uri.parse(""android.resource://com.accuweather.wordweather/"" + R.raw.test2);        }        if(mVid.isPlaying() == true){            mVid.stopPlayback();        }        mVid.setVideoURI(mPath);        mVid.requestFocus();        mVid.start();        Log.d(DEB_TAG, ""THIS IS THE HEIGHT: "" + mVid.getMeasuredHeight());        Log.d(DEB_TAG, ""THIS IS THE WIDTH: "" + mVid.getMeasuredWidth());    }    ImageView temp = null;    switch(page){    case 0:        temp = (ImageView) findViewById(R.id.scroll_page_1);        mOnPage = 0;        break;    case 1:        temp = (ImageView) findViewById(R.id.scroll_page_2);        mOnPage = 1;        break;    case 2:        temp = (ImageView) findViewById(R.id.scroll_page_3);        mOnPage = 2;        break;    }    // Change pagination image    mPageSelected.setImageResource(R.drawable.scrollview_page_off);    temp.setImageResource(R.drawable.scrollview_page_on);    mPageSelected = temp;}</code></pre><p><strong>First, does loading my video this way ensure that it will be displayed alike on each different device?<br>Second, any idea why a video will start to play and then kick an error of video not able to play?Here is what I get in LogCat when video starts but locks up.</strong></p><pre><code>07-01 13:27:05.594: WARN/PlayerDriver(30): Using generic video MIO07-01 13:27:22.324: WARN/PlayerDriver(30): Video track fell behind07-01 13:27:22.324: ERROR/MediaPlayer(409): error (1, 48)07-01 13:27:22.324: ERROR/MediaPlayer(409): Error (1,48)07-01 13:27:22.324: DEBUG/VideoView(409): Error: 1,48</code></pre>","2186261","","","","","2010-07-01 13:47:37","Video not displaying properly","<android><video>","1","0","","",""
"3158466","1","","","2010-07-01 13:56:42","0","635","<p>The best way to ask this question is to provide an example, so here it is:</p><pre><code>&lt;ScrollView&gt;    &lt;LinearLayout        android:id=""@+id/main""        android:orientation=""vertical""    &gt;        &lt;TextView            android:id=""@+id/some_text""        /&gt;        &lt;LinearLayout            android:id=""@+id/stretch_me""        /&gt;        &lt;Button            android:id=""@+id/i_can_toggle""        /&gt;        &lt;TextView            android:id=""@+id/toggle_me""            android:visibility=""gone""        /&gt;        &lt;Button            android:id=""@+id/finished""        /&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>This seems fairly simple, but hold on ...</p><p>1) I would like the stretch_me layout to take all the remaining space on the screen (and I need its size so I can dynamically populate it from code)</p><p>2) I can't change main to RelativeLayout because I would like to toggle toggle_me between gone and visible using the i_can_toggle but need to keep strech_me size the same as before</p><p>3) Before changing toggle_me to visible there must be no scroll and finished button must be positioned at the bottom of the screen</p><p>Now I have tried many things and the most promising approach was this one with some coding (I was thinking about setting the stretch_me size from code), but I was not able to get the size of the view from my onCreate() method (screen_height - view_height = remaining space).</p><p>Any ideas?</p><p>Thanks!</p>","235910","","","","","2010-07-01 14:29:22","Calculating the size of a view","<android>","2","1","","",""
"3158498","1","","","2010-07-01 14:00:30","2","755","<p>I'm downloading a web page then extracting some data out of it, using regex (don't yell at me, I know a proper parser would be better, but this is a very simple machine generated page). This works fine in the emulator, and on my phone when connected by wi-fi, but not on 3G - the string returned is not the same, and I don't get a match. I can imagine it has something to do with packet size or latency, but I can't figure it out. </p><p>My code:</p><pre><code>public static String getPage(URL url) throws IOException {    final URLConnection connection = url.openConnection();    HttpGet httpRequest = null;    try {        httpRequest = new HttpGet(url.toURI());    } catch (URISyntaxException e) {        e.printStackTrace();    }    HttpClient httpclient = new DefaultHttpClient();    HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);    HttpEntity entity = response.getEntity();    BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);     InputStream stream = bufHttpEntity.getContent();    String ct = connection.getContentType();    final BufferedReader reader;    if (ct.indexOf(""charset="") != -1) {        ct = ct.substring(ct.indexOf(""charset="") + 8);        reader = new BufferedReader(new InputStreamReader(stream, ct));    }else {         reader = new BufferedReader(new InputStreamReader(stream));    }    final StringBuilder sb = new StringBuilder();    String line;    while ((line = reader.readLine()) != null) {        sb.append(line);    }    stream.close();    return sb.toString();}</code></pre><p>Is it my poor connection causing this, or is there a bug in there? Either way, how do I solve it?</p><hr><p><strong>Update:</strong> The file downloaded over 3G is 201 bytes smaller than the one over wi-fi. While they are obviously both downloading the correct page, the 3G one is missing a whole bunch of whitespace, and also some HTML comments that are present in the original page which I find a little strange. Does Android fetch pages differently on 3G as to reduce file size?</p>","31168","","31168","","2010-07-01 14:41:11","2012-01-04 16:41:05","Downloading a web page with Android","<java><android><networking>","3","4","","",""
"3158847","1","","","2010-07-01 14:42:25","0","709","<p>Is it possible to get a smaller CheckBox, like the one used in Settings application? I'd like to use it in my own custom Preference class, to mimic Android UI more closely...</p><p>Thank you for your time,Kipple</p>","381466","","","","","2010-07-01 17:51:03","How can I get smaller CheckBox","<android><checkbox><settings>","1","3","","",""
"3158881","1","","","2010-07-01 14:45:09","1","1483","<p>I'd like to know how to do a HTTP GET request to a server from which I know I will get redirected at least a couple of times...I'd like to get the response (body) of the ""last"" webpage. It should come up with a code in my specific example...</p><p>Or, as an alternative, I do know you can start the browser from within your Android app, is it possible to actually retrieve the body from that ?</p><p>Any help, tips, source whatever would be helpfull, cause till now I have found (and tried) like 4 methods and to me it seems there is a jungle of HttpGet, HttpClient, HttpResponse etc libraries ?</p>","162147","","","","","2010-07-01 15:57:04","Correct Redirected HTTP GET retrieval","<android><http><redirect><get>","1","3","0","",""
"3159023","1","","","2010-07-01 15:01:34","2","1494","<p>I am trying to get the transition date for daylight savings in Android.  That is the date that daylight savings start and ends for a specific timezone.</p><p>How do I do that?</p>","18132","","","","","2010-10-17 01:15:28","How do I get the date of the start and end of daylight savings?","<android>","2","0","1","",""
"3159080","1","3159119","","2010-07-01 15:06:36","0","178","<p>I m new to android application development. I made a project on getting feeds of sites. I displayed the title and description of feeds in textview which is not looking very presentable. Is there any alternate to it? I just need my application to look a bit presentable. </p>","172543","","","","","2010-07-02 07:34:51","Is there any alternate to TextView?","<java><android>","2","0","","",""
"3159081","1","","","2010-07-01 15:06:57","0","1416","<p>I don't really know anything about this, but I'm learning how to write Android apps.  I'm working through the <a href=""http://developer.android.com/resources/tutorials/hello-world.html"" rel=""nofollow"">Hello, World | Android Developer Tutorial</a>, and was doing fine until I tried the XML code.  I copy/pasted the code given in the tutorial into the layout file as instructed.  But when I attempted the next step (open strings.xml from res/values), I encountered problems:  java.lang.NullPointerException.  In the Console below, I can see several instances of ""SDK Manager warning: null"".  </p><p>Does anyone know how I can fix this?  Obviously, it's some problem with the SDK but I don't know what/where to check.</p><p>In the error log (several instances of this error):///////////////////////////////////////////////////////////////////////////////////////////</p><p>java.lang.NullPointerExceptionat org.eclipse.wst.xml.core.internal.document.ElementImpl.getDefaultValue(ElementImpl.java:259)at org.eclipse.wst.xml.core.internal.document.ElementImpl.getAttributeNS(ElementImpl.java:329)at com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode.getShortDescription(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.ui.tree.UiModelTreeLabelProvider.getText(Unknown Source)at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getText(WrappedViewerLabelProvider.java:108)at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:164)at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:152)at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:934)at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:102)at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1014)at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:481)at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2141)at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:829)at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:804)at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:778)at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:644)at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:749)at org.eclipse.jface.viewers.AbstractTreeViewer.internalInitializeTree(AbstractTreeViewer.java:1492)at org.eclipse.jface.viewers.TreeViewer.internalInitializeTree(TreeViewer.java:833)at org.eclipse.jface.viewers.AbstractTreeViewer$5.run(AbstractTreeViewer.java:1476)at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1422)at org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:403)at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1383)at org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(AbstractTreeViewer.java:1469)at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:274)at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1664)at com.android.ide.eclipse.adt.internal.editors.ui.tree.UiTreeBlock.createTreeViewer(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.ui.tree.UiTreeBlock.createMasterPart(Unknown Source)at org.eclipse.ui.forms.MasterDetailsBlock.createContent(MasterDetailsBlock.java:161)at org.eclipse.ui.forms.MasterDetailsBlock.createContent(MasterDetailsBlock.java:142)at com.android.ide.eclipse.adt.internal.editors.resources.ResourcesTreePage.createFormContent(Unknown Source)at org.eclipse.ui.forms.editor.FormPage$1.run(FormPage.java:152)at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)at org.eclipse.ui.forms.editor.FormPage.createPartControl(FormPage.java:150)at org.eclipse.ui.forms.editor.FormEditor.pageChange(FormEditor.java:471)at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.pageChange(Unknown Source)at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1067)at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:603)at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.selectDefaultPage(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.addPages(Unknown Source)at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2863)at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2768)at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2760)at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2711)at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2707)at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2691)at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2682)at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:365)at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:168)at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:229)at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:208)at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)at org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run(OpenAndExpand.java:49)at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:221)at org.eclipse.ui.navigator.CommonNavigatorManager$3.open(CommonNavigatorManager.java:185)at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:845)at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:843)at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1131)at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:462)at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1235)at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264)at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258)at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298)at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)at org.eclipse.equinox.launcher.Main.run(Main.java:1407)</p><p>///////////////////////////////////////////////////////////////////////////////////////////</p><p>Any help would be greatly appreciated!Thanks,Linziza</p>","381207","","","","","2010-09-12 22:44:30","Eclipse Android SDK Manager Warning: null","<xml><eclipse><android>","1","1","","",""
"3159320","1","","","2010-07-01 15:36:53","1","2561","<p>Ok, so I am about to embarrass my self here but I am working on a project that I will need to get some help on so I need to get some conventions down so I don't look too stupid. I have only been doing java for 2 months and 100% of that has been on Android. </p><p>I need some help understanding setting up variables and why I should do it a certain way.</p><p>Here is an example of my variables list for a class:</p><pre><code>    Button listen,feed;Context context = this;int totalSize = 0;int downloadedSize = 0;SeekBar seek;String[] feedContent = new String[1000];String[] feedItems = new String[1000];ListView podcast_list = null;HtmlGrabber html = new HtmlGrabber();String pkg = ""com.TwitForAndroid"";TextView progress = null;long cp = 0;long tp = 0;String source = null; String pageContent = null; String pageName = ""http://www.shanescode.com""; DataBaseHelper mdbHelper = new DataBaseHelper(this);int songdur = 0;</code></pre><p>So all of these are variables that I want to use in all through the whole class. Why would I make something a static, or a final. I understand Public but why make something private?</p><p>Thanks for your help and please don't be too harsh. I just need some clarification.</p>","282475","","","","","2010-07-02 14:07:56","Java Variables Basics","<java><android><variables>","6","2","1","",""
"3159373","1","3161451","","2010-07-01 15:43:37","0","610","<p>I am using the Android onTouchEvent to register touch and the associated movement. I then want to iterate a sprite along that path. </p><p>I need to store the path traced by the finger for use later on.</p><p>The  problem is that after the finger is lifted off the screen the ArrayList (pArray) is completely populated with the X &amp; Y position of the ACTION_UP coordinates.</p><p>From the Log i can see that it is adding the current X &amp; Y position to the Arraylist while the finger is moving which is great but then the Arraylist gets overwritten by the data in Arraylist.size() - 1...</p><p>Can someone please offer a suggestion.</p><pre><code>public boolean onTouchEvent(MotionEvent event) {  synchronized (mHeartbeat.getSurfaceHolder()) {    getXX = event.getX();    getYY = event.getY();    pathArr.setX(getXX);    pathArr.setY(getYY);    pArray.add(pathArr);    if (event.getAction() == MotionEvent.ACTION_DOWN) {    } else if(event.getAction() == MotionEvent.ACTION_MOVE) {    } else if(event.getAction() == MotionEvent.ACTION_UP) {    }    return true;   } }</code></pre>","381258","","443515","","2013-05-23 13:49:14","2013-05-23 13:49:14","Android ArrayList populated with last elements data","<android><arraylist>","1","0","","",""
"3159484","1","","","2010-07-01 15:53:55","2","656","<p>I'm developing an application that would need to persist data locally in Android devices. I'm aware that Android provides two packages for database persistence, the normal ""java.sql"" and the ""android.database.sqlite""? Which one is used more for persistence? I suppose that ""android.database.sqlite"" is the implementation of ""java.sql"", right?</p>","141639","","","","","2013-03-23 19:17:57","What is more usual to persist data when developing Android applications?","<android><database><sqlite><persistence>","1","0","","",""
"3159597","1","","","2010-07-01 16:06:58","1","299","<p>I have a service that is listening for some events.</p><p>When that event happens, it fires a screen by startActivity(intent)</p><p>When the user finishes doing something on that screen, the code calls finish()</p><p>but instead of 'closing' the complete application, is shows the main/launcher activity.</p><p>any way to go around this?</p><p>thanks</p>","332432","","","","","2010-07-01 16:10:41","Activity remains on screen after another activity is called from a service and finished on Android","<android><activity>","1","0","","",""
"3159758","1","3159798","","2010-07-01 16:31:35","7","10995","<p>Suggestions for building a treeview control in Android</p>","375867","","375867","","2010-07-05 15:30:53","2014-01-06 08:51:13","Suggestions for building a treeview control in Android","<android><listview><treeview><android-widget>","3","0","8","",""
"3159793","1","3159815","","2010-07-01 16:36:14","0","2632","<p>I am developing an android application that receives data about events from a server.</p><p>In a ListView I put the name and category of the event and a picture.My problem is: each category should have a specific picture. How do I choose which of the pictures in the drawable folder should be displayed?</p><pre><code>View v; /**I get this view from the parameters.**/ImageView iconCategory = (ImageView) v .findViewById(R.id.category_icon);Drawable drawable = null;if (o.getCategoria().equals(""category1"")) {/* here I want to set the icon to the file named icon_category1.png . I wanna do that by instantiating drawable */} else if (o.getCategoria().equals(""category2"")) {/* here I want to set the icon to the file named icon_category2.png I wanna do that by instantiating drawable */} else if (o.getCategoria().equals(""category3"")) {/* here I want to set the icon to the file named icon_category3.png I wanna do that by instantiating drawable */}iconCategory.setImageDrawable(drawable);</code></pre>","313721","","","","","2010-07-01 16:39:49","Select Drawable file path","<android><drawable>","1","0","","",""
"3159897","1","3187007","","2010-07-01 16:50:54","9","8005","<p>I'm trying to disable the highlighting of objects in a GridView in Android 2.2.</p><p>I found <a href=""http://stackoverflow.com/questions/2865683/android-disable-highlighting-in-gridview"">this other answer</a> saying that I should set the selector to a transparent ColorDrawable (<code>android:listSelector=""@android:color/transparent""</code>), but the views in my GridView are still dimmed when I select them.</p><p>I'm just using the GridView to display static objects in a grid. None of these objects will be selected. Would it be better to just use a basic view and draw my images manually?</p>","381309","","85950","","2013-11-26 23:24:45","2013-11-26 23:24:45","Disable Android GridView highlighting completely (disable selection)","<android><gridview><selector>","3","0","3","",""
"3159969","1","3160613","","2010-07-01 17:00:12","0","211","<p>I'm currently developing my first android app, and my first game.  I've been developing on a netbook with a CliqXT (HVGA).  Things are going well, it renders perfectly on the smaller screen.  I knew I'd have some issues when rendering on larger screens, but the issues I'm having are not what I was expecting and I'm kind of stuck.  </p><p>So basically the game consists of a main SurfaceView which I'm rendering the tiled game world on to.  I followed this tutorial to get started, and my structure is still pretty similar except that it calculates the boundries based on the player location:</p><pre><code>http://www.droidnova.com/create-a-scrollable-map-with-cells-part-i,654.html</code></pre><p>The game also has various buildings the player can enter.  Upon entering it launches another activity for that particular building.  The building activities are just normal Views with Android UI stuff defined in XML (Buttons, TextViews, etc).  </p><p><strong>What I expected to happen:</strong></p><p>So I expected the the building UIs to render correctly on the larger screen.  I specified all dimensions in ""dp"" and fonts in ""sp"" in hopes that they'd scale correctly.  I expected the actual game tilemap to render generally correctly, but maybe be really tiny due to the higher resolution / dpi.  I'm using a very similar function to the tutorial linked above (calculateLoopBorders(), my version is pasted below) to calculate how many tiles to render based on screen height and width (getHeight() and getWidth()).  </p><p><strong>What is actually happening:</strong></p><p>The whole game is just being rendered as if it's HVGA.  The tilemap, and the building UIs are just scaled down to the smaller screen size, leaving black borders around the left, right, and bottom (see images). </p><p>If anyone can point me in the right direction it'd be greatly appreciated, thanks a lot!</p><p>(Some of you may recognize this public domain DOS classic)</p><p><img src=""http://i.imgur.com/ikPLl.png"" alt=""alt text""></p><p><img src=""http://i.imgur.com/OTbgO.png"" alt=""alt text""></p><p>Edit: Thanks Christian for fixing code formatting.  </p><p>mCellHeight and mCellWidth are the width/height of the cells in pixels</p><p>mMapHeight and mMapWidth are the width/height of the total game world in number of tiles</p><pre><code>  public void calculateLoopBorders() {  mWidth = getWidth();  mHeight = getHeight();  mStartRow = (int) Math.max(0, mPlayer.mRow - ((int) (mHeight / 2) / mCellHeight));  mStartCol = (int) Math.max(0, mPlayer.mCol - ((int) (mWidth / 2) / mCellWidth));  mMaxRow = (int) Math.min(mMapHeight, mStartRow + (mHeight / mCellHeight)) + 1;  mMaxCol = (int) Math.min(mMapWidth, mStartCol + (mWidth / mCellWidth));  if (mMaxCol &gt;= mMapWidth) {   mStartCol = mMaxCol - (mWidth / mCellWidth);  }  if (mMaxRow &gt;= mMapHeight) {   mStartRow = mMaxRow - (mHeight / mCellHeight);   }  int x1 = mStartCol * mCellWidth;  int y1 = mStartRow * mCellHeight;  int x2 = x1 + mWidth;  int y2 = y1 + mHeight;  mBgSrcRect = new Rect(x1, y1, x2, y2);  mBgDestRect = new Rect(0,0, mWidth, mHeight); }</code></pre>","1742702","","1742702","","2010-07-01 17:39:30","2010-07-24 12:54:54","Issues with screen sizes and activity rendering","<android><compatibility>","1","1","","",""
"3160075","1","","","2010-07-01 17:12:02","0","229","<p>I have 2 activities declared as singleTask in my application. The reason for this is, with standard mode, pressing ""HOME"" in one activity (say A) and launching another (say B), still shows activity A.</p><p>However, a new problem arises because of this. </p><p>A -> ""HOME"" -> B (Result : B, Expected Result: B) -> ""BACK"" -> (Result:A, Expected Result: Home Screen)</p><p>Any ideas why?</p>","610446","","","","","2010-07-10 19:09:32","Android: Multiple singleTasks within a single Application: problem with <HOME>","<android><activity>","1","0","","",""
"3160205","1","3160294","","2010-07-01 17:29:40","2","5916","<p>HI,Im trying to show a ProgressDialog while the activity is loading.my problem is that although i completed all the work in the activityit takes a long time for the activity to load, i suspect this is because i usemultiple views with multiple listviews with custom array adapters inside a viewflipper.it takes a long time for the UI to show.</p><p>how would i go about checking that all the UI inside the activity finished loading?</p><p>or is there a way to preload all the activity and the UI?</p><p>Thanks, </p>","274180","","","","","2010-07-01 18:43:48","Android show ProgressDialog until activity UI finished loading","<android><activity>","2","2","2","",""
"3160231","1","3160260","","2010-07-01 17:33:09","0","1869","<p>I have a TextViewer Activity , that has a button, and when I click on it I want to popup an AlertDialog with list. I followed this <a href=""http://developer.android.com/intl/de/guide/topics/ui/dialogs.html#CustomDialog"" rel=""nofollow"">link</a> but it does not work (no popup). I believe the context is wrong.I used the following code:</p><pre><code>    protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.resources);    ImageButton btnlist = (ImageButton)findViewById(R.id.list);    btnlist.setOnClickListener(new View.OnClickListener() {             public void onClick (View v){                                if (Vars.bookchapter&gt;1){               final CharSequence[] items = {""Red"", ""Green"", ""Blue""};               Context mContext = getBaseContext();               AlertDialog.Builder builder = new AlertDialog.Builder(mContext);               builder.setTitle(""Pick a color"");               builder.setItems(items, new DialogInterface.OnClickListener() {                   public void onClick(DialogInterface dialog, int item) {                       Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();                   }               });               AlertDialog alert = builder.create();              }else{               //Nothing              }             }});              }        }</code></pre>","380490","","","","","2010-07-01 17:36:31","Custom AlertDialog not showing","<android><alertdialog>","1","0","","",""
"3160384","1","3160499","","2010-07-01 17:57:27","0","646","<p>I have an Activity, which contains a bunch of check boxes and a submit button.</p><p>When the submit button is clicked, the activity will exit (finish() will be called). Before the activity exits, I want to save the states of the check boxes in the activity, so when the activity starts again, the check boxes can stay in their previous states. What's the correct way to save these states? Should I use SharedPreference.</p><p>Thanks.</p>","256239","","","","","2010-07-02 07:19:04","What's the correct way to save state of an Activity","<android>","1","0","","",""
"3160396","1","3167962","","2010-07-01 17:58:37","0","4457","<p>I'm making a custom adapter so that I can display a list of items with icons which looks like the menu that comes up when you long click the home screen.</p><p>For some reason though the list items are not clickable. The can be navigated to with the D-pad but they cannot be clicked in any way. I thought maybe the problem was with the AlertDialog I was using so I replaced a working adapter I had elsewhere but I have the same issue there. </p><p>My adapter looks like this:</p><pre><code>ArrayList&lt;IconListItem&gt; mItems;LayoutInflater mInflater;public IconListAdapter(Context context, ArrayList&lt;IconListItem&gt; items) {    mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    mItems = items;}public IconListAdapter(Context context) {     this(context, new ArrayList&lt;IconListItem&gt;()); }public void add(IconListItem item) {    mItems.add(item);    notifyDataSetChanged();    return item;}public void remove(IconListItem item) {    mItems.remove(item);    notifyDataSetChanged();}@Overridepublic int getCount() {    return mItems.size();}@Overridepublic IconListItem getItem(int position) {    return mItems.get(position);}@Overridepublic long getItemId(int position) {    return position;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    View view;    if(convertView == null){        view = mInflater.inflate(R.layout.two_line_icon_list_item, null);    } else {        view = convertView;    }    IconListItem item = mItems.get(position);    TextView lineOne = (TextView) view.findViewById(R.id.firstLine);    TextView lineTwo = (TextView) view.findViewById(R.id.secondLine);    ImageView iconImage = (ImageView) view.findViewById(R.id.icon);    lineOne.setVisibility(View.VISIBLE);    lineTwo.setVisibility(View.VISIBLE);    iconImage.setVisibility(View.VISIBLE);    lineOne.setText(item.getText());    if (item.getSubtext() == null)        lineTwo.setVisibility(View.GONE);    else         lineTwo.setText(item.getSubtext());    if (item.getIcon() == null)        iconImage.setVisibility(View.GONE);    else         iconImage.setImageDrawable(item.getIcon());    return view;}</code></pre><p>And the XML it's inflating:</p><pre><code>&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""6dip""&gt;    &lt;ImageView        android:id=""@+id/icon""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_marginRight=""6dip""    /&gt;    &lt;LinearLayout        android:orientation=""vertical""          android:layout_width=""wrap_content""        android:layout_weight=""1""        android:layout_height=""fill_parent""    &gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:gravity=""center_vertical""            android:id=""@+id/firstLine""            android:ellipsize=""marquee""            android:inputType=""text""        /&gt;        &lt;TextView              android:layout_width=""wrap_content""            android:layout_height=""0dip""            android:layout_weight=""1""                      android:ellipsize=""marquee""            android:id=""@+id/secondLine""            android:inputType=""text""        /&gt;               &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>EDIT:</p><p>When I say they are not clickable, I mean that they items do not highlight in orange when I press them nor does onItemClick ever get called.</p><p>In my code I have this, a different adapter for another purpose and it works perfectly</p><pre><code>this.foos= foos;fa = new FooAdapter(this.foos);fooList.setAdapter(fa);// View the details for an item when it is selectedfooList.setOnItemClickListener(new OnItemClickListener() {    @Override    public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,            long arg3) {        Intent i = new Intent(MyActivity.this, MyOtherActivity.class);        i.putExtra(""foo"", ((fooAdapter)arg0.getAdapter()).getItem(arg2));        i.putExtra(""list_position"", arg2);        MyActivity.this.startActivityForResult(i, 0);    }});</code></pre><p>But when I swap out the first 3 lines for </p><pre><code>IconListAdapter ila = new IconListAdapter(this);ila.add(0, ""Test 1"", android.R.drawable.ic_menu_mylocation);ila.add(0, ""Test 2"", android.R.drawable.ic_menu_edit);ila.add(0, ""Test 3"", android.R.drawable.ic_menu_search);groupList.setAdapter(ila);</code></pre><p>it stops working.</p>","370556","","370556","","2010-07-01 19:18:51","2011-07-26 15:03:18","Android ListView item from custom adapter not selectable","<android>","2","2","","",""
"3160447","1","4849869","","2010-07-01 18:05:41","3","2594","<p>i have an application which uses the tts engine in android, now as the activity starts , i  want to show to the users the settings present in the phone for the tts engine in which they can change the pitch, test the engine, etc which is already present in the emulator.So, how do i present to them this screen?</p>","238505","","","","","2011-12-31 13:27:48","how to show up the settings for text to speech in my app?","<android>","3","0","2","",""
"3160501","1","3160661","","2010-07-01 18:13:16","0","189","<p>I know how to lunch another activity, But how do I meke sure an activity exist for my MIME type before starting the activity? for example if I have a PDF file that I want to display, how do I make sure a PDF viewer exist?</p><p>here is the code I use to lunch the PDF viewer</p><pre><code>MimeTypeMap tMimeType = MimeTypeMap.getSingleton();String tMimeStr = tMimeType.getMimeTypeFromExtension(""pdf"");Intent intent = new Intent();intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);intent.setAction(android.content.Intent.ACTION_VIEW);intent.setDataAndType(Uri.fromFile(""xyz.pdf""), tMimeStr);try{    startActivity(intent);}catch (Exception e){    // Display error message here}</code></pre>","339392","","","","","2010-07-01 18:35:03","Findout if a default viewer exist","<android><mime><intentfilter>","1","0","1","",""
"3160657","1","3160777","","2010-07-01 18:34:56","0","879","<p>I have developed two separate applications 1) android 2.1 that takes user input / registers , shared pref and stuff and 2) Google Maps GPS on target Google APIs 7 . Now, I would like to embed the second project in first . That is, after the user registers it will bring up Maps and suggestions and stuff. How can I use both the targets (Apis ) together in a single App?</p>","357349","","","","","2010-07-01 19:14:11","Linking Google Maps Api Target with Android 2.1 Target","<android><android-emulator>","1","0","","",""
"3160778","1","","","2010-07-01 18:49:46","2","3936","<p>I want to set the AlertDialog position behind the status bar, when the content in my Dialog will increase, How to do that? I am creating a custom AlertDialog using my own layout.... Please help me out....</p><hr><p>Below is my code, I am setting the height and x-y position of alertDialog, but still it doesnot show its effect..</p><pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(this);       LayoutInflater inf = getLayoutInflater();        View layout = inf.inflate(R.layout.main, null);        builder.setView(layout);        builder.setTitle(""Add to Home screen"");    AlertDialog dialog = builder.create();        WindowManager.LayoutParams WMLP = dialog.getWindow().getAttributes();        int dialogOriginalHeight = WMLP.height;    WMLP.height += 750;    Log.i(""XnY"", ""x=""+WMLP.x+"", y=""+WMLP.y);    WMLP.x = -10;   //x position    WMLP.y = -10;   //y position    Log.i(""XnY"", ""x=""+WMLP.x+"", y=""+WMLP.y);    dialog.getWindow().setAttributes(WMLP);    Log.i(""POSITION"", ""POS::HEIGHT:""+WMLP.height);    dialog.show();</code></pre>","381423","","1288","","2011-12-03 19:06:44","2013-05-02 14:16:08","How to set the position of a AlertDialog off the screen at top in Android?","<android><position><alertdialog>","2","3","1","",""
"3160974","1","3161148","","2010-07-01 19:18:18","4","3064","<p>I have an app that requires scrollbars to be enabled in one landscape orientation but not in portrait orientation.  I thought the easiest way to do this would be to make an attribute indicating whether the scrollbar is enabled or not, such as the following:</p><pre><code>&lt;ScrollView        a:layout_width=""fill_parent""        a:layout_height=""fill_parent""        a:scrollbars=""?my_activity_scrollbars""        a:fadingEdge=""none""        &gt;</code></pre><p>I would then define separate values of the attribute for landscape and portrait modes.  Seemed easy.  </p><p>So I then defined this attribute in attrs.xml:</p><pre><code>&lt;resources&gt;  &lt;declare-styleable name=""Theme""&gt;    &lt;attr name=""my_activity_scrollbars"" format=""enum"" /&gt;   &lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre><p>And added it to my app's styles.xml:</p><pre><code>&lt;style name=""MyApp"" parent=""@android:style/Theme.Light""&gt;    &lt;item name=""add_credit_card_scrollbars""&gt;none&lt;/item&gt; &lt;/style&gt;</code></pre><p>However, when I try to compile my app, I get the following error:</p><pre><code>styles.xml:8: error: Error: String types not allowed (at 'my_activity_scrollbars' with value 'none').</code></pre><p>It seems clear that it's treating ""none"" as a string rather than an enumerated value.  Rather than using ""none"" I tried things like ""?android:attr/scrollbars/none"", ""?android:attr/none"", etc, but those didn't work.</p><p>How can I specify the ""none"" value as an enumerated value instead of a string?</p>","82156","","","","","2010-07-01 19:54:53","Referencing enumerated style attributes from XML in Android","<android>","1","0","2","",""
"3161125","1","3161296","","2010-07-01 19:42:41","0","692","<p>I got a ListActivity. </p><p>I update the activity using onContentChanged() API.</p><p>My problem is that each time I call the above API the list scrolls to the top. Is there any easy way to turn this ""feature"" off?</p><p>Thanks.</p><p>/ Henrik</p>","226342","","","","","2010-07-01 20:07:45","How to turn list scrolling off when calling onContentChanged in Android ListActivity?","<android><listview><scrollbar>","1","0","1","",""
"3161166","1","3161201","","2010-07-01 19:47:29","0","133","<p>My XML layout in res/layout/edit.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;GridView   android:id=""@+id/GridView01""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  xmlns:android=""http://schemas.android.com/apk/res/android""  android:numColumns=""2""&gt;&lt;TextView  android:text=""Person's Name""  android:id=""@+id/PersonName""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;TextView  android:text=""Person's Points""  android:id=""@+id/PersonPoints""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;/GridView&gt;</code></pre><p>When I try to switch from ""edit.xml"" to ""Layout"", I see this error:</p><pre><code>java.lang.UnsupportedOperationException: addView(View, LayoutParams) is notsupported in AdapterView</code></pre><p>I checked the documentation for AdapterView, and this is expected behavior.  Why, then, does ADT expect it to work?</p>","346688","","","","","2010-07-02 04:28:13","Why is ADT calling code that the doc specifies throws an UnsupportedOperationException?","<android><eclipse><adt>","1","0","","",""
"3161184","1","","","2010-07-01 19:49:10","0","710","<pre><code>package com.iperetz1.android.testbutton1;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class TestButton extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button test2 = (Button)findViewById(R.id.test2);              test2.setOnClickListener(new OnClickListener()        {           @Override           public void onClick(View v)            {               setContentView(R.layout.test2);;           }        });        Button other = (Button)findViewById(R.id.backmain);              other.setOnClickListener(new OnClickListener()        {           @Override           public void onClick(View v)            {               setContentView(R.layout.main);;           }        });    }}</code></pre><p>main.xls</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/widget0""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;Buttonandroid:id=""@+id/test2""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""test2""android:layout_x=""24px""android:layout_y=""165px""&gt;&lt;/Button&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>test2.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/widget0""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;Buttonandroid:id=""@+id/backmain""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""backmain""android:layout_x=""24px""android:layout_y=""165px""&gt;&lt;/Button&gt;&lt;/AbsoluteLayout&gt;</code></pre>","381479","","1065190","","2012-07-02 14:41:26","2012-07-02 14:41:26","Error ""android (name of project) has stopped unexpectedly","<android>","2","4","","",""
"3161250","1","3162737","","2010-07-01 20:00:17","0","256","<p>I've a code that display a list of items based on a custom adapter. To display a content of a table no problem but when I need to add a reference to many table it's another thing. Two solution are possible in my point of view:</p><p>1) Querying the database inside setViewValue (didn't investigate too much this possibility)or2) Find a way to associate dynamically a column to my other tables</p><p>(solution for both are welcome) </p><p>I have a main table where a column called slug is a reference to other tables. These other tables contain some data which I would like to count.</p><p>Once I have my query I use a SimpleCursorAdapter to display a nice list in android (eg 1024 (2 ref), 2048 (3 ref)...).</p><p>I think a little schema is probably better than my explanation.</p><pre><code>Table: A-----------------------_id    | slug | value |-----------------------1      | a_a  | 1024  |2      | g_z  | 2048  |-----------------------Table: mytable_a_a----------------_id    | value |----------------1      | xxx   |2      | yyy   |----------------Table: mytable_g_z----------------_id    | value |----------------1      | xxx   |2      | yyy   |3      | zzz   |----------------The goal is to produce something like-------------------------------_id    | slug | value | count-------------------------------1      | a_a  | 1024  | 22      | g_z  | 2048  | 3...</code></pre><p>I've tried something like:</p><p>SELECT * FROM A UNIONSELECT COUNT(*) FROM A.slug;</p><p>but I'm missing the point and if a solution exists it would be a bit more complicated.</p><p><em>possible workaround: include a counter in the table a</em></p><p>Thank you</p>","155144","","","","","2010-07-02 01:27:20","Get table on the fly with sqlite","<android><sqlite3><adapter>","1","0","","",""
"3161308","1","3161623","","2010-07-01 20:10:09","2","611","<p>I have a problem with an appwidget. It doesn't have a configuration activity. When I set <code>android:updatePeriodMillis=""10000""</code> ( know this shouldn't be done but it's just for testing) in the emulator the <code>onUpdate(...)</code> function is called every 10 seconds. But when i install my app on my real phone (motorola milestone) <code>onUpdate(...)</code> is only called when I add the widget to the home screen. And never again.Any ideas why this happens on the real device but not in the emulator?</p>","373138","","1288","","2012-08-04 17:32:25","2012-08-04 17:32:25","AppWidget only updates once","<android><android-widget>","1","3","","",""
"3161458","1","3161500","","2010-07-01 20:31:28","1","546","<p>I have a program that creates a notification if the application is not running. To do this, I have used the following code:</p><pre><code>public void onWindowFocusChanged(boolean focus){    inFocus = focus;    if (inFocus)    {//If this activity is in focus, fills data and clears notifications        fillData();        Notify.clear();    }    else    {        if (!RespondScreen.inFocus &amp;&amp; !ClearDialog.inFocus)        {            Creates a notification        }    }}</code></pre><p>This works fine, except when the notification shade is pulled down. This causes the activity to not be in focus, and because neither of the other two activities are in focus, a notification is created. This notification is destroyed as soon as the shade is pulled back up, but it creates an annoying, unnecessary disturbance to the user. Is there some setting I can use to test if the notification shade is in focus, or another way entirely?</p><p><strong>Edit: Using Qberticus' advice, I was able to find a workable solution:</strong></p><pre><code>    public void onWindowFocusChanged(boolean focus){    if (focus)    {//If this activity is in focus, fills data and clears notifications        inFocus = focus;        fillData();        Notify.clear();    }}@Overridepublic void onPause(){    super.onPause();    inFocus = false;    Handler handler = new Handler();      handler.postDelayed(new Runnable() {           public void run() {               if (!RespondScreen.inFocus &amp;&amp; !ClearDialog.inFocus)             {                Intent notifier = new Intent();                notifier.setAction(""itp.uts.program.NOTIFY"");                Bundle bundle = new Bundle();                bundle.putBoolean(""StartNotify"", true);                bundle.putBoolean(""StartSound"", false);                notifier.putExtras(bundle);                getApplicationContext().startService(new Intent(notifier));             }         }      }, 200);   }</code></pre><p>The onResume method was for some reason not working with Notify.clear(), so I used a combination of my attempt and Qberticus' suggestion. It's a little clumsy, but it works perfectly.</p>","381508","","381508","","2010-07-02 14:13:47","2010-07-02 14:13:47","How to tell if notification shade is pulled down in android","<android><notifications><visible><shade>","1","0","1","",""
"3161462","1","3162403","","2010-07-01 20:32:20","7","8333","<p>I have a custom component that I want to give the same colors as a TextView.That is, I don't want to copy its colors, I want to get the default background and foreground colors, if there's such a concept on android.</p><p>[Edit]</p><p>The following seems to yield the text color of my TextView. But is it just luck? It's not intuitive to me that a default TextView would use <code>android.R.attr.textColorSecondary</code>? And why does not <code>resolveAttribute</code> return the color directly?</p><pre><code>TypedValue tv = new TypedValue();getContext().getTheme().resolveAttribute(android.R.attr.textColorSecondary, tv, true);Color holyColor = getResources().getColor(tv.resourceId);</code></pre><p>[Edit]</p><p>I found the source code of TextView at <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob_plain;f=core/java/android/widget/TextView.java;hb=HEAD"">android.git.kernel.org</a>, but it seemed to contain a lot of referrences to <code>com.android.internal.R</code>, which I don't think I should use in my own code. I'm currently looking for some kind of evidence that <code>TextView</code> uses <code>android.R.attr.textColorSecondary</code>.</p><p>[Edit]</p><p>I found some kind of evidence at <a href=""http://developer.android.com/guide/topics/ui/themes.html#PlatformStyles"">developer.android.com</a>, in <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/styles.xml;h=d7b654e49809cb97a35682754b1394af5c8bc88b;hb=HEAD"">styles.xml</a> that <code>TextView</code> uses <code>android.R.attr.textAppearanceSmall</code>. <code>textAppearanceSmall</code> is documented to default to ""secondary text color"".</p><p>I guess I was lucky after all, but I still don't like that little code snippet of mine.</p>","215904","","215904","","2010-07-02 22:25:34","2012-05-25 09:52:05","How to get the default colors on Android","<android>","1","1","1","",""
"3161493","1","3162269","","2010-07-01 20:38:25","0","3759","<p>I'm developing a android application that uses a ListActivity.</p><p>In the method onListItemClick, I instantiate an object x. I have an Activity a whose constructor receives and object of the same type of x. How do I do to instantiate a and start it?</p><p>Pretty much like this, but it does not work:</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {    EventoSingle eventoSingle = new EventoSingle(this.eventos.get(position));    Intent i = new Intent(this, EventoSingle.class);    eventoSingle.startActivity(i);    startActivity(i);    super.onListItemClick(l, v, position, id);}</code></pre>","313721","","","","","2010-07-01 22:58:37","Android - Switching Activities","<android><activity>","3","0","","",""
"3161525","1","","","2010-07-01 20:44:13","0","248","<p>I'm trying to create a homescreen Android widget and have it alternate between two different textviews I would send to it.  Is this possible? </p>","381519","","114066","","2010-07-02 06:35:31","2010-07-02 06:35:31","what would be the best way to have an Android homescreen widget alternate between textviews?","<android><text><android-widget><textview><viewflipper>","2","1","","",""
"3161712","1","3163793","","2010-07-01 21:12:09","2","14598","<p>I am using a html parser called jsoap, to load and parse html files. The problem is that the webpage I'm scraping is encoded in ISO-8859-1 charset while Android is using UTF-8 encoding(?). This is results in some characters shows up as question marks.</p><p>So now I guess I should convert the string to UTF-8 format.</p><p>Now I have found this Class called <a href=""http://developer.android.com/reference/java/nio/charset/CharsetDecoder.html"" rel=""nofollow"">CharsetEncoder</a> in the Android SDK, which I guess could help me. But I can't figure out how to implement it in practice, so I wonder if could get som help with by a practical example.ThanksUPDATE: Code to read data (<a href=""http://jsoup.org/cookbook/input/load-document-from-url"" rel=""nofollow"">Jsoup</a>)</p><pre><code>url = new URL(""http://www.example.com"");Document doc = Jsoup.parse(url, 4000);</code></pre>","215088","","157882","","2010-08-11 21:26:40","2014-03-26 09:16:02","How do I convert a string to UTF-8 in Android?","<java><android><jsoup>","2","2","","",""
"3161744","1","","","2010-07-01 21:15:43","1","1187","<p>I have a user's name and password stored in their preferences.</p><p>How do I go about passing it back into the webview in a secure way?I know if I do this it will work, but it just seems bad. There has to be a better way to post the variables.</p><p>webview.loadUrl(""http://mysite.com?name=""+username+""&amp;password=""+somepassword);</p><p>I've been looking for days and can't find anything, which make me think I'm missing something obvious.</p>","381544","","","","","2013-03-07 08:19:53","Howto: pass a username and password back into a webview securely","<android><post><cookies><session><security>","2","0","1","",""
"3161763","1","3161992","","2010-07-01 21:19:18","5","3127","<p>I need to make a video as a demo for one application I have developed. I know that there are some experimental applications that use DDMS and achieve a framerate of 5-6 FPS. This framerate is completely insufficient for my purposes since the application has smooth animations that I would like to show. Is there a way to do a real-time screen capture on Android? Should I settle for a capture of the emulator or a real video done with a real camera?</p>","368819","","496830","","2011-11-08 15:14:15","2012-08-16 12:17:20","Is there a way to capture the screen as real-time video?","<android><screen-capture>","2","0","3","",""
"3161848","1","3163842","","2010-07-01 21:32:32","0","772","<p>I installed today from Market, the Yahoo Mail application and I was reading it offers push message notification technique. Indeed it works, as I got exactly the same moment the alert on my desktop computer and my mobile mail client.</p><p>How is it accomplished?</p>","243782","","","","","2010-07-02 07:06:32","How does a push notification system works like on Y! Mail app?","<android><yahoo><push-notification>","3","0","2","",""
"3161854","1","3163610","","2010-07-01 21:32:50","1","1954","<p>Ok i have an application with 2 different languages (english and german), how to change them from my application? When i click the Language button im using intent to com.android.settings.LocalePicker and from there i select the language.So instead of that i want to select English and German options from dialog box.I know how to create the dialog box, but don't know how to change the locale.</p>","360819","","","","","2012-07-19 11:27:36","How to change localization in my android app without going to the settings?","<android>","2","2","2","",""
"3162126","1","3162421","","2010-07-01 22:25:45","0","847","<p>I need more room in a single AlertDialog and when I set .title to null it doesn't show a title but it also doesn't add any space to the AlertDialog.  The dialog just starts that much lower on the screen.  Not using setPosativeButton has the desired effect but I do want the close button.  How can I set the AlertDialog so I can show my long Message starting at the top of the screen?</p>","293565","","","","","2012-05-15 11:20:26","How to take out title and icon in alertDialog for Android","<android><alertdialog>","1","1","","",""
"3162375","1","3162378","","2010-07-01 23:26:16","3","425","<p>I would like to produce a popup window giving the user to ability to select yes to reboot the phone. Possible?</p>","371532","","","","","2010-12-22 03:28:51","Android: popup to reboot phone","<android><phone><reboot>","1","0","1","",""
"3162471","1","","","2010-07-01 23:55:17","0","160","<p>Iam working on a app and I need to send data from my database, As I have udnerstood arch of android, I must use REST service. I have tried finding information but I can't. I have tryied with books, and none of the are showing how to connect the services, and how to create WCF service in asp.net. </p><p>PLS.Help me out</p>","381625","","","","","2010-07-01 23:59:31","Connection my app to a WCF Service","<java><.net><android>","1","0","1","",""
"3162648","1","3167748","","2010-07-02 01:00:14","0","584","<p>This might be a pretty basic question, or peculiar to my set up (hopefully not too peculiar)</p><p>I am new to android development and have been playing around with the tutorials offered at developer.android.com.</p><p>I don't have a problem with projects I create from scratch, but when I start a project from the android sample code provided at android.com or from any other android project, I can never seem to get the bugs out to even run the thing.</p><p>For example, when loading up the NotePad sample in the android-7 package of samples - </p><p>from the error log I see:</p><blockquote>  <p>Failed to load properties file com.android.ide.eclipse.adt  Problems occurred when invoking code from plug-in: ""org.eclipse.jface"".</p></blockquote><p>from the problems log I get:</p><blockquote>  <p>error_message cannot be resolved or is not a field   menu_delete cannot be resolved or is not a field<br>  menu_discard cannot be resolved or is not a field  text_edit cannot be resolved or is not a field</p></blockquote><p>etc., didn't want to list them all</p><p>It seems that it is not playing well with the <strong>strings.xml file in res/values</strong></p><p>Have tried: 1. Importing anything missing w/ cmd,shft,O2. Fixing properties from Android Tools3. Project>>Clean...4. Making sure that the SDK Versions all match up5. Restarting and restarting</p><p>Nothing, still getting the error.</p><p>Anyone have any ideas what I am doing wrong?</p><p>would like a general solution, something more global bc this is occurring whenever I pull in anyone's source code from outside.</p><p>kind of frustrated because I feel that I am spending too much time working out these kinks and not being able to study other people's code against how it performs in the emulator.</p>","340648","","","","","2011-12-14 15:14:31","Having routine problem debugging other people's android source code in eclipse - ADT plug-in might not be functioning properly","<android><eclipse><adt>","3","0","0","",""
"3162667","1","3603969","","2010-07-02 01:05:49","17","28733","<p>There seem to be quite a number of OBJ mesh file loaders out there that people have developed for use on the Android platform.  I'm wondering if anyone has any experience with these and can offer a recommendation on which one seems to work best for them.</p><p>Here are my criteria:</p><ul><li>Lightweight (small file size),</li><li>Optimized for speed,</li><li>Easy to implement,</li><li>Offers some sort of texture mapping support (not sure if I need this -- haven't gotten far enough in my coding to know if I need a library to do this, or if OpenGL ES will be able to do all that work I need here), and</li><li>Can be used in Android apps that are being sold commercially.</li></ul><p>Here are a few of the libraries I've found.</p><ul><li><a href=""http://code.google.com/p/min3d/"">Min3D</a></li><li><a href=""http://sourceforge.net/projects/objloaderforand/files/"">.obj Loader for Android</a></li><li>Random <a href=""http://rapidshare.com/files/183773190/objloader.7z"">objloader</a> found on <a href=""http://www.anddev.org/viewtopic.php?p=17618"">anddev.org forum</a></li><li><a href=""http://code.google.com/p/android-gl/"">Android-GL</a></li><li><a href=""http://code.google.com/p/libgdx/"">LibGDX</a></li></ul><p>I'm also open to hearing about others not included on this list.  Thanks!</p>","107277","","44729","","2010-07-02 04:23:12","2013-11-03 01:41:25","Android OpenGL .OBJ file loader","<android><3d><opengl-es><mesh>","3","0","22","2014-02-20 21:06:35",""
"3162715","1","3163682","","2010-07-02 01:20:58","0","1594","<p>I'd like to maintain a hash table in a broadcast receiver.  If I understand BroadcastReceiver's life cycle currently it could get killed wiping out my member variables. What would be the ideal strategy for retrieving a hash table from a previous run of onReceive in the BroadcastReceiver?  </p>","48784","","","","","2011-12-19 15:20:08","Save data in Broadcast receiver","<android><broadcastreceiver>","5","0","1","",""
"3162863","1","3303626","","2010-07-02 02:04:40","0","300","<p>Simple problem: With the XML layout shown below, I have some views wrapped in a GestureOverlayView. As shown below, my first row is blended with the second row, as-if the first row is transposed right on top of the second. </p><p>Now when I take the GestureOverlayView out of the code and leave everything else as-is, my table looks fine - the rows are separate and not on top of each other. </p><p>I'm wondering why the rows overlap like that with the gestureOverlayView present? </p><p>Screenshot showing the problem: <a href=""http://img413.imageshack.us/img413/4994/overlayblending.png"" rel=""nofollow"">http://img413.imageshack.us/img413/4994/overlayblending.png</a></p><p>Thank you</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout             xmlns:android=""http://schemas.android.com/apk/res/android""            android:id=""@+id/ll1""            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            &gt;    &lt;android.gesture.GestureOverlayView       android:id=""@+id/gesturePage01""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:layout_weight=""1.0""&gt;        &lt;TableRow android:id=""@+id/TableRow01"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;            &lt;TextView                 android:text=""Connection info""                 android:id=""@+id/tvCon1""                 android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:background=""#F0F0F0""                android:textColor=""#FF0000""                /&gt;        &lt;/TableRow&gt;        &lt;TableRow android:id=""@+id/TableRow02"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;        &lt;ScrollView             android:id=""@+id/ScrollView01""             android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;                &lt;TextView                      android:id=""@+id/tvMessages""                    android:layout_width=""fill_parent""                     android:layout_height=""fill_parent""                     android:text=""""                    /&gt;        &lt;/ScrollView&gt;    &lt;/TableRow&gt;&lt;/android.gesture.GestureOverlayView&gt;    &lt;/LinearLayout&gt;</code></pre>","268803","","","","","2010-07-21 20:39:34","GestureOverlayView causes strange TableRow blending","<android><layout><gestures>","1","0","","",""
"3163045","1","3211802","","2010-07-02 03:09:50","8","3187","<p>How do you check if the SD card is full or not so that your application can decide if it can continue to do its job i.e. write to external storage or notify the user that storage has run out of space.</p>","381699","","56285","","2014-01-17 08:41:46","2014-01-17 09:52:22","How to check availability of space on external storage?","<android><android-sdcard><android-externalstorage>","5","0","1","",""
"3163086","1","3163120","","2010-07-02 03:26:13","0","4862","<p>I'm doing Major Project on my final year and I'm very new to Android plus I;m not good at codings. I need help with my login page. I've created something like a database connection java file which is this:</p><pre><code>package one.two;import java.util.List;import android.app.ListActivity;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;import java.util.ArrayList;    public class UserDB     {     public String KEY_USERNAME = ""Username"";     public  String KEY_PASSWORD = ""Password"";     public String KEY_LNAME = ""LastName"";     public String KEY_FNAME = ""FirstName"";     private static final String DATABASE_NAME = ""Users"";     private static final String DATABASE_TABLE = ""User"";     private static final int DATABASE_VERSION = 1;     private static Context context;     private static DatabaseHelper DBHelper;     private static SQLiteDatabase db;     public UserDB(Context ctx)     {      this.context = ctx;      DBHelper = new DatabaseHelper(context);     }     private static class DatabaseHelper extends SQLiteOpenHelper     {      DatabaseHelper(Context context)      {       super(context, ""Users"", null, 1);      }      @Override      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)      {      }      @Override      public void onCreate(SQLiteDatabase db)      {      }     }//end DatabaseHelper     // ---opens the database---     public UserDB open() throws SQLException     {      db = DBHelper.getWritableDatabase();      return this;     }     // ---closes the database---     public void close()     {      DBHelper.close();     }    }</code></pre><p>I've already created a database for users using SQLite. The database name is Users and the table is called User. The records inside the table are Username, Password, LastName, FirstName. I've inserted one user's info into the database. The problem is I do not know whether my UserDB.java is correct. </p><p>And I've also created login.java. Hardcoded Login page: </p><pre><code>package one.two;import android.app.Activity;import android.content.Intent;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.GridView;import android.widget.ListView;import android.widget.TextView;public class Login extends Activity implements OnClickListener{ UserDB db = new UserDB(this);/** Called when the activity is first created. */ private EditText etUsername; private EditText etPassword; private Button btnLogin; //private Button btnRegister; private TextView lblResult;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.login);     // Get the EditText and Button References        etUsername = (EditText)findViewById(R.id.usernametxt);        etPassword = (EditText)findViewById(R.id.passwordtxt);        btnLogin = (Button)findViewById(R.id.btnLogin);        //btnRegister = (Button)findViewById(R.id.btnRegister);        lblResult = (TextView)findViewById(R.id.msglbl);        //Cursor c = (Cursor) db.getAllTitles();        Button btnArrival = (Button) findViewById(R.id.btnRegister);     btnArrival.setOnClickListener(this);    // Set Click Listener    btnLogin.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {  // Check Login  String username = etUsername.getText().toString();  String password = etPassword.getText().toString();  if(username.equals(""guest"") &amp;&amp; password.equals(""guest"")){   lblResult.setText(""Login successful."");  } else {   lblResult.setText(""Login failed. Username and/or password doesn't match."");  } }}); }    public void onClick(View v) {   Intent intent = new Intent(this, DatabaseActivity.class);   startActivity(intent);}}</code></pre><p>So I want to know how I should apply the database connection on the login.java. Should I insert database connection something like db.Open();? I studied ASP.Net a few months back and I kind of forget most of what I've learnt. </p><p>So how should I open the database connection on login.java and how to check with database whether the user enters the right username and password? </p><p>Just incase you need my xml, here's the code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/widget0""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background = ""@drawable/image""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextViewandroid:id=""@+id/widget32""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Ferry Hub""android:textSize=""25sp""android:textStyle=""bold""android:textColor=""#ff009999""android:layout_x=""97px""android:layout_y=""15px""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/widget35""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Login""android:textColor=""#ff100999""android:layout_x=""116px""android:layout_y=""48px""&gt;&lt;/TextView&gt;&lt;EditTextandroid:layout_width=""168px""android:layout_height=""42px""android:text=""""android:textSize=""18sp""android:layout_x=""133px""android:layout_y=""146px""android:id=""@+id/passwordtxt""&gt;&lt;/EditText&gt;&lt;EditTextandroid:layout_width=""169px""android:layout_height=""41px""android:text=""""android:textSize=""18sp""android:layout_x=""132px""android:layout_y=""93px""android:id=""@+id/usernametxt""&gt;&lt;/EditText&gt;&lt;TextViewandroid:id=""@+id/widget31""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Username:""android:textColor=""#ff000000""android:layout_x=""32px""android:layout_y=""102px""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/widget32""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Password:""android:textColor=""#ff000000""android:layout_x=""32px""android:layout_y=""155px""&gt;&lt;/TextView&gt;&lt;Buttonandroid:id=""@+id/btnLogin""android:layout_width=""109px""android:layout_height=""34px""android:text=""Login""android:layout_x=""38px""android:layout_y=""272px""&gt;&lt;/Button&gt;&lt;Buttonandroid:id=""@+id/btnRegister""android:layout_width=""110px""android:layout_height=""35px""android:text=""Register""android:layout_x=""159px""android:layout_y=""272px""&gt;&lt;/Button&gt;&lt;TextViewandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Click 'Register' if you do not have an account.""android:textSize=""13px""android:textColor=""#ff000000""android:layout_x=""3px""android:layout_y=""305px""android:id=""@+id/msglbl""&gt;&lt;/TextView&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>Any help is appreciated. I need to learn how to do it so that I can apply for other pages for example Register.java page. </p><p>-Dayne</p>","380770","","","","","2011-03-22 06:11:28","ANDROID: Database connection, check data, login page","<sql><android><database>","1","2","","",""
"3163151","1","3163544","","2010-07-02 03:53:46","1","6018","<p>Is there an easy way to grab a attribute value from an xml item in your Java class definition? I'm looking for something like this:</p><p>// In xml layout:</p><pre><code>&lt;TextView android:id=""@+id/MyXMLitem"" android:textColor=""#000000"" /&gt; </code></pre><p>// in Java Class definition</p><pre><code>String some_text_color;some_text_color = R.id.MyXMLitem.attr.textColor; // I'd like this to return ""#000000""</code></pre><p>I know you can grab similar xml attributes from the converted objects using getters/setters like View.getText()... I'm just wondering if there's a way to grab an xml attribute right from the item itself.</p>","301991","","301991","","2010-07-02 06:53:40","2012-12-27 17:35:27","Android: Get an attribute's value from an XML item","<android>","3","0","1","",""
"3163164","1","","","2010-07-02 03:58:43","1","797","<p>Our products still target OS 1.5+, so C2DM in Froyo is not an option.</p><p>I think wrap a persistent TCP connection in a service would be feasible. But I'm still wondering how to use one service to receive notifications for multiple applications. I don't want to create service and connection for each of my apps.</p><p>Should I try to register the same service in all my apps, or release the service as a single app?</p><p>Thanks in advance.</p>","372859","","","","","2011-03-10 17:41:28","How to implement push notification for multiple Android apps?","<android><service><push><notifications>","1","0","3","",""
"3163214","1","","","2010-07-02 04:15:44","1","1523","<p>I have a parent activity, and a child activity that extends the parent activity. When the parent starts the child activity, </p><p>Which onCreate gets executed first? The child's or parent's?</p><p>There is a particular variable I am setting in the Child activity's onCreate method, and right now, it looks like it takes a while to get to the Child activity's onCreate, and so the methods in the Parent are reporting an empty variable. Whereas when I make the Parent sleep for a while, it reports the correct variable. </p><p>ThanksChris</p><p>Parent Activity:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.mylayout);    goButton = (ImageButton) this.findViewById(R.id.goButton);    goButton.setOnClickListener(new OnClickListener() {        public void onClick(View view) {            Intent childIntent = new Intent(""com.example.Child"");            String newValue = ""Child Value"";            Bundle bun = new Bundle();            bun.putString(""value"", newValue); // add two parameters: a string and a boolean            childIntent.putExtras(bun);            startActivity(childIntent);        }    });    this.doTheWork(""Parent Value"");}private void doTheWork(String value) {    new MyNewThread(value).start();}public String getTheValue(String value) {    return ""My Value is: "" + value;}private class MyNewThread extends Thread {    String value;    public LoadThread(String v) {        this.value = v;    }    @Override    public void run() {        String str = getTheValue(this.value);    }}</code></pre><p>Child Activity:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Bundle bun = getIntent().getExtras();    childValue = bun.getString(""value"");}public String getTheValue(String value) {    return ""My Value is: "" + value;}</code></pre><p>So, basically, even after the Parent starts the Child, it still returns ""Parent Value"", but when I have the thread sleep, it return ""Child Value"".</p>","321927","","321927","","2010-07-02 05:33:25","2013-12-18 16:45:51","Android Parent and Child Activity onCreate question","<android><activity><parent><oncreate>","2","3","","",""
"3163252","1","3165961","","2010-07-02 04:33:18","0","774","<p>Iam connecting 3G phone for my Android device for internet connection and another Socket(SPP) for CAN signal receiving.Whenever I manually connect to the Bluetooth tethering via 3G phone, i can browse internet perfectly and speed is good.Whenever programmatically connect to the 3G connection, i couldn't browse internet.i checked in shell and observing that in my mobile 'device is connected' message displayed and E symbol appears.No problem for me to connect Socket.But I got problem to use 3G phone.For this iam using APN/DUN mode.I checked both but no use.Is there any performance issue here or anything wrong to connect different devices by using Bluetooth API in android.Why this happends while connecting Mobile programmatically.Please give me guidance.</p><p>Regards,Rajendar</p>","362544","","35142","","2010-07-02 04:40:58","2014-01-23 17:00:06","is it ok to connect 2 devices concurrently to connect Bluetooth in Android?","<android><bluetooth>","2","0","","",""
"3163280","1","3535112","","2010-07-02 04:46:51","1","1963","<p>I'm a little confused on how binding to services works. I understand using Context.startService() starts the service and that bindService doesn't call onStartCommand. But my understanding is that if I use startService, I have to explicitly stop the service. But I want the service to die if there are no more activities bound to it.</p><p>My problem is that calling bindService never calls onServiceConnected(), so my Service binder object is null. Does the service have to be explicitly started in order to bind to it? If so, how does it know to terminate when nothing is binding to it anymore, and how do I know if it's started so I can know to use the bound object?</p>","375874","","","","","2010-08-20 21:48:31","Binding to a service in Android","<android><binding><service>","3","0","1","",""
"3163348","1","","","2010-07-02 05:11:25","0","334","<p>At the time of button click I need to show my data in landscape view.<br>How to show the data in landscape view?</p>","373172","","63550","","2010-09-15 21:28:47","2010-09-15 21:28:47","View application in landscape view?","<android>","2","0","","",""
"3163368","1","","","2010-07-02 05:15:54","0","576","<p>Tried to parse an xml file in res/xml using the following code.But when launches the project it shows an exception ""there is no such file/directory"".Is any error in the code?Give me an answer immediately.Thanks in advance.</p><pre><code> try    {        DocumentBuilderFactory docBuilderFactory=DocumentBuilderFactory.newInstance();        DocumentBuilder docBuilder=docBuilderFactory.newDocumentBuilder();        *Document doc=docBuilder.parse(new File(""project_data.xml""));*        NodeList projects=doc.getElementsByTagName(""PROJECTDESC"");        for(int i=0;i&lt;projects.getLength();i++)        {            Element project=(Element)projects.item(i);            ProjectData projectdata=new ProjectData(null, null, null, null, null, null);            projectdatas.add(projectdata);            projectdata.setProject(project.getFirstChild().getNodeValue());            projectdata.getProject();        }    }catch (Throwable t) {        Toast.makeText(this, ""Request failed: ""+t.toString(), 4000).show();    }</code></pre><p>XML FILE IS</p><pre><code>&lt;?xml version=""1.0"" encoding=""ISO-8859-1""?&gt;&lt;Results&gt;    &lt;Row&gt;        &lt;PROJECTID&gt;1000&lt;/PROJECTID&gt;        &lt;PROJECTDESC&gt;ERP Tool&lt;/PROJECTDESC&gt;        &lt;MANAGER&gt;John Jakes&lt;/MANAGER&gt;        &lt;SPONSOR&gt;Gregory Mallor&lt;/SPONSOR&gt;        &lt;STARTDATE&gt;02-01-2010&lt;/STARTDATE&gt;        &lt;PLANNEDCOMPDATE&gt;06-21-2010&lt;/PLANNEDCOMPDATE&gt;        &lt;PROBABLECOMPDATE&gt;06-30-2010&lt;/PROBABLECOMPDATE&gt;        &lt;STATUS&gt;Active&lt;/STATUS&gt;        &lt;PLNRSK&gt;59.5065&lt;/PLNRSK&gt;        &lt;EPLRSK/&gt;        &lt;EPRRSK/&gt;        &lt;BDTRSK/&gt;        &lt;ACTUALCOMPDATE/&gt;        &lt;MILESTONETOLERANCE&gt;2&lt;/MILESTONETOLERANCE&gt;        &lt;ACTIVITYTOLERANCE&gt;1&lt;/ACTIVITYTOLERANCE&gt;        &lt;WORKFLOWID&gt;10002&lt;/WORKFLOWID&gt;        &lt;CREATED&gt;02/10/2010 16:20:43 PM&lt;/CREATED&gt;    &lt;/Row&gt;    &lt;Row&gt;        &lt;PROJECTID&gt;1001&lt;/PROJECTID&gt;        &lt;PROJECTDESC&gt;CMS Implementation&lt;/PROJECTDESC&gt;        &lt;MANAGER&gt;Florence Marie&lt;/MANAGER&gt;        &lt;SPONSOR&gt;Gregory Mallor&lt;/SPONSOR&gt;        &lt;STARTDATE&gt;02-11-2010&lt;/STARTDATE&gt;        &lt;PLANNEDCOMPDATE&gt;02-16-2010&lt;/PLANNEDCOMPDATE&gt;        &lt;PROBABLECOMPDATE&gt;02-17-2010&lt;/PROBABLECOMPDATE&gt;        &lt;STATUS&gt;Open&lt;/STATUS&gt;        &lt;PLNRSK/&gt;        &lt;EPLRSK/&gt;        &lt;EPRRSK/&gt;        &lt;BDTRSK/&gt;        &lt;ACTUALCOMPDATE/&gt;        &lt;MILESTONETOLERANCE&gt;1&lt;/MILESTONETOLERANCE&gt;        &lt;ACTIVITYTOLERANCE&gt;1&lt;/ACTIVITYTOLERANCE&gt;        &lt;WORKFLOWID&gt;10004&lt;/WORKFLOWID&gt;        &lt;CREATED&gt;02/10/2010 17:07:14 PM&lt;/CREATED&gt;    &lt;/Row&gt;    &lt;Row&gt;        &lt;PROJECTID&gt;1002&lt;/PROJECTID&gt;        &lt;PROJECTDESC&gt;Key Account Manager Recruiting&lt;/PROJECTDESC&gt;        &lt;MANAGER&gt;Florence Marie&lt;/MANAGER&gt;        &lt;SPONSOR&gt;John Jakes&lt;/SPONSOR&gt;        &lt;STARTDATE&gt;02-11-2010&lt;/STARTDATE&gt;        &lt;PLANNEDCOMPDATE&gt;02-13-2010&lt;/PLANNEDCOMPDATE&gt;        &lt;PROBABLECOMPDATE&gt;02-13-2010&lt;/PROBABLECOMPDATE&gt;        &lt;STATUS&gt;Open&lt;/STATUS&gt;        &lt;PLNRSK/&gt;        &lt;EPLRSK/&gt;        &lt;EPRRSK/&gt;        &lt;BDTRSK/&gt;        &lt;ACTUALCOMPDATE/&gt;        &lt;MILESTONETOLERANCE&gt;1&lt;/MILESTONETOLERANCE&gt;        &lt;ACTIVITYTOLERANCE&gt;1&lt;/ACTIVITYTOLERANCE&gt;        &lt;WORKFLOWID&gt;10009&lt;/WORKFLOWID&gt;        &lt;CREATED&gt;02/10/2010 17:07:18 PM&lt;/CREATED&gt;    &lt;/Row&gt;    &lt;Row&gt;        &lt;PROJECTID&gt;1003&lt;/PROJECTID&gt;        &lt;PROJECTDESC&gt;Fast Food Regional Market Analysis&lt;/PROJECTDESC&gt;        &lt;MANAGER&gt;John Jakes&lt;/MANAGER&gt;        &lt;SPONSOR&gt;Florence Marie&lt;/SPONSOR&gt;        &lt;STARTDATE&gt;02-12-2010&lt;/STARTDATE&gt;        &lt;PLANNEDCOMPDATE&gt;02-16-2010&lt;/PLANNEDCOMPDATE&gt;        &lt;PROBABLECOMPDATE&gt;02-16-2010&lt;/PROBABLECOMPDATE&gt;        &lt;STATUS&gt;Open&lt;/STATUS&gt;        &lt;PLNRSK/&gt;        &lt;EPLRSK/&gt;        &lt;EPRRSK/&gt;        &lt;BDTRSK/&gt;        &lt;ACTUALCOMPDATE/&gt;        &lt;MILESTONETOLERANCE&gt;2&lt;/MILESTONETOLERANCE&gt;        &lt;ACTIVITYTOLERANCE&gt;1&lt;/ACTIVITYTOLERANCE&gt;        &lt;WORKFLOWID&gt;10010&lt;/WORKFLOWID&gt;        &lt;CREATED&gt;02/10/2010 17:07:22 PM&lt;/CREATED&gt;    &lt;/Row&gt;    &lt;Row&gt;        &lt;PROJECTID&gt;1004&lt;/PROJECTID&gt;        &lt;PROJECTDESC&gt;ss&lt;/PROJECTDESC&gt;        &lt;MANAGER&gt;John Jakes&lt;/MANAGER&gt;        &lt;SPONSOR&gt;Gregory Mallor&lt;/SPONSOR&gt;        &lt;STARTDATE&gt;02-11-2010&lt;/STARTDATE&gt;        &lt;PLANNEDCOMPDATE&gt;02-16-2010&lt;/PLANNEDCOMPDATE&gt;        &lt;PROBABLECOMPDATE&gt;02-17-2010&lt;/PROBABLECOMPDATE&gt;        &lt;STATUS&gt;Open&lt;/STATUS&gt;        &lt;PLNRSK/&gt;        &lt;EPLRSK/&gt;        &lt;EPRRSK/&gt;        &lt;BDTRSK/&gt;        &lt;ACTUALCOMPDATE/&gt;        &lt;MILESTONETOLERANCE&gt;1&lt;/MILESTONETOLERANCE&gt;        &lt;ACTIVITYTOLERANCE&gt;1&lt;/ACTIVITYTOLERANCE&gt;        &lt;WORKFLOWID&gt;10080&lt;/WORKFLOWID&gt;        &lt;CREATED&gt;06/27/2010 19:16:26 PM&lt;/CREATED&gt;    &lt;/Row&gt;&lt;/Results&gt;</code></pre>","357112","","133802","","2010-07-02 05:20:39","2011-08-11 08:20:22","DOM parser in android","<android><domparser>","2","1","","",""
"3163453","1","","","2010-07-02 05:36:00","17","16469","<p>Yes, I know Android has already implemented the Bluetooth HeadsetProfile, but it is in Audio Gateway Role, not in HeadSet Role.</p><p>What I want to do is develop an application on Android phone whichwill act as a bluetooth headset, so it can connect to my laptop bybluetooth.When I try to call somebody, I can use my phone to dial him, and myapplication will forward the voice through bluetooth to my laptop,and one other application running on laptop will get the voice dataand forward them to Skype or GTalk or some VoIP program else.</p><p>In other words, how can I implement the Headset Profile in HeadsetRole on Android phone? Thanks in advance!</p>","381748","","","","","2013-06-01 19:38:34","How to make Android phone as a bluetooth headset?","<android><bluetooth><headset>","2","1","9","",""
"3163511","1","3164047","","2010-07-02 05:50:58","3","616","<p>I am setting an alarm for my reminder app:</p><pre><code>PendingIntent sender = PendingIntent.getBroadcast(AddToDoList.this,           Integer.parseInt(DBHelperClass.getMaxPrimaryId()), intent, 0);</code></pre><p>i am using a unique value (primary ID) to set an alarm. When i want to edit the alarm i am using the same key. But what i see is that both the alarms go off! original as well as edited one.</p><p>how do i cancel the old alarm ?Also these alarms are not working once i switchOff &amp; then again switchOn my device .</p>","344768","","114066","","2010-07-02 06:38:39","2010-07-02 07:52:41","Editing an alarm !","<android><alarm>","2","0","","",""
"3163628","1","3163656","","2010-07-02 06:24:00","4","3843","<p>I am developing an Android application. I am novice in Touch enabled Android Application. I have read the article about <code>onFling</code> and <code>onScroll</code> events on:</p><p><a href=""http://developer.android.com/reference/android/view/GestureDetector.OnGestureListener.html"" rel=""nofollow"">http://developer.android.com/reference/android/view/GestureDetector.OnGestureListener.html</a></p><p>But I didn't get exactly what is the meaning and for what we can use <code>onFling</code> and <code>onScroll</code> events.</p>","379693","","1128737","","2012-01-13 10:46:55","2012-01-13 10:46:55","What is the purpose of ""onFling"" and ""onScroll"" event in GestureDetector of Android?","<android><android-widget>","1","1","2","",""
"3163706","1","","","2010-07-02 06:37:57","2","14534","<p>I want to add play gif format to my android app. Could this be done, and how would I do it?</p>","369972","","114066","","2010-07-02 06:51:35","2012-04-11 13:09:33","Is it possible to play GIF format in Android?","<android><animated-gif>","4","1","","2012-03-20 18:03:48",""
"3163805","1","3163831","","2010-07-02 06:58:07","1","1125","<p>Say I want to create a database using the Android SDK's sqlite tool. What would the file extension have to be? I would think .db or .sqlite3 or .sqlite? How would I import it in my source code (Is there a method I should call?) and where in my source code? I was thinking in the onCreate method of a class that implements <a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html"" rel=""nofollow""><code>SqliteOpenHelper</code></a>.</p>","200477","","","","","2012-12-03 04:17:23","Use custom SQLite database for Android","<java><android><database><sqlite>","1","2","1","",""
"3163845","1","3163893","","2010-07-02 07:07:11","21","10267","<p>Is the <a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html#onUpgrade%28android.database.sqlite.SQLiteDatabase,%20int,%20int%29""><code>onUpgrade</code></a> method of <a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html""><code>SQLiteOpenHelper</code></a> ever called? If so, when is it called and by what? Or if it is not called by developers, then why is it there? What should be done in the method I have seen examples where it drops all the tables, but then a comment says that dropping all the tables is <b>NOT</b> what you should do.</p>","200477","","","","","2012-10-04 08:00:13","Is the onUpgrade method ever called?","<java><android><sqlite>","3","0","9","",""
"3163884","1","","","2010-07-02 07:15:24","34","27358","<p>I want to create tabs <strong>without</strong> extending TabActivity. (The reason is that TabActivity cannot handle a custom titlebar as it seems). I have</p><pre><code>public class startTab extends Activity { @Override public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.mylayout);        Resources res = getResources();        LocalActivityManager mlam = new LocalActivityManager(this, false);        TabHost tabHost = (TabHost) findViewById(R.id.tabhost);        tabHost.setup(mlam);        TabHost.TabSpec spec;        Intent intent;    intent = new Intent().setClass(this, Show1.class);    spec = tabHost.newTabSpec(""Items"").setIndicator(""Items"", res.getDrawable(R.drawable.items32_ldpi)).setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, Show2.class);    spec = tabHost.newTabSpec(""Users"").setIndicator(""Users"",res.getDrawable(R.drawable.user32_ldpi)).setContent(intent);    tabHost.addTab(spec);}</code></pre><p>}</p><p>The error I get is </p><pre><code>    07-02 07:11:12.715: ERROR/AndroidRuntime(411): Caused by: java.lang.IllegalStateException: Activities can't be added until the containing group has been created.</code></pre><p>The xml for the view is</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/tabhost"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" &gt; &lt;LinearLayout android:orientation=""vertical""  android:layout_width=""fill_parent"" android:layout_height=""fill_parent""  android:paddingTop=""5dip""&gt;  &lt;TabWidget android:id=""@android:id/tabs""   android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;/TabWidget&gt;  &lt;FrameLayout android:id=""@android:id/tabcontent""   android:layout_width=""fill_parent"" android:layout_height=""fill_parent""   android:paddingTop=""5dip""&gt;  &lt;/FrameLayout&gt; &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>I read somewhere that I have to use a LocalActivityManager, I assume that I am missing something there. Anyone an idea?</p><p>Thanks!</p>","363436","","539542","","2012-01-15 05:31:29","2013-01-01 15:47:38","Android: TabHost without TabActivity","<android><android-tabhost>","4","1","16","",""
"3163928","1","3379541","","2010-07-02 07:23:33","1","3271","<p>I've got an app that creates an intent for the last.fm android app in which it will start the ""recommended"" station for my account when i press a button. The trick i'm trying to figure out is how do i get the phone back to my app without the user having to navigate back manually? Once it start the last.fm intent it takes you to the playlist and i need it to resume back to my app automatically.  </p>","361582","","","","","2012-10-16 16:24:44","startActivity(intent) and resume to main activity?","<android><activity><android-intent>","2","0","","",""
"3164032","1","","","2010-07-02 07:47:59","0","4737","<p>I have added a Button to a view in java code.  Basically I want to add the xml</p><pre><code>android:layout_gravity=""center_horizontal""</code></pre><p>to the Button but do this in Java code, how is this done?</p>","248521","","","","","2013-09-01 14:48:19","android:layout_gravity=""center_horizontal"" in Java code","<android>","2","4","0","",""
"3164145","1","","","2010-07-02 08:16:30","1","1758","<p>I'm developing an android application that involves the detection of the users' location. What I would like to know is, how does this -> LocationManager.GPS_PROVIDER work?</p><p>Does it uses the GPS system in the phone or does it uses the mobile company's area network location?</p><p>Whenever I turn on the GPS system in my phone, the map would not load. It will only be able to  detect &amp; pinpoint the location when I deactivate it. I think the application is tapping into the GPRS or something.</p><p>Thanks.</p>","381848","","","","","2012-07-26 04:53:41","Android GPS Provider","<android><gps>","2","0","1","",""
"3164197","1","","","2010-07-02 08:29:42","0","680","<pre><code>        Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);     //Using a File so it overwrites previous camera shot        File pictureFile = new File(cameraImagePath);        camera.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(pictureFile));        startActivityForResult(camera, TAKE_PICTURE);</code></pre><p>I'm using this code to get a camera shot which is then uploaded to an imageboard. The problem is that on some phones GPS locations are recorded in the EXIF data and users are unknowingly revealing their locations. Is there some value I can add to the intent to tell the camera app not to record any EXIF data?</p><p>(Using 1.6 API's also)</p>","381856","","","","","2011-03-31 15:09:58","Setting camera intent to not add in EXIF data","<android>","1","0","","",""
"3164211","1","3165239","","2010-07-02 08:32:35","1","428","<p>I want to enter an website using the tel num as a password how do i get it using the android API is it possible ?</p><hr><p>or is there another key value on the android which is unique and I can ask him from the android system , android devices and therefore security is promised?  </p>","368440","","368440","","2010-07-02 09:53:11","2010-07-02 11:27:16","how to get the device(android) tel number or other device unique id which can be taken from the system","<android>","2","0","1","",""
"3164325","1","3945697","","2010-07-02 08:53:22","8","4690","<p>Android 2.2 i.e API Level 8 has tabStripEnabled=""true"" for TabWidgethow to achieve the same in Older versions of Android?</p>","367016","","","","","2012-10-01 08:06:28","tabStripEnabled for TabWidget in Older API's","<android>","2","1","2","",""
"3164353","1","3165595","","2010-07-02 08:59:13","1","5024","<p>I want to upload image to IIS server using c# web service. I have written the web method for this as follows:</p><pre><code>[WebMethod] public string UploadFile(byte[] f, string fileName){    try    {       MemoryStream ms = new MemoryStream(f);       FileStream fs = new FileStream(System.Web.Hosting.HostingEnvironment.MapPath       (""~/TransientStorage/"") +fileName, FileMode.Create);        ms.WriteTo(fs);        ms.Close();       fs.Close();       fs.Dispose();        return ""OK"";    }    catch (Exception ex)    {        // return the error message if the operation fails        return ex.Message.ToString();    }}</code></pre><p>Here the web method is taking argument as byte[] .I have convert the sdcard image to byte[] but when i am passing it as an URL paramete it is not working .I have also tried by converting the byte[] array to base64 strig still it is not working.</p><p>Can any one tell me how to upload image to IIS server using c# web service.</p>","307585","","1047741","","2013-03-20 13:26:49","2014-04-18 15:42:28","image uploading from android application to server using c# web service","<c#><android><web-services>","1","0","","",""
"3164480","1","5153951","","2010-07-02 09:18:14","2","3326","<p>after hours of research I still haven't found any answer.I'm trying to send a DateTime as a Parameter to a Method exposed over a WCF RESTful Service with JSON encoding. The request looks like this:</p><pre><code>POST http://IP:PORT/LogService/json/GetLogEntriesByModule HTTP/1.1Content-Length: 100Content-Type: application/jsonHost: IP:PORTConnection: Keep-AliveUser-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)Expect: 100-Continue{""maxentries"":10,""upperdate"":""1280703601462"",""lowerdate"":""1277938801462"",""module"":""Windows Service""}</code></pre><p>I tried several formats for the DateTime:</p><ul><li>2010-07-01T10:54:00<ul><li>which is send by the WCFTestClient Application over net.tcp and it gets results...</li></ul></li><li>\/Date(12345678+0100)\/</li><li>01.07.2010 10:54:00</li></ul><p>The Methoddefinition:</p><pre><code>LogEntry[] GetLogEntriesByModule( string module, DateTime lowerDate, DateTime upperDate, int maxEntries, out bool maxEntriesReached)</code></pre><p>I always the the following response:</p><pre><code>HTTP/1.1 200 OKContent-Length: 60Content-Type: application/json; charset=utf-8Server: Microsoft-HTTPAPI/2.0Date: Fri, 02 Jul 2010 09:07:04 GMT{""GetLogEntriesByModuleResult"":[],""maxEntriesReached"":false}</code></pre><p>It seems the DateTime isn't correctly parsed, because there are several Entries in the Log for that Time...</p><p>Does anyone know on how to do this? </p><p>EDIT: The Problem was on the server side and has been resolved.</p>","381899","","381899","","2010-10-27 13:03:04","2013-07-22 13:59:30","POSTing a DateTime from Android to a WCF RESTful JSON Service","<android><wcf><json><datetime><rest>","3","2","3","",""
"3164603","1","","","2010-07-02 09:38:04","6","5901","<p>I have a two Views. One is a WebView and the other is an ImageView. I set the auto zoom controls for the WebView like so:</p><pre><code>webview.getSettings().setBuiltInZoomControls(true);</code></pre><p>I am just changing the visibility of both Views using <code>GONE</code> and <code>Visible</code>. While changing my View from WebView to ImageView, the zoom controls do not lose their visibility for some period of time.</p><p>Is there any possible way to hide and show the Autozoomcontrols?</p><p>Edit:</p><p>I tried these methods, but it's still not working.</p><pre><code>webview.getZoomControls().setVisibility(View.GONE);webview.getZoomControls().invalidate();</code></pre>","267269","","496830","","2011-10-11 16:29:09","2012-07-24 16:01:48","Is there a way to hide and show the zoom controls on a WebView?","<android><webview><zoom>","3","0","","",""
"3164613","1","3164644","","2010-07-02 09:39:50","1","1317","<p>I need the way to check an item in ListView with choice mode SINGLE from my code. Simply cant't find the method needed.  </p><p>Thanks.</p>","218783","","","","","2010-07-02 09:45:37","Programmatically checking item in ListView","<android>","1","0","","",""
"3164638","1","","","2010-07-02 09:44:13","1","1556","<p>recently i upgraded from android 1.5 to 2.2.. now when i run the voicerecognition app it gives me the error ""recognizer not present""is there a solution to this.. </p>","381921","","","","","2010-07-30 15:09:07","android voice recognizer not present","<android><emulator>","1","0","0","2012-08-23 11:39:28",""
"3164729","1","","","2010-07-02 09:58:51","-2","636","<p>How to send any message from one activity to anothere using intent and intent filters.</p>","381932","","","","","2013-05-23 01:21:28","intents and intents filter","<android>","2","1","0","2013-05-23 12:37:26",""
"3164862","1","3223676","","2010-07-02 10:21:34","9","4407","<p>My <code>PreferenceActivity</code> contains a nested <code>PreferenceScreen</code> in another <code>PreferenceScreen</code> and I'm applying a theme to my <code>PrefenceActivity</code> that changes the background color. However when I open the nested <code>PreferenceScreen</code> I get a black background and I cannot see the options.</p><p>This happens with android 2.1 , but it does not happen with android 1.6.Any ideas on how this can be corrected?</p>","304866","","119895","","2010-07-11 15:16:23","2013-12-15 11:42:45","Black screen in inner preferenceScreen","<android>","4","1","3","",""
"3164864","1","3165116","","2010-07-02 10:22:12","2","626","<p>Where and how can I find and download <strong>Android 1.5</strong> source code?</p>","378882","","648313","","2011-07-13 21:00:16","2011-07-13 21:00:16","Where and how can I find and download Android 1.5 source code?","<android><android-source>","3","0","1","",""
"3164908","1","","","2010-07-02 10:29:38","1","3338","<p>I am attempting to follow Diane Hackborn's <a href=""http://groups.google.com/group/android-porting/browse_thread/thread/4559c6864fc5fb80?hl=en"" rel=""nofollow"">request</a>:</p><blockquote>  <p><em>For a permission that allows an application to be root, it is okay to  add the permission to the framework  &lt;...>. However, there still must be  some kind of shared library (even if  it is a stub) for the application to  request along with it, and the package  manager should not allow the  application get this permission unless  they also request the shared library.</em></p></blockquote><p>So I used the sdk's sample example of TicTacToe:</p><ol><li>exported com.example.android.tictactoe.library to a /data/app/TTTLib.jar</li><li><p>added /system/etc/permissions/com.example.android.tictactoe.library.xml with lines:</p><p><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;permissions&gt;    &lt;library name=""com.example.android.tictactoe.library""            file=""/data/app/TTTLib.jar"" /&gt;&lt;/permissions&gt;</code></p></li><li><p>And compile com.example.android.tictactoe.MainActivity by adding a class folder pointing to the library but not adding the library itself to the .apk</p></li></ol><p>It compiles, installs, starts running, but at the point when a library class were called crashes with error msg:</p><pre><code>W/dalvikvm(  464): threadid=1: thread exiting with uncaught exception (group=0x4001d800)E/AndroidRuntime(  464): FATAL EXCEPTION: mainE/AndroidRuntime(  464): java.lang.NoClassDefFoundError: com.example.android.tictactoe.library.GameActivityE/AndroidRuntime(  464):    at com.example.android.tictactoe.MainActivity.startGame(MainActivity.java:51)E/A</code></pre><p>What do I miss? Thanks for your help.</p>","334617","","","","","2012-07-06 11:05:55","How to add system permission file/system library to Android","<android>","1","0","1","",""
"3165061","1","3167707","","2010-07-02 10:53:06","1","3946","<p>I am developing an application for Android phone. In this I need to use at least 400 audio files which can be played for some respective texts. Now my question is which is the optimized way to do this..</p><p>One solution is putting all the audio files in the resource folder and referring from there, this will never be a feasible solution as the application size will increase. Is there any way to convert the audio file into some format and dump into the SQLite database and  retrieve flexibly?</p><p>Any suggestions or guidance is highly appreciated.</p>","28557","","615882","","2012-10-27 20:34:18","2013-06-19 12:05:02","Android - Storing Audio Files into the SQLite Database","<android><database><sqlite><audio><android-sqlite>","4","0","2","",""
"3165105","1","","","2010-07-02 11:00:52","2","2866","<p>I have a problem with a tab view on android.</p><p>I am using 4 xml layout files (each a RelativeLayout) as the content for tabs in a tab view.</p><p>The main.xml contains: TabHost (@android:id/tabhost) containing a linearLayout which contains a TabWidget (@android:id/tabs) and a FrameLayout (@android:id/tabcontent) </p><p>If I embedd the multiple   one after another in the  in the main.xml everything works fine...    (except my main.xml is unmaintainable which is the problem i want to solve by splitting the files into a simple main.xml which defines the tab and the content frame and then push the views onto this...).</p><p>The code i have to inflate and insert the 4 RelativeLayout xml files into the tab content is as follows:</p><pre><code>mTabHost = getTabHost();View wv = null;wv = LayoutInflater.from(this).inflate(R.layout.user_tab, mTabHost.getTabContentView(), true);mTabHost.addTab(mTabHost.newTabSpec(""User"").setIndicator(""User"").setContent(wv.getId()));wv = LayoutInflater.from(this).inflate(R.layout.track_tab, mTabHost.getTabContentView(), true);mTabHost.addTab(mTabHost.newTabSpec(""Track"").setIndicator(""Track"").setContent(wv.getId()));wv = LayoutInflater.from(this).inflate(R.layout.chart_tab, mTabHost.getTabContentView(), true);mTabHost.addTab(mTabHost.newTabSpec(""Chart"").setIndicator(""Chart"").setContent(wv.getId()));</code></pre><p>//  And so on for the multiple tabs.</p><p>When i run this the first tab (User) is empty and the remaining tabs have all the content from all the views...  So tab2 has the content from tab1-4, tab3 has the content from tab1-4 and tab4 has the content from tab1-4...  Returning to tab1 it then has all the content from tab1-4 now.</p><p>The code works just fine, the events on the various objects in the views etc all are good...  It is just that they are all muddled together in the view...</p><p>Any ideas on what is causing this and how to correct it?</p><p>Thanks in advance.</p><p>Jim</p>","314130","","","","","2010-07-03 11:38:41","Android issue with Tab initialization","<android><tabs>","2","0","2","",""
"3165117","1","3169306","","2010-07-02 11:02:28","54","11192","<p>Can anyone describe a good Vim setup for Android Development? I'm using Eclipse for now but I would really like to use Vim because it's faster and I like it better. I'm not interested in Eclim for example.</p><p>I'm interested in what Vim plugins are used (for Java, autocomplete etc.), how the <code>.vimrc</code> looks like and how the whole process of building/running applications works (as efficiently as possible).</p>","292263","","100754","","2011-12-17 19:05:15","2013-10-06 14:28:04","How can I set up Vim for Android development?","<android><vim>","5","3","33","",""
"3165160","1","3165241","","2010-07-02 11:08:18","3","742","<p>In my project whenever I extend activity it works fine but as soon as I extend ListActivity it throws exception and shows file not found. Why is that? We already know that ListActivity itself extends the Activity class. The application must run fine.</p><p>Here's the java file:</p><pre><code>package com.android.feedGrabber;import java.net.URL;import java.net.URLConnection;import java.util.Collection;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import com.sun.cnpi.rss.elements.Item;import com.sun.cnpi.rss.elements.Rss;import com.sun.cnpi.rss.parser.RssParser;import com.sun.cnpi.rss.parser.RssParserFactory;public class feedGrabber extends Activity {    public static Collection&lt;Item&gt; readRSSDocument(String url) throws Exception {                RssParser parser = RssParserFactory.createDefault();                URL feedUrl = new URL(url);                URLConnection urlc=feedUrl.openConnection();                urlc.setRequestProperty(""User-Agent"","""");                urlc.connect();                Rss rss = parser.parse(urlc.getInputStream());                return rss.getChannel().getItems();        }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        int links=0;        try        {        for(Item item : feedGrabber.readRSSDocument(""http://feeds.feedburner.com/Tutorialzine"")){                if(links++&gt;3)                        break;                TextView t = (TextView)findViewById(R.id.title);                t.append(""Title: "");                t.append(item.getTitle().toString());                t.append(""\n\n"");                //System.out.println(""Title: "" + item.getTitle());                //System.out.println(""Link: "" + item.getLink());        }        }catch(Exception e)        {            //        }      }}</code></pre><p>If I change ""extends Activity"" to ""extends ListActivity"" it gives the exception. I need to bring this change because I want to implement it on ListView instead of TextView.</p><p>Error it throws:debug mode gets active and it highlights under Suspended(exception RunTimeException): ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2663.</p>","172543","","172543","","2010-07-02 11:29:28","2010-12-13 05:58:22","Problem regarding extending ListActivity","<java><android>","2","6","","",""
"3165190","1","","","2010-07-02 11:14:04","1","8678","<p>I am trying to call my service class's stopService() method from my activity.But I dont know how to access stopservice method from my activity class.I have the below code but its not working...........</p><blockquote>  <p>This is HomeScreen class:</p></blockquote><pre><code> public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        enablecheck = (CheckBox)findViewById(R.id.enablecheck);                    enablecheck.setOnCheckedChangeListener(new OnCheckedChangeListener()        {            @Override            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {                // TODO Auto-generated method stub                if(enablecheck.isChecked()){                        startService(new Intent(HomeScreen.this, AutoService.class));                }else                {                    stopService(new Intent(HomeScreen.this, AutoService.class));                }                                   }        });    }</code></pre><blockquote><pre><code>This is Service Class:</code></pre></blockquote><pre><code>public class AutoService extends Service {    private static final String TAG = ""AutoService"";    private Timer timer;        private TimerTask task;    @Override    public IBinder onBind(Intent intent) {        return null;    }    @Override    public void onCreate() {        Toast.makeText(this, ""Auto Service Created"", Toast.LENGTH_LONG).show();        Log.d(TAG, ""onCreate"");             int delay = 5000; // delay for 5 sec.        int period = 5000; // repeat every sec.        timer = new Timer();        timer.scheduleAtFixedRate(task = new TimerTask(){            public void run()             {                System.out.println(""done"");            }           }, delay, period);    }    @Override    public boolean stopService(Intent name) {        // TODO Auto-generated method stub        timer.cancel();        task.cancel();        return super.stopService(name);    }}</code></pre><p>Any suggestion highly appreciable.Thanks and RegardsMintu</p>","162644","","","","","2013-11-27 17:30:32","How to call stopservice() method of Service class from the calling activity class","<android>","3","0","2","",""
"3165233","1","3165390","","2010-07-02 11:25:58","1","1861","<p>What I'm trying to do is play the first video retrieved from the external SD card, which on my T-Mobile G2 turns out to be the sample video for the phone. Now I assumed that since it plays in the phones video player, that it'd have no problems with playing in the VideoView in my test app.</p><p>How wrong... </p><p>All I get is the audio playing. I'm pretty sure the code is all fine. After all it's pretty simple. </p><p>All I can think is that maybe the phones video player uses some native playback function which supports more video formats? </p><p>I've also tried playing an the mv4 (actually an MP4 file) and the 3gp file from this site <a href=""http://support.apple.com/kb/HT1425"" rel=""nofollow"">http://support.apple.com/kb/HT1425</a> but pushing them on to the emulator SDCard, but both exhibit the same problem. Audio but no video!</p><p>Actually, am I missing a permission somewhere?</p><p>Can anyone else explain this behaviour? </p><p>Code:</p><pre><code>public class Video extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                                   WindowManager.LayoutParams.FLAG_FULLSCREEN);          setContentView(R.layout.video);        // Get the external storage state        String state = Environment.getExternalStorageState();        // Check if we can read it in        if (Environment.MEDIA_MOUNTED.equals(state)==false&amp;&amp;         Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)==false)        {         // We can't read from the memory card, so warn and return;         Toast toast = Toast.makeText(this,            ""The SD card is either missing or not in a readable state."", Toast.LENGTH_LONG);         toast.show();         return;        }        // Get a cursor to the video files        Cursor cc = this.getContentResolver().query(          MediaStore.Video.Media.EXTERNAL_CONTENT_URI,           null, null, null, null);        // Get the video column index        int videoIDColumn = cc.getColumnIndex(MediaStore.Video.VideoColumns._ID);        // Iterate though the videos pointed to by the cursor        if (cc.moveToFirst())        {          int videoID = cc.getInt(videoIDColumn);          Uri videoPath = Uri.withAppendedPath(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,String.valueOf(videoID));          // Log and add an image to the view          Log.i(""Video Found"",videoPath.toString());          VideoView videoView = (VideoView)findViewById(R.id.VideoTest);          videoView.setVideoURI(videoPath);          videoView.start();        }        else        {         Toast toast = Toast.makeText(this,            ""Can't find a video to play."", Toast.LENGTH_LONG);         toast.show();        }    }}</code></pre><p>Thanks in advanced!</p><p>Andy</p><p>** Update</p><p>I've tried using android 1.5 and 1.6 and the problem still persists. </p><p>Also, just checked logcat, and I don't get any errors for any of the other files, but for the .3gp I get this error below:</p><pre><code>07-02 10:53:31.181: INFO/Video Found(235): content://media/external/video/media/207-02 10:53:31.383: VERBOSE/VideoView(235): reset duration to -1 in openVideo07-02 10:53:31.541: INFO/ActivityManager(58): Displayed activity com.dvl.testing/.screens.Video: 533 ms (total 533 ms)07-02 10:53:31.693: WARN/PlayerDriver(31): Using generic video MIO07-02 10:53:31.883: ERROR/SW_DEC(31): PV SW DECODER is used for MPEG407-02 10:53:31.922: DEBUG/AudioSink(31): bufferCount (4) is too small and increased to 1207-02 10:53:32.322: INFO/ARMAssembler(58): generated scanline__00000077:03010104_00000004_00000000 [ 22 ipp] (41 ins) at [0x2166f8:0x21679c] in 3379159 ns</code></pre><p>Make sense to anyone?</p>","187100","","187100","","2010-07-02 11:36:21","2010-07-02 11:52:39","Android VideoView not playing sample video on T-Mobile G2 (Just audio)","<java><android><video>","1","0","","",""
"3165401","1","3165504","","2010-07-02 11:54:03","1","1430","<p>how to send a message from one activity to another using intent and intent filters?</p>","1497488","","369","","2010-07-02 11:55:34","2010-07-02 12:10:03","Send message through intent filter","<android>","1","0","","",""
"3165553","1","3165738","","2010-07-02 12:19:23","0","1196","<p>Started coding up a simple android app. Part of it pulls the users last 20 tweets and saves them to a database. When I run this, statuses = twitter.getUserTimeline(); throws an exception its handled and prints out: failed to get timeline-permission denied. When I run the same code non-android, it works fine. I'm a little bit baffled. Could android be limiting the network connection?  Im using some database helper classes, haven't included the code because the exception is thrown before any of these are even involved :(Heres the code:</p><pre><code>import twitter4j.Paging;import twitter4j.Status;import twitter4j.Twitter;import twitter4j.TwitterException;import twitter4j.TwitterFactory;import java.io.File;import java.io.IOException;import java.util.ArrayList;import java.util.Date;import android.app.ListActivity;import android.os.Bundle;import android.widget.ArrayAdapter;public class  TwitterTest extends ListActivity{ private ArrayList&lt;String&gt; queryString; private DatabaseQuery query; /* returns date in string format-without time */ String getThisYearDate(Date d){  String x = d.toString();  String y= x.substring(0, 11);  String z =x.substring(17);  String a = y.concat(z);  return a; } @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  query = new DatabaseQuery(this);  /*If file exists then tables in db created successfully*/  File file = new File(""exists.txt"");  boolean success = file.exists();  if (success==false) {   try {    ArrayList&lt;Status&gt; statuses = new ArrayList&lt;Status&gt;();    Twitter twitter = new TwitterFactory().getInstance(""USERNAME"", ""PASSWORD"");    statuses = twitter.getUserTimeline();    /* adds status data to database*/    for(Status s: statuses){     query.appendData(""Text"", s.getText());     query.appendData(""Date"", this.getThisYearDate(s.getCreatedAt()));     query.appendData(""ID"",String.valueOf(s.getId()) );     query.addRow();    }   }   catch (TwitterException te) {    System.out.println(""Failed to get timeline: "" + te.getMessage());    System.exit( -1);   }   try{    boolean created = file.createNewFile();   }   catch (IOException e) {    System.out.println(""error"");   }   queryString = query.getData(new String[] {""Text""},this.getThisYearDate(new Date()), null, null, null, ""Date"", "" ASC"");   try {    query.destroy();   } catch (Throwable e) {    e.printStackTrace();   }  } else {   // File already exists   queryString = query.getData(new String[] {""Text""},this.getThisYearDate(new Date()), null, null, null, ""Date"", "" ASC"");   try {    query.destroy();   } catch (Throwable e) {    e.printStackTrace();   }  } // Set the ListView setListAdapter(new ArrayAdapter&lt;String&gt;(this,   android.R.layout.simple_list_item_1, queryString)); getListView().setTextFilterEnabled(true);}}</code></pre>","312928","","105224","","2010-07-02 12:32:48","2013-06-16 15:48:24","Android Twitter exception error :(","<java><android><twitter><twitter4j>","2","0","","",""
"3165570","1","3165925","","2010-07-02 12:21:43","2","5672","<p>As the title says, it is possible to run a full android device rom inside the Android emulator?</p>","268247","","","","","2012-09-05 02:38:19","Run a full android phone rom on the Android Emulator","<android><android-emulator>","2","0","1","",""
"3165587","1","3167685","","2010-07-02 12:23:38","0","282","<p>hello I want to work with a site how do I do itlet's say I want my app to grab some information from a site.</p><p>lets say I have a site which store all the phone numbers data and I want an application app who will have a menu where you just need to click name and address and the app find for you using the web(a web which supply this service ) the person phone number .</p><p>i want the user to see my UI(the application UI) and the app to communicate to this site and by asking the right queries getting the information.</p><p>is there any open source example of that ?</p>","368440","","368440","","2010-07-02 12:34:13","2011-02-17 23:40:26","mobileapp - web communication ,application connection to web using her own UI concept?","<android><mobile-phones><mobile-website>","1","0","","",""
"3165667","1","","","2010-07-02 12:34:51","6","2773","<p>I've installed the Android plugin on Eclipse 3.6 in a regular way (aka i followed step by step the google installation page). </p><p>When I launch any sample application, everything works fine, but if I try to quit the emulator (by clicking the exit cross button of the emulator), the emulator seems to hang completly.</p><p>What is very bothering is that I can't even kill the process, launch another emulator or even reboot my pc, since the process seems to be impossible to stop or kill.</p><p>Does anyone have similar problem, and a solution to give?</p>","382043","","494626","","2011-10-13 19:02:10","2013-03-22 18:40:49","Android Emulator hang up and impossible to quit","<android><android-emulator>","4","1","","",""
"3165706","1","","","2010-07-02 12:39:53","1","173","<p>My android project shows error on the root folder(red cross on the application root folder)although any class or resource file inside the root folder does not show any error.</p>","382049","","1307905","","2013-05-11 05:56:20","2013-05-11 05:56:20","Android beginners","<android>","3","1","","",""
"3165928","1","3166143","","2010-07-02 13:10:33","2","1503","<p>I have a .sqlite file with one table in it. i want to access this data. Please tell me, where to copy this .sqlite file (in eclipse project) and how to access the data from this .sqlite file.</p><p>please suggest some code or liniks.. [i am using Android 2.1, dont know the database version..]</p><p>Thank you..</p>","365184","","","","","2010-07-02 13:37:51","Accessing .sqlite file in Android 2.1","<android><database><sqlite><sqlite3>","1","0","1","",""
"3165938","1","3165971","","2010-07-02 13:11:44","3","3607","<p>I have an image drawable. i rotating the image like a progress bar.</p><pre><code>&lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android""android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""0""android:toDegrees=""360"" android:drawable=""@drawable/spinner_white_48"" /&gt;</code></pre><p>i want to increase the rotation speed? for that, What attribute i have to use?</p>","267269","","","","","2013-10-04 15:41:11","How to increase the rotation speed in android?","<android><animation><rotation>","3","0","3","",""
"3166039","1","","","2010-07-02 13:25:57","6","8437","<p>Is it by anyway possible to write to call logs database?? I mean i want to add selected numbers to the call history. I tried searching the tutorial on net but couldn't find any... Though 1 thing is for sure, IT CAN BE DONE. coz i have seen lots of applications online, which restore call logs, so i guess we can modify the call history database somehow(but how exactly is not clear with me).</p><p>i already read <a href=""http://stackoverflow.com/questions/2738421"">this post</a> but it happens to be posted a long time back.</p><p>Any help will be appreciated! Thanx!</p>","238071","","","","","2011-06-19 22:12:50","android adding number to Call logs","<android><calllog>","2","7","1","",""
"3166288","1","3166572","","2010-07-02 13:52:05","1","1242","<p>I have a ListView that gets filled from a cursor (using rawQuery) that I need to get the text of the selected item from on click.</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    Intent mViewChaptersIntent = new Intent(this, ViewWeb.class);    String s = ((TextView) l.getItemAtPosition(position)).getText().toString(); // Tried this, didn't work.    mViewChaptersIntent.putExtra(""extension"", s);    mViewChaptersIntent.putExtra(""itmClicked"", String.format(""%d"", id));    startActivity(mViewChaptersIntent);}</code></pre><p>But I'm not sure about the right way to do it. The getItemAtPosition that I've seen in other posts doesn't seem to work...</p>","356438","","","","","2010-07-02 14:24:55","Getting text from a Listview","<android>","1","0","","",""
"3166329","1","3166496","","2010-07-02 13:56:46","1","1474","<p>I have trouble with an Android app keeping a partial wake lock on my system; so I'd like to write an app that keeps an eye on the bad app and kills its partial wake lock shortly after it acquires one.</p><p><a href=""http://google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/os/PowerManager.java&amp;q=android.os.PowerManager&amp;d=4"" rel=""nofollow"">android.os.PowerManager</a> is used to acquire and release wake locks but I don't see any way to get all wake locks in the system; even if I got access to its <code>IPowerManager mService</code> variable, that service doesn't release a wake lock without the <code>IBinder</code> object associated with the wake lock.</p><p>So I'm stuck. How do I proceed? Is this even possible?</p>","47493","","","","","2011-07-13 23:44:04","Android: Enumerate all wake locks in the system","<android>","2","0","1","",""
"3166501","1","3166582","","2010-07-02 14:17:08","192","85661","<p>How to get the screen density programmatically in android? </p><p>I mean How to find the screen dpi of the current device?</p>","267269","","","","","2014-03-24 13:50:23","getting the screen density programmatically in android?","<android>","11","0","72","",""
"3166573","1","","","2010-07-02 14:24:58","1","42","<p>any idea how to implement something like the multiple desktops of the android?</p><p>I tried Gallery but it sucks I wansted something just like the desktop app </p><p>thanks </p>","87624","","","","","2013-02-01 13:47:45","something olike the multi desktops app","<android>","2","0","1","",""
"3166758","1","3167640","","2010-07-02 14:50:04","4","993","<p>Do you have any idea what's the starting point to develop an UI for Android OS, similar with HTC SenseUI ?</p><p>Can I create that on top of Android or I need to get the Android source code ?</p><p>Thank you.</p><p>Florin Matinca</p>","370381","","","","","2012-04-05 12:59:42","Creating Android UI like HTC Sense","<android><htcsense>","3","1","3","",""
"3166769","1","9494589","","2010-07-02 14:51:33","3","1308","<p>Does anyone know how to achieve the ""scroll past top"" functionality that you see in some apps (like the HTC Sense email app for example) where when you scroll up to the top of the list and try to scroll up past that, it appears to pull down, and when you release it springs back up?</p>","372405","","","","","2012-02-29 06:33:52","android listview scroll past top","<android><listview><animation><scroll>","2","0","1","",""
"3166796","1","4975103","","2010-07-02 14:54:46","1","3390","<p>I've only started learning Java about 3 months ago and this is my first post here, so please bear with me.</p><p>I have multiple ArrayLists built from parsed XML that are directly related to each other in order. The arrays are later put into a single mapped ArrayList (groupData) to be read with a SimpleAdapter which creates the list in the Android GUI.</p><p>What I want to do is sort the list in alphabetical order based on one array (arr_title) and the other arrays stay in synchronized order to it. It doesn't matter where the sorting happens as long as the final displayed list is sorted. I expect it would be best to sort the mapped array once it's built. The simpler or easier to understand the code the better, but don't want the sorting to go very slow either. I have about 140 objects per array, but that could expand considering the XML is pulled from the web.</p><p>I've spent hours searching Google and tried a number of things with little progress. Collections.sort(arr_title) will sort the one array as I want it, but then the other arrays don't match up and doing the same thing to the other arrays obviously just sorts them individually as I don't want. I've noticed mention of using the TreeMap type and Comparator for similar sorting, but couldn't figure out how to use them in this case probably because the examples didn't provide a big enough picture for me to understand. </p><p>The sample below is where most of the stuff happens after the separate arrays are created.</p><pre><code>List&lt;Map&lt;String, String&gt;&gt; groupData = new ArrayList&lt;Map&lt;String, String&gt;&gt;();Map&lt;String, String&gt; group;int item = 0;do {    group = new HashMap&lt;String, String&gt;();    group.put(""title"", arr_title.get(item));    group.put(""desc"", arr_desc.get(item));    group.put(""num"", Integer.toString(arr_num.get(item)));    groupData.add(group);    item++;} while (item &lt; arr_num.size());SimpleAdapter adapter = new SimpleAdapter(this, groupData, android.R.layout.simple_list_item_2, new String[] {""title"", ""desc"", ""num""}, new int[]{android.R.id.text1, android.R.id.text2});setListAdapter(adapter);</code></pre>","382130","","","","","2011-02-14 18:23:07","Java: Sorting multiple ArrayLists synchronously or a single mapped ArrayList","<java><android><arrays><sorting>","4","0","2","",""
"3166939","1","3167568","","2010-07-02 15:10:09","1","619","<p>I'm still pretty new to using Android, but I decided that my first application would be a simple flashlight app for my new Incredible. Unfortunately, it seems to be more difficult than I had originally thought.</p><p>It seems that there's no way to access the LEDs through the SDK, at least not without a bunch of weird hacks to make the phone pretend that it's taking a picture. Even then, I can only get the LEDs to turn on. They only turn off if the phone is put on hold, and doing so breaks all camera-related apps until the phone is rebooted.</p><p>So, I was wondering if accessing the LEDs through the NDK was possible, or if there was any other camera-related APIs that would seem to do what I want.</p><p>I've looked at other code for other flashlights, so it looks like it's a hardware-based problem. I figured I'd give up because it doesn't appear to be possible, but I thought I should ask here first on the off-chance somebody knows something that I don't.</p>","60312","","","","","2010-07-02 16:44:41","Is it possible to access the camera's LEDs directly in Android?","<android><camera><android-ndk>","1","0","1","",""
"3166947","1","3167033","","2010-07-02 15:10:55","6","8421","<p>I am very new to Eclipse (Galileo, Eclipse IDE for Java Developers) and working on my first Android app, but have used SVN on many other kinds of projects and development. Last night I took my first crack at pushing the new source into a shared repository (at work) and then pulling it back down at home. </p><p>Based on an SO question/answer, I had ignored the <code>bin</code> and <code>gen</code> folders, but added everything else. When I got home, I had hoped it would be as easy as pointing eclipse to the newly downloaded source tree.</p><p>I tried setting the workspace (requested when eclipse started) to the precise folder holding all source. Nothing showed up. It was as if I were starting fresh regardless of all the source and files sitting in the workspace folder.</p><p>Then I thought maybe I needed to open a ""project"" file to get things rolling. Opening the <code>.project</code> file yielded the contents of that file in the XML editor of eclipse. </p><p>What am I missing here? Is the project metadata not stored in the source tree? Do I have to build project metadata up on every machine that gets a working copy of the source? Is this something wrong with my home Eclipse install? Can someone give me an overview of how they (successfully) do this?</p>","8668","","","","","2014-01-07 16:53:23","Android+Eclipse project sharing via SVN?","<java><android><eclipse><svn>","1","0","3","",""
"3166951","1","3166967","","2010-07-02 15:11:15","19","14412","<p>since the beginning of my programmation, I used some special character like ""&lt;-"", """"&lt;&lt;"" im my string.xml in Eclipse while developping for Android.</p><p>All worked fine for one year, but today, i just wanted to make some minor changes and began to edit my xml files.</p><p>I get now compilation error on these characters because eclipse believe it's part of the xml blocks.</p><p>Any idea on how I could add this symbol ""&lt;"" in my xml files?</p><p>Thank a lot.</p>","327402","","","","","2010-11-23 07:45:03","writing some characters like '<' in an xml file","<android><xml><special-characters>","2","1","6","",""
"3166988","1","3167049","","2010-07-02 15:16:38","2","1052","<p>I have an Android application composed by several Activities.  Most of them need to check whether an active network is available or not:</p><pre><code>public boolean isNetworkAvailable() {    ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);    TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);    ...}</code></pre><p>I would like to move that code to a helper class in order to avoid the need to write that code in every Activity, but calls to <code>getSystemService</code> are only allowed from an Activity.</p><p>The other alternative is to move that code to a parent activity use inheritance but:</p><ol><li>Every activity already extends from android.app.Activity</li><li>Some of my activities already extend from a common my.package.BaseActivity (Activity &lt;- BaseActivity &lt;- XXXActivity)</li></ol><p>so I don't like this idea very much.</p><p>What do you recommend in this case?  Is there any other alternative?</p>","12388","","","","","2011-07-14 02:05:26","Android : Several activities sharing common code","<java><android>","2","0","1","",""
"3166990","1","3167306","","2010-07-02 15:17:11","0","841","<p>My program has a list of tabs that each contain a list of people.  Clicking a person should edit their details, but instead, clicking a person throws an ActivityNotFoundException.  My code that starts the edit activity:</p><pre><code>Intent intent = new Intent(""my.package.EDIT"");                // Person is bothintent.putExtra(""my.package.PERSON"", (Parcelable) myPerson);  // Parcelable andGroupArrayAdapter.this.getContext().startActivity(intent);    // Serializable</code></pre><p>Relevant part of AndroidManifest.xml:</p><pre><code>&lt;activity android:name=""EditActivity""&gt;  &lt;intent-filter&gt;    &lt;action android:name=""my.package.EDIT"" /&gt;  &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>What's going on?</p>","346688","","346688","","2010-07-02 15:54:59","2010-07-02 22:57:15","Launching Intent cannot find Activity","<java><android><activity>","2","3","","",""
"3167251","1","3167262","","2010-07-02 15:55:04","1","1020","<p>Humm... I can do this easily in Java (and all other languages) but, it doesn't seem to work in Android.</p><p>I simply want to get an integer number input from the user, press a button and do some simple math on it, then display it.</p><p>I'm using a TextEdit (also tried a TextView) and have tried many different approaches but, none work.  The code itself has no errors and I can do the math and display it if using constants.</p><p>The problem is in either parsing it to an integer (though, the code-line seems ok, even though it's a tad different than what I use in pure java.</p><p>Any help is welcome - I'm sure it's simple and I read many related posts for this, including the Android Dev site - but...</p><p>Here's the short complete code:</p><pre><code>package com.bt.strint;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.TextView;public class string_integer extends Activity {    /** Called when the activity is first created. */       int aa = 3;    int y=33;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);      final TextView input = (TextView) findViewById(R.id.EditText01);                 final Button btn = (Button) findViewById(R.id.Button01);      final TextView showMe = (TextView) findViewById(R.id.TextView01);       btn.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            //showMe.setText(""meow"");       //ok                        //showMe.setText(String.valueOf(y * 7)); // ok            y = Integer.parseInt((String) input.getText());            showMe.setText(String.valueOf(y));        }      });           }}</code></pre>","382200","","60261","","2010-07-02 15:57:00","2010-07-02 17:45:43","String to Integer not working","<android><string><integer>","1","0","","",""
"3167558","1","3167588","","2010-07-02 16:42:15","2","228","<p>I was wondering if the Android had any limitations that would prevent 300+ MB's worth of videos to be included in the application?</p><p>Currently, I have several iPhone apps that do this, and due to demand, I am looking at the possibility of porting them over to the Android.</p>","382225","","","","","2010-07-02 16:53:36","Can you include large videos files in Android applications?","<android>","3","0","1","",""
"3167697","1","3167716","","2010-07-02 17:03:23","0","667","<p>How can I install an Eclipse Android project onto deviceanywhere to test on different devices?</p><p>ThanksChris</p>","334802","","","","","2011-05-12 07:20:25","Android Install Eclipse project onto DeviceAnywhere","<android><eclipse><project><device><apk>","2","0","","",""
"3167771","1","3168396","","2010-07-02 17:16:15","1","1420","<p>I'm trying to modify some code I found online to my needs. It is supposed to catch a MotionEvent (a fling in particular) and launch a separate activity. I am new to java, so I'm having some trouble understanding the code. Here's what I have so far:</p><pre><code>public class Hypertension extends Activity { private GestureDetector flingDetector; View.OnTouchListener gestureListener; private TextView redView; private TextView greenView;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        redView = (TextView)findViewById(R.id.buttonRed);        greenView = (TextView)findViewById(R.id.buttonGreen);        redView.setOnTouchListener(gestureListener);        greenView.setOnTouchListener(gestureListener);        flingDetector = new GestureDetector(new MyFlingListener());        gestureListener = new View.OnTouchListener() {            public boolean onTouch(View v, MotionEvent event) {                if (flingDetector.onTouchEvent(event)) {                    //startActivity(new Intent(Hypertension.this, Green.class));                 return true;                }                return false;            }        };    }    class MyFlingListener extends SimpleOnGestureListener {        @Override        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,          float velocityY) {         // TODO Auto-generated method stub         startActivity(new Intent(Hypertension.this, Green.class));         return false;        }    }    @Override    public boolean onTouchEvent(MotionEvent event) {        if (flingDetector.onTouchEvent(event))         return true;     else      return false;    }}</code></pre><p>My understanding is that when the screen is touched, onTouchEvent is called. In the above code, this method is overridden to call flingDetector, which listens for a fling. If one is heard, it launches the activity.</p><p>As of now, however, nothing happens when I perform a fling in the emulator. Also, I am fairly confused as to what the return values of the various boolean methods actually represent.</p>","382252","","382252","","2010-07-02 17:57:53","2011-11-09 11:49:05","Handling UI Events in Android","<android>","2","0","","",""
"3167843","1","3167864","","2010-07-02 17:28:06","3","598","<p>I upgraded my Nexus One a few days ago with 2.2 (Froyo). This morning when I went to use it I saw a Dialog sitting atop the home/launcher screen notifying me that an update was available and that I could choose to upgrade now or later.</p><p>My question is, what API mechanisms is this using to show a Dialog (perhaps an AlertDialog) atop the home screen? Having written an Android app, it was my understanding that Dialogs could only be shown atop an Activity, and that a Service cannot show a Dialog (only a Toast).</p><p>Is Google perhaps skinning an Activity to look like a Dialog? Is there a new API method available for showing a Dialog without needing an Activity?</p>","300368","","32502","","2010-07-02 17:33:43","2010-07-04 17:34:31","How does Froyo display a Dialog atop the home screen?","<android><layout><activity><themes>","1","1","","",""
"3167876","1","3168302","","2010-07-02 17:34:00","0","386","<p>I am new to Android and Java so pardon me if the question sounds stupid.</p><p>I have connected a device to PC which runs android OS. Once the device is attached I can see its direcotry F:\ . </p><p>How do I write a code in JAVA which can display me those files. I am using Eclipse IDE and Android plug in.</p><p>Thank you</p>","110287","","243782","","2010-07-02 18:00:33","2010-07-02 18:42:06","Read file from android based device?","<java><android>","1","0","","",""
"3168109","1","","","2010-07-02 18:10:15","2","420","<p>I'm trying to find out how use Android's <code>multicastlock</code> for capturing packets not addressed to the device. As I understand <a href=""http://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock.html"" rel=""nofollow"">the SDK</a>, I can capture them.</p><p>How can I capture them, or how can I use <code>multicastlock</code>?</p>","382302","","496830","","2011-11-08 14:41:26","2011-11-08 14:41:26","How can I capture packets not addressed to the device?","<android>","0","0","1","",""
"3168115","1","","","2010-07-02 18:11:04","2","1197","<p>How can I launch the QuickContact action in android 2.1.Like the one shown <a href=""http://1.bp.blogspot.com/_GTM_W5mVPTU/S-rk_0rla6I/AAAAAAAAADs/dUw4bDiagO4/s1600/Contacts.png"" rel=""nofollow"">here</a></p>","286802","","101361","","2010-12-13 10:52:11","2010-12-13 10:52:11","How can I launch the QuickContact action in android 2.1","<android><quickcontact>","1","0","1","",""
"3168178","1","3168246","","2010-07-02 18:20:28","1","1916","<p>I simply want to do:</p><pre>if(getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)    setContentView(R.layout.search_portrait);else    setContentView(R.layout.search_landscape);</pre><p>The problem is - getRequestedOrientation always returns -1.</p><p>Any suggestions?</p>","237858","","45668","","2011-07-21 14:55:05","2011-07-21 14:55:05","How to set the activity content based on the current screen orientation?","<android>","2","0","1","",""
"3168232","1","3168695","","2010-07-02 18:28:44","1","422","<p>In my Android app, I have some data that needs to be synced daily but also needs to be updated every hour when a user is inside the app.</p><p>I have already implemented a service that gets called from an alarm for the daily update. Im having a problem with developing a strategy to do the hourly sync. I could use an hourly alarm too and fire the same intent, but since your app can be killed at any time, there would be no way to cancel it (and since they use the same Intent, doing a cancel would cancel ALL alarms including my daily sync, so that's probably not good).</p><p>The other option is to use a Timer that's set when inside the app, and have that fire my Intent when inside the app. Im assuming all Timers get cancelled when an app is killed right? But my app consists of several activities and I want the timer to work across all activities, how do I do that? I dont want to duplicate code - we're already using a subclass for Activity and ListActivity.</p>","246793","","","","","2010-07-02 19:46:58","Best strategy to implement this behavior in Android app?","<android><asynchronous><timer><task><alarms>","2","0","2","",""
"3168247","1","","","2010-07-02 18:31:38","0","12607","<p>I have a listview which contains textviews as its elements. </p><ol><li>Now I want the first item of the list to be automatically focused when I launch the application</li><li>How can I set the focus on any item of the list when I click on the some other view for example a button?</li></ol>","382324","","1675469","","2014-04-05 08:48:23","2014-04-05 08:48:23","set focus on any item of listview in android","<android><listview>","3","0","","",""
"3168256","1","3168933","","2010-07-02 18:33:17","2","2173","<p>I am looking to create timed events which trigger UI changes (like a Toast) on Android. I already know you can do this with a <code>Handler</code> object's <code>postDelayed(runnable, timeDelay)</code> method (<a href=""http://developer.android.com/resources/articles/timed-ui-updates.html"" rel=""nofollow"">see this page for a great example</a>).</p><p>Here is the twist: <strong>I also need to be able to pause and resume the countdown for these events</strong>. So when a user pauses the on-screen timer it also pauses the countdown before each of these events trigger.</p><p>One approach that came to mind was to create a <code>Handler</code> object on a new <code>Thread</code> (not the UI thread) and queue up my events using <code>postDelayed</code>; then I would pause or resume this entire <code>Thread</code>'s execution using <a href=""http://www.exampledepot.com/egs/java.lang/PauseThread.html"" rel=""nofollow"">this method</a> as needed. The main problem here is figuring out how to make the events run on the UI thread after they have been triggered.</p><p>The only other way I can think of would be to check every second that the timer ticks against a list of all my events (brute force) on the UI thread, which is very messy.</p><p>If anyone has any thoughts on this or solutions, that would be great!</p>","2359478","user370382","2359478","","","2010-07-03 05:49:38","Android - Timed UI events (with pause/resume)","<java><android><timer><handler>","3","2","2","",""
"3168335","1","3168481","","2010-07-02 18:47:25","1","335","<p>I have a main activity that takes elements from a database and displays them in a clickable listview. I use this method to accomplish the task:</p><pre><code>private void fillData() {    // Get all of the notes from the database and create the item list    Cursor c = RequestManager.getRequests(getApplicationContext());    startManagingCursor(c);    String[] from = new String[] { DataBase.KEY_TITLE, DataBase.KEY_BODY };    int[] to = new int[] { R.id.text1, R.id.text2 };    // Now create an array adapter and set it to display using our row    SimpleCursorAdapter notes =        new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to);    setListAdapter(notes);}</code></pre><p>I am wondering, is it possible to access a boolean field inside the database, and bold the specific element is the field is marked as unread? The elements are each in a textview, and are then placed in a listview. Thanks</p><p>Edit: Used the suggestion to extend the CursorAdapter Class, but when any element in the list is bolded, the first element is also bolded. Once all the elements are marked as read, the first element goes back to unbolded. Any ideas?</p><pre><code>    public void bindView(View view, Context context, Cursor cursor) {    TextView textRequestNo = (TextView) view.findViewById(R.id.text1);    TextView textMessage = (TextView) view.findViewById(R.id.text2);    StringBuilder requestNo = new StringBuilder(cursor.getString(cursor            .getColumnIndex(""requestNo"")));    StringBuilder message = new StringBuilder(cursor.getString(cursor            .getColumnIndex(""Message"")));    textRequestNo.setText(requestNo);    textMessage.setText(message);    if (cursor.getString(cursor.getColumnIndex(""Read"")).equals(""false""))    {        textRequestNo.setTypeface(null, Typeface.BOLD);        textMessage.setTypeface(null, Typeface.BOLD);    }   }@Overridepublic View newView(Context context, Cursor cursor, ViewGroup parent) {    final View view = mInflater.inflate(R.layout.notes_row, parent, false);    bindView(view, context, cursor);    return view;}</code></pre>","381508","","381508","","2010-07-08 17:53:47","2010-07-08 17:53:47","How to bold specific elements from a Database using a SimpleCursorAdapter","<android>","1","0","","",""
"3168362","1","3168820","","2010-07-02 18:51:40","15","29733","<p>I know it is not right to do this, but is there any APK decoder/decompiler available around?</p><p><strong>[Edit]</strong> From all efforts and  searching i can conclude that, its not possible to regenerate exact java code from APK. Even re-engineering from DEX file will give procedural steps. Definitely it will help to understand the code &amp; approach; It will be not at all compilable.</p>","279990","","279990","","2011-11-11 07:36:27","2012-11-11 12:58:49","Decompiler for APK?","<android><apk><decompiler>","3","3","5","2012-05-23 08:45:37",""
"3168484","1","3168653","","2010-07-02 19:11:29","26","13678","<pre><code>  protected void displayNotification(String response) {    Intent intent = new Intent(context, testActivity.class);    PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, Intent.FLAG_ACTIVITY_NEW_TASK);    Notification notification = new Notification(R.drawable.icon, ""Upload Started"", System.currentTimeMillis());    notification.setLatestEventInfo(context, ""Upload"", response, pendingIntent);    nManager.notify((int)System.currentTimeMillis(), notification);}</code></pre><p>This function will be called multiple times.  I would like for each notification to launch testActivity when clicked.  Unfortunately, only the first notification launches testActivity.  Clicking on the rest cause the notification window to minimize.</p><p>Extra information:  Function displayNotification() is in a class called UploadManager.  Context is passed into UploadManager from the activity that instantiates. Function displayNotification() is called multiple times from a function, also in UploadManager, that is running in an ASyncTask.</p><p>Edit 1: I forgot to mention that I am passing String response into Intent intent as an extra.</p><pre><code>  protected void displayNotification(String response) {    Intent intent = new Intent(context, testActivity.class);    intent.putExtra(""response"", response);    PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);</code></pre><p>This makes a big difference because I need the extra ""response"" to reflect what String response was when the notification was created.  Instead, using PendingIntent.FLAG_UPDATE_CURRENT, the extra ""response"" reflects what String response was on the last call to displayNotification().</p><p>I know why this is from reading the documentation on FLAG_UPDATE_CURRENT.  However, I am not sure how to work around it at the moment.</p>","","user350617","","user350617","2010-07-05 23:36:41","2012-12-21 13:00:25","PendingIntent works correctly for the first notification but incorrectly for the rest","<android><notifications><android-pendingintent>","5","0","3","",""
"3168901","1","3168951","","2010-07-02 20:23:44","0","1704","<p>I have a program that monitors incoming SMS's, and I want it to monitor them full-time, so I registerReceiver with a Broadcast receiver that I've created. The problem is, if I want to unregister that receiver, I can't unless I know the original BroadcastReceiver class I registered. This is not a problem if I set it to stop when the program stops, but I want the receiver to keep running, only stopping when the user specifies. </p><p>EDIT: Or is there a way of ""Storing"" the BroadcastReceiver class that I've created, such that when onDestroy is called it can be saved and when create is called again it can be pulled out.</p><p>Is there any way of doing this?</p>","256108","","256108","","2010-07-02 20:57:55","2010-07-02 20:57:55","Finding which BroadcastReceivers are registered?","<android><broadcastreceiver>","1","0","","",""
"3169187","1","6591906","","2010-07-02 21:25:13","0","1696","<p>by using web services we are able to download file from cloud to buffer storage. We need to now access this downloaded file from buffer memory and move it to SD card. I am using Eclipse and Android plug in. </p><p>Can someone share any code ?</p><p>My code snippet is below.</p><pre><code>      String filename = ""Test.zip"";      URL url = new URL(FromUrl);      HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();        urlConnection.setRequestMethod(""GET"");      urlConnection.setDoOutput(true);      urlConnection.connect();        FileOutputStream fileOutput = openFileOutput(filename, Context.MODE_WORLD_READABLE);      InputStream inputStream = urlConnection.getInputStream();        int totalSize = urlConnection.getContentLength();        int downloadedSize = 0;        //create a buffer...        byte[] buffer = new byte[1024];        int bufferLength = 0; //used to store a temporary size of the buffer        //now, read through the input buffer and write the contents to the file        while ( (bufferLength = inputStream.read(buffer)) &gt; 0 ) {            fileOutput.write(buffer, 0, bufferLength);            downloadedSize += bufferLength;        }        //close the output stream when done        fileOutput.close();      return filename;</code></pre>","110287","","","","","2011-07-06 05:26:26","How to download file on android emulator?","<android><android-emulator>","1","0","","",""
"3169275","1","3169563","","2010-07-02 21:41:38","1","1231","<p>Hey All,   My logcat output has completely disappeared from both eclipse and ""adm logcat"".  In both instances they're just blank. </p><p>I've tried:</p><pre><code>   adb kill-server / adb start-server   Restarted eclipse    Rebooted computer (dell mini 10v)   Rebooted phone (cliqxt)   Unplugged and replugged in phone usb connection</code></pre><p>I can't really test with the emulator because it takes a minimum of 45 minutes to start it on this machine. Anyone have any idea what can cause this?  </p><p>Thanks</p>","1742702","","","","","2010-07-02 22:54:37","Logcat Broken. No output in eclipse or terminal","<android><mobile><logcat>","1","1","","",""
"3169406","1","","","2010-07-02 22:13:55","0","315","<p>I have a call blocking application. It has 3 files:</p><p>1) class BlockMyCall extends BroadcastReceiver<br>2) class SimpleClass1 extends Service <br>3) PhoneBlock extends Activity</p><p>I start ""PhoneBlock "" Activity to call Service ""SimpleClass1"", which eventually calls ""BlockMyCall"" intended to block outbound calls (by setting result to ""null"").</p><p>I want to know if I can run the class1 from service without starting activity. If so, how?</p>","357349","","667810","","2012-07-13 07:30:47","2012-07-13 07:30:47","starting service without application","<android><service><activity><receiver>","2","0","","",""
"3169541","1","3169615","","2010-07-02 22:49:17","5","2593","<p>i'm currently writing on some piece of code in android 2.1 that is supposed to measure the signal strength of the gsm signals.what i need is some kind of list with some kind of network IDs matching the corresponding signal strengthes...i got this far:</p><pre><code>public class main extends Activity {    TelephonyManager telManager;    GSMListener gsmListener;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        gsmListener = new GSMListener();        telManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);        telManager.listen(gsmListener ,PhoneStateListener.LISTEN_SIGNAL_STRENGTHS);    }    private class GSMListener extends PhoneStateListener {        /* Get the Signal strength from the provider, each time there is an update */        @Override        public void onSignalStrengthsChanged(SignalStrength signalStrength) {            super.onSignalStrengthsChanged(signalStrength);            Toast.makeText(main.this, ""GSM Cinr: "" + signalStrength.getGsmSignalStrength(), Toast.LENGTH_SHORT).show();        }    };}</code></pre><p>but at this point, i wonder if there's network-id like the bssid for wifi networks? how is this handled with gsm? i need to identify the gsm network i'm getting the signal strength of.</p><p>EDIT:</p><p>by ""network-id"", meant ""cell-id"". what i need is a list of <code>*all available*</code> gsm networks in range and their reception quality. the operator-id is not of much interest to me, as i need to identify cell AND network, i'm getting the signal strength from.</p>","370969","","370969","","2010-07-03 07:36:54","2011-04-22 21:34:33","how to get a list of available gsm networks?","<android><gsm><signal-strength>","1","0","","",""
"3169622","1","3195113","","2010-07-02 23:11:28","2","1486","<p>Inside of a ListView row, I have a box (right now its an imageview, but i will probably be converting it to a linear or relative layout object at some point).  when you click on the box, i have it start a scale animation that makes it appear to grow. however, once the animation is over, the box goes immediately back to its original state. I'd like to have the box stay at the transformed size (at least until they click it again). </p><p>here's the xml: </p><p></p><pre><code>&lt;scale    android:fromXScale=""1"" android:toXScale=""5""    android:fromYScale=""1"" android:toYScale=""1""    android:pivotX=""100%"" android:pivotY=""0%"" android:fillAfter=""true""    android:duration=""600"" /&gt;</code></pre><p></p>","372405","","","","","2010-10-22 16:09:08","android grow box animation","<android><listview><animation><scale>","2","0","1","",""
"3169640","1","","","2010-07-02 23:15:21","0","2425","<p>I have a problem with ACTION_CALL intent from my service on Motorola Milestone after upgrade to 2.1 - update1 firmware version. I have a very simple (worked before) code. </p><pre><code>Intent dialIntent = new Intent(Intent.ACTION_CALL, Uri.parse(""tel://"" + dialOutNumber)); dialIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(dialIntent); </code></pre><p>Now it looks like InCallScreen ""hangs up"" after set audio mode or ActivityManager ""blocks"" InCallScreen activity The phone does call, but the screen is black and locked. If I call ACTION_CALL intent from an activity it works all right. Here is the log: </p><pre><code>&lt;p&gt;07-01 00:42:39.617: INFO/ActivityManager(1282): Starting activity: Intent { act=android.intent.action.CALL dat=tel:5247519 flg=0x10000000 cmp=com.android.phone/.OutgoingCallBroadcaster } 07-01 00:42:39.664: DEBUG/PhoneUtils(6381): checkAndCopyPhoneProviderExtras: some or all extras are missing. ... 07-01 00:42:40.679: DEBUG/InCallScreen(6381): placeCall()...  intent = Intent { act=android.intent.action.CALL dat=tel:5247519 flg=0x10800000 cmp=com.android.phone/.InCallScreen (has extras) } 07-01 00:42:40.679: DEBUG/InCallScreen(6381): checkIfOkToInitiateOutgoingCall: ServiceState = 0 07-01 00:42:40.679: DEBUG/PhoneUtils(6381): placeCall: '5247519'... ... 07-01 00:42:40.710: DEBUG/PhoneUtils(6381): ===&gt; phone.dial() returned:  incoming: false state: DIALING post dial state: NOT_STARTED 07-01 00:42:40.710: DEBUG/PhoneUtils(6381): setAudioMode(MODE_IN_CALL)... 07-01 00:42:40.710: DEBUG/AudioHardwareMot(1055): AudioMgr:setMode(IN_CALL) 07-01 00:42:40.710: DEBUG/AudioHardwareMot(1055): AudioMgr:setMode MODE_IN_CALL 07-01 00:42:40.710: INFO/MYPhoneService(6437): Telephony OFFHOOK ... Here the screen is black and locked ~ 3 min. Only status panel available. Call ends. After some timeout see InCallScreen... If start from the Activity - the InCallScreen apears right after call start. ... 07-01 00:45:14.031: DEBUG/InCallScreen(6381): placeCall: PhoneUtils.placeCall() succeeded for regular call '5247519'. 07-01 00:45:14.031: DEBUG/DTMFTwelveKeyDialer(6381): closeDialer()... 07-01 00:45:14.031: DEBUG/DTMFTwelveKeyDialer(6381): clearDigits()... 07-01 00:45:14.031: DEBUG/PhoneApp(6381): updateProximitySensorMode: state = OFFHOOK 07-01 00:45:14.031: DEBUG/PhoneApp(6381): updateProximitySensorMode: lock already released. 07-01 00:45:14.031: DEBUG/PhoneApp(6381): isInDockMode bInDockMode is : false 07-01 00:45:14.039: DEBUG/StatusBar(1282): DISABLE_EXPAND: yes &lt;/p&gt;</code></pre><p>I can send full log, but it is really big. Thanks, in advance.</p>","190650","","407382","","2011-05-30 09:37:57","2011-05-30 09:37:57","ACTION_CALL intent called from Android service on Motorola Milestone hangs Dial In activity","<android><android-sdk-2.1>","1","0","","",""
"3169880","1","","","2010-07-03 00:56:49","1","578","<p>I'm trying to have my listView as defined in my main.xml display a list of my objects. This worked fine when my activity extended on ListActivity and used getListView(). Now I extend from a normal Activity though and want to plug my custom adapter into my R.id.list like this:</p><pre><code>   ListView lv = (ListView) findViewById(R.id.list);   lv.setTextFilterEnabled(true);   lv.setAdapter(new MyCustomAdapter(this, R.layout.custom_list, nameResults));</code></pre><p>where custom_list is the xml file defining a row. My debugger goes bonkers as soon as it hits the setAdapter part, heading into strange files and finally returning a NullPointerException.</p><p>My custom adapter btw:</p><pre><code> public class MyCustomAdapter extends ArrayAdapter&lt;String&gt; {  private String[] nameResults;  public MyCustomAdapter(Context context, int textViewResourceId, String[] names) {   super(context, textViewResourceId, names);   nameResults = names;  }  @Override  public View getView(int position, View convertView, ViewGroup parent) {   LayoutInflater inflater=getLayoutInflater();   View row=inflater.inflate(R.layout.custom_list, parent, false);   TextView label=(TextView)row.findViewById(R.id.Name);   label.setText(nameResults[position]);   TextView descr=(TextView)row.findViewById(R.id.Description);   descr.setText(linkedResults.get(nameResults[position]));   return row;  } }</code></pre><p>Any way I can get it back working? I only changed it so I could get some buttons above it for a previous/next page structure, aka I need to setContentView(R.layout.main); (right? :P . I used this link to build the listview: <a href=""http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/"" rel=""nofollow"">Custom listview with adapter</a>.</p><p>Stacktrace:</p><pre><code>07-03 12:18:02.936: ERROR/AndroidRuntime(2747): Uncaught handler: thread main exiting due to uncaught exception07-03 12:18:03.026: ERROR/AndroidRuntime(2747): java.lang.NullPointerException07-03 12:18:03.026: ERROR/AndroidRuntime(2747):     at com.rvthof.ShowPage.buildPage(ShowPage.java:102)07-03 12:18:03.026: ERROR/AndroidRuntime(2747):     at com.rvthof.ShowPage.access$0(ShowPage.java:78)07-03 12:18:03.026: ERROR/AndroidRuntime(2747):     at com.rvthof.ShowPage$1.run(ShowPage.java:74)07-03 12:18:03.026: ERROR/AndroidRuntime(2747):     at android.os.Handler.handleCallback(Handler.java:587)07-03 12:18:03.026: ERROR/AndroidRuntime(2747):     at android.os.Handler.dispatchMessage(Handler.java:92)07-03 12:18:03.026: ERROR/AndroidRuntime(2747):     at android.os.Looper.loop(Looper.java:123)07-03 12:18:03.026: ERROR/AndroidRuntime(2747):     at android.app.ActivityThread.main(ActivityThread.java:4363)07-03 12:18:03.026: ERROR/AndroidRuntime(2747):     at java.lang.reflect.Method.invokeNative(Native Method)07-03 12:18:03.026: ERROR/AndroidRuntime(2747):     at java.lang.reflect.Method.invoke(Method.java:521)07-03 12:18:03.026: ERROR/AndroidRuntime(2747):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)07-03 12:18:03.026: ERROR/AndroidRuntime(2747):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)07-03 12:18:03.026: ERROR/AndroidRuntime(2747):     at </code></pre><p>dalvik.system.NativeStart.main(Native Method)</p>","124950","","124950","","2010-07-03 12:21:05","2010-07-03 12:21:05","Setting an adapter on my listview","<android><listview><adapter>","1","2","","",""
"3170130","1","3170182","","2010-07-03 02:50:20","1","714","<p>I'd like to make a list adapter that formats views like this:</p><p><img src=""http://i.imgur.com/WLR0p.png"" alt=""List Entry""></p><p>I want to be able to fire a different onClick when the user clicks the image.  I have defined the onClick on the image itself in the getView() override, but how do I then get the position of the line that was clicked so I can update the record in the database to record the action?</p>","283952","","","","","2010-07-03 03:16:39","Creating a split button for a custom ListView adapter","<android><listview><listviewitem>","1","0","1","",""
"3170243","1","3170280","","2010-07-03 03:48:14","0","4784","<p>I have the following layout for a dialog:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/categorylist""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:stretchColumns=""0""&gt;     &lt;TableRow&gt;        &lt;ListView             android:id=""@+id/categorylistview""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:isScrollContainer=""true""            android:scrollbars=""vertical""            android:scrollbarStyle=""insideOverlay""        /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView             android:text=""New Category""             ...        &lt;/TextView&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;EditText             android:id=""@+id/NewCategoryEditText""             ...        &lt;/EditText&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;Button             android:id=""@+id/newcategorybutton""            ...        /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;      </code></pre><p>I would like the Listview to grow until the available space is used, then scroll as it coninues to grow. This works fine when the table row with the Listview is the last one in the TableLayout:</p><p><img src=""http://heeroz.com/scroll2.png"" alt=""alt text""></p><p>However, having the Add button at the top of the list is not very intuitive. When I move the ""fixed"" table rows to the bottom, the ListView will push them off the screen once it grows to a point where it should scroll. The ListView will only then begin to scroll when there is nothing else left that can be pushed off the screen:</p><p><img src=""http://heeroz.com/scroll1.png"" alt=""alt text""></p><p>How can I change my layout so that the table rows with the button and the EditText view remain visible?</p>","58880","","","","","2010-07-03 04:05:50","Scrollable Android ListView in TableView Row","<android><listview><scrolling><tablelayout>","1","0","1","",""
"3170308","1","3171504","","2010-07-03 04:18:28","33","25694","<p>As far as I can tell, there are two ways to show a Dialog from an Activity.</p><ol><li>Create the Dialog (for example, using an <code>AlertDialog.Builder</code>), and then call the newly created Dialog's <code>show()</code> method.</li><li>Call the Activity's <code>showDialog()</code> method, passing in an int that uniquely defines what sort of Dialog you want to build. Then override <code>onCreateDialog()</code> to actually build the Dialog, and Android will display it for you.</li></ol><p>The second method seems to be the standard practice but I'm curious if there is any reason it matters which one I use. Here's all I can come up with:</p><p>Reasons to use <code>Dialog.show</code></p><ol><li>If you need to parameterize the Dialog in some way, it can be a little awkward to use <code>Activity.showDialog</code>, as described in <a href=""http://stackoverflow.com/questions/1929556/showing-simple-message-dialogs"">this question</a>. You may have to store a String or something in a member variable, just so that it can be retrieved moments later during <code>onCreateDialog</code> or <code>onPrepareDialog</code>.</li><li>The logic for creating and modifying the dialog is spread out across a number of places, potentially making the code harder to read and maintain: <ul><li>The place where you call <code>showDialog()</code></li><li>Inside a potentially large <code>switch</code> statement in the overridden <code>onCreateDialog</code> method</li><li>Inside a potentially large <code>switch</code> statement in the overridden <code>onPrepareDialog</code> method</li></ul></li></ol><p>Reasons to use <code>Activity.showDialog</code>:</p><ol><li>The API docs for <code>Activity.showDialog</code> say that the Dialog is ""managed"" by the Activity which I suppose provides some benefit? But this is also true if you use the <code>AlertDialog.Builder</code>, I would think, because you pass in <code>this</code> as an argument to the Builder's constructor. </li><li>If your Activity is going to show the same (or a very similar) Dialog several times, this option creates it only once, instead of creating a new one each time, thus putting less strain on the system as far as allocating space for new objects, garbage collection, etc.</li></ol><p>So my question is, what are the criteria for deciding when to use <code>Activity.showDialog</code> and when to use <code>Dialog.show</code>, and why?</p>","65977","","","","","2012-06-04 06:28:21","Dialog.show() vs. Activity.showDialog()","<android><dialog>","3","0","6","",""
"3170350","1","","","2010-07-03 04:51:21","5","4360","<p>I want to create a custom dialog like Quick Contact in contact app or the one in official Twitter app. When i click on a button, it will be opened above or below the button.</p><p><a href=""http://londatiga.net/images/qc-tw.jpg"">http://londatiga.net/images/qc-tw.jpg</a> Quick Contact &amp; Twitter </p><p>I've read the source code of Contact app but it seems to use internal API. The alternative solution is to extends Dialog class, i can set custom layout, but can't manage to position the dialog. Any solutions for this? </p><p>Thanx in advance</p>","431041","","","","","2012-08-07 11:51:32","Android custom dialog like 'Quick Contact'","<android><dialog><popupwindow>","2","2","3","",""
"3170367","1","","","2010-07-03 04:58:15","1","636","<p>Here is my code below. When I just had the EditText Box code, it loaded fine. When I added the ImageButtons and listeners, it will not run at all. I do not want to add method code until I can get it to at least run. I am running on API 7</p><pre><code>package org.chrome9.golfCalc;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.EditText;import android.widget.ImageButton;import android.widget.TextView;public class launchCalculator extends Activity  {       private EditText txtEditScore;       private EditText txtEditRating;       private EditText txtEditSlope;       private ImageButton btnCalc;       private ImageButton btnNext;       private ImageButton btnBack;       private ImageButton btnReset;        private ImageButton btnCourseHandicap;       private TextView txtHeader;       private TextView txtEnterScore;       private TextView txtEnterRating;       private TextView txtEnterSlope;       private TextView txtBottom;    // Variables in the application    int[] Score = new int[20];    double[] Rating = new double[20];    double[] Slope = new double[20];    double CourseHandicapResult = 0;    /** Called when the activity is first created. */    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        btnCalc = (ImageButton)findViewById(R.id.btnCalc);        btnCalc.setEnabled(false);        btnCalc.setOnClickListener(calcListener);        btnNext=(ImageButton)findViewById(R.id.btnNext);        btnNext.setEnabled(false);        btnNext.setOnClickListener(nextListener);        btnBack=(ImageButton)findViewById(R.id.btnBack);        btnBack.setEnabled(false);        btnBack.setOnClickListener(backListener);        btnReset=(ImageButton)findViewById(R.id.btnReset);        btnReset.setEnabled(false);        btnReset.setOnClickListener(resetListener);        btnCourseHandicap=(ImageButton)findViewById(R.id.btnCourseHandicap);        btnCourseHandicap.setEnabled(false);        btnCourseHandicap.setOnClickListener(courseHandicapListener);        txtHeader = (TextView) findViewById(R.id.txtHeader);        txtHeader = (TextView) findViewById(R.id.txtEnterScore);        txtHeader = (TextView) findViewById(R.id.txtEnterRating);        txtHeader = (TextView) findViewById(R.id.txtEnterSlope);        txtHeader = (TextView) findViewById(R.id.txtBottom);        txtEditScore = (EditText)findViewById(R.id.txtEditScore);        txtEditScore.requestFocus();        txtEditScore.setText(""0"");        txtEditRating = (EditText) findViewById(R.id.txtEditRating);        txtEditRating.setText(""0"");        txtEditSlope = (EditText) findViewById(R.id.txtEditSlope);        txtEditSlope.setText(""0"");    }    private OnClickListener calcListener=new OnClickListener()    {        public void onClick(View v)        {        }    };    private OnClickListener nextListener=new OnClickListener()    {        public void onClick(View v)        {        }    };    private OnClickListener backListener=new OnClickListener()    {        public void onClick(View v)        {        }    };    private OnClickListener resetListener=new OnClickListener()    {        public void onClick(View v)        {        }    };    private OnClickListener courseHandicapListener=new OnClickListener()    {        public void onClick(View v)        {        }    };}</code></pre><p>Main XML </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout android:id=""@+id/tblLayout""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:background=""@color/background"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    /* Row 1: This is the Row for the header */    &lt;TableRow&gt;        &lt;TextView android:id=""@+id/txtHeader"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:layout_column=""0""            android:layout_span=""4"" android:typeface=""serif"" android:textSize=""18px""            android:textColor=""@color/darkblue"" android:paddingBottom=""15px""            android:paddingTop=""5px"" android:text=""      The Chrome9 Calculator v1.0"" /&gt;    &lt;/TableRow&gt;    /* Row 2: This is the Row for Entering the score */    &lt;TableRow&gt;        &lt;TextView android:id=""@+id/txtEnterScore""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_column=""0"" android:layout_span=""2"" android:textSize=""18px""            android:textColor=""@color/black"" android:text="" Enter Your Score:     "" /&gt;        &lt;EditText android:id=""@+id/txtEditScore""            android:layout_height=""wrap_content"" android:numeric=""integer""            android:layout_column=""2"" android:layout_span=""1"" /&gt;    &lt;/TableRow&gt;    /* Row 3: This is the Row for entering the Course rating */    &lt;TableRow&gt;        &lt;TextView android:id=""@+id/txtEnterRating""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_column=""0"" android:layout_marginRight=""30px""            android:textSize=""18px"" android:textColor=""@color/black""            android:text="" Enter Course Rating"" /&gt;        &lt;EditText android:id=""@+id/txtEditRating""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:numeric=""decimal"" android:layout_column=""2""            android:layout_span=""1"" /&gt;    &lt;/TableRow&gt;    /* Row 4: The row for entering the course slope */    &lt;TableRow&gt;        &lt;TextView android:id=""@+id/txtEnterSlope""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_column=""0"" android:textSize=""18px"" android:textColor=""@color/black""            android:text="" Enter Course Slope"" /&gt;        &lt;EditText android:id=""@+id/txtEditSlope""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:numeric=""decimal"" android:layout_column=""2""            android:layout_span=""1"" /&gt;    &lt;/TableRow&gt;    /* This separator view is used to separate    the area below the buttons which will display the    calculation results */    &lt;View android:layout_height=""2px"" android:background=""#DDFFDD""        android:layout_marginTop=""5dip"" android:layout_marginBottom=""5dip"" /&gt;    // Row 5 contains a text at column 2    &lt;TableRow&gt;        &lt;TextView android:id=""@+id/txtHandicap"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:textSize=""18px""            android:textColor=""@color/black"" android:text=""Handicap:""            android:layout_column=""2"" android:layout_span=""1"" /&gt;    &lt;/TableRow&gt;    /* Row 6: Is the calcuation button and the textbox for the    results of the handicap calculation*/    &lt;TableRow&gt;        &lt;ImageButton android:id=""@+id/btnCalc"" android:src=""@drawable/calculator32""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""/&gt;        &lt;EditText android:id=""@+id/txtHandicap"" android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:numeric=""decimal""            android:layout_column=""2"" android:layout_span=""1"" /&gt;    &lt;/TableRow&gt;    /* Row 7: Back button */    &lt;TableRow&gt;        &lt;ImageButton android:id=""@+id/btnBack"" android:src=""@drawable/back32""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_column=""0"" android:layout_span=""1"" /&gt;        &lt;Button android:id=""@+id/btnCourseHandicap""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_column=""2"" android:text=""Course"" android:textSize=""18px"" /&gt;    &lt;/TableRow&gt;    /* Row 8: The forward and reset/edit buttons */    &lt;TableRow&gt;        &lt;ImageButton android:id=""@+id/btnNext"" android:src=""@drawable/forward32""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_column=""0"" /&gt;        &lt;ImageButton android:id=""@+id/btnReset""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_column=""2"" android:src=""@drawable/edit32"" /&gt;    &lt;/TableRow&gt;    /* Row 9: This is just a row for the plug of the company */    &lt;TableRow android:paddingBottom=""10dip"" android:paddingTop=""5dip""&gt;        &lt;TextView android:id=""@+id/txtBottom"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:layout_column=""0""            android:textSize=""14px"" android:textColor=""@color/darkblue""            android:text=""                         www.chrome9.org"" /&gt;    &lt;/TableRow&gt;    // End of all rows and widgets&lt;/TableLayout&gt;</code></pre><p>Manifest</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""org.chrome9.golfCalc""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon""&gt;        &lt;activity android:name="".launchCalculator""                  &gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt;</code></pre>","382533","","12707","","2010-07-03 05:32:39","2010-07-03 05:32:39","I added ImageButtons and listener, now emulator crashes","<android>","0","9","","",""
"3170443","1","","","2010-07-03 05:42:13","2","1053","<p>I downloaded my Android apk onto a Device on deviceanywhere. After the download, when I click on it, it asks ""Do you want to install this application?"". I click ""Install"", it comes back saying ""Application not installed"" with a warning symbol. </p><p>Anyone know why this is happening?</p><p>ThanksChris</p>","321927","","","","","2011-03-24 02:25:51","Android apk install on deviceanywhere","<android><install><device><apk>","1","2","","",""
"3170463","1","3183068","","2010-07-03 05:52:08","2","991","<p>onActivityResult is giving me major headaches. My little game has a title / menu screen.  Upon clicking ""new game"" an Activity is launched which creates a SurfaceView for my game world. </p><p>When playing, the player can enter buildings in the game world. Upon entering a building I launch the activity for that particular building from my SurfaveView.  Here is an example:</p><pre><code>   Intent storeIntent = new Intent(mMinerClass, GeneralStore.class);   storeIntent.putExtra(""player"", mPlayer.save());       ((Activity) mContext).startActivityForResult(storeIntent, Miner.REQUEST_STORE);</code></pre><p>mMinerClass is defined in the game Activity onCreate:</p><pre><code>  mMap .mMinerClass = Miner.this;</code></pre><p>mMap is the SurfaceView. I'm passing a bundle containing the state of the player. In onActivityResult I grab the bundle returned by the store activity and update the player state. </p><pre><code> public void onActivityResult(int requestCode, int resultCode, Intent intent) {      Bundle player = intent.getExtras();      mMap.mSavedPlayer = player;  }</code></pre><p>mSavedPlayer is later used to set the new player state. </p><p><strong>All the above works generally</strong></p><p>I can enter stores, buy stuff, leave and the player is updated correctly. </p><p><strong>The problem</strong> manifests when I press the Home button (or someyimes back button) and onDestroy gets called. My onDestroy method does nothing besides call super.onDestroy();  </p><p>After onDestroy() gets called onActivityResult no longer gets called. </p><p>So:</p><p>1) I play the game, everthing works great. </p><p>2) I press home and ondestroy is called</p><p>3) relaunch my game via launcher icon</p><p>4) Resume game. I can still enter and leave stores but onActivityResult is no longer called. </p><p>Here is some logcat output. I'm logging each time I enter a relevant method. </p><pre><code>  App start.  Resuming a saved game  07-03 00:33:04.759: ERROR/Miner(4014): --&gt;onCreate  07-03 00:33:04.819: ERROR/Miner(4014): --&gt;onStart  07-03 00:33:08.329: ERROR/Miner(4014): --&gt;onResume  Enter store and buy stuff 2 times.  Everything working great.  07-03 00:33:30.419: ERROR/Miner(4014): --&gt;onPause  07-03 00:33:31.279: ERROR/Miner(4014): --&gt;onStop  07-03 00:33:35.069: ERROR/Miner(4014): --&gt;onActivityResult  07-03 00:33:35.069: ERROR/Miner(4014): --&gt;onRestart  07-03 00:33:35.069: ERROR/Miner(4014): --&gt;onStart  07-03 00:33:36.709: ERROR/Miner(4014): --&gt;onResume  07-03 00:33:42.129: ERROR/Miner(4014): --&gt;onPause  07-03 00:33:43.289: ERROR/Miner(4014): --&gt;onStop  07-03 00:33:55.279: ERROR/Miner(4014): --&gt;onActivityResult  07-03 00:33:55.279: ERROR/Miner(4014): --&gt;onRestart  07-03 00:33:55.279: ERROR/Miner(4014): --&gt;onStart  07-03 00:33:56.879: ERROR/Miner(4014): --&gt;onResume  Back button pressed bringing me to title screen  07-03 00:35:26.283: ERROR/Miner(4014): --&gt;onPause  07-03 00:35:27.153: ERROR/Miner(4014): --&gt;onStop  07-03 00:35:27.333: ERROR/Miner(4014): --&gt;onDestroy  Resume Game  07-03 00:36:12.953: ERROR/Miner(4014): --&gt;onCreate  07-03 00:36:13.003: ERROR/Miner(4014): --&gt;onStart  07-03 00:36:14.663: ERROR/Miner(4014): --&gt;onResume  Enter store and buy stuff twice.  No more onActivityResult  07-03 00:36:52.063: ERROR/Miner(4014): --&gt;onPause  07-03 00:36:52.863: ERROR/Miner(4014): --&gt;onStop  07-03 00:36:59.913: ERROR/Miner(4014): --&gt;onRestart  07-03 00:36:59.913: ERROR/Miner(4014): --&gt;onStart  07-03 00:37:01.593: ERROR/Miner(4014): --&gt;onResume  07-03 00:37:23.353: ERROR/Miner(4014): --&gt;onPause  07-03 00:37:24.173: ERROR/Miner(4014): --&gt;onStop  07-03 00:37:29.173: ERROR/Miner(4014): --&gt;onRestart  07-03 00:37:29.173: ERROR/Miner(4014): --&gt;onStart  07-03 00:37:30.793: ERROR/Miner(4014): --&gt;onResume</code></pre><p>I'm posting this from my phone so excuse any dumb typos. </p><p>I appreciate any insight y'all can provide regarding this. Thanks!</p>","1742702","","","","","2010-07-06 02:02:05","onActivityResult no longer being called after onDestroy","<android><onresume><activity-state>","1","1","","",""
"3170509","1","3170672","","2010-07-03 06:14:18","1","1279","<p>Can someone point me to right direction, how to create an adapter for <code>AutoCompleteTextView</code>, which would be getting data from <code>SQLite</code> DB, using data, which user entered into the text field? I want to use the user-entered data to filter suggestions for autocompletion. I imagine that adapter should always take user-entered data as soon as changes appears and use it for fetching suggestions on-the-fly. Is that possible? So far I've seen many tutorials for autocompletion where static <code>String</code> arrays were used, but never seen them build dynamically. Is it possible to do it automatically or I need always fetch <code>String</code> array myself and pass as <code>ArrayList</code> to adapter on every <code>AutoCompleteTextView</code> change?</p>","283037","","","","","2010-07-03 07:21:37","Autocomplete list from SQLite with criteria","<android><sqlite><autocomplete>","1","0","","",""
"3170563","1","3170671","","2010-07-03 06:40:54","11","8308","<p>I want to be able to detect the phone lock event. When my app is running, if I press the red button (call end button/power button), the phone gets locked and the screen goes blank. I want to be able to detect this event, is it possible?</p><p>ThanksChris</p>","321927","","","","","2013-12-24 16:53:43","Android detect phone lock event","<android><events><locking><phone>","2","0","3","",""
"3170619","1","3170662","","2010-07-03 07:01:22","4","1486","<p>I want to port a program I wrote to android. The program is in c++ on windows and linux. The program uses dll's for a plugin architecture. New plugins can be added to the program by downloading a dll which the program loads from a specific folder. My question is...Is it possible to download dlls built for android to a directory on the sdcard then from native code load and use those dll's</p>","382561","","","","","2010-07-03 07:17:48","can android load dll's from sdcard in native mode","<android><dll><plugins><native><sd-card>","1","1","","",""
"3170691","1","3192348","","2010-07-03 07:28:55","38","54562","<p>I have used /proc/meminfo and parsed command response.however it result shows that : </p><p>MemTotal:        94348 kBMemFree:          5784 kB</p><p>means. it shows there is only 5MB free memory. Is it possible with android mobile?There is only 5-6 application installed on my mobile and no other task is running. but still this command shows there is very less free memory.</p><p>Can somebody clarify this? or is there any other way of getting memory usage in android?</p>","376287","","","","","2013-10-09 08:55:55","How to get current memory usage in android?","<android><memory-management>","8","0","29","",""
"3170706","1","","","2010-07-03 07:36:22","3","2093","<p>I need to access and Android context for a JUnit Test.</p><p>I have tried using MockContext and extending the AndroidTestCase but each time I get an error saying (stub!)</p>","248521","","248521","","2010-07-03 08:02:36","2012-09-11 10:32:37","How do you get hold of an Android Context for a Junit test from a Java Project?","<android>","3","0","","",""
"3170739","1","","","2010-07-03 07:52:03","1","660","<p>I'm trying to get to grips with using 'Canvas' in Android. I'm using SDK 1.5. </p><p>I've been able to rotate text, but the background gets rotated as well.  Ideally, I'd like to be able to put my background image on one layer and rotate text (or zoom text) on a second layer.</p><p>How would I go about creating different layers on the Canvas? And is there a limit to the number of layers that can be created?</p><p>Thanks.</p>","330770","","","","","2010-07-03 07:52:03","Android - Animating Layers in Canvas","<android><canvas><zoom><rotation><layer>","0","2","0","",""
"3170805","1","3171069","","2010-07-03 08:18:47","2","11754","<p>I need to get a list of available bluetooth devices in the area using google android 2.1.</p><p>Thing is, i don't just need a list of those devices, i need some unique id for each device found and i need an indicator, how ""good"" the signal is received (like the ""level"" in android.wifi.ScanResult)... How do i do that?</p>","370969","","944657","","2012-10-19 09:21:18","2012-10-19 09:21:18","How to scan for available bluetooth devices in range in android?","<android><bluetooth><scanning>","2","0","2","",""
"3170852","1","","","2010-07-03 08:34:46","1","210","<p>i am developing a password storage software. To enter into the application we have to login with valid details.</p><p>Now when i press home key, the application should log of automatically and then start all over again from security perspective. It should logout everytime the home key is pressed.How do i do it?</p>","344768","","","","","2010-07-03 09:30:52","Security application","<android>","1","1","1","",""
"3170928","1","","","2010-07-03 08:58:37","1","1737","<p>When development various platforms(Android,iPhone,Mac,Windows and so on), it is necessary diverged processing(#ifdef/#endif) by depends on an platform definition.But, I don't know original definition in Mac/iPhone/Android.</p><p> Windows : WIN32 (Visual C++)</p><p> Mac : __MAC_NA(?)  (XCode)</p><p> iPhone/iPad/iPod : __IPHONE_NA(?) (XCode)</p><p> Android : ?? (AndroidNDK)</p><p>By what definition should I divide?</p>","367144","","","","","2010-07-03 18:20:14","Macro definition in cross-platform","<c++><iphone><c><android><osx>","3","1","","",""
"3171056","1","3171080","","2010-07-03 09:42:05","2","1355","<p>I want to download an image from the 'net and set it as the users background. This works great over wi-fi, and some 3G networks, but others (T-Mobile UK, for sure) seem to compress the images before sending them. </p><p>This effect is noticeable when using the browser, too - however, if you long press on an image and save it, when viewing in the gallery it is either not compressed at all, or substantially less so. I want to be able to do this in my own app. </p><p>I assume it has something to do with the HTTP headers, but of the ones I've modified, none has made a difference.</p><p>Can anyone help me out here?  </p><p>Similar question here <a href=""http://stackoverflow.com/questions/2183808/android-bitmapfactory-decodebytearray-gives-pixelated-bitmap"">http://stackoverflow.com/questions/2183808/android-bitmapfactory-decodebytearray-gives-pixelated-bitmap</a> but is unresolved.</p>","31168","","981331","","2012-01-15 08:29:19","2014-02-05 12:25:10","Avoiding image compression on some 3G networks","<android><image><networking><http-headers><3g>","4","0","1","",""
"3171216","1","","","2010-07-03 10:41:34","1","563","<p>This maybe somewhat of a strange question but I just can`t figure it out.Basically I have a class that extends View and overrides the onDraw method so it draws a bitmap what it is called. What I want to do is when by choosing a picture from a gallery, send it through and intent and draw that on the View.</p><p>The problem is that I can`t get the Activity to draw the bitmap when it is started. I try setting in in onCreate, onStart... nothing works.</p><p>It works if I set the bitmap on a button press and calling invalitate(), so I suspect that I try to draw before the Activity hasn`t finished drawing itself.</p><p>Any suggestions? </p>","367017","","21234","","2010-12-08 11:01:01","2010-12-08 11:01:01","When has the Activity finished drawing itself?","<android><graphics>","1","0","","",""
"3171223","1","","","2010-07-03 10:43:46","5","1020","<p>(I'm sorry for not being so clear in my first post)</p><p>Here is the situation: I have data that is to be refreshed from the Internet. Let's call it <code>Model</code>.</p><p><strong>What I want to do:</strong> Basically it sounds like an MVC model, where the <code>Model</code> is also kept persistent in local (private) storage. The <code>Model</code> and its associated methods are application-wise. There are several <code>Activity</code>'s that display and manipulate different aspects of it:</p><ul><li>Usernavigates across different <code>Activity</code>'sthat display <code>Model</code>from different perspectives. Currently I have a <code>ListActivity</code> for all elements, and an <code>Activity</code> for one element's details</li><li>Sometimes <code>Model</code> needs refreshing.Surely this is done on a different thread. Refreshing can be triggered from several <code>Activity</code>'s.</li><li>There are several (time consuming) common tasks that can be triggered from different <code>Activity</code>'s</li><li>My application loads and saves <code>Model</code>to private storage when it startsand stops</li></ul><p><strong>My problem:</strong> I'm not sure where to put <code>Model</code> and the related tasks in. Also, I don't know what mechanism to use to notify <code>Activity</code>'s. Currently I come up with 2 approaches:</p><ul><li>Use <code>Service</code> and send broadcasts. Saving to disk is performed in <code>Service#onDestroyed()</code>, so I want to minimize that by binding it to <code>Activity</code>'s. At this point, I'm also not sure how to deliver the updated information: whether to provide a <em>getter</em> in <code>Binder</code>, or include that in the broadcast message.</li><li>Customize the <code>Application</code> object so that <em>refreshing methods</em> and <em>getters</em> are available globally. I then perform update from <code>Activity</code>'s using <code>AsyncTask</code>. If there are other <code>Activity</code>'s that are behind the current <code>Activity</code>, they will update in <code>onResume()</code> when the user navigates back.</li></ul><p>Reasons I'm not using a class with static methods:</p><ul><li>I need to save and store <code>Model</code> to disk.</li><li>Some of the methods need a Contextfor displaying toasts, notifications, caching, etc.</li></ul><p>Also, I don't put these functionalities in an <code>Activity</code> because there are several activities that manipulate the same piece of persistent data.</p><p>Below are pseudocode illustrating what I mean:</p><p><strong>Using Service:</strong></p><pre><code>/** Service maintaining state and performing background tasks */class MyService extends Service {    Model mModel;    Binder mBinder;    onCreate() {        super.onCreate();        mBinder = new Binder();        // load mModel from disk, or do default initialization    }    onDestroy() {        super.onDestroy();        // save mModel to disk    }    onBind() {        return mBinder;    }    class Binder {        refresh() {            new AsyncTask() {                doInBackground() {                    // update mModel from Internet                }                onPostExecute() {                    sendBroadcasts(new Intent(""my.package.REFRESHED""));                }            }.execute();        }        getState() {            return mModel.getState();        }    }}/** Activity displaying result */class MyActivity extends ListActivity {    MyService.Binder mBinder;    onCreate() {        super.onCreate();        // register mReceiver        // bind service    }    onDestroy() {        super.onDestroy();        // unbind service        // unregister mReceiver    }    /** Invokes time-consuming update */    refresh() {        // binding is asynchronous, and user may trigger refreshing too early        if (mBinder != null) {            mBinder.refresh();        }    }    BroadcastReceiver mReceiver = new BroadcastReceiver() {        onReceive(Intent intent) {            if (""my.package.REFRESHED"".equals(intent.getAction())                    &amp;&amp; mBinder != null) {                updateViews(mBinder.getState());            }        }    };}</code></pre><p><strong>Make the functionality globally accessible in the custom Application object</strong></p><pre><code>/** Custom Application providing domain specific functionalities */class MyApplication extends Application {    Model mModel;    onCreate() {        super.onCreate();        // load mModel from disk, or do default initialization    }    onTerminate() {        super.onTerminate();        // save mModel to disk    }    void refresh() {        /** time-consuming */    }    getState() {        return mModel.getState();    }}/** Activity displaying result */class MyActivity extends ListActivity {    onResume() {        super.onResume();        // in case some top Activities have refreshed        // and user is navigating back        updateViews(((MyApplication)getApplicationContext()).getState());    }    /** Invokes time-consuming update */    refresh() {        new AsyncTask() {            doInBackground() {                ((MyApplication)getApplicationContext()).refresh();            }            onPostExecute() {                // update the ListView according to result                updateViews(((MyApplication)getApplicationContext()).getState());            }        }.execute();    }}</code></pre><p>Weaknesses I can think of for the <code>Service</code> approach is complexity, since Binding is asynchronous. And it's very likely that I have to repeat some code because I have both <code>ListActivity</code> and <code>Activity</code></p><p>For the <code>Application</code> approach, the documentation says not to rely on <code>onTerminate()</code> being called.</p><p>I know I'm being very awkward. What is the conventional way to solve this sort of problem?</p><p>Many thanks.</p>","159759","","159759","","2010-07-03 16:00:57","2010-07-03 16:00:57","MVC in Android: Application or Service for asynchronous updates?","<android><model-view-controller><design><service>","3","0","2","",""
"3171392","1","3171488","","2010-07-03 11:48:34","0","716","<p>I have finally - after days and days of agony - figured out that I need two forms of encryption for my Digital Signatures Project.  The first will will be <strong>symmetric (AES)</strong> and will encrypt the <strong>license data</strong> and the second will be a <strong>asymmetric (RSA)</strong> an will <strong>encrypt the symmetric key</strong>.  Can someone give me pointers on the best methods to use for Android.</p><p><code>For the public/private keys I am using: ""RSA/ECB/PKCS1Padding""</code>(I head ECB is bad so what should I use?, what about the PKCS1Padding - shoudl I be using PKCS5Padding?)</p><p><code>For the symetric keys I will probably use: ""AES/???/?????????""</code> (What mode and padding should I use?)</p><blockquote>  <p>The provider: ""BC""</p>    <p>RSA Keysize: 1024 (I tried 2048 but it didn't work for some reason)</p>    <p>AES Keysize: ????  (suggestions)</p></blockquote><p>Also if you know where I can find a good guide on what is actually supported in Android that would be great.</p><p>I am in no way an encryption expert so if anything looks a little precarious here please tell me a better alternative!</p><p>If you know of a good combination but are not sure if it is supported on Android please say so, so that I don't end up wasting a whole lot of time to find it is not supported.</p>","248521","","","","","2010-07-03 14:41:33","Recommended Encryption combination for digital signatures","<java><android><encryption>","4","0","","",""
"3171394","1","3171980","","2010-07-03 11:49:14","9","4435","<p>I am trying to create a simple exception handler which will help me debug the application. Right now, when I have an exception I am forced to connect with Eclipse debugger merely to see the exception details.</p><p>To avoid that I've used <strong>setUncaughtExceptionHandler</strong> to handle any unhandled exception and display a Toast on the exception. Unfortunately, that doesn't work.</p><pre><code>public class TicTacToe extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Thread.currentThread().setUncaughtExceptionHandler(new UncaughtExceptionHandler() {            @Override            public void uncaughtException(Thread thread, Throwable ex) {                Toast.makeText(TicTacToe.this, ""TOAST"", Toast.LENGTH_LONG).show();            }        });        setContentView(R.layout.main);        Button continueButton = (Button) findViewById(R.id.cell01);        continueButton.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                int i = 5;                i = 5 / 0;                Toast.makeText(TicTacToe.this, ""BUTTON"", Toast.LENGTH_LONG).show();                         }        });    }}</code></pre><p>Essentially I made a form with a single button, pressing on which, it would throw a devision-by-zero exception. However, pressing the button doesn't cause the global toast handler to show. Instead, the button stays orange (pressed) and nothing happens.</p><p>Needless to say, if I comment out <strong>i = 5 / 0;</strong> I see the toast that says that a button was pressed.</p><p>Two questions:1) Why isn't the toast showing in the <strong>UncaughtExceptionHandler</strong> body? How do cause it to show?2) Is there an alternative/better way for global exception handling? I guess I could install aLogCat on the android simulator and simply log the uncaught exception, it seems, however, less comfortable - I will need to be switching applications just to see exception details.</p><p>Thanks!</p>","126574","","32502","","2010-07-03 13:23:10","2011-07-05 05:50:24","Using global exception handling with ""setUncaughtExceptionHandler"" and ""Toast""","<java><android><exception><exception-handling>","2","4","6","",""
"3171452","1","","","2010-07-03 12:17:13","5","6338","<p>I have a Gallery composed of many ScrollViews each of which occupies the whole screen. problem is the ScrollViews' onTouchEvent returns true and therefore prevent any other view in the DOM to handle the same event (which is swallowed after being processed at the ScrollView level). As a result the Gallery doesn't scroll anymore. On the other hand if I override onTouchEvent like this:</p><pre><code>   @Override   public boolean onTouchEvent(MotionEvent ev) {      super.onTouchEvent(ev);      return false; // &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;   }   </code></pre><p>then the Gallery receives its on event to process but the SrollView doesnt scroll anymore. Either way you lose! or do you?</p><p>problem sounds puzzling but I am sure if u stumbled upon it in the past u r gonna recognize it straight away as it a freaking damn one!</p><p>thanks</p>","87624","","","","","2012-10-20 06:50:34","ScrollView and Gallery interfering","<android>","5","1","4","",""
"3171482","1","3572834","","2010-07-03 12:29:57","11","6320","<p>hi im trying to add a phone number to an existing contact on android 2.1. Im currently using:</p><pre><code>ContentValues values = new ContentValues();values.put(Phone.RAW_CONTACT_ID,cursor.getColumnIndex(Phone.CONTACT_ID));String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + "" = '1'"";ContentResolver cr = getContentResolver();Cursor cursor = cr.query(ContactsContract.Contacts.CONTENT_URI,null, selection, null,ContactsContract.Contacts.DISPLAY_NAME+"" COLLATE LOCALIZED ASC"");if (cursor.getCount() &gt; 0) {    cursor.moveToPosition(oldcontactid);    contactid = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));    values.put(Phone.RAW_CONTACT_ID,cursor.getColumnIndex(Phone.CONTACT_ID));    if (Integer.parseInt(cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0) {        Cursor pCur = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null,ContactsContract.CommonDataKinds.Phone.CONTACT_ID +"" = ?"",new String[]{contactid}, null);        while (pCur.moveToNext()) {            values.put(Phone.NUMBER,pCur.getString(pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)));            values.put(Phone.TYPE, Phone.TYPE_MOBILE);        }        pCur.close();    }}Uri uri = getContentResolver().insert(Phone.CONTENT_URI, values);</code></pre><p>but i get an error:</p><pre><code>java.lang.UnsupportedOperationException: Unknown uri: content://com.android.contacts/data/phones</code></pre><p>how would i be able to fix this?</p><p>thanks for any help,ng93</p>","364727","","364727","","2011-02-16 14:14:57","2012-12-20 09:27:19","android edit contact","<java><android><contact><contactscontract>","4","2","1","",""
"3171546","1","3175555","","2010-07-03 12:54:09","1","439","<p>I'm facing a recurrent problem that I don't know why it is happening. It happens all of a sudden. I didn't do anything different from what I was doing before.</p><p>I'm using these tabs: <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a></p><p>When I open one of the three tabs (Class name = Tab1), this problem comes out. Before, this error came out after clicking all of the tabs (????).A part of the stack trace:</p><hr><p>Could not find class 'org.android.catsMobile.packageName.Tab1$OrderAdapter', refereced from method org.android.catsMobile.packageName.Tab1.onCreate[...]</p><p>threadid=3: thread exiting with uncaught exception (group=0x4000fe70)java.lang.VerifyError: org.android.catsMobile.packageName.Tab1</p><hr>","313721","","313721","","2010-07-03 13:00:17","2010-07-04 17:26:22","Android - java.lang.VerifyError","<android>","1","1","","",""
"3171547","1","3172545","","2010-07-03 12:54:39","2","588","<p>I've got an activity with a search field with a ""near current location"" checkbox and a listview to show the results. I'm now in the life cycle of the activity, implementing the onSaveInstanceState and onRestoreInstanceState methods. When the activity is destroyed and I get back to it, the listview with the results has disappeared, but the text in the search box and the checkbox state are restored, while I haven't saved anything in onSaveInstanceState. Why? What is saved ""automatically"" and what do I need to save in onSaveInstanceState?</p><pre><code>public class Atable extends Activity {    private EditText mSearch;    private static final int ACTIVITY_EDIT=0;    private Button mSearchButton;    private TextView mNoresults;    private TextView mytext;    private ListView lv;    private CheckBox checkBox;    private LocationManager locationManager;        public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);                setContentView(R.layout.main);        lv= (ListView)findViewById(R.id.listview);        mNoresults = (TextView) findViewById(R.id.noresults);          mNoresults.setVisibility(View.GONE);        mSearchButton = (Button)this.findViewById(R.id.button);        checkBox = (CheckBox) findViewById(R.id.local_check);                locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);        final Criteria criteria = new Criteria();        criteria.setAccuracy(Criteria.ACCURACY_FINE);        mSearchButton.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                mNoresults.setVisibility(View.GONE);                mSearch = (EditText) findViewById(R.id.search);                  String tmp_str = mSearch.getText().toString().replace("" "",""+"");                           HttpClient httpclient = new DefaultHttpClient();                    // Prepare a request object                String url = ""http://www.atable.org/getRestaurantByQuery/?query="" + tmp_str;                              if (checkBox.isChecked()) {                    //get location                    String provider = locationManager.getBestProvider(criteria, true);                                    Location location = locationManager.getLastKnownLocation(provider);                    if (location!=null) {                        String lat = String.valueOf(location.getLatitude());                        String lng = String.valueOf(location.getLongitude());                        url += ""&amp;lat=""+lat+""&amp;lng=""+lng;                                       }                }                HttpGet httpget = new HttpGet(url);                 // Execute the request                HttpResponse response;                try {                    response = httpclient.execute(httpget);                    HttpEntity entity = response.getEntity();                    if (entity != null) {                        InputStream instream = entity.getContent();                        Reader r = new InputStreamReader(instream);                                              Gson gson = new Gson();                        final RestaurantList restaurantList = gson.fromJson(r, RestaurantList.class);                        int nResults = restaurantList.getSize();                        if (nResults&gt;0) {                            lv.setVisibility(View.VISIBLE);                            lv.setAdapter( new ArrayAdapter&lt;String&gt;(Atable.this ,android.R.layout.simple_list_item_1,restaurantList.getRestaurantNames()));                            lv.setOnItemClickListener(new OnItemClickListener() {                                public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {                                    Intent intent = new Intent(Atable.this, RestaurantDescription.class);                                    Restaurant tmp_resto = restaurantList.getRestaurant((int)id);                                    String tmp_categories = tmp_resto.getCategories().get(0);                                    for (int i=1; i&lt;tmp_resto.getCategories().size(); i++) {                                        tmp_categories+="", ""+tmp_resto.getCategories().get(i);                                    }                                    String address = tmp_resto.getStreet()+"", ""+tmp_resto.getStreetNumber()+""\n""+tmp_resto.getCity()+                                                    "" ""+tmp_resto.getPostalCode()+""\n""+tmp_resto.getCountry();                                    intent.putExtra(""name"", tmp_resto.getName());                                    intent.putExtra(""address"", address);                                                                    intent.putExtra(""rating"", tmp_resto.getRating());                                    intent.putExtra(""price_range"", tmp_resto.getPriceRange());                                    intent.putExtra(""categories"", tmp_categories);                                    intent.putExtra(""latitude"", tmp_resto.getLatitude());                                    intent.putExtra(""longitude"", tmp_resto.getLongitude());                                    startActivityForResult(intent, ACTIVITY_EDIT);                                }                            });                        }                        else {                            lv.setVisibility(View.GONE);                            mNoresults.setVisibility(View.VISIBLE);                        }                        //Closing the input stream will trigger connection release                        instream.close();                    }                   } catch (ClientProtocolException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }        });    }    //Start a location listener    LocationListener onLocationChange=new LocationListener() {        public void onLocationChanged(Location loc) {            //sets and displays the lat/long when a location is provided            /*String latlong = ""Lat: "" + loc.getLatitude() + "" Long: "" + loc.getLongitude();               mytext.setText(latlong);*/        }        public void onProviderDisabled(String provider) {        // required for interface, not used        }        public void onProviderEnabled(String provider) {        // required for interface, not used        }        public void onStatusChanged(String provider, int status,        Bundle extras) {        // required for interface, not used        }    };    //pauses listener while app is inactive    @Override    public void onPause() {        super.onPause();        locationManager.removeUpdates(onLocationChange);    }    //reactivates listener when app is resumed    @Override    public void onResume() {        super.onResume();        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,onLocationChange);    }    @Override    protected void onDestroy() {        super.onDestroy();        Toast.makeText(this, ""Activity is getting killed"", Toast.LENGTH_LONG).show();    }    @Override    protected void onRestoreInstanceState(Bundle savedInstanceState) {              Toast.makeText(this, ""onRestoreInstanceState"", Toast.LENGTH_LONG).show();        super.onRestoreInstanceState(savedInstanceState);    }    @Override    protected void onSaveInstanceState(Bundle outState) {               Toast.makeText(this, ""onSaveInstanceState"", Toast.LENGTH_LONG).show();        super.onSaveInstanceState(outState);    }}</code></pre>","326849","","3043","","2010-11-22 22:05:46","2010-11-22 22:05:46","Another question about the lifecycle of a simple Android application","<android><lifecycle>","1","0","","",""
"3171934","1","3172847","","2010-07-03 15:33:28","2","1719","<p>How do you programatically do this in the Android SDK:  </p><ol><li>Dial a phone number  </li><li>Bypass the keypad screen  </li><li>Send additional DTMF after the number is dialed  </li><li>Bypass the send DTMF tone prompt  </li></ol><p>I have managed to do 1 till 3 by dialing +555-1212w1234 but I am wondering if anyone knows how to bypass the send DTMF tone prompt.</p>","382740","","119895","","2010-07-04 02:31:59","2012-05-30 13:39:32","How to Programatically Dial a Phone number in the Android SDK?","<android><dtmf>","2","0","1","",""
"3171992","1","3355394","","2010-07-03 15:59:21","6","380","<p>I'm really struggling here, and it's holding me back.</p><p>What is the correct way to handle OpenGL, and an Activity - which launches sub-activities, or goes back to the home screen. And have it resume just exactly where it was.</p><p>I have it semi-working as it stands, textures/VBOs are reloaded at onResume() when needed.</p><p>But sometimes, when launching sub-activities and returning, or going to home screen and returning, onCreate is being triggered again. This messes up the whole thing, and I end up with a black screen.</p><p>I'm sure I'm doing the whole thing wrong. Can someone explain how one should handle an Activity like this?</p>","310455","","44729","","2010-07-04 20:21:45","2010-07-28 17:02:33","What's the proper way to handle the Activity lifecycle with OpenGL","<android><opengl-es>","1","0","1","",""
"3172151","1","3172180","","2010-07-03 16:55:54","11","4101","<p>I've read lots of articles about intent filters and I really can't understand exactly what they do?</p><p>so please if anybody can explain to me with a clear example what is the role of intent filters exactly ?</p><p>thanks</p>","235123","","626445","","2011-04-20 08:15:56","2011-04-20 08:15:56","What are Intent Filters exactly?","<android><intentfilter>","4","2","4","",""
"3172333","1","5130072","","2010-07-03 17:57:23","6","10662","<p>I created an instance of a custom class RestaurantList to hold my data (a list of restaurant data received from a web service as json data).</p><p>How can I save it in <code>onSaveInstanceState</code>?</p>","326849","","119895","","2010-07-03 18:27:04","2012-09-18 00:30:48","How to save an instance of a custom class in onSaveInstanceState?","<android>","3","0","6","",""
"3172376","1","3172407","","2010-07-03 18:08:38","2","710","<p>I use the following main.xml for my app.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:id=""@+id/toplinear""&gt;    &lt;LinearLayout      xmlns:android=""http://schemas.android.com/apk/res/android""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:id=""@+id/linear""&gt;        &lt;Button              android:layout_width=""fill_parent""             android:layout_height=""wrap_content""             android:text=""Previous""            android:id=""@+id/previous""            android:layout_weight=""1""            /&gt;        &lt;Button              android:layout_width=""fill_parent""             android:layout_height=""wrap_content""             android:text=""Next""            android:id=""@+id/next""            android:layout_toRightOf=""@id/previous""            android:layout_weight=""1""            /&gt;    &lt;/LinearLayout&gt;    &lt;ListView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""         android:id=""@+id/android:list""        android:layout_weight=""10""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>I want to have 2 buttons at the top, previous and next and my listview with custom adapter below it. Few days ago I had only my ListView showing, going over the buttons. Now I seem to  be stuck on the other side, where my listview doesn't show while my buttons do.</p><p>My activity extends on ListActivity and uses this code to fill it with a customadapter.</p><pre><code>ListView lv = getListView();lv.setAdapter(new MyCustomAdapter(this, R.layout.custom_list, nameResults));    public class MyCustomAdapter extends ArrayAdapter&lt;String&gt; {        private String[] nameResults;        private Context context;        public MyCustomAdapter(Context context, int textViewResourceId,                String[] names) {            super(context, textViewResourceId, names);            this.context = context;            nameResults = names;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            View row = convertView;            if (row == null) {                LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);                row = inflater.inflate(R.layout.custom_list, parent, false);            }            TextView label = (TextView) row.findViewById(R.id.Name);            label.setText(nameResults[position]);            TextView descr = (TextView) row.findViewById(R.id.Description);            descr.setText(linkedResults.get(nameResults[position]));            return row;        }    }</code></pre><p>I tried using ""lv.addHeaderView(previous);"" but that only gave me vague ClassCastExceptions about LayoutParams.</p><p>I think my problem is currently in my main.xml, as the Layout tab in Eclipse of it won't show the ListView either. It knows its there as it shows up in the outline tab, but the visual representation doesn't give it a red outline when I select it.</p><p>For completeness, my custom_list (aka row) layout xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:background=""#ffffff""&gt;  &lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:id=""@+id/Name""    android:textColor=""#000000""    android:textStyle=""bold""  /&gt;  &lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:id=""@+id/Description""    android:textColor=""#000000""  /&gt;&lt;/LinearLayout&gt;</code></pre>","124950","","","","","2010-07-03 18:20:48","ListView won't show up anymore","<android><list><adapter>","1","0","","",""
"3172534","1","","","2010-07-03 19:03:01","3","1958","<p>Does anyone know if there is a support for <a href=""http://en.wikipedia.org/wiki/Cell_Broadcast"" rel=""nofollow"">cell broadcast</a> on Android?If yes, can anyone point me to any example that shows how to use it? (e.g. receive messages on some channel)</p><p>Thank you.</p>","220110","","","","","2013-07-21 17:51:08","Cell broadcast support on Android?","<java><c++><android><android-ndk><telephony>","1","0","1","",""
"3172742","1","3172764","","2010-07-03 20:13:38","1","2719","<p>Alright, so I followed the <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">Tab Widget</a> tutorial to create some tabs for my application.  In one of the tabs, I have a TextView with a lot of text that I'm debugging with.  But, with all of the text, all of the info doesn't show up on the screen.  I figured that I could scroll down to see the rest, but I cannot scroll.  Any idea on how to make it so that I can scroll down my FrameLayout so I can see the rest of my text?</p>","362857","","","","","2010-07-03 20:17:20","Scrollable FrameLayout","<android>","1","0","","",""
"3172861","1","3173025","","2010-07-03 20:54:52","4","1102","<p>I'm trying to build a app that uses the SmsMessage class but there are two versions depending on the API level of the device:</p><p>android.telephony.gsm.SmsMessage (deprecated for 1.6 and above)</p><p>android.telephony.SmsMessage (the new class for 1.6 and up)</p><p>I want to target 1.5 and yet have the newer class (android.telephony.SmsMessage) run on devices with 1.6 or higher. How do I do this?</p><p>I have already tired this: <a href=""http://devtcg.blogspot.com/2009/12/gracefully-supporting-multiple-android.html"" rel=""nofollow"">http://devtcg.blogspot.com/2009/12/gracefully-supporting-multiple-android.html</a> but I couldn't get it to work (the author doesn't mention how he/she handles the different imports, the exact api level settings etc.)</p><p>Thanks.</p><pre><code>import java.util.Date;import com.apps.myapp.Utilities;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.telephony.gsm.SmsMessage;//*NOTE* depreciated in v1.6+public class OfflineSMSReceiver extends SMSReceiver{    @Override    public void onReceive(Context context, Intent intent)    {        System.out.println(""SMS_RECEIVED"");        System.out.println(Utilities.getNow());        //---get the SMS message passed in---        Bundle bundle = intent.getExtras();                SmsMessage[] msgs = null;        Date date;         long timeStamp;        String time;        String str = """";                    if (bundle != null)        {            //---retrieve the SMS message received---            Object[] pdus = (Object[]) bundle.get(""pdus"");            msgs = new SmsMessage[pdus.length];                        for (int i=0; i&lt;msgs.length; i++){                msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                timeStamp = msgs[i].getTimestampMillis();                date = new Date(timeStamp);                time = this.getTime(date.getHours(),date.getMinutes(),date.getSeconds());                str += ""SMS from "" + msgs[i].getOriginatingAddress();                                     str += "" :"";                str += msgs[i].getMessageBody().toString();                str += ""\n"";                str += ""TIME: ""+time+""\t""+this.getNowDate();            }            System.out.println(str);        }    }}</code></pre>","272302","","65977","","2010-07-03 22:17:37","2014-02-12 10:12:31","Android -- Support 1.6+, and Support for Deprecated Code in 1.5?","<android><api><deprecated>","2","0","4","",""
"3172923","1","","","2010-07-03 21:22:35","3","853","<p>I have just started doing some Android development. One of the things that I would like to add to the app the I'm working on, is data exchange between a desktop computer and an android phone. Think of it like syncing data between Microsoft Outlook and the phone when it is connected to the wifi network. (Stanza on the iPhone is another good example)</p><p>The application that is running on the desktop is written in C# (to make it more interesting ;-)). I'm trying to avoid using a WebService, since this requires something like IIS.</p><p>Are there any libraries that can help me with this, or is it simple enough to do using the Java Socket functionalities?</p>","382848","","","","","2014-01-15 19:26:59","Exchange data between computer and android phone over Wifi","<android>","2","0","1","",""
"3172966","1","3173111","","2010-07-03 21:43:55","2","1114","<p>With my notification system, when the notification is sent, I would like to be able to click on the notification and have it send me to my application.  But, with my current code, it doesn't do so.  How can I fix that?</p><pre><code>public void causeNotification(CharSequence contentText, CharSequence tickerText) {    Log.d(TAG, ""Sending notification - \"""" + contentText + ""\"""");    String ns = Context.NOTIFICATION_SERVICE;    NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);    int icon = R.drawable.neoseeker_swoosh;    long when = System.currentTimeMillis();    Notification notification = new Notification(icon, tickerText, when);    notification.defaults |= Notification.DEFAULT_ALL;    notification.defaults |= Notification.FLAG_AUTO_CANCEL;    Context context = getApplicationContext();    CharSequence contentTitle = ""Neoseeker"";    Intent notificationIntent = new Intent();    PendingIntent contentIntent = PendingIntent.getActivity(Neoseeker.this, 0, notificationIntent, 0);    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);    mNotificationManager.notify(Neoseeker.NOTIFICATION_ID, notification);}</code></pre>","362857","","","","","2010-07-03 22:55:22","Click Notification - Send to application","<android>","1","0","1","",""
"3172988","1","3173510","","2010-07-03 21:53:31","1","2208","<p>My animation works and when the thread ends, the intent for the next screen fires, but it won't fire from the end of the animation.  I put log entries for all of the <code>AnimationListener's</code> callbacks (only End is in this listing), but none get logged.</p><pre><code>public class PromoActivity extends Activity implements AnimationListener {    protected boolean _active = true;    protected int _splashTime = 5000; // time to display the splash screen in ms    private static final float ROTATE_FROM = 0.0f;    private static final float ROTATE_TO = -10.0f * 360.0f;// 3.141592654f * 32.0f;    private static final String TAG = ""PromoActivity"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Thread promoThread = new Thread() {            @Override            public void run() {                try {                    ImageView favicon = (ImageView) findViewById(R.id.favicon);                    RotateAnimation r; // = new RotateAnimation(ROTATE_FROM, ROTATE_TO);                    r = new RotateAnimation(ROTATE_FROM, ROTATE_TO, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);                    r.setDuration((long) 2*1500);                    favicon.startAnimation(r);                    RotateAnimation q;                    q = new RotateAnimation(ROTATE_FROM, -ROTATE_TO, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);                    q.setDuration((long) 2*1500);                    q.setRepeatCount(0);                    TextView mobiText = (TextView) findViewById(R.id.logotext_mobi);                    mobiText.startAnimation(q);                    TextView dawgText = (TextView) findViewById(R.id.logotext_bob);                    dawgText.startAnimation(q);                    int waited = 0;                    while (_active &amp;&amp; (waited &lt; _splashTime)) {                        sleep(100);                        if (_active) {                            waited += 100;                        }                    }                } catch (InterruptedException ex) {                } finally {                    finish();                    startActivity(new Intent(""com.mobibob.promo.AboutActivity""));                    stop();                }            }        };        promoThread.start();    }    @Override    public void onAnimationEnd(Animation animation) {        Log.d(TAG, ""onAnimationEnd"");        startActivity(new Intent(""com.mobibob.promo.AboutActivity""));    }}</code></pre>","157804","","","","","2010-07-04 02:38:47","Why isn't my Android animation not calling my onAnimationEnd?","<android><animation>","1","3","","",""
"3173263","1","3173672","","2010-07-03 23:57:57","7","3075","<p>I have a view with a spinner. The activity starts another acvitity with a popup where I add or delete values that the parent shows in the Spinner.So, in onActivityResult() I refresh the content of the Spinner so that it reflects any additional or deleted values, by calling my fillSpinner() method.The parameter to this method is the previously selected value:</p><pre><code>private void fillSpinner(String value){    Cursor c =  mDbHelper.getAllCategories();    startManagingCursor(c);    c.moveToFirst();    String[] from = new String[]{DBAdapter.KEY_CATEGORY};           SimpleCursorAdapter scCats = new SimpleCursorAdapter(        this, android.R.layout.simple_spinner_item,c,from,            new int[]{android.R.id.text1});    scCats.setDropDownViewResource(        android.R.layout.simple_spinner_dropdown_item);    category.setAdapter(scCats);    if (value != null &amp;&amp; value != """") {        category.setSelection((int)mDbHelper.categoryIndex(value));    }}</code></pre><p>When I open the Spinner, it contains the correct list (i.e. it was refreshed) and the correct value is selected. However, the Spinner control itself (in its closed state) does not show the selected value, but the first in the list.</p><p>When I step through the code in the debugger, the Spinner value is correct before and after I call setSelection() (and it is always called with the same correct id). However, since I cannot step out of the event, when I resume the execution after a short moment the value in the Spinner changes.</p><p>In other words, the spinner's displayed string is changed and is different from the selected item when I return from my popup activity.</p><p>Any ideas are appreciated.</p>","58880","","58880","","2010-07-04 02:06:25","2012-03-19 23:21:14","Refreshing a Spinner","<android><activity><spinner>","2","0","","",""
"3173276","1","","","2010-07-04 00:05:22","0","965","<pre><code>07-03 23:59:01.067: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test' (No such file or directory)07-03 23:59:01.067: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory)07-03 23:59:01.067: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)07-03 23:59:01.067: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory)07-03 23:59:28.297: ERROR/BatteryService(60): usbOnlinePath not found07-03 23:59:28.307: ERROR/BatteryService(60): batteryVoltagePath not found07-03 23:59:28.307: ERROR/BatteryService(60): batteryTemperaturePath not found07-03 23:59:28.407: ERROR/SurfaceFlinger(60): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake07-03 23:59:39.097: ERROR/EventHub(60): could not get driver version for /dev/input/mouse0, Not a typewriter07-03 23:59:39.137: ERROR/EventHub(60): could not get driver version for /dev/input/mice, Not a typewriter07-03 23:59:39.777: ERROR/System(60): Failure starting core service07-03 23:59:39.777: ERROR/System(60): java.lang.SecurityException07-03 23:59:39.777: ERROR/System(60):     at android.os.BinderProxy.transact(Native Method)07-03 23:59:39.777: ERROR/System(60):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)07-03 23:59:39.777: ERROR/System(60):     at android.os.ServiceManager.addService(ServiceManager.java:72)07-03 23:59:39.777: ERROR/System(60):     at com.android.server.ServerThread.run(SystemServer.java:176)07-03 23:59:39.837: ERROR/AndroidRuntime(60): Crash logging skipped, no checkin service07-04 00:00:00.400: ERROR/vold(26): Cannot start volume '/sdcard' (volume is not bound)07-04 00:00:01.147: ERROR/MediaPlayerService(30): Couldn't open fd for content://settings/system/notification_sound07-04 00:00:01.227: ERROR/MediaPlayer(60): Unable to to create media player07-04 00:00:06.315: ERROR/ActivityThread(104): Failed to find provider info for android.server.checkin07-04 00:00:11.615: ERROR/ActivityThread(104): Failed to find provider info for android.server.checkin07-04 00:00:12.124: ERROR/ActivityThread(104): Failed to find provider info for android.server.checkin07-04 00:00:35.335: ERROR/AndroidRuntime(126): ERROR: thread attach failed07-04 00:00:42.835: ERROR/AndroidRuntime(211): ERROR: thread attach failed</code></pre>","382533","","199972","","2012-06-15 13:21:24","2012-06-15 13:21:24","What do these LogCat errors mean? My program crashes","<android><logcat>","1","0","","",""
"3173639","1","","","2010-07-04 03:31:01","4","255","<p>Is there a replacement somewhere in the SDK for javax.sound.sampled.AudioFormat and associated stuff that allows you to open a .wav file and extract the PCM samples from it? Or do I really need to implement my own codec? </p>","267257","","","","","2010-07-04 03:31:01","How do I read a 16 bit .wav audio file into a buffer suitable for writing to an Android AudioTrack?","<android><audio>","0","0","","",""
"3173646","1","3200792","","2010-07-04 03:35:22","6","403","<p>If you were to start your app again from scratch what would you do differently, knowing the platforms you were going to port to?This questions comes as my team is about to under-go development for a mobile app targeting iphone, android and qt. We aim to complete the iphone version first, and then port to android and qt, and it would be great to know any tips or ideologies to grasp/employ from the outset, that would make the porting process as seamless as possible. I'm sure there a few of you who have completed their iphone version of an app first, and then gone about developing an android version. I am keen to know any of the hurdles that you encountered, or things you wish you knew from the start.</p><p>edit:More specifically, the app we are making will contain forms and some visuals(charts)</p>","179914","","179914","","2010-07-04 22:27:43","2010-07-08 05:05:12","Porting iphone app. If you were to start your app again from scratch what would you do differently?","<iphone><android><qt><porting>","3","2","","",""
"3173846","1","","","2010-07-04 05:35:39","1","3735","<p>I am implementing something like the user interface from Microsoft Zune HD player. So, I would like to change the text color of my button when the button is being pressed as well as when it has been clicked.</p>","372107","","","","","2011-07-29 15:50:12","How to change the text color when the button is being pressed?","<android><android-widget>","2","0","1","",""
"3173919","1","","","2010-07-04 06:24:08","0","278","<p>How can I change the orientation to landscape while testing the app on deviceanywhere? I tried to right-click on the device, and click on Controls -> Turn left, that turned the phone, but my app did not orient to landscape. My app works well for rotation on the actual device. </p><p>ThanksChris</p>","321927","","","","","2014-02-10 07:56:18","Android Change orientation on deviceanywhere","<android><orientation><device><landscape>","1","3","","",""
"3174246","1","","","2010-07-04 09:16:38","0","346","<p>I want to use SMPP for sms sending rather then standard mechanism. Can I programmatically replace mechanism of SMS sending to my own?</p>","2237840","","12388","","2010-07-04 10:28:11","2010-07-04 10:28:11","How programmaticaly replace internal mechanism for SMS sending","<android><sms>","1","0","","",""
"3174309","1","","","2010-07-04 09:48:49","15","10729","<p>im writing an app in google android 2.1 that needs to know which direction (n/w/s/e) the device (htc hero) is facing. the sensor and its listener is working great, but the values i get from the sensor are totally crappy. e.g. it tells me i'd be facing north when the device is facing sw or so...</p><p>this seems to be a known problem with android devices. the ""solutions"" i found on the web look like this: - shake the device around - move the device like an eight - tap on the devices backthis is thought to trigger the sensors recalibration. and: the thing with the ""moving around"" works for me... but that's not very professional i guess...</p><p>so - how do i trigger the recalibration of the orientation sensor from the sdk? i need the sensor to be properly calibrated without any fancy stuff that would make users of this app look like complete idiots while they are ""manually"" recalibrating their phones...</p><p>is there any way to do this ""right""?</p><p>EDIT:</p><p>or: is there any way to determine PROGRAMATICALLY, if the device is correctly calibrated or not? as a fallback-option so to speak... then i could warn the user that the device needs ""manual"" recalibration</p>","370969","","370969","","2010-07-07 07:21:34","2010-07-24 08:29:03","how to calibrate the orientation sensor in android?","<java><android><sensor>","3","2","11","",""
"3174327","1","","","2010-07-04 10:00:07","0","862","<p>I am working on the notpadv1 tutorial.  I get an error from the parser as soon as I create a new xml file called note_row.xml and put in the following code:The error is at the end of the file.  It says: multiple annotations found at this linepremature end of fileerror parsing XML:no element found</p><p>I also see the following error in the console:[2010-07-04 05:34:32 - Notepadv1] Error in an XML file: aborting build.</p><p>I am following the instructions in step 5 of the following url:<a href=""http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html</a></p>","383020","","21234","","2010-07-04 11:01:36","2010-10-28 20:42:30","xml parser error in notepadv1 tutorial","<java><android><xml><notepad>","2","1","","",""
"3174368","1","3328429","","2010-07-04 10:24:54","0","173","<p>I wrote a widget that can call numbers directly with one click. It works on the emulator, and it used to work on my nexus one when it had Android 2.1. Now I got the update, and the widget stopped working. I am using Intent.ACTION_CALL, and android.permission.CALL_PHONE. If I change to Intent.ACTION_DIAL it works, and the same code works from an activity. It is the combination of an app widget and the call action. I don't see any error. Does anyone know if it is not possible, and if so, how? Are there many cases the emulator is different than the cell phones, concerning the permission aspects?</p><p>The numbers are all regular, not 911 or something.</p>","329611","","","","","2010-07-25 07:41:33","using direct call from a widget in version 2.1 and 2.2","<android><android-widget>","1","3","","",""
"3174424","1","3177492","","2010-07-04 11:01:56","5","1331","<p>I have a app that uses ads.The ad id is set in the manifest id with a meta-data tag.</p><p>I want to change this tag when i start the app in some cases(diferent id for some localisations)</p><p>Can i do this in code?</p>","368598","","114066","","2010-07-05 07:37:48","2010-07-05 07:37:48","Changing manifest meta-data from code","<android><android-manifest>","1","0","1","",""
"3174433","1","","","2010-07-04 11:05:56","3","748","<p>Froyo and Flash Player are coming to our phones.</p><p>In the Adobe PreRelease programs we can find AIR beta for Froyo and Eclair. With that, I can develop a Flash app and export it to my phone.</p><p>So, is AIR player the Flash player? o_OI can't understand what differences are between AIR and Flash on Android.</p><p>Can you help me? Thank you!</p>","252711","","","","","2010-07-04 23:28:37","'Flash for Android' vs 'AIR for Android' - differences?","<android><flash><air>","1","0","","",""
"3174448","1","3174466","","2010-07-04 11:15:20","22","5196","<p>I would like to switch to certain views in a ViewFlipper. Currently, I have 6 children inside the ViewFlipper. And I am having some buttons for navigation. It is very much similar to ""News and weather"" application.</p>","372107","","","","","2013-07-15 07:33:27","How to move to a certain view using ViewFlipper?","<android>","2","0","2","",""
"3174480","1","","","2010-07-04 11:26:15","1","759","<p>I'm Loading an Hebrew (rtl) xml feed with xml Dom using eclipse android environment.</p><p>When displaying the feed on TextView text is OK but numbers Displaying inverse </p><p>for example :</p><p>if feed (XML) contain 007 it WILL displayed as 700..</p>","1514062","","569101","","2013-06-05 11:40:14","2013-06-05 11:40:14","Displaying inverse numbers when loading Hebrew rss with android ...","<android><xml><feed><hebrew><right-to-left>","4","0","","",""
"3174781","1","","","2010-07-04 13:14:05","0","1629","<p>I am new to android.At the time of closing application i need to stop the thread in android.Can anyone help me to solve this?</p>","365616","","","","","2010-07-04 13:32:19","Stop thread at the time of closing application in android?","<android>","2","0","","",""
"3174959","1","3175242","","2010-07-04 14:27:29","0","235","<p>Is there a way to place widgets / views on the screen at any specific position required?</p><p>Something like a calendar with daily events that could overlap.e.g. if every hour in a day is represented by 1 hour and there are 2 appointments that overlap partially (say 12:00 - 12:30 and 12:20 - 01:00) this would be drawn in the same row but the 12:20 one positioned slightly below the first.</p><p>Also there may be views (Image/TextView) that need to span 2 rows (i.e. 12:30 - 1:30).</p><p>I think a SurfaceView is one option (is this efficient?) but am not sure if there is some better layout that could be used.</p><p>We could use a TableLayout for the hour rows but not sure if there is a way to place overlapping widgets on this?</p><p>TIA</p>","365681","","","","","2010-07-04 15:48:07","Position views at specific location?","<android>","1","0","","",""
"3175029","1","","","2010-07-04 14:50:00","0","336","<p>jarsigner: Certificate chain not found for: csi.keystore. csi.keystore must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain..</p><p>who has idea? thanks...</p>","295275","","","","","2011-11-16 12:52:57","error when use ant to build android project","<android><ant>","3","1","","",""
"3175309","1","3175612","","2010-07-04 16:08:35","2","902","<p>I would like to allow the user to enter (a non-predetermined amount of) values for an Android application preference. Existing examples that come to mind are the alarm clock applications found on various smartphones (iPhone, HTC Android, ...) where the user can add an alarm clock time.*</p><p>Can anyone think of a simple way to present an Android user with an extensible list of editable preference values?</p><p>So far I've thought of:</p><ul><li>Comma separated values in a simple text field.</li><li>Limit the user to let's say 10 values and implement them as 10 editable preference items (EditTextPreference).</li><li>Make my own fancy sub-application just for these settings (although I'm not sure yet how I'd do that).</li></ul><p>Any other ideas?</p><p>Chris</p><p>*(additional nice-to-haves along the lines of the alarm example would be: automatic ordering by value/time, a way to activate/deactivate certain values, a wheel for selecting numeric values similar to time and date selection wheels on the iPhone or Android).</p>","349169","","","","","2012-11-23 21:18:39","Android Preferences: Unlimited, extensible value-list","<android><preferences><alarm><android-preferences>","1","0","2","",""
"3175334","1","3175689","","2010-07-04 16:16:29","1","1336","<p>I'd like to set a ListView to data I get from a web service. I get the data in a AsyncTask instance, but when I try to set some of my ListView attributes, it crashes (on line ""lv.setVisibility(View.VISIBLE);""). Anybody can help?</p><p>thanks</p><pre><code>public class Atable extends Activity {    private EditText mSearch;    private static final int ACTIVITY_EDIT=0;    private Button mSearchButton;    private TextView mNoresults;    private ListView lv;    private CheckBox checkBox;    private LocationManager locationManager;    private RestaurantList restaurantList;    private Criteria criteria;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        lv= (ListView)findViewById(R.id.listview);        mNoresults = (TextView) findViewById(R.id.noresults);          mNoresults.setVisibility(View.GONE);        mSearchButton = (Button)this.findViewById(R.id.button);        checkBox = (CheckBox) findViewById(R.id.local_check);                locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);        criteria = new Criteria();        criteria.setAccuracy(Criteria.ACCURACY_FINE);        mSearchButton.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                mNoresults.setVisibility(View.GONE);                mSearch = (EditText) findViewById(R.id.search);                  String tmp_str = mSearch.getText().toString().replace("" "",""+"");                  String url = ""http://www.atable.org/getRestaurantByQuery/?query="" + tmp_str;                if (checkBox.isChecked()) {                    //get location                    String provider = locationManager.getBestProvider(criteria, true);                                    Location location = locationManager.getLastKnownLocation(provider);                    if (location!=null) {                        String lat = String.valueOf(location.getLatitude());                        String lng = String.valueOf(location.getLongitude());                        url += ""&amp;lat=""+lat+""&amp;lng=""+lng;                                       }                }                new GetRestaurantData().execute(url);                           }        });    };    private class GetRestaurantData extends AsyncTask&lt;String, Boolean, RestaurantList&gt; {        private HttpClient httpclient = new DefaultHttpClient();        @Override        protected RestaurantList doInBackground(String... url) {                        publishProgress(true);                     HttpGet httpget = new HttpGet(url[0]);                      // Execute the request            HttpResponse response;            try {                response = httpclient.execute(httpget);                HttpEntity entity = response.getEntity();                if (entity != null) {                    InputStream instream = entity.getContent();                    Reader r = new InputStreamReader(instream);                                          Gson gson = new Gson();                    restaurantList = gson.fromJson(r, RestaurantList.class);                    int nResults = restaurantList.getSize();                    if (nResults&gt;0) {                                               lv.setVisibility(View.VISIBLE); //app crashes here                                              lv.setAdapter( new ArrayAdapter&lt;String&gt;(Atable.this ,android.R.layout.simple_list_item_1,restaurantList.getRestaurantNames()));                        lv.setOnItemClickListener(new OnItemClickListener() {                            public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {                                Intent intent = new Intent(Atable.this, RestaurantDescription.class);                                Restaurant tmp_resto = restaurantList.getRestaurant((int)id);                                String tmp_categories = tmp_resto.getCategories().get(0);                                for (int i=1; i&lt;tmp_resto.getCategories().size(); i++) {                                    tmp_categories+="", ""+tmp_resto.getCategories().get(i);                                }                                String address = tmp_resto.getStreet()+"", ""+tmp_resto.getStreetNumber()+""\n""+tmp_resto.getCity()+                                                "" ""+tmp_resto.getPostalCode()+""\n""+tmp_resto.getCountry();                                intent.putExtra(""name"", tmp_resto.getName());                                intent.putExtra(""address"", address);                                                                intent.putExtra(""rating"", tmp_resto.getRating());                                intent.putExtra(""price_range"", tmp_resto.getPriceRange());                                intent.putExtra(""categories"", tmp_categories);                                intent.putExtra(""latitude"", tmp_resto.getLatitude());                                intent.putExtra(""longitude"", tmp_resto.getLongitude());                                startActivityForResult(intent, ACTIVITY_EDIT);                            }                        });                    }                    else {                        lv.setVisibility(View.GONE);                        mNoresults.setVisibility(View.VISIBLE);                    }                    //Closing the input stream will trigger connection release                    instream.close();                }               } catch (ClientProtocolException e) {                                   e.printStackTrace();            } catch (IOException e) {                                   e.printStackTrace();            }            return restaurantList;        }        @Override        protected void onProgressUpdate(Boolean... progress) {            // line below coupled with             //    getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS)             //    before setContentView             // will show the wait animation on the top-right corner            Atable.this.setProgressBarIndeterminateVisibility(progress[0]);        }        @Override        protected void onPostExecute(RestaurantList result) {            publishProgress(false);            // Do something with result in your activity        }    }</code></pre>","326849","","","","","2010-07-04 18:11:14","Issue when setting a ListView in a AsyncTask class","<android><listview><android-asynctask>","2","0","","",""
"3175336","1","","","2010-07-04 16:17:54","2","3130","<p>I have a TabActivity which contains an Activity. When the tab for the activity is selected, if I press the Menu button, onPrepareOptionsMenu is called in the parent TabActivity, but not on the activity for the tab which was selected. </p><p>The options menu for the activity in the tab isn't shown unless I click inside the tab, then I get calls to both (which is what I want). Is there any way to 'focus' the activity in the tab when the tab is selected?</p>","30512","","","","","2013-01-15 13:30:49","Android: Options menu for nested Activity in Tab","<android><menu><tabs><activity><android-tabhost>","2","0","1","",""
"3175421","1","3175440","","2010-07-04 16:44:49","0","542","<p>I'm trying to use the Point class from <code>android.graphics</code>, but it appears that all the methods are stubs.  For example, the line</p><pre><code>Point p = new Point(1, 1);</code></pre><p>causes <code>java.lang.RuntimeException: Stub!</code>.  If I look at the bytecode for Point, I see a bunch of stubbed methods, e.g:</p><pre><code>  // Method descriptor #17 (II)V  // Stack: 3, Locals: 3  public Point(int x, int y);     0  aload_0 [this]     1  invokespecial java.lang.Object() [1]     4  new java.lang.RuntimeException [2]     7  dup     8  ldc &lt;String ""Stub!""&gt; [3]    10  invokespecial java.lang.RuntimeException(java.lang.String) [4]    13  athrow      Line numbers:        [pc: 0, line: 5]      Local variable table:        [pc: 0, pc: 14] local: this index: 0 type: android.graphics.Point        [pc: 0, pc: 14] local: x index: 1 type: int        [pc: 0, pc: 14] local: y index: 2 type: int</code></pre><p>What's the deal here?  Surely they didn't ship a class that's 100% stubs.</p>","79646","","","","","2010-07-04 16:52:42","android.graphics.Point: all methods are stubs","<android>","1","0","","",""
"3175445","1","","","2010-07-04 16:53:58","0","872","<p>I have a PreferenceActivity that uses addPreferencesFromResource() to load the view from the xml. The xml contains has the following structure:</p><pre><code>&lt;PreferenceScreen android:id=""outer""&gt;  &lt;ListPreference ...&gt;&lt;/ListPreference&gt;  &lt;PreferenceScreen android:id=""inner""&gt;    &lt;CheckboxPreference ...&gt;&lt;/CheckboxPreference&gt;    &lt;CheckboxPreference ...&gt;&lt;/CheckboxPreference&gt;    &lt;CheckboxPreference ...&gt;&lt;/CheckboxPreference&gt;  &lt;/PreferenceScreen&gt;  &lt;/PreferenceScren&gt;</code></pre><p>I'd like to know know what happens when the ""inner"" PreferenceScreen is clicked. The view that is tight to this screen is displayed in the same activity as the ""outer"" one , or is it displayed in a new created one ?  And if it is displayed in a new activity how could I obtain a reference to it so that I can set a theme  ?</p><p>Thanks !</p>","284609","","","","","2010-07-04 18:52:25","About nested PreferenceScreens","<android>","0","2","","",""
"3175514","1","3175693","","2010-07-04 17:14:56","1","6809","<p>What I want to do in one of my tabs in my application is have a <a href=""http://developer.android.com/resources/tutorials/views/hello-listview.html"" rel=""nofollow"">ListView</a> of contacts.  Though, in that example, the ListView is made from an array of Strings.  Is there a way that I can create one of those using the values from an ArrayList?</p><p>Thanks!</p>","362857","","2699","","2010-08-09 17:39:16","2010-08-09 17:39:16","Creating a ListView layout from an ArrayList","<android><listview><arraylist>","3","0","3","",""
"3175545","1","","","2010-07-04 17:21:36","2","318","<p>I have an app for speed measuring and would to detect when a user goes above or below certain speed. Do I have to constantly monitor the speed or there an event I can create?</p>","383180","","","","","2011-05-04 22:15:58","it there an Android event lister for speed?","<android>","2","0","1","",""
"3175605","1","","","2010-07-04 17:46:22","3","4820","<p>I'm developing a web-application for iPhone and Android. It works flawlessly on the iPhone but when I try to run it on an Android device, it just does not work.</p><p><strong>But to the point… I need to access the (JavaScript) error console</strong> in the Android <em>default browser</em>. Is there a way to do that?</p><p>I tried changing the ""Enable tracing"" setting after accessing the hidden <code>about:debug</code> menu in the browser but nothing seems to change.</p><p>UPDATE: by the way, I'm using the Android Virtual Device software from the Android SDK.</p>","365183","","297762","","2010-07-04 17:55:52","2010-07-04 17:55:52","Debugging Web-Applications on Android","<javascript><android><debugging><console>","0","0","","2014-03-30 04:33:03",""
"3175608","1","","","2010-07-04 17:47:59","-1","114","<p>Alright, so I followed a tutorial on the Android website, and I got a ListView going in my application.  But, the example they had did everything in Java basically.  How could I transform the following code to XML?</p><pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, COUNTRIES));ListView lv = getListView();lv.setTextFilterEnabled(true);lv.setOnItemClickListener(new OnItemClickListener() {  public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {    // When clicked, show a toast with the TextView text    Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_SHORT).show();  }});</code></pre><p>I know I can't make the click listener XML, I just put that there for example.</p>","362857","","","","","2010-07-04 19:17:24","Changing Java ListView to XML","<android>","1","1","","",""
"3175666","1","","","2010-07-04 18:05:53","1","959","<p>I have created a custom content provider in application A and have another application B access this content provider in A. Below are my code snippets:</p><p>In content provider in application A:</p><pre><code>public Cursor query(Uri uri, String[] projection, String selection,                    String[] selectionArgs, String sortOrder) {    int table = um.match(uri);    SQLiteQueryBuilder sqlBuilder = new SQLiteQueryBuilder();;    // configure where to query from    if (table == MYKEYS || table == MYKEY_ID) {        sqlBuilder.setTables(DATABASE_TABLE_MY);        if (table == MYKEY_ID)            sqlBuilder.appendWhere(            _ID + "" = "" + uri.getPathSegments().get(1));     }    else if (table == FDKEYS || table == FDKEY_ID) {        sqlBuilder.setTables(DATABASE_TABLE_FD);        if (table == FDKEY_ID)            sqlBuilder.appendWhere(            _ID + "" = "" + uri.getPathSegments().get(1));    }    else         throw new IllegalArgumentException(""Unknown URI: "" + uri);    if (sortOrder==null || sortOrder=="""")        sortOrder = DEFAULT_SORT_ORDER;    // query    SQLiteDatabase db = dbOpenHelper.getReadableDatabase();    Cursor c = sqlBuilder.query(               db,                projection,                selection,                selectionArgs,                null,                null,                sortOrder);    //register to watch a content URI for changes    c.setNotificationUri(getContext().getContentResolv er(), uri);    return c;}</code></pre><p>This is how I declare my content provider in application A manifest file:</p><pre><code>&lt;provider android:name="".KeysProvider""android:authorities=""com.android.keychain.keysprovider""/&gt;</code></pre><p>This is how I make a query in application B:</p><pre><code>String[] whereArgs = new String[]{""Private Key""};Cursor c = managedQuery(MYTABLE_URI, null, ""name"", whereArgs, null); </code></pre><p>When I run the the code for application B, I have the following errors:</p><p>07-02 12:53:58.153: ERROR/DatabaseUtils(9195): android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x126558</p><p>I really don't know what's wrong here. It works fine when I tried to access this same content provider from within application A. Also, looking from the log, it seems that from application B (at managedQuery line), it is able to go to this content provider in application A (KeysProvider) but dies when trying to make a query (at line: Cursor c = sqlBuilder.query ... ). Anyone knows what's the problem here?</p><p>Thanks very much in advance</p>","383195","","","","","2010-07-04 18:05:53","Can't access content provider of another application (android)","<android><content><provider>","0","2","","",""
"3175669","1","","","2010-07-04 18:06:16","7","5551","<p>i'm using PreferenceActivity class to configure my widget. PreferenceActivity class automatically saves user preferences, so in widget update service i can call context.getSharedPreferences() and i obtain user preferences. Problem is follow: if you have many widget of same type, how PreferenceActivity class saves prefs? how i can load appWidgetId specific prefs from sharedPreferences?</p>","251434","","","","","2012-02-12 03:49:30","Use PreferenceActivity to configure widget, how retrieve preference?","<android><widget>","3","0","3","",""
"3175729","1","3176681","","2010-07-04 18:27:59","2","270","<p>Using my new Android phone established a small problem: I'm living in country A but my mobile provider is from country B, because it's just cheaper. Concerning mobile phone tarifs my country isn't a foreign country for country B. However I have to enable data roaming in my Android phone. The problem is, I'm also quite often in country C and every time I have to switch off data roaming.</p><p>So I thought about writing a small app which disables data roaming if I'm not in country A or B and enables it otherwise.</p><p>My first try was to define the location using GPS, but this is rather useless, because I would have to calculate for every coordinate if it is in the allowed range. So I think the better solution would by to read from the phone the current provider and if this provider isn't in the whitelist (which is defined by me), data roaming is switched off.</p><p>Do you know any other approaches? And how could I get the name of the current provider? And how to programatically disable data roaming?</p>","","anon","","","","2010-07-05 00:24:30","Read mobile provider from the phone","<java><android><mobile><provider>","2","0","0","",""
"3175774","1","","","2010-07-04 18:42:25","12","2098","<p>I would like to get some sort of distance measure between two pieces of audio. For example, I want to compare the sound of an animal to the sound of a human mimicking that animal, and then return a score of how similar the sounds were. </p><p>It seems like a difficult problem. What would be the best way to approach it? I was thinking to extract a couple of features from the audio signals and then do a Euclidian distance or cosine similarity (or something like that) on those features. What kind of features would be easy to extract and useful to determine the perceptual difference between sounds? </p><p>(I saw something on how Ahazam uses hashing, but that seemed like a different problem because there the two pieces of audio are exactly the same, with the addition of noise. Whereas in this case the two pieces of audio are not the same, they are just perceptually similar)</p>","303104","","1288","","2013-11-26 13:34:59","2013-11-26 13:34:59","Perceptual similarity between two audio sequences","<android><algorithm><audio><audio-processing>","3","0","3","",""
"3175806","1","","","2010-07-04 18:49:17","1","389","<p>I am creating an Android app using PhoneGap and jqTouch, and I have a JSON object containing a word along with a language which that word is in. How can I sort this alphabetically, by the column on the right (the language), using Javascript? The end result should be Afrikaans as the first entry and Zulu as the last.</p><pre><code>var languages = {    ""Hello"" :   ""English"",    ""Bonjour""   :   ""French"",    ""Hola""  :   ""Spanish"",    ""??????? ?????"" :   ""Arabic"",    ""Haai""  :   ""Afrikaans"",    ""Nei ho""    :   ""Cantonese"".    ""Goddag""    :   ""Danish"",    ""Goede dag"" :   ""Dutch"",    ""Saluton""   :   ""Esperanto"",    ""Hei""   :   ""Finnish"",    ""Guten tag"" :   ""German"",    ""Gia'sou""   :   ""Greek"",    ""Aloha"" :   ""Hawaiian"",    ""Hebrew""    :   ""Shalom"",    ""Namaste""   :   ""Hindi"",    ""Halo""  :   ""Indonesian"",    ""Aksunai""   :   ""Inuit"",    ""Dia dhuit"" :   ""Irish"",    ""Salve"" :   ""Spanish"",    ""Kon-nichiwa""   :   ""Japanese"",    ""An-nyong Ha-se-yo"" :   ""Korean"",    ""Mandarin""  :   ""Ni hao"",    ""Hallo"" :   ""Norweigan"",    ""Dzien' dobry""  :   ""Polish"",    ""Jambo"" :   ""Swahili"",    ""Hej""   :   ""Swedish"",    ""Sa-wat-dee""    :   ""Thai"",    ""Merhaba""   :   ""Turkish"",    ""Vitayu""    :   ""Ukrainian"",    ""Hylo""  :   ""Welsh"",    ""Sholem aleychem""   :   ""Yiddish"",    ""Sawubona""  :   ""Zulu""}</code></pre><p>Thanks for your help guys :)</p>","314416","","","","","2010-07-04 18:58:56","How do I sort this JSON object by the languages on the right of each entry?","<javascript><android><json><sorting><jqtouch>","1","1","","",""
"3175823","1","3176567","","2010-07-04 18:54:27","1","580","<p>I have a setup view where the user can enter their name and email and click done when they are finished which navigates them to another activity1.  When they are in activity1, and they hit the soft back button on the phone, it takes them screen where they entered their name and email.  However, the name and email EditText fields are blank.</p><p>In the view where the name and email are entered I looked to see if onStart, onCreate, OnPause, onResume,... where being called after the back button was hit, but they are not.</p><p>Do you know how I can make it so that the EditText fields have the information that was previously entered.</p>","207795","","","","","2010-07-05 18:47:20","How to get an EditText field prefilled after hitting the back button","<android><edittext><back>","1","1","","",""
"3176033","1","3177667","","2010-07-04 20:03:50","9","6801","<p>i am looking for an example of how to build and display SpannableString with Image spans. Something like inline display of smileys.</p><p>Thanks a lot</p>","367677","","","","","2010-07-05 07:08:36","SpannableString with Image example","<android>","1","0","2","",""
"3176090","1","3176426","","2010-07-04 20:22:46","1","1766","<p>My app plays a video using VideoView. I am using a LinearLayout to add some text, the video and then some buttons. </p><p>My question is what kind of layout params can I use for the VideoView to make sure it plays well in all phones? Basically, when in portrait mode, I want the complete width to be used, and video height to be used. When in landscape, I would like it to look more like the full screen mode.</p><p>I have noticed that this setting works well on myTouch for both portrait and landscape,</p><p>new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT,480);</p><p>and, this works on Droid for both portrait and landscape,</p><p>new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);</p><p>ThanksChris</p>","321927","","321927","","2010-07-04 20:55:57","2010-07-04 22:32:22","Android VideoView LinearLayout LayoutParams","<android><layout><params><android-linearlayout><videoview>","1","0","","",""
"3176260","1","5571236","","2010-07-04 21:21:01","3","886","<p>I'm developing an application that is supposed to run on both Android as well as regular Java SE.</p><p>I have an eclipse project called <strong>foobar-core</strong> which contains code that is used both by the Android and the SE version. I have another project called <strong>foobar-android</strong>, which contains all android-specific code.</p><p>I need to reference some of the <strong>foobar-core</strong> code in the <strong>foobar-android</strong> project, so I added <strong>foobar-core</strong> to <strong>foobar-android</strong> in Settings -> Java Build path -> Projects -> Required projects on the build path. This works fine, as I can use code from <strong>foobare-core</strong> in <strong>foobar-android</strong> now.</p><p>Here's the problem: Both <strong>foobar-core</strong> and <strong>foobar-android</strong> are independent git repositories, which means they both have a .git subdirectory. Now I get a lot of warnings on the ""Console"" tab whenever I compile <strong>foobar-android</strong>. They look like this:</p><pre><code>/foobar-core/src/.git/HEAD conflicts with another file already put at .git/HEAD/foobar-core/src/.git/config conflicts with another file already put at .git/config/foobar-core/src/.git/description conflicts with another file already put at &gt; .git/description/foobar-core/src/.git/hooks/applypatch-msg.sample conflicts with another file already &gt; put at .git/hooks/applypatch-msg.sample</code></pre><p>How can I tell Eclipse to ignore the .git files when importing sources from the foobar-core project?</p>","112308","","","","","2011-04-06 20:00:37","Eclipse: How to ignore .git subdir when adding one project to another project's build path?","<android><eclipse><git>","2","0","","",""
"3176555","1","3177784","","2010-07-04 23:23:07","12","14432","<p>for the documentation of a project I would like to record the screen of my Nexus One as a movie or at least in form of a lot of images, which I can convert into a movie. Is that possible? Is there an app for it? For the moment I only know about this screen capture functions in the SDK's tool directory.</p>","331556","","","","","2013-09-30 11:46:19","Android - capture screen of phone as a movie","<android><screen><capture>","4","0","12","",""
"3176618","1","","","2010-07-04 23:54:05","6","914","<p>I have a problem searching my SQLite database, which contains data written with cyrillic characters. If the key word is also cyrillic, then everything is ok, but if not, then I can`t get the result in my Android application. </p><p>Does anyone have an idea how can I implement searching the cyrilic data no matter the charset of the keyword? Thanks</p>","383295","","352841","","2012-05-04 18:55:30","2013-01-21 14:15:55","Searching a SQLite database which contains cyrillic data","<android><sqlite><search><utf-8>","2","0","1","",""
"3176697","1","3177430","","2010-07-05 00:30:22","3","2695","<p>Do I have to do anything special to display UTF-8 characters in a TextView?</p><p>I'm trying to display the following characters:</p><p>???, ?????? ????????, ?????? ?? ?????, ????? ??????????. ???? ?????????????? ???? ???? ????? ?????? ???? ?? ??????. ?? ??? ???????? ????????????, ???? ???? ????? ???? ????? ????? ??????.</p><p>If I use <code>Log.d(TAG, text)</code> where <code>text</code> contains the characters I'm going to display, it displays correctly in the logcat output.  If I then use <code>textview.setText(text)</code>, all that's displayed in the TextView is boxes.  </p><p>From what I've been reading, a lot of these fonts, like Hebrew and such aren't supported by Android, however, if I send myself an email with these characters, they are displayed correctly in the Gmail and Tiwtter apps.</p><p>How can I display these characters correctly?</p><p>UPDATE:</p><p>I installed the AnySoftKeyboard app, and the Hebrew language pack, and suddenly my app is able to display Hebrew.  If I uninstall both of these, my app is still able to display Hebrew.  This doesn't make any sense at all to me.  </p>","238849","","238849","","2010-07-05 00:58:42","2010-07-05 05:57:32","Displaying UTF-8 characters in a TextView","<android>","1","0","2","",""
"3176923","1","","","2010-07-05 02:08:33","0","612","<p>I am building application related to WiFi using my Samsung Android Phone.</p><p>Am trying to access the pre shered key to my application using WifiConfiguration class provided by Android. The getPreSharedKey() method returns only ""*"" if key is present and null if the key is absent.I need the actual the pre shared key. How do i obtain it ?</p><p>Is there any other method that I can use to get the key ?</p><p>Thanks in Advance .</p>","383347","","","","","2010-07-05 05:54:19","How Can Get the actual Pre Shared Key to Application instead of ""*"" in Android","<android>","1","0","","",""
"3177026","1","","","2010-07-05 02:51:46","4","3528","<p>My requirement is to open one app's Asset file from another app via content provider.(I am exposing that file with ContentProvider implementation)</p><p>I am able to open few files and read, but while opening some files I am getting exception. Please find the implementation for opening Asset File.</p><pre><code>@Overridepublic AssetFileDescriptor openAssetFile(Uri uri, String mode) throws FileNotFoundException {    AssetManager am = getContext().getAssets();    String file_name = uri.getLastPathSegment();    if(file_name == null)         throw new FileNotFoundException();    AssetFileDescriptor afd = null;    try {        afd = am.openFd(file_name);    } catch (IOException e) {        e.printStackTrace();    }    return afd;//super.openAssetFile(uri, mode);}</code></pre><p>Some times, <code>am.openFd(file_name);</code> is throwing an exception saying that,</p><pre><code>java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressedat android.content.res.AssetManager.openAssetFd(Native Method)at android.content.res.AssetManager.openFd(AssetManager.java:329)at com.pineone.swfinstaller.SwfProvider.openAssetFile(SwfProvider.java:25)at android.content.ContentProvider$Transport.openAssetFile(ContentProvider.java:218)at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:234)at android.os.Binder.execTransact(Binder.java:288)at dalvik.system.NativeStart.run(Native Method)</code></pre><p>But, the same file I can open in my PC or even in Android device in some other manner.</p><p>Can anyone point out me, in what scenarios, we will get this exception.</p><p>Thanks in advance.</p>","269304","","269304","","2010-07-05 08:42:20","2013-07-22 13:30:10","Problem while opening Asset File with the help of Content Provider","<java><android><android-assets>","1","0","1","",""
"3177262","1","3178982","","2010-07-05 04:43:47","1","255","<p>I'm having issues with using the number property of the notificationmanager.  It works on the emulator and other phone I've used.  However, it does not seem to display on my Droid Incredible.  </p>","48784","","","","","2010-07-05 11:08:18","Notification number does not display on all phones","<android><notifications>","1","0","","",""
"3177291","1","","","2010-07-05 05:00:27","1","1000","<p>I use the following code to receive the data using UDP. When I click the back button my screen visual is closed and it shows the home screen. But a thread is working in the background (it receives the data from the UDP server). When I close the application I also need to stop the thread. How to stop a thread?</p><pre><code>public void onClick(View view) {    port=Integer.parseInt(etd_port.getText().toString());    etd_port.setCursorVisible(false);    Thread fst = new Thread(new Server());    fst.start();}public class Server implements Runnable {    private String tagid="""",roomid="""";    public final int SERVERPORT = port;    private DatagramSocket ds;    private String recdata;    @Override    public void run() {        int buffer_size = 1024;        byte buffer[] = new byte[buffer_size];        try {            ds = new DatagramSocket(SERVERPORT);            while (true) {                DatagramPacket p = new DatagramPacket(buffer, buffer.length);                ds.receive(p);                Log.d(""MY UDP "",""After Receive"");                recdata=new String(p.getData(),0,p.getLength());                Log.d(""Receive data "",recdata);            }        } catch(Exception e){            Log.e(""MY UDP "", "" Error"", e);        }    }}......@Overrideprotected void onStop() {    finish();    fst.stop();    super.onStop();}</code></pre>","373172","","63550","","2010-10-24 15:11:18","2010-10-24 15:11:18","At the time of closing an application: How to stop a thread?","<android>","2","0","","",""
"3177376","1","","","2010-07-05 05:32:28","8","1434","<p>I want to develop a tabbed application on Android. At the same time, I want the search functionality to be present on some tabs. For this reason, I declared some activites in manifest file and added them to TabHost. But the problem is that when I make a search, it calls onCreate() method of the current activity which resided in tab content. What I want is to make searchManager call onNewIntent() method so that a new activity is not created and I can handle the search in existing activity. I'm posting my manifest and TabActivity source file to be more clear:</p><p>Part of manifest file:</p><pre><code>  &lt;activity    android:name=""KarniyarikTabsWidget""    android:label=""@string/app_name""   android:theme=""@android:style/Theme.NoTitleBar""    android:launchMode=""singleTop""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.MAIN"" /&gt;    &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;   &lt;/intent-filter&gt;  &lt;/activity&gt;  &lt;activity android:name=""UrunTab""   android:theme=""@android:style/Theme.NoTitleBar""   android:launchMode=""singleTop""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.SEARCH"" /&gt;   &lt;/intent-filter&gt;   &lt;meta-data android:name=""android.app.searchable""    android:resource=""@xml/searchable"" /&gt;  &lt;/activity&gt;  &lt;activity android:name=""ArabaTab"" android:theme=""@android:style/Theme.NoTitleBar""   android:launchMode=""singleTop""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.SEARCH"" /&gt;   &lt;/intent-filter&gt;   &lt;meta-data android:name=""android.app.searchable""    android:resource=""@xml/searchable"" /&gt;  &lt;/activity&gt;  &lt;activity android:name=""GecmisTab"" android:theme=""@android:style/Theme.NoTitleBar""   android:launchMode=""singleTop""&gt;  &lt;/activity&gt;  &lt;activity android:name=""HakkindaTab"" android:theme=""@android:style/Theme.NoTitleBar""   android:launchMode=""singleTop""&gt;  &lt;/activity&gt;</code></pre><p>Tab Activity onCreate method:</p><pre><code>public class KarniyarikTabsWidget extends TabActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Resources res = getResources(); // Resource object to get Drawables        TabHost tabHost = getTabHost();  // The activity TabHost        TabHost.TabSpec spec;  // Resusable TabSpec for each tab        // Initialize a TabSpec for each tab and add it to the TabHost        spec = tabHost.newTabSpec(""UrunTab"")         .setIndicator(""Ürün"",res.getDrawable(R.drawable.product))         .setContent(new Intent(this, UrunTab.class));        tabHost.addTab(spec);        //Do the same for other tabs        spec = tabHost.newTabSpec(""ArabaTab"")          .setIndicator(""Araba"",res.getDrawable(R.drawable.car))          .setContent(new Intent(this, ArabaTab.class));        tabHost.addTab(spec);        //Do the same for other tabs        spec = tabHost.newTabSpec(""GecmisTab"")          .setIndicator(""Geçmis"",res.getDrawable(R.drawable.history))          .setContent(new Intent(this, GecmisTab.class));        tabHost.addTab(spec);        //Do the same for other tabs        spec = tabHost.newTabSpec(""HakkindaTab"")         .setIndicator(""Hakkinda"",res.getDrawable(R.drawable.about))          .setContent(new Intent(this, HakkindaTab.class));        tabHost.addTab(spec);    }</code></pre><p>Any help would be appreciated.</p>","369001","","369001","","2010-07-05 06:37:56","2010-08-21 04:33:45","Search creates new activites in TabActivity","<android><search>","1","2","4","",""
"3177416","1","","","2010-07-05 05:53:17","5","1445","<p>What's the best way to clear the notification number when the user clicks on the notification?  I say the best way, but really I haven't found ANY way.  I'm launching a built in activity when the user clicks on the notification, not something I wrote so I can't clear it that way.  I've got the notification manager's flag set to clear</p><pre><code>   NotificationManager notification    .    .    .    notification.flags |= Notification.FLAG_AUTO_CANCEL;    notification.number++;    nm.notify(1,notification);</code></pre><p>But whatever I do the Notification.number keeps going up and never resets to 0.  </p>","48784","","","","","2013-12-29 10:11:01","How to reset notificationmanager number on notification clear","<android><notifications>","2","0","1","",""
"3177459","1","","","2010-07-05 06:08:02","2","688","<p>I am almost done creating a game for android using a port of irrlicht 3d engine to android.All code except a minimal frame work to make the native calls and play sounds is written in C++.Even the opengles display is created in c++ code using eglGetDisplay and eglCreateWindowSurface</p><p>The problem I need to solve is that when home is pressed then relaunch the game the screen is all white.From other answers I have found that the opengl context is lost then recreated when onSurfaceCreated is called. I thought that I could just reload textures but that seams to work for only some textures. Also the background color is changed which is not a resource.It seams I would have to completely restart the game but this could be really annoying to a user.</p><p>the port of quake 3 has notes about this problem be has no solution.</p><p>Is there a example anywhere of a game written in native code which correctly handles this situation?</p>","382561","","","","","2011-03-11 12:14:11","Need example how to recover opengl in native code after new onSurfaceCreated","<android><opengl-es><native>","1","0","1","",""
"3177568","1","3177631","","2010-07-05 06:38:57","0","4692","<p>Iam getting this error on my log</p><pre><code>07-06 06:22:07.419: ERROR/AndroidRuntime(2618): java.lang.SecurityException: SECURE PERMISSION: Neither user 10070 nor current process has android.permission.WRITE_SECURE_SETTINGS.</code></pre><p>I used like this</p><p>in activity file</p><pre><code>private static final String SECURE_SETTINGS = android.Manifest.permission.WRITE_SECURE_SETTINGS;mContext.enforceCallingOrSelfPermission(SECURE_SETTINGS,        ""BLUETOOTH_ADMIN permission"");</code></pre><p>in manifest file</p><pre><code>&lt;uses-permission android:name=""android.permission.WRITE_SETTINGS"" /&gt;  &lt;uses-permission android:name=""android.permission.WRITE_SECURE_SETTINGS"" /&gt;</code></pre><p>Why does it give error?</p>","362544","","1420197","","2013-02-27 13:35:12","2013-02-27 13:35:12","Java.lang.SecurityException:SECURE PERMISSION in android?","<java><android><android-manifest>","2","2","","",""
"3177599","1","3177658","","2010-07-05 06:49:13","1","1160","<p>I've seen this code on the web:</p><pre><code>Bitmap grayscaleBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565); Canvas c = new Canvas(grayscaleBitmap); Paint p = new Paint(); ColorMatrix cm = new ColorMatrix(); cm.setSaturation(0); ColorMatrixColorFilter filter = new ColorMatrixColorFilter(cm); p.setColorFilter(filter);  c.drawBitmap(bmp, 0, 0, p); </code></pre><p>My questions are:1.  Is 'bmp' supposed to be the color bitmap I want to affect?2.  How do I get the 0-255 value of the grayscale?</p><p>Thanks.</p>","225626","","","","","2011-02-03 04:57:07","Turning a color bmp to grayscale:","<android>","1","0","","",""
"3177604","1","","","2010-07-05 06:50:14","2","354","<p>Would anyone have an idea as to why an app would work on almost every phone that has 2.1 but not the Desire?</p><p>One of my apps uses voice input and the Desire is the only phone that force closes when the voice prompt comes up.</p><p>The worst part is that I don't know how to test this, I don't have one or know anyone who does. </p><p>Any ideas?</p><p>EDIT:I finally found out that HTC disabled voice in the Desire and you have to do a work around to install it.</p><p>So if you are relying on voice input make sure you use the code in the google example to catch the error:</p><pre><code>PackageManager pm = getPackageManager();     List&lt;ResolveInfo&gt; activities = pm.queryIntentActivities(             new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);     if (activities.size() == 0) {                    noResults.setText(""Voice input not found on this phone."");     }else{            //If voice is enabled            }</code></pre>","282475","","387076","","2012-05-12 20:19:42","2012-05-12 20:19:42","Android HTC Desire Voice input issues","<voice-recognition><android>","1","1","","",""
"3177700","1","4662939","","2010-07-05 07:16:31","7","7693","<p>Is it possible to change the color of the <code>radio button</code> in the Android <strong>spinner widget</strong>. By default it displays the green color for the radio button. </p><p>I need to change it to <strong>some other</strong> color, is it possible, and how?</p>","28557","","805252","","2011-09-30 19:21:27","2011-09-30 19:21:27","Android - Customizing the Spinner widget Look and Feel","<android><android-widget><android-ui><android-custom-view>","1","0","6","",""
"3177823","1","3177919","","2010-07-05 07:40:47","4","230","<p>I would like to release a beta version of my app, but I would like to set and end date hardcoded in the code.</p><p>How can I do that easily? Is there an entry point that is fired before any of the activities?</p>","243782","","","","","2010-07-07 07:17:30","What's the easiest way to set a date limit until an application can be used?","<android>","2","3","","",""
"3177944","1","3178141","","2010-07-05 08:09:20","6","2399","<p>I was wondering if there was any way that I could get a hint at the bottom of an Edit Text view -- and then the user to start entering text at the top of the box. </p><p>As a bonus question, is there any way I can make the hint NOT disappear once the user starts entering text. </p><p>Let me know if you don't understand my question and I will try to clarify. </p><p>Thanks a bunch,hwrd</p>","354247","","","","","2013-07-11 21:40:38","Custom Position of Hint in Edit Text box","<android><gui><android-widget>","2","0","","",""
"3177963","1","3179889","","2010-07-05 08:12:57","2","956","<p>I've some files stored in a SQL database. When a user visits a url with the given ID, the BLOB data is retrieved from the database to the webbrower via:</p><pre><code>Byte[] myData = b.BlobContent;Response.Clear();Response.ContentType = ""application/octet-stream"";Response.AddHeader(""content-disposition"", ""attachment; filename="" + fileName);Response.AddHeader(""Content-Length"", b.SizeInBytes.ToString());Response.BinaryWrite(myData);Response.End();</code></pre><p>However, the iPhone (Safari) can't download a *.txt and *.doc file. It says: ""Safari can't download this file"". A pdf can(!) be downloaded and viewed.</p><p>On Android none of the files can be downloaded.</p><p>Is this because the iPhone and Android just can't handle all files? Or am I doing something wrong in the Response.</p><p>Many thanks in advance</p>","167196","","","","","2010-07-05 13:34:07","Asp.net Download file on mobile platform","<asp.net><iphone><android><download><response>","1","0","0","",""
"3178043","1","5833459","","2010-07-05 08:31:43","15","2288","<p>I am wondering if I am able to detect if my application was installed with Android Market (it's in the download list of the Market and eligible for update checks) or it's not?</p><p>It would be a very good point to detect if the app has been installed without, as that can mean it was stolen and installed from SDcard.</p>","243782","","","","","2011-04-29 14:35:07","Is there a way to detect if app was installed with Market or not?","<android>","2","0","9","",""
"3178071","1","3179531","","2010-07-05 08:35:44","1","607","<p>Hi i am new to android.I need to download .ics file from mail attachment. I use intent filter in Manifest xml file. But it downloads all the files from my application.I need to download .ics file only.How it's possible???</p><pre><code>&lt;intent-filter&gt;  &lt;action android:name=""android.intent.action.VIEW"" /&gt;  &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;  &lt;data android:mimeType=""*/*"" /&gt;  &lt;data android:pathPattern="".*\\.ics"" /&gt;    &lt;/intent-filter&gt;</code></pre>","383489","","","","","2010-07-05 12:44:53","download ics(outlook Calendar) file from my application?","<android>","1","0","1","",""
"3178089","1","3179024","","2010-07-05 08:38:46","1","707","<p>I've set set files to localhost an set the <code>href</code> links for the epub files .. </p><pre><code>&lt;a href=""more-utopia.epub"" target=""_blank""&gt; more-utopia &lt;/a&gt;&lt;br&gt;</code></pre><p>and I've try to browse from my custom web view .. but when I click to download the link , it appears no download .. and open the file in the browser with custom web view. </p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    WebView web = (WebView) findViewById(R.id.webview);    web.getSettings().setJavaScriptEnabled(true);    web.loadUrl(""http://10.0.2.2/epub"");    web.setWebViewClient(new myWebView());  }   class myWebView extends WebViewClient{    @Override       public boolean shouldOverrideUrlLoading(WebView view, String url) {        url = ""http://10.0.2.2/epub/"";        view.loadUrl(url);        return true;    }}</code></pre><p>What  I want to do is to download the files and want to set path the download location to user selected location .</p><p>Any helpful tips are humbly welcome.</p>","2438460","","","","","2010-07-05 11:16:01","epub files does not downloadable [ANDROID]","<java><android><epub>","1","0","","",""
"3178148","1","","","2010-07-05 08:47:18","2","152","<p>I've just started playing with Android in the last few days and have begun to put together a simple application. I am struggling to work out whether I'm doing things the ""right"" way or just making life difficult for myself.</p><p>The app displays a series of connected nodes on the screen, similar to a mind-map. I want to be able to tap the nodes in order to edit them. When the map of nodes becomes larger than the screen, I need to be able to scroll on both X and Y axes as needed to see the whole map. Image of current implementation at <a href=""http://ubergeek.org.uk/images/nodetest.png"" rel=""nofollow"">http://ubergeek.org.uk/images/nodetest.png</a>.</p><p>Currently I don't have scrolling working, however I assume that I can do that by making the root view a ScrollView and sticking an AbsoluteLayout inside that (though it's deprecated, I wish to place objects at specific X/Y coordinates).</p><p>The nodes themselves are currently each a pair of roundrects (one for the outline and one for the fill) and a drawText and are being drawn in the main activity's onDraw(). In order to make these clickable buttons I believe I need to create a custom view for the button in order to use its onClick() events. I can then create a view object for each of my nodes and add them to the AbsoluteLayout view.</p><p>Does this sound like a reasonable way to do it in Android, or is this a horrible abuse of the API? :)</p><p>Thanks!</p>","118549","","","","","2010-07-10 03:56:32","Right way to do scrollable view of custom buttons?","<android>","1","0","","",""
"3178167","1","","","2010-07-05 08:50:59","0","133","<p>I can't seem to find any options to retrieve apps on my SDK's virtual Android device. Can you direct me to where I may find apps so that I can test them out?</p>","383502","","21234","","2010-07-05 08:57:05","2010-07-05 09:04:58","I have the Android SDK Downloaded, and a AVD created. How can I get apps for it?","<android><sdk><avd>","1","0","","",""
"3178308","1","3178647","","2010-07-05 09:11:40","7","758","<p>i'm trying to get android running on a <a href=""http://gumstix.com/"" rel=""nofollow"">gumstix overo</a> system.since i'm not planning to use the final ""product"" as a phone, i asked my self if it is possible to exclude applications like the phone/dialer-app from the kernel build-process (any config parameter probably?)</p><p>thanks for any advice in advance :-)</p>","368959","","","","","2011-04-05 22:21:07","How to build Android without the phone application?","<android><build><exclude>","2","0","1","",""
"3178452","1","3178474","","2010-07-05 09:35:11","0","321","<p>My problem is thus; I am new to programming on the ANDROID platform and have a 'working' application that piggy-backs on the API-Docs example. I wish it to launch three tabs one containing a list of reports, one a form to file a report and the last to show the geo-located reports. It doesn't appear as a separate application, it instead appears as a list to be launched by the API-Docs example. Below is my manifest code...</p><p>    </p><pre><code>    &lt;activity android:name="".HelloFlamingos""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.SAMPLE_CODE"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".Controls2"" android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".List1"" android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".ReviewTab"" android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""3"" /&gt;</code></pre><p> </p><p>HelloFlamingos is the initial page that I wish to be displayed, I realise that the intents for this are wrong, have thought about using category: VIEWS, action: DEFAULT, however is seemingly unwilling to work. Thanks!</p>","195633","","","","","2010-07-05 09:39:43","ANDROID Intents Problem Launching Application","<android><mobile-phones><android-intent>","1","0","","",""
"3178462","1","","","2010-07-05 09:37:18","2","1927","<p>I have a method that is passed a text string. For a specified font and size, it works out the bounding box for the text and then draws a roundrect that will contain it.</p><p>I'm trying to keep all of these roundrects the same height (irrespective of ascenders and descenders in the font), so the basic getTextBounds isn't quite enough as it bounds the specific text passed.</p><p>The solution I came up with was to use getTextBounds to work out the width of the text, and ascent/descent from FontMetricsInt to work out the height:</p><pre><code>Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);paint.setTextSize(fontsize);paint.setTypeface(Typeface.SANS_SERIF);Rect textBounds = new Rect();paint.getTextBounds(value, 0, value.length(), textBounds);FontMetricsInt fm = paint.getFontMetricsInt();this.width = textBounds.width();this.height = fm.descent - fm.ascent;this.textAscent = fm.ascent;</code></pre><p>Is there a simpler way?</p><p><b>Edits:</b> Finally figured out how to format the code properly!</p>","118549","","118549","","2010-07-05 10:02:42","2012-10-02 08:23:16","Determining string/font dimensions","<android>","2","0","0","",""
"3178547","1","3185175","","2010-07-05 09:51:14","1","287","<p>I have developed an App that launches and works fine on Android 1.5 and 1.6.</p><p>When I try and use it on version higher then that the app's activity starts, progress dialogs popup and I can see my AsyncTask executing and the info being returned via Logcat. No errors or exceptions are shown. </p><p>But the Activity never displays. All I see is the progress dialog showing over the home screen and then nothing. The process is active and running under the DDMS view. </p><p>Any ideas?</p>","369479","","369479","","2010-07-05 11:23:49","2010-07-06 09:51:38","Process started,no errors,activity not visible on Android >1.6","<android><activity><visibility>","1","1","","",""
"3178564","1","","","2010-07-05 09:54:05","2","695","<p>I'd like to be able to use an image as my background in a relative layout, without it stretching. I don't want to just enter the images details into an XML file, as I want to use different images, with different sizes.</p><p>I've tried the following, but it just stretches the images (I know the left, top, right and bottom variables have the wrong values, but I've just entered something into them, as a test to see if it makes any difference to the output, but it does not. If it did, I'd calculate the correct values programmaticly  : -</p><pre><code>    RelativeLayout explosionlayout = (RelativeLayout) findViewById (R.id.explosionlayout);     imageAnim = (ImageView) findViewById(R.id.explosion);   Drawable d;   d = this.getResources().getDrawable(R.drawable.bomb);   int left = 10; int top = 10; int right = 20; int bottom = 20;   d.setBounds(left, top, right, bottom);  explosionlayout.setBackgroundDrawable(d);</code></pre><p>This is obviously wrong. What would be the correct solution?</p><p>Thanks.</p>","330770","","","","","2010-07-05 10:46:10","Android - how to use a random image, in it's original size, as a background","<android><image><layout><background>","1","0","1","",""
"3178692","1","3178700","","2010-07-05 10:17:56","1","546","<p>friends,</p><p>i am facing an issue </p><p>when i display <strong>someone's post</strong> in android listview it shows me</p><p><strong>someone\'s post</strong></p><p>i want to remove <strong>\</strong> from string and wrote following code which give me outofmemory error</p><pre><code>if(val.contains(""\\""))        {        val=val.replace("""", ""\\"");        }</code></pre><p>any one guide me whats the soultion?</p>","249991","","135589","","2010-07-05 10:21:11","2010-07-05 11:01:01","android string Comparison problem?","<java><android>","2","0","","",""
"3178845","1","","","2010-07-05 10:43:48","0","1922","<p>Hai, I am developing an application in Android.In that there is a refresh button.If I click that button, the page needs to be reloaded like when execution begins.Is there any built in method in Android for getting this?</p><p>Thanks in Advance</p>","383580","","","","","2012-09-25 15:28:42","Android refresh button","<android>","2","2","","",""
"3178849","1","4396760","","2010-07-05 10:44:10","2","2868","<p>I have a table-top style game board consisting of 10x10 squares. Each square is a PNG image. On top of these squares I want to place tiles which can be drag and dropped on top of the squares.</p><p>What would be my best approach concerning Views?</p><p>Is it possible to have two layers where layer one is a grid of ImageView's which represents the board. Would it then be possible to let the tile be an ImageView also which could be ""stacked"" on top of the ImageView's which represents the board?</p><p>Any good design ideas are welcome!</p><p>Thanks.</p><p>/ Henrik</p>","226342","","","","","2011-11-08 13:31:48","Drag and drop overlapping ImageView in Android","<android><design><drag-and-drop><imageview>","2","0","","",""
"3178883","1","3179247","","2010-07-05 10:51:06","4","22240","<p>I'm having problems implementing an asynchronous image loader to the following code. I read some posts around the web about it and I think I understand the logic behind it, but I seem to fail in implementing it.</p><p>The code bellow is what I use to simply load the images in my listview.</p><pre><code>public class MyCustomAdapter extends ArrayAdapter&lt;RSSItem&gt; {   Bitmap bm;   public MyCustomAdapter(Context context, int textViewResourceId, List&lt;RSSItem&gt; list) {      super(context, textViewResourceId, list);    }   @Override   public View getView(int position, View convertView, ViewGroup parent) {      // TODO Auto-generated method stub      BitmapFactory.Options bmOptions;      bmOptions = new BitmapFactory.Options();      bmOptions.inSampleSize = 1;      bm = LoadImage(myRssFeed.getList().get(position).getDescription(), bmOptions);      View row = convertView;      if(row == null) {         LayoutInflater inflater = getLayoutInflater();         row = inflater.inflate(R.layout.rsslist, parent, false);       }      TextView listTitle = (TextView)row.findViewById(R.id.listtitle);      listTitle.setText(myRssFeed.getList().get(position).getTitle());      ImageView listDescription = (ImageView)row.findViewById(R.id.listdescription);      listDescription.setImageBitmap(bm);      TextView listPubdate = (TextView)row.findViewById(R.id.listpubdate);      listPubdate.setText(myRssFeed.getList().get(position).getPubdate());      return row;   }}</code></pre>","383576","","403455","","2012-07-30 12:32:07","2013-08-05 17:25:56","Asynchronous image loader on listview [Android]","<java><android><listview><android-asynctask><imageview>","3","0","4","",""
"3178931","1","","","2010-07-05 10:58:41","2","1250","<p>Which of the following is/are appropriate for saving the state of an Android application?</p><p>a.  Activity.onFreeze() b.  Activity.onPause() c.  Activity.onStop() d.  Activity.onDestroy() e.  Activity.onFinish()</p>","383589","","","","","2010-07-23 08:44:26","saving state of an android Application?","<android>","2","0","","",""
"3179050","1","","","2010-07-05 11:20:49","1","251","<p>I have HTC T-Mobile device having Android OS 1.6, Eclair platform. I doubt if Flash Adobe Air can run on that. Because that is the only supported on 2.1 and 2.2. Please confirm.</p><p>Also can i upgrade my device's OS to Froyo by downloading the OS from android.source.com?I have downloaded SDK 2.1 and 2.2 on my machine. Can i develop and run flash games on the AVD/emulator?</p><p>Please comment and reply precisely to the aforementioned questions. Thank you</p>","2355649","","2355649","","2010-07-05 11:23:37","2010-07-06 13:18:46","What resources are required to run Flash on Android?","<android>","2","5","1","",""
"3179063","1","3179412","","2010-07-05 11:22:57","3","1267","<p>App A has this BroadcastReceiver in its manifest (within &lt;application&gt;):</p><p>         </p><p>And this receiver:</p><pre><code>public class RemoteControl extends BroadcastReceiver {  @Override  public void onReceive(Context context, Intent intent) {      Log.w(TAG, ""Look what I did!"");  }}</code></pre><p>I'm trying to trigger this from App B:</p><pre><code>public void onClick(View v) {  Log.w(TAG, ""Sending stuff"");  Intent i = new Intent(""app.a.remotecontrol"");  i.setData(""http://test/url"");  sendBroadcast(i);}</code></pre><p>For whatever reason, the onReceive() in App A is never triggered even though it's broadcasted from App B.  What can be the cause of this?</p><p>EDIT &amp; <strong>SOLUTION</strong>: I forgot to write that I used setData() on the Intent before broadcasting it.  That was indeed the problem:  as soon as I removed setData(), the broadcast worked as intended.</p>","13365","","13365","","2010-07-05 12:30:30","2010-07-05 13:18:47","Why doesn't my BroadcastReceiver receive broadcasts from another app?","<android><android-intent><broadcastreceiver><android-manifest>","1","4","","",""
"3179164","1","3179258","","2010-07-05 11:39:26","2","3726","<p>I'm working on an SMS Application for Android, which undoubtedly needs to send SMSes (go figure! ;)</p><p>Now, i know there are a plenty of sources on the net that describe using the SmsManager to send SMSes...But, apparently, when using that method, the SMSes aren't stored in the ""SENT"" Folder...which is kind of a basic requirement for an SMS application.</p><p>How do i add an entry (of a message) into the ""Outbox"", so that it gets sent (and stored in the SENT Folder Automatically)....What would be the Values of the fields ""_id,threadid,read,status,type,service_center"" (Attributes of the message table)??</p><p>Any other alternatives are also welcome. :)Thanks in Advance...</p>","216517","","","","","2012-05-23 07:56:32","Android : Sending an SMS (using the Outbox)","<android><sms>","3","0","2","",""
"3179212","1","3179397","","2010-07-05 11:48:00","3","2743","<p>I have an issue with Webview. I'm programming my own WebChromeClient class overriding onProgressChanged method because I want to show the page  when it  finishes loading and then, to hide the splash screen. As I just want it to happen with a specific url, I compare the actual WebView url with a specific string, but there is a problem, I get a null pointer when webview.getUrl() method is called and my application finishes.This is the code:</p><pre><code>private class MyWebChromeClient extends WebChromeClient {    @Override    public void onProgressChanged (WebView webview, int newProgress) {        super.onProgressChanged(webview,newProgress);        if(webview.equals(w1) &amp;&amp; newProgress == 100 &amp;&amp; webview.getUrl().startsWith(""https://ssl.facebook.com/login.php"")) {             webview.setVisibility(WebView.VISIBLE);            ImageView imageview = (ImageView)findViewById(R.id.ivsplash);            imageview.setVisibility(ImageView.GONE);            ProgressBar progressbar = (ProgressBar)findViewById(R.id.pbsplash);            progressbar.setVisibility(ProgressBar.GONE);        }    }}</code></pre><p>I do this for avoid the webview takes three or four seconds to render the page, but it doesn't work. The code I used before was:</p><pre><code>private class MyWebViewClient extends WebViewClient {    @Override    public boolean shouldOverrideUrlLoading(WebView webview, String url) {        super.shouldOverrideUrlLoading(webview, url);        webview.loadUrl(url);        return true;    }    @Override    public void onPageFinished(WebView webview, String url) {        if(url.startsWith(""https://ssl.facebook.com/login.php"")) {            webview.setVisibility(WebView.VISIBLE);            ImageView imageview = (ImageView)findViewById(R.id.ivsplash);            imageview.setVisibility(ImageView.GONE);            ProgressBar progressbar = (ProgressBar)findViewById(R.id.pbsplash);            progressbar.setVisibility(ProgressBar.GONE);        }    }}</code></pre><p>Thanks</p>","383628","","383628","","2010-07-05 13:32:08","2010-07-05 13:45:33","WebView.getUrl() returns null","<android><webview><geturl>","1","0","","",""
"3179399","1","3179470","","2010-07-05 12:20:31","0","213","<p>Does anyone know how to display points, lines etc. (basically every overlay) created in android in standard google maps on website? The android db is synchronized with remote db. I'm getting the points from the database, creating kml file from them and uploading in to the map. The problem is that the areas I've created are not appearing where they should. They're somewhere on the ocean. I thought that's because I'm running this code in android:</p><pre><code>Double lat = location.getLatitude()*1E6;Double lng = location.getLongitude()*1E6;</code></pre><p>So basically I'm doing microdegrees here. I thought that dividing lat and long from db by 1E6 would do the trick but it didn't. Can someone please help me on that one? Thanks in advance.</p>","359656","","","","","2010-07-05 12:43:10","How to display lines created in android in web google maps?","<android><google-maps>","2","2","","",""
"3179423","1","","","2010-07-05 12:25:10","3","444","<p>I want to integrate <a href=""http://www.google.com/mobile/skymap/"" rel=""nofollow"">Google Sky Map</a> in my application.  Does it have an API?</p><p>What steps should be taken to integrate with this service, and how can I integrate it in an application?</p>","304961","","23199","","2011-02-15 17:37:00","2011-02-15 17:37:00","integrate Google Sky Map into an application","<android><google-api>","2","0","","",""
"3179462","1","3182887","","2010-07-05 12:33:16","7","1366","<p>I've read many posts on the same topic and tried all the given solutions without getting the result I want.The program should start an intent with extras from a notification:</p><pre><code>NotificationManager mNotificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);  Intent notificationIntent = new Intent(context, myActivity.class);    notificationIntent.putExtra(""someData"", data);PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);mNotificationManager.notify(ID, notification);</code></pre><p>The problem is that when a new notification is shown, the extras added to the intent is the same as in the first notification. I've triend with differnt flags in both the intent and the pending intent, without result. What am I getting wrong?If i just launch the same activity (and the same extras) with a button, everything works as it's supposed to.</p>","383614","","","","","2011-07-23 21:07:26","Android Pending intent started from notificaion does'nt replace the last","<android><notifications><android-pendingintent>","2","2","1","",""
"3179511","1","3179694","","2010-07-05 12:42:03","2","622","<p>I am trying to build an app that accesses the sms on android os.But i dont have an android device.. so how to add some dummy sms on to the avd so that i can test my app on those sms?? or any other way out?</p><p>Thanks.</p>","30868","","","","","2010-07-05 13:09:25","how to add dummy SMSs to android avd?","<android><sms><avd>","1","0","","",""
"3179547","1","","","2010-07-05 12:47:25","0","386","<p>I wanna set a <code>textview</code> as the values from <code>SQLite</code> when I click the <code>ListView</code>Here is my way:</p><pre><code>myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView arg0, android.view.View arg1, int arg2, long arg3) { myCursor.moveToPosition(arg2); setContentView(R.layout.main2); _id = myCursor.getInt(0); textStudyUID.setText(myCursor.getString(0)); </code></pre><p>But there is a exception, here is the log:</p><pre><code>07-05 12:37:16.613: ERROR/AndroidRuntime(17689): java.lang.NullPointerException07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at irdc.sqlitetest2.SQLiteTest2$1.onItemClick(SQLiteTest2.java:53)07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at android.widget.AdapterView.performItemClick(AdapterView.java:284)07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at android.widget.ListView.performItemClick(ListView.java:3285)07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640)07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at android.os.Handler.handleCallback(Handler.java:587)07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at android.os.Handler.dispatchMessage(Handler.java:92)07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at android.os.Looper.loop(Looper.java:123)07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at android.app.ActivityThread.main(ActivityThread.java:4363)07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at java.lang.reflect.Method.invokeNative(Native Method)07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at java.lang.reflect.Method.invoke(Method.java:521)07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)07-05 12:37:16.613: ERROR/AndroidRuntime(17689): at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Here is the full code:</p><pre><code>public class SQLiteTest2&lt;View&gt; extends Activity {           private DoDB ToDoDB;    private Cursor myCursor;    private int _id;    private ListView myListView;    public TextView textStudyUID;    protected ListAdapter adapter1;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);           myListView = (ListView)findViewById(R.id.ListView);        textStudyUID = (TextView)findViewById(R.id.widget40);        ToDoDB = new DoDB(this);        myCursor = ToDoDB.select();        SimpleCursorAdapter adapter1 = new SimpleCursorAdapter(this,R.layout.list,myCursor,new String[]{DoDB._StudyUID},new int[]{R.id.listTextView1});        myListView.setAdapter(adapter1);        myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; arg0,android.view.View arg1, int arg2,                                     long arg3) {               myCursor.moveToPosition(arg2);               setContentView(R.layout.main2);               _id = myCursor.getInt(9);               textStudyUID.setText(myCursor.getString(0));        }      });</code></pre>","364979","","1248044","","2013-05-23 09:59:21","2013-05-23 09:59:21","About get the values from SQLite","<android><sqlite>","1","5","","",""
"3179710","1","","","2010-07-05 13:11:10","3","4367","<p>I'm trying to receive data from a multicast address, but the call to MulticastSocket.receive() blocks until a timeout takes place. I did some network sniffing and found out that my device (and the emulator) never send a MulticastSocket.joinGroup request. I tried running the same Java code from my PC as a standalone application and it worked well. Could it be that the Android platform blocks IGMP join requests?Has anyone succeeded with Multicast on Android before?</p><p>My manifest file contains the following permission:</p><p>I am running my application on 2.1 (Both emulator &amp; device).</p><p>Any ideas anyone?</p><p>Thanks,</p>","340081","","","","","2013-08-19 18:57:32","How to receive Multicast packets on Android","<android>","4","0","1","",""
"3179741","1","3179906","","2010-07-05 13:14:31","1","497","<p>Is there a way to distinguish between types of messages sent to an Android Handler? For example, I have 2 background threads and would like the handler to recognize which thread a message came from.</p>","440093","","","","","2010-07-05 13:37:00","Sending messages of different types to Android Handler","<android>","2","0","","",""
"3179908","1","","","2010-07-05 13:37:08","8","2459","<p>Is there a song picker for Android that can be invoked programatically? </p><p>I'm looking for something similar to iPhone's MPMediaPickerController, which shows a view from where the user can select songs.</p>","143378","","390278","","2012-02-24 14:47:48","2013-10-05 15:37:10","Song picker for Android","<android><media><mpmediapickercontroller>","1","1","2","",""
"3179994","1","3180035","","2010-07-05 13:51:54","4","787","<p>If I attach an object to a bundle and store the bundle in an intent and start another activity, does that activity work on a copy of the original object or does it use the same object but just passes along a pointer?</p>","25282","","","","","2011-04-05 04:12:34","Android bundles passing Pointer or copies of objects","<android>","1","0","","",""
"3180279","1","5212890","","2010-07-05 14:30:42","10","5140","<p>Is it possible to register a listener to listen for changes in the volume level of the music stream in Android?</p><p>I'm displaying the actual volume in a SeekBar and I would like to change the seekbar if the user changes the volume with the hardware volume keys. At the moment the correct volume is displayed until the user changes the volume with hardware keys.</p>","114066","","114066","","2010-07-07 08:41:28","2012-01-25 11:02:25","Is there a listener to listen for changes in the volume in android?","<android><sound-api>","3","0","4","",""
"3180290","1","","","2010-07-05 14:32:36","1","258","<p>I made a javascript class that let me use gears or html5 (if available) storage to store an stringified json object. the code is ment to be use on Android 1.5 and 2.0. When I save many objects into gears, it's very slow even on a PC (google chrome / gears). The CPU doesn't go high but the page gets unresponsive for 45 sec. On a cellphone it's even worse. I removed the <code>makeJsonString(oContent)</code> but it's the same. The html5 part of the code (in IE8) works fast (2 sec to insert 300 elems).</p><p>On the phone, I only do 1 insert at the time.</p><p>In the constructor:</p><pre><code>this.db = google.gears.factory.create('beta.database');this.db.open(""foobar"");this.db.execute('CREATE TABLE IF NOT EXISTS ' + this.sDatabase + ' (AUTO_ID INTEGER PRIMARY KEY AUTOINCREMENT, CONTENT_JSON TEXT);');</code></pre><p>The saving part:</p><pre><code>var sContent = makeJsonString(oContent);this.db.execute(""INSERT INTO "" + this.sDatabase + "" (CONTENT_JSON) VALUES (?)"", [sContent]);</code></pre><p>The testing code:</p><pre><code>var oContent = {};oContent.field = ""test'os"";for (var i = 1; i &lt; 300; i++) db.saveContent(oContent);</code></pre><p><code>makeJsonString</code> use json2.js or the native function.</p><p><strong>EDIT</strong></p><p>Google Chrome CPU profiling:<img src=""http://img685.imageshack.us/img685/4317/savecontent.jpg"" alt=""alt text""></p><p><strong>EDIT 2</strong></p><p>from: <a href=""http://www.sqlite.org/faq.html#q19"" rel=""nofollow"">http://www.sqlite.org/faq.html#q19</a></p><blockquote>  <p>Actually, SQLite will easily do 50,000  or more INSERT statements per second  on an average desktop computer. But it  will only do a few dozen transactions  per second. Transaction speed is  limited by the rotational speed of  your disk drive. A transaction  normally requires two complete  rotations of the disk platter, which  on a 7200RPM disk drive limits you to  about 60 transactions per second.  Transaction speed is limited by disk  drive speed because (by default)  SQLite actually waits until the data  really is safely stored on the disk  surface before the transaction is  complete. That way, if you suddenly  lose power or if your OS crashes, your  data is still safe. For details, read  about atomic commit in SQLite..</p>    <p>By default, each INSERT statement is  its own transaction. But if you  surround multiple INSERT statements  with BEGIN...COMMIT then all the  inserts are grouped into a single  transaction. The time needed to commit  the transaction is amortized over all  the enclosed insert statements and so  the time per insert statement is  greatly reduced.</p>    <p>Another option is to run PRAGMA  synchronous=OFF. This command will  cause SQLite to not wait on data to  reach the disk surface, which will  make write operations appear to be  much faster. But if you lose power in  the middle of a transaction, your  database file might go corrupt.</p></blockquote><p>adding a transaction (<code>BEGIN</code>, <code>COMMIT</code>) boosted the performance for 300 insertfrom 45 sec to ~1 sec. Still need to test it on the phone. </p><p><strong>EDIT 3</strong></p><p>still slow on the phone :(</p>","286557","","286557","","2010-07-06 12:59:45","2010-07-06 12:59:45","Google Gears Database performance","<android><performance><sqlite><google-gears>","0","0","","",""
"3180303","1","","","2010-07-05 14:34:14","0","126","<p>I wanna set a textview as the values from SQLite when I click the ListView <br></p><h2>Here is the code:<br></h2><pre><code>public class SQLiteTest2 extends Activity {&lt;br&gt;private DoDB ToDoDB; private Cursor myCursor; private int _id;&lt;br&gt; private ListView myListView;public TextView textStudyUID;protected ListAdapter adapter1;public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);myListView = (ListView)findViewById(R.id.ListView);textStudyUID = (TextView)findViewById(R.id.widget40);ToDoDB = new DoDB(this);myCursor = ToDoDB.select();SimpleCursorAdapter adapter1 = new SimpleCursorAdapter(this,R.layout.list,myCursor,new String[]{DoDB._StudyUID},new int[]{R.id.listTextView1});&lt;myListView.setAdapter(adapter1);myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {public void onItemClick(AdapterView&lt;? extends Adapter&gt; arg0, android.view.View arg1, int arg2, long arg3) {myCursor.moveToPosition(arg2);CursorAdapter adapter = (CursorAdapter) arg0.getAdapter(); Cursor myCursor = adapter.getCursor(); setContentView(R.layout.main2);_id = myCursor.getInt(7);textStudyUID.setText(myCursor.getString(0));}});</code></pre><p>But there is still exception when I click the Item in <code>ListView</code><br></p><h2>Here is the log:<br></h2><pre><code>07-05 14:21:13.101: ERROR/AndroidRuntime(6006): java.lang.NullPointerException&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at irdc.sqlitetest2.SQLiteTest2$1.onItemClick(SQLiteTest2.java:60)&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at android.widget.ListView.performItemClick(ListView.java:3285)&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640)&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at android.os.Handler.handleCallback(Handler.java:587)&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at android.os.Handler.dispatchMessage(Handler.java:92)&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at android.os.Looper.loop(Looper.java:123)&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at android.app.ActivityThread.main(ActivityThread.java:4363)&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at java.lang.reflect.Method.invokeNative(Native Method)&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at java.lang.reflect.Method.invoke(Method.java:521)&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)&lt;br&gt;07-05 14:21:13.101: ERROR/AndroidRuntime(6006):     at dalvik.system.NativeStart.main(Native Method)&lt;br&gt;07-05 14:26:13.862: ERROR/gralloc(58): [unregister] handle 0x520670 still locked (state=40000001)</code></pre>","364979","","1232277","","2013-01-03 07:34:53","2013-01-03 07:34:53","About get the values from SQLite (2)","<android><sqlite>","0","6","","",""
"3180438","1","3180464","","2010-07-05 14:52:56","2","1058","<p>I posted a free app and I've got a couple users who posted a comment saying that the app force closes in google's feedback.  It's got a few hundred downloads in the day it's been up with an 84% retention rate.  Google's error report in the developer's console says it has 0 errors.  I've never had an app that reported any errors in the console. Does it actually work or am I getting fake reports of force closes?  I'm a bit suspicious competitors might be posting the comments, but I don't have any way to confirm that the error reporting google provides does actually work.  </p>","48784","","","","","2010-12-21 08:57:40","Android Developer console error report","<android><google-play>","2","0","","",""
"3180439","1","3205578","","2010-07-05 14:53:13","1","940","<p>Hi<br>I need to create desktop shortcut for content managed by my app. I've found the way to do it using <a href=""http://d.android.com/reference/android/content/Intent.html#ACTION%5FCREATE%5FSHORTCUT"" rel=""nofollow"">ACTION_CREATE_SHORTCUT</a> But I need the way to implement it without using ""Create shortcut"" menu. It would be great if user could select ""create shourtcut"" from item's context menu inside my activity and it will be automatically placed on desktop.</p><p>Thanks<br>Aleksander</p>","218783","","","","","2011-11-29 23:23:23","Creating shortcut on android","<android>","1","0","","",""
"3180459","1","","","2010-07-05 14:56:52","3","974","<p>I have a launched android application that works fine most of the time.  However 1 in about 1000+ runs I get an android.content.ActivityNotFoundException: Unable to find explicit activity class exception.  The activity is declared in my manifest and I've never seen it crash myself. It is declared like this...</p><pre><code>&lt;activity android:name=""com.myCompany.myPackage.MyDialog""   android:theme=""@android:style/Theme.Dialog""&gt;&lt;/activity&gt; </code></pre><p>The crash reports show it failing on all OS's from 1.5 to 2.1.  </p><p>Any help would be greatly appreciated.</p><p>--Gary</p>","383787","","","","","2010-07-05 18:15:18","ActivityNotFoundException for an activity declared in my AndroidManifest.xml","<android>","2","4","","",""
"3180531","1","9103540","","2010-07-05 15:07:21","10","4693","<p>Is there a way to read the points created when drawing a path? It seems silly to me that a path cannot be readable.</p><p>Or is it just better to manually write the current finger position to an array?</p><p>thanks</p>","381258","","","","","2013-01-14 16:16:49","Android path to array - read the points on a path?","<android><path>","3","0","5","",""
"3180570","1","3181310","","2010-07-05 15:14:08","0","2330","<p>I want to save a list of Parcelable Restaurant objects on onSaveInstanceState. I created a Restaurant class extending Parcelable and a RestaurantList object, both shown below.In my main activity I fill my RestauranList directly from json internet data using GSON:</p><pre><code>restaurantList = gson.fromJson(r, RestaurantList.class);</code></pre><p>Now, when I want to save the List of Restaurant objects using</p><pre><code>protected void onSaveInstanceState(Bundle outState) {               if (restaurantList != null ) {              outState.putParcelableArrayList(""restoList"", (ArrayList&lt;Restaurant&gt;)restaurantList.getRestaurants());    }           super.onSaveInstanceState(outState);}</code></pre><p>I get an error (shown below), I guess because Parcelable data are not written. How should I do it? Do I have to create an array of Parcel objects in my main activity and fill it by calling writeToParcel for each of the Restaurant objects? </p><p>thanks for any suggestion</p><p>Julien</p><p>++++++</p><p>LogCat (it crashes in outState.putParcelableArrayList(""restoList"", (ArrayList)restaurantList.getRestaurants());)</p><pre><code>07-05 19:34:13.846: WARN/ActivityManager(563): Activity pause timeout for HistoryRecord{436950f8 {org.digitalfarm.atable/org.digitalfarm.atable.Atable}}07-05 19:34:28.336: DEBUG/AndroidRuntime(808): Shutting down VM07-05 19:34:28.336: WARN/dalvikvm(808): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)07-05 19:34:28.336: ERROR/AndroidRuntime(808): Uncaught handler: thread main exiting due to uncaught exception07-05 19:34:28.637: DEBUG/dalvikvm(808): GC freed 3337 objects / 259288 bytes in 94ms07-05 19:34:28.647: ERROR/AndroidRuntime(808): java.lang.RuntimeException: Unable to pause activity {org.digitalfarm.atable/org.digitalfarm.atable.Atable}: java.lang.ClassCastException: java.util.LinkedList07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2840)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2797)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2780)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at android.app.ActivityThread.access$2000(ActivityThread.java:112)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at android.os.Handler.dispatchMessage(Handler.java:99)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at android.os.Looper.loop(Looper.java:123)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at android.app.ActivityThread.main(ActivityThread.java:3948)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at java.lang.reflect.Method.invokeNative(Native Method)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at java.lang.reflect.Method.invoke(Method.java:521)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at dalvik.system.NativeStart.main(Native Method)07-05 19:34:28.647: ERROR/AndroidRuntime(808): Caused by: java.lang.ClassCastException: java.util.LinkedList07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at org.digitalfarm.atable.Atable.onSaveInstanceState(Atable.java:254)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at android.app.Activity.performSaveInstanceState(Activity.java:1008)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1256)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2822)07-05 19:34:28.647: ERROR/AndroidRuntime(808):     ... 12 more</code></pre><p>RestaurantList class</p><pre><code>public class RestaurantList {    private List&lt;Restaurant&gt; restaurants = new ArrayList&lt;Restaurant&gt;();    public int getSize() {        return restaurants.size();              }    public List&lt;Restaurant&gt; getRestaurants() {        return this.restaurants;    }           public Restaurant getRestaurant(int i) {        return this.restaurants.get(i);    }    public void setRestaurants(List&lt;Restaurant&gt; restaurants) {        this.restaurants = restaurants;    }    public List&lt;String&gt; getRestaurantNames() {        List&lt;String&gt; restaurantNames = new ArrayList&lt;String&gt;();        for (int i=0; i&lt;this.restaurants.size(); i++) {            restaurantNames.add(this.restaurants.get(i).getName());                     }        return restaurantNames;    }}</code></pre><p>Restaurant class</p><pre><code>public class Restaurant implements Parcelable{    private String name;    /* more stuff */    public Restaurant() {}              public String getName() {        return this.name;       }    public void setName(String name) {        this.name = name;    }           public void writeToParcel(Parcel out, int flags) {          out.writeStringArray(new String[] {this.name, /* more stuff*/});                }    public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {            public Restaurant createFromParcel(Parcel in) { return new Restaurant(in); }            public Restaurant[] newArray(int size) { return new Restaurant[size]; }    };    private Restaurant(Parcel in) {        String[] stringData = new String[6];                        in.readStringArray(stringData);        this.name = stringData[0];                  /* more stuff */         }           public int describeContents(){         return 0;    }}</code></pre>","326849","","326849","","2010-07-05 17:47:51","2010-07-05 17:51:25","Question about parcelable object","<android><parcelable>","1","0","","",""
"3180585","1","","","2010-07-05 15:16:27","3","973","<p>I have a PreferenceActivity with a few EditText and CheckBox Preferences. I would like to add a preference of Contact so that when the button was pressed it would allow the selction of a Contact's number</p><p>Is that possible using the PreferenceActivity functionality?</p><p>TIA</p><p>Pat Long</p>","63286","","","","","2011-10-02 13:53:32","Set PreferenceScreen type as ""Select Contact""","<android><android-manifest>","2","0","1","",""
"3180654","1","3181119","","2010-07-05 15:28:40","2","1742","<p>I want to provide my own version of password mechanism. Is this possible?</p>","329611","","","","","2012-05-07 04:57:02","Is there a way to override the lock pattern screen?","<android>","1","0","1","",""
"3180722","1","","","2010-07-05 15:39:53","0","89","<p>When I click the <code>ListView</code> in layout1, it will go to layout2 and show some imformation.But when I click the button I designed to back to layout1, I can't see the <code>ListView</code>.Just black background.</p><p>Here is the Button code:</p><pre><code>Button backButton = (Button) findViewById(R.id.widget39);backButton.setOnClickListener(new Button.OnClickListener()    {        public void onClick(android.view.View v) {            setContentView(R.layout.layout1);            myListView = (ListView) findViewById(R.id.ListView);            myCursor = ToDoDB.select();    } });</code></pre>","364979","","12388","","2010-07-05 15:52:47","2010-07-05 17:04:35","About layout change in SQLite","<android><sqlite><sqlite3>","1","1","","",""
"3180750","1","3180795","","2010-07-05 15:45:14","1","489","<p>Here's my code:</p><pre><code>InetAddress address =  InetAddress.getByName(""www.whyoceans.com"");if (!address.isReachable(3000)) {  Toast.makeText(this,    ""Unable to ping host"",    Toast.LENGTH_SHORT).show();}</code></pre><p>The isReachable always fails, yet I can open a shell and ping it justfine (from both my PC and my phone):</p><pre><code>ping www.whyoceans.comPING www.whyoceans.com (69.163.249.123) 56(84) bytes of data.64 bytes from apache2-fritz.harmony.dreamhost.com (69.163.249.123):icmp_seq=1 ttl=55 time=38.3 ms64 bytes from apache2-fritz.harmony.dreamhost.com (69.163.249.123):icmp_seq=2 ttl=55 time=40.9 ms^C--- www.whyoceans.com ping statistics ---2 packets transmitted, 2 received, 0% packet loss, time 1002msrtt min/avg/max/mdev = 38.319/39.654/40.989/1.335 ms</code></pre><p>Why? </p>","298511","","","","","2010-07-05 15:55:24","Unable to ping host from app but can otherwise","<java><android>","1","0","","",""
"3180778","1","3181137","","2010-07-05 15:51:43","0","400","<p>I'm experimenting with twitter4j on android (new to both) coded up a simple process in java just to test it out. It downloads a users timeline and prints to screen.</p><p>I modify the code for android, but I get a TwitterException when i try to download the user timeline. I checked out the debugger and the exception is null; no information given. I've also added the Internet permission to the android manifest on previous advice. Heres the code:</p><pre><code>package com.test;import java.util.List;import twitter4j.Status;import twitter4j.Twitter;import twitter4j.TwitterException;import twitter4j.TwitterFactory;import android.app.Activity;import android.os.Bundle;public class Test2 extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        List&lt;Status&gt; statuses = null;        Twitter api = new TwitterFactory().getInstance(""USERNAME"",""PASSWORD"");        try{         statuses = api.getUserTimeline();        }        catch(TwitterException e){            System.out.println(""ERROR"");            System.exit(-1);        }        for(Status s: statuses){            System.out.println(s.getText());        }    }}</code></pre><p>I realise this only prints to the console, just to keep it simple. </p><p>Thanks for any and all help.</p>","312928","","312928","","2010-07-05 17:30:18","2012-04-04 09:50:39","Internet on android, causing twitter4j exception?","<java><android><twitter><twitter4j>","2","1","","",""
"3180822","1","3182050","","2010-07-05 16:00:16","0","601","<p>How can I open them which have already stored in SQLite ??</p>","364979","","","","","2010-07-05 20:43:27","How to open PDF/xml which stored in a SQLite file?","<android><sqlite>","2","2","","",""
"3181108","1","3181300","","2010-07-05 17:00:44","0","1853","<p>Which property sets the subtext as highlighted <a href=""http://tinypic.com/view.php?pic=2vljfb9&amp;s=6"" rel=""nofollow"">here</a> in a ListView.</p>","200477","","","","","2010-07-05 17:50:34","How to get subtext in ListView in Android","<java><android><listview>","1","0","","",""
"3181505","1","","","2010-07-05 18:30:40","1","392","<p>You know with Facebook, how you can share video on your sites and Facebook embeds the videos via flash.</p><p>Well on computers and laptop the embeded video will play on Facebook since they have Flash installed. But for iPhone and Android users will just be redirected to the site, I want to stop this and add an alt text stated something like ""Flash is needed to view"", is this possible?</p>","383917","","","","","2010-08-02 11:13:18","Facebook Share can I add Alt text for flash videos?","<iphone><android><flash><facebook><facebook-sharer>","1","0","0","",""
"3181611","1","3181893","","2010-07-05 18:54:30","0","1911","<p>I have the following code and the markers are not appearing on the map at all!</p><pre><code>private class SitesOverlay extends ItemizedOverlay&lt;pfOverlayItem&gt; {    private List&lt;pfOverlayItem&gt; items=new ArrayList&lt;pfOverlayItem&gt;();    //private   PopupPanel panel=new PopupPanel(R.layout.popup);    public SitesOverlay() {        super(null);        items = mainOverlayArray;        populate();    }    @Override    protected pfOverlayItem createItem(int i) {        return(items.get(i));    }    @Override    public void draw(Canvas canvas, MapView mapView,                                        boolean shadow) {        super.draw(canvas, mapView, shadow);    }    @Override    public int size() {        return(items.size());    }    private Drawable getMarker(int resource) {        Drawable marker=getResources().getDrawable(resource);        marker.setBounds(0, 0, marker.getIntrinsicWidth(),                                            marker.getIntrinsicHeight());        boundCenter(marker);        return(marker);    }}</code></pre><p>mainOverlayArray is full of pfOverlayItem's and the code for that class is </p><pre><code>public class pfOverlayItem extends OverlayItem {private String coolText;public String getcoolText() {    return coolText;}public void setcoolText(String coolText) {    this.coolText = coolText;}public pfOverlayItem(GeoPoint point, String title, String snippet) {    super(point, title, snippet);    // TODO Auto-generated constructor stub}</code></pre><p>}</p><p>I also set the marker outside of this after processing an XML file...</p><pre><code> ArrayList&lt;pfOverlayItem&gt; overArray = myXMLHandler.getOverlayArray();                mainOverlayArray = overArray;                pfOverlayItem tempOver = null;                Drawable marker = getResources().getDrawable(R.drawable.icon);                for (int i = 0; i &lt; mainOverlayArray.size(); i++) {                    tempOver = mainOverlayArray.get(i);                    tempOver.setMarker(marker);                }                sites=new SitesOverlay();                myMapView.getOverlays().add(sites);                myMapView.invalidate(); [/code]</code></pre>","103999","","103999","","2010-07-05 20:16:15","2010-07-05 20:16:15","OverlayItem not displaying markers!","<android><overlay><android-mapview>","1","0","","",""
"3181628","1","5762767","","2010-07-05 18:57:27","1","651","<p>I'm creating a scene for a game.</p><p>There's a background which is a bitmap and player objects. I want to have the player objects to be able to ""eat"" away at the background with a transparent color as they move around the board. Basically if an object is at a certain point a circle around that object is alpha'ed out of the bitmap. The edits of the bitmap need to persist.</p><p>What's the best way to accomplish this? I was thinking of modifying the pixels for the bitmap using Bitmap.setPixel but that would probably be very expensive.</p>","42005","","","","","2011-04-23 06:54:45","On the fly bitmap editing in Android","<android><canvas><bitmap><alphablending>","1","0","1","",""
"3181629","1","","","2010-07-05 18:57:29","0","5139","<p>I have a swf file on the sdcard and I wrote a html file flash.html with the swf file embeded. The only way to open it now is1) open the browser 2) type in file:///sdcard/flash.htmlThe swf runs fine.</p><p>But if use the code list below:</p><pre><code>Uri uri = Uri.parse(""file:///sdcard/flash.html"");   Intent intent = new Intent(Intent.ACTION_VIEW, uri);   startActivity(intent);  </code></pre><p>It shows the error: The application has stopped unexpectly.</p><p>I also tried the following code using WebView:</p><pre><code>WebView browser = (WebView) findViewById(R.id.list_web);   browser.loadUrl(""file:///sdcard/flash.html"");                                </code></pre><p>The Webview showed up, but the area should start the swf is empty.</p><p>So is there a way to open the html through code, how can I do it?   </p><p>I also think if there is a way to open the android browser using ACTION_VIEW by a simple html then reset the URL through code?</p>","330915","","277140","","2011-07-20 13:30:55","2014-04-06 18:49:34","android 2.2 open swf in browser","<android><android-2.2-froyo>","2","0","","",""
"3181728","1","3182722","","2010-07-05 19:24:57","5","7582","<p>I've reviewed some posts about lazy loading but I believe my problem is a bit different.  </p><p>I have a gallery (my class extends Gallery) which displays 20 rather large in size images (400-500K each). I cannot load them all to gallery since I get an OutOfMemory exception.<br>So, I created an array of 20 Drawables and initially populated the first 9 elements (the images come from the Web) and set all the rest to null. My intention was this: on a fling to the right, fetch element no. 10 and set to null element no. 0. On another fling to the right fetch element no. 11 and set to null element no. 1 to null. Same logic on a fling left.  </p><p>The problem is I can fling much faster than the elements are fetched.My gallery has a BaseAdapter and its getView() looks something like this:</p><pre>public View getView(int position, View  convertView, ViewGroup  parent){     ImageView imageView = new ImageView();     imageView.setDrawable(imageArray[position];     ....     ....     return imageView;}</pre><p>How do I tell getView() - if imageArray[position] is still null, show a ""loading..."" dialog and once it is set repeat yourself with the same position?<br>I don't want to see the imageView empty and then set on the fly. I want to not be able to see the imageView at all until it is set.</p><p>Thanks.</p>","283630","","","","","2010-07-05 23:39:53","Android: lazy loading in Gallery","<android><lazy-loading><image-gallery><image-loading>","1","1","2","",""
"3181744","1","3181972","","2010-07-05 19:26:49","2","1335","<p>There is something I'm just not getting, and I'm looking for assistance in understanding what is happening here.</p><p>I have a custom list adapter (that just extends BaseAdapter) that I have successfully been using to generate and display a list. Now I want to add a static footer to the bottom of my list. After looking at a number of resources (specifically <a href=""http://blog.maxaller.name/2010/05/attaching-a-sticky-headerfooter-to-an-android-listview/"" rel=""nofollow"">this one)</a> I've come to realize that my reluctance of using XML has to come to an end, and set up the following xml layout in a file called devices_list.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:orientation=""vertical""&gt;&lt;LinearLayout android:id=""@+id/bottom_control_bar""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""&gt;    &lt;ToggleButton android:id=""@+id/bottom_control_toggle""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""         android:textOff=""Filter Favourites OFF""         android:textOn=""Filter Favourites ON""/&gt;&lt;/LinearLayout&gt;&lt;ListView android:id=""@android:id/list""    android:layout_width=""fill_parent""    android:layout_height=""0dip""     android:layout_above=""@id/bottom_control_bar""&gt;&lt;/ListView&gt;&lt;TextView android:id=""@android:id/empty""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:text=""@string/main_empty_list""    android:layout_above=""@id/bottom_control_bar""/&gt;  &lt;/RelativeLayout&gt;</code></pre><p>After some adjustments to the activity that holds the list, I ran the code. I see my footer, (and also the tab widget which is parent to everything), but the area where the list goes is empty.</p><pre><code>    @Override    public void onCreate(Bundle savedInstanceState){       super.onCreate(savedInstanceState);       this.setContentView(R.layout.devices_list);       db = new DbManager(this);       db.open();       AllCur = db.fetchAllDevices();       startManagingCursor(AllCur);       list = new DeviceListAdapter(this, AllCur);   //make my custom list adapter                         setListAdapter(list);            }</code></pre><p>Is there some way to link up the ListView widget declared in my xml with my DeviceListAdapter? It's pretty clear to me now that I'm not entirely sure about how this is all working. Any help in clarification would be much appreciated.</p>","259645","","","","","2010-07-05 20:24:54","Custom Listview Adapter, adding a static footer, and understanding R.id.list","<android><listview><sticky-footer>","1","2","0","",""
"3181843","1","3182146","","2010-07-05 19:56:30","11","14427","<p>I want to check a ""404 page not found"" from a WebView and if it's a 404 then I revert to theprevious page. Ty for your help</p><p>EDIT also the webpages I want to see are pure .jpg 1.jpg 2.jpg 3.jpg but I have no info of how many images exist. So if anyone can propose another method, he is welcome to do so.</p>","348058","","812149","","2012-09-06 13:34:33","2014-02-26 09:29:36","How can I check from Android WebView if a page is a ""404 page not found""?","<android><webview>","5","1","3","",""
"3181994","1","3202457","","2010-07-05 20:30:32","3","382","<p>I am web developer from a year.I have Used PHP,python with client side Js libraries like Jquery,motools, etc.</p><p>So if switching to Adobe air will be a good thing ?</p><ol><li>If It is strong enough to make decent desktop apps (Eg:  music/videos player)?</li><li>If apps can be made for Android or iphone OS ?</li><li>Can i use Jquery like libraries (i am very used to that syntax) ?</li><li>And at last if there will be sufficient work in future for Air developers ?</li></ol><p>Sorry if asked already .</p>","349297","","446733","","2010-07-05 21:26:03","2010-07-08 09:59:08","If switching to adobe air will be a good move?","<javascript><android><air>","3","1","","",""
"3182157","1","3182234","","2010-07-05 21:03:09","2","3353","<p>the title is self-explaining. On iPhone, Mobile Safari is WebKit based and supports hardware-accelerated -webkit-transform CSS properties. To be specific, I use the translate3d() transform.</p><p>What alternative is there for the Android browser? I need it to work on Android 1.5.</p><p>Thanks in advance.</p>","365183","","333255","","2010-07-05 21:30:45","2011-11-08 00:36:33","How to achieve smooth (hw accelerated) transitions in the Android browser?","<css><android><webkit><transform><hardware-acceleration>","1","0","","",""
"3182337","1","","","2010-07-05 21:51:41","0","47","<p>I am new to android. I have created a simple application that starts a service to register an SMS broadcast receiver. The application works fine but I keep getting alerts that different process are not responding. The associated buttons are to ""Force Close"" or ""Wait"". The particular process varies. For example, ""com.android.inputmethod.latin"". Other times it mught the ""mms"" process.</p><p>I get these alerts under the 2.1 or 2.1-update1 platform but I do not however under the 2.2 platform.</p>","384008","","","","","2010-07-06 05:01:26","Application interfering with OS processes","<android>","1","0","","",""
"3182393","1","3196036","","2010-07-05 22:03:38","25","27153","<p>Is there a simple way to have text be able to have a black outline? I have textviews that will be different colors, but some of the colors don't show up on my background so well, so I was wondering if there's an easy way to get a black outline or something else that will do the job? I'd prefer not to have to create a custom view and make a canvas and such.</p>","375874","","","","","2014-01-08 10:30:32","Android textview outline text","<android><colors><textview>","6","0","10","",""
"3182448","1","","","2010-07-05 22:20:01","0","407","<p>ok so here I have a difficult one. apparently no1 does know a thing about this issue but I did find some app implementing the behaviour so hopefully...</p><p>I'll keep this short as I am sure if you stumbled upon it too, then you'll recognize the issue straight aways.</p><p>I have a horizontal Gallery with SrollViews in it. The 2 onTouchEvents (the one of the gallery and the one of the scrollview being displaied) collide and you need to take a decision about who to dispatch the event to.</p><p>anyone!?</p><p>please if u have no idea what I am talking about please let the http alone ... it's  already busy enough ;)</p>","87624","","","","","2010-07-05 22:28:19","gallery and scrollview : a complete disaster!","<android>","1","0","","",""
"3182723","1","5174521","","2010-07-05 23:39:57","3","2507","<p>I've got a ListActivity with a ListView in it.   I need to draw a repeating image around the border (""on top of it (I guess after the listview is renderered))</p><p>How can I hook in my own drawing code for this?</p>","62709","","","","","2011-03-02 22:47:30","Android: Draw custom border around listview?","<android><listview><listactivity><drawable>","3","0","2","",""
"3182740","1","","","2010-07-05 23:46:52","0","136","<p>Could anyone supply a sample of a working proximityAlert code?  Including the activity that sets the alert, the receiver that accepts the alert, and the manifest xml?</p><p>Thanks!</p><p>edit:near geopoint would be great</p>","384060","","384060","","2010-07-06 02:10:10","2010-07-06 02:10:10","proximityAlert sample code?","<android>","1","0","","",""
"3182816","1","","","2010-07-06 00:16:38","0","624","<pre><code>//Check that external storage is mounted and accessable    String accessable = Environment.getExternalStorageState();    if (!Environment.MEDIA_MOUNTED.equals(accessable)) {        buildWarningMessage();    }//Set the cache directory        CACHE_DIRECTORY = externalRoot + ""/folder/.cache/"";@Override    protected void onDestroy() {        super.onDestroy();        File cacheFile = new File(CACHE_DIRECTORY);        if (cacheFile.exists()) {            deleteDir(cacheFile);        }</code></pre><p>I'm currently using the above code to create a folder which is used to temporarily store images that the app uses later. deleteDir is just a generic recursive file deletion to empty a directory. Is there a better way to do this than to delete everything? Ideally I just want a temp folder that empties when the application closes.</p>","384071","","","","","2010-07-06 00:39:33","Alternative to recursive file deletion in directories?","<android>","1","0","","",""
"3182904","1","9417828","","2010-07-06 00:52:59","7","5755","<p>How can I attach Java source to an Android project?</p><p>I'm able to browse java source for a Java project, but not for an Android project. </p><p>I modified project properties and add Java source in ""Libraries"" section, still not working</p><p>Any suggestions ?</p>","109603","","","","","2013-05-04 17:55:17","Attaching Java Source to Android projects in Eclipse","<java><android><eclipse><source>","3","0","4","",""
"3182937","1","6679154","","2010-07-06 01:05:16","8","6222","<p>Anyone know how to add playlists to Android in code?</p><p>I kind of get that I have to insert it into the content resolver but do I have to just put the song id in or do I have to put all of the song's data in?</p><p>I have been looking for sample code but haven't found any yet.</p><p>EDIT:Found an answer here is how I do it:</p><pre><code>  public static void addToPlaylist(ContentResolver resolver, int audioId) {        String[] cols = new String[] {                ""count(*)""        };        Uri uri = MediaStore.Audio.Playlists.Members.getContentUri(""external"", YOUR_PLAYLIST_ID);        Cursor cur = resolver.query(uri, cols, null, null, null);        cur.moveToFirst();        final int base = cur.getInt(0);        cur.close();        ContentValues values = new ContentValues();        values.put(MediaStore.Audio.Playlists.Members.PLAY_ORDER, Integer.valueOf(base + audioId));        values.put(MediaStore.Audio.Playlists.Members.AUDIO_ID, audioId);        resolver.insert(uri, values);    }   public static void removeFromPlaylist(ContentResolver resolver, int audioId) {       Log.v(""made it to add"",""""+audioId);        String[] cols = new String[] {                ""count(*)""        };        Uri uri = MediaStore.Audio.Playlists.Members.getContentUri(""external"", YOUR_PLAYLIST_ID);        Cursor cur = resolver.query(uri, cols, null, null, null);        cur.moveToFirst();        final int base = cur.getInt(0);        cur.close();        ContentValues values = new ContentValues();        resolver.delete(uri, MediaStore.Audio.Playlists.Members.AUDIO_ID +"" = ""+audioId, null);    }</code></pre>","282475","","282475","","2010-07-29 21:53:18","2013-10-28 14:23:02","Android Create Playlist","<android><android-contentresolver>","3","4","6","",""
"3182995","1","","","2010-07-06 01:27:14","1","1728","<p>I am fairly new to Android and I am trying to use Wi-Fi Adhoc Mode in my application. But I could not find any API or method to set the same. I read a thread in Android Forum and could not come any concrete solution on how to use enable Adhoc mode in Android.I used to use WPA_Supplicant conf file in Linux to enable Adhoc mode.</p><p>I would like know if I can enable Wi-Fi Adhoc mode in Android from my application and how to do the same.</p><p>Thanks in advance.</p>","383347","","32502","","2010-07-06 01:42:16","2010-07-06 01:45:00","Is Wi-Fi Adhoc Mode operation supported in Android?","<android><wifi><adhoc>","2","0","","",""
"3183105","1","3183656","","2010-07-06 02:09:36","0","705","<p>Hey all, this is quite an elaborate problem for me that i've been trying to figure out for a while now. Even explaining it is a little difficult for me but i'll give it a try.</p><p>I am using a gutted version of the Snake Android sample. Pretty much I am using the TileView class verbatim and am only trying to display a few tiles on the screen. Instead of the SnakeView class I am using a GameView class in which I only included the code I thought necessary to display a tile on the screen. Here is the class</p><pre><code>    public class GameView extends TileView {    /**     * Labels for the drawables that will be loaded into the TileView class     */    private static final int RED_STAR = 1;    private static final int YELLOW_STAR = 2;    private static final int GREEN_STAR = 3;    /**     * mMoveDelay: number of milliseconds between animations.      */    private long mMoveDelay = 600;    /**     * mLastMove: tracks the absolute time when the last animation happened.     */    private long mLastMove;    /**     * Create a simple handler that we can use to cause animation to happen.  We     * set ourselves as a target and we can use the sleep()     * function to cause an update/invalidate to occur at a later date.     */    private RefreshHandler mRedrawHandler = new RefreshHandler();    class RefreshHandler extends Handler {        @Override        public void handleMessage(Message msg) {            GameView.this.update();            GameView.this.invalidate();        }        public void sleep(long delayMillis) {            this.removeMessages(0);            sendMessageDelayed(obtainMessage(0), delayMillis);        }    };    /**     * Constructs a GameView based on inflation from XML     *      * @param context     * @param attrs     */    public GameView(Context context, AttributeSet attrs) {        super(context, attrs);        initGameView();   }    public GameView(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        initGameView();    }    private void initGameView() {        setFocusable(true);        Resources r = this.getContext().getResources();        resetTiles(4);        loadTile(RED_STAR, r.getDrawable(R.drawable.redstar));        loadTile(YELLOW_STAR, r.getDrawable(R.drawable.yellowstar));        loadTile(GREEN_STAR, r.getDrawable(R.drawable.greenstar));    }    public void initNewGame() {               // set the move delay. This tells the update method how often it should        // refresh the screen.        mMoveDelay = 600;        update();    }    public void update() {        long now = System.currentTimeMillis();        if (now - mLastMove &gt; mMoveDelay) {            // clear any tiles on the screen            clearTiles();            updateWalls();            // draws the tiles storred in mCellularArray            //updateCellularArray();            mLastMove = now;        }        mRedrawHandler.sleep(mMoveDelay);    }    private void updateWalls() {        for (int x = 0; x &lt; mXTileCount; x++) {            setTile(GREEN_STAR, x, 0);            setTile(GREEN_STAR, x, mYTileCount - 1);        }        for (int y = 1; y &lt; mYTileCount - 1; y++) {            setTile(GREEN_STAR, 0, y);            setTile(GREEN_STAR, mXTileCount - 1, y);        }    }    private void updateCellularArray() {        setTile(YELLOW_STAR, 6, 7);    }}</code></pre><p>Now what is happening is that when the updateWalls() method is called, the tiles are placed within the View and comes up like this:</p><p><img src=""http://imgur.com/4as66.png"" alt=""alt text""></p><p>Now when I uncomment out the <code>updateCellularArray()</code> method and comment out the <code>updateWalls()</code> the program force closes and throws a NullPointerException. After some debugging I figured out that when the updateCellular array method is called, the mTileGrid array in the TileView class is not initialized, but it is when <code>updateWalls()</code> is called. I am completely baffled as to why this is happening. It doesn't matter if i replace the for loop with a simple <code>setTile(GREEN_STAR, 3, 3);</code> it still force closes.</p><p>Here is the TileView class I am using (again this is the same one in the Snake sample that comes with the Android SDK):</p><pre><code>/** * TileView: a View-variant designed for handling arrays of ""icons"" or other * drawables. *  */public class TileView extends View {    /**     * Parameters controlling the size of the tiles and their range within view.     * Width/Height are in pixels, and Drawables will be scaled to fit to these     * dimensions. X/Y Tile Counts are the number of tiles that will be drawn.     */    protected static int mTileSize;    protected static int mXTileCount;    protected static int mYTileCount;    private static int mXOffset;    private static int mYOffset;    /**     * A hash that maps integer handles specified by the subclasser to the     * drawable that will be used for that reference     */    private Bitmap[] mTileArray;     /**     * A two-dimensional array of integers in which the number represents the     * index of the tile that should be drawn at that locations     */    private int[][] mTileGrid;    private final Paint mPaint = new Paint();    public TileView(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TileView);        mTileSize = a.getInt(R.styleable.TileView_tileSize, 12);        a.recycle();    }    public TileView(Context context, AttributeSet attrs) {        super(context, attrs);        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TileView);        mTileSize = a.getInt(R.styleable.TileView_tileSize, 12);        a.recycle();    }    /**     * Rests the internal array of Bitmaps used for drawing tiles, and     * sets the maximum index of tiles to be inserted     *      * @param tilecount     */    public void resetTiles(int tilecount) {     mTileArray = new Bitmap[tilecount];    }    @Override    protected void onSizeChanged(int w, int h, int oldw, int oldh) {        mXTileCount = (int) Math.floor(w / mTileSize);        mYTileCount = (int) Math.floor(h / mTileSize);        mXOffset = ((w - (mTileSize * mXTileCount)) / 2);        mYOffset = ((h - (mTileSize * mYTileCount)) / 2);        Log.d(""Tomek"", ""TileGrid array dimensions are: "" + mXTileCount + "","" + mYTileCount);        mTileGrid = new int[mXTileCount][mYTileCount];        clearTiles();    }    /**     * Function to set the specified Drawable as the tile for a particular     * integer key.     *      * @param key     * @param tile     */    public void loadTile(int key, Drawable tile) {        Bitmap bitmap = Bitmap.createBitmap(mTileSize, mTileSize, Bitmap.Config.ARGB_8888);        Canvas canvas = new Canvas(bitmap);        tile.setBounds(0, 0, mTileSize, mTileSize);        tile.draw(canvas);        mTileArray[key] = bitmap;    }    /**     * Resets all tiles to 0 (empty)     *      */    public void clearTiles() {        for (int x = 0; x &lt; mXTileCount; x++) {            for (int y = 0; y &lt; mYTileCount; y++) {                setTile(0, x, y);            }        }    }    /**     * Used to indicate that a particular tile (set with loadTile and referenced     * by an integer) should be drawn at the given x/y coordinates during the     * next invalidate/draw cycle.     *      * @param tileindex     * @param x     * @param y     */    public void setTile(int tileindex, int x, int y) {     //Log.d(""Tomek"", ""Attempting to set tile: "" + x + "","" + y);     //Log.d(""Tomek"", ""The current value at "" + x + "","" + y + "" is "" + mTileGrid[x][y]);     //Log.d(""Tomek"", ""It will be changed to "" + tileindex);        mTileGrid[x][y] = tileindex;    }    @Override    public void onDraw(Canvas canvas) {        super.onDraw(canvas);        for (int x = 0; x &lt; mXTileCount; x += 1) {            for (int y = 0; y &lt; mYTileCount; y += 1) {                if (mTileGrid[x][y] &gt; 0) {                    canvas.drawBitmap(mTileArray[mTileGrid[x][y]],                       mXOffset + x * mTileSize,                      mYOffset + y * mTileSize,                      mPaint);                }            }        }    }}</code></pre><p>Sorry for posting all this code. Any help would be greatly appreciated.</p><p>Thanks much,</p><p>Tomek</p><p>EDIT: simplified GameView class</p><p>EDIT 2: Alright after modifying the <code>updateCellularArray()</code> method to the following: </p><pre><code>private void updateCellularArray() {    for (int x = 0; x &lt; mXTileCount; x++) {        setTile(GREEN_STAR, 12, 12);    }}</code></pre><p>It finally placed the tile where I wanted it to...<img src=""http://img188.imageshack.us/img188/1148/device2z.png"" alt=""alt text""></p><p>I'm starting to wonder if it has something to do with the RefreshHandler. Possibly when the RedrawHandler's sleep method is called in the update method of the GameView class. I'm not quite sure how it works so I am going to try playing around with it and see what I can come up with.</p>","29326","","29326","","2010-07-06 05:07:46","2010-07-06 05:18:41","Strange problem with modified Android Snake example","<android><nullpointerexception>","1","0","","",""
"3183179","1","","","2010-07-06 02:38:05","1","229","<p>Will SharedPreference be destroyed if the Context has been destroyed?</p><p>For example, if the Context is an Activity, and this Activity has quit.</p><p>I tried in my code, and the SharedPreference turns to be null, as well as the Context.</p><p>I also tried to find some clues in the opensource code, but it's complicated for me. </p>","234939","","","","","2011-06-13 17:39:58","Will SharedPreference be destroyed if the Context has been destroyed?","<android>","1","0","","",""
"3183260","1","","","2010-07-06 03:03:22","1","2537","<p>i am unable to view maps on the emulator. I am under proxy internet connection, I also set the proxy via GUI and also have set api Key alongwith the perimissions and library.</p><p>here's my code:</p><pre><code>package com.example.MyMapActivity;import org.apache.http.HttpHost;import org.apache.http.conn.params.ConnRoutePNames;import org.apache.http.impl.client.DefaultHttpClient;import android.os.Bundle;import com.google.android.maps.MapActivity;import com.google.android.maps.MapController;import com.google.android.maps.MapView;public class MyMapActivity extends MapActivity {private MapView mapview;private MapController mapcontroller;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    DefaultHttpClient client = new DefaultHttpClient();    String proxyHost = android.net.Proxy.getHost(this);    if (proxyHost !=null) {      int proxyPort = android.net.Proxy.getPort(this);      HttpHost proxy = new HttpHost(""*********"", ***);      client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);    }    //mapview = (MapView)findViewById(R.id.mapview);}@Overrideprotected boolean isRouteDisplayed() {    // TODO Auto-generated method stub    // this method must return true if your app returns driving directions , else return false    return false;}</code></pre><p>}</p><p><strong>The Layout file</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;com.google.android.maps.MapView android:id=""@+id/mapview""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:enabled=""true""android:clickable=""true"" android:apiKey=""***********""&gt;     &lt;/com.google.android.maps.MapView&gt;</code></pre><p></p><p><strong>The mainfest file</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""com.example.MyMapActivity""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;uses-library android:name=""com.google.android.maps""&gt;&lt;/uses-library&gt;    &lt;activity android:name="".MyMapActivity""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name =""android.permission.ACCESS_COARSE_LOCATION""/&gt;</code></pre><p> </p>","238505","","238505","","2010-07-07 08:52:14","2012-09-26 08:28:30","Unable to view map on the android emulator","<android>","3","5","","",""
"3183479","1","","","2010-07-06 04:21:17","2","1791","<p>I have a problem with listView, I used ArrayList to store data, and a customized Adapter. But, when I remove all the data, and add one item again, it does not display anything in this list. What happens to my List, can anyone help me?</p><pre><code>static ArrayList&lt;String&gt;  chattingListData=new ArrayList&lt;String&gt;(); static IconicAdapter chattingListDataAdapter;@Overridepublic void onCreate(Bundle icicle) {   super.onCreate(icicle);   chattingListDataAdapter=new IconicAdapter(this);   setListAdapter(chattingListDataAdapter);   registerForContextMenu(this.getListView());}class IconicAdapter extends ArrayAdapter {   Activity context;   IconicAdapter(Activity context) {      super(context, R.layout.chatting_list, chattingListData);             this.context=context;   }   public View getView(int position, View convertView, ViewGroup parent) {      LayoutInflater inflater=context.getLayoutInflater();      View row=inflater.inflate(R.layout.chatting_list, null);      TextView label=(TextView)row.findViewById(R.id.chattinglist_userName);      label.setText(chattingListData.get(position));        return(row);   }}</code></pre><p>I use static ArrayList to modify data from outside, when I start the ListView activity and add data, it's Ok, but when I remove all data, I can not add anymore to the data list. Please help me.</p>","384152","","114066","","2010-07-06 07:08:38","2011-06-30 12:14:33","Android: How to add data to an empty listView","<android>","2","1","","",""
"3183486","1","3183570","","2010-07-06 04:23:07","0","2269","<p>I want to send data to server from client(Android), below is my format </p><pre><code>http://101.34.45.45/rawData?data={""userId"":""guest1"",""timestamp"":""2010-07-01 08:58:23"",""wifi"":[{""ssid"":""guest"",""rssi"":""40""},{""ssid"":""guest1"",""rssi"":""80""}]}, </code></pre><p>i'm trying series of trial but no use, how this can be done?</p>","142636","","114066","","2010-07-06 06:49:29","2012-07-15 01:45:06","android http post with parameter","<android><http><http-post>","2","2","","",""
"3183578","1","3199189","","2010-07-06 04:56:00","1","2410","<p>I have an app that is making use of photos stored on either the SD card or directly on the phone.</p><p>I have 2 Activities that seem to be having some kind of problem (Acitives for Viewing and Editing a record). A single record references a photo by storing a URI that gives the location of the related photo.</p><p>When I click on my View activity, I pass the URI, and then set the ImageView using the URI. When inside the View Activity, I have a menu option that allows you to reach the Edit Activity. When you click Edit, I again pass the URI of the photo, and set the ImageView using the URI. Both of these activities display fine on their own.</p><p>However, when I click the Back button to move from Edit to View, the app crashes. Initially the crash was an OutOfMemory Exception. I got past this exception by adding a call to <code>((BitmapDrawable)mImageView.getDrawable()).getBitmap().recycle()</code> in the onPause function in both activities.</p><p>With the recycle code in place, execution moves from Edit back to View, and then just crashes somewhere. I've stepped through the lifecycle functions, and execution makes it through successfully, except for onCreate. Execution never reaches onCreate again.</p><p>I know it's something related to ImageView because when I remove the ImageView from the layout in my View activity, the crash no longer happens.</p><p>Here is the initial stack trace when the crash happens:</p><pre><code>Thread [&lt;3&gt; main] (Suspended (exception RuntimeException))      ViewRoot.draw(boolean) line: 1356       ViewRoot.performTraversals() line: 1097     ViewRoot.handleMessage(Message) line: 1613      ViewRoot(Handler).dispatchMessage(Message) line: 99     Looper.loop() line: 123     ActivityThread.main(String[]) line: 4203        Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]      Method.invoke(Object, Object...) line: 521      ZygoteInit$MethodAndArgsCaller.run() line: 791      ZygoteInit.main(String[]) line: 549     NativeStart.main(String[]) line: not available [native method]  </code></pre><p>After this stack trace, if I keep pushing ""Step Over"" in Eclipse, the stack trace ends up like this:</p><pre><code>Thread [&lt;3&gt; main] (Suspended)       ThreadGroup.uncaughtException(Thread, Throwable) line: 884      NativeStart.main(String[]) line: not available [native method]  </code></pre>","449070","","114066","","2010-07-06 06:56:53","2010-07-07 23:47:38","ImageView in Android Causing App to Crash","<android>","2","0","1","",""
"3183614","1","3200865","","2010-07-06 05:07:57","5","3803","<p>Has anybody blogged about this comparison, or does anyone want to give it a shot here? Would be nice to see some <strong>reasoned</strong> thoughts on Adobe AIR on Android vs. the ""native"" Android SDK (in Java). </p><p><strong>Edit:</strong> Despite few views and no answers, I'm leaving this question up here since it's a topic that needs to be covered at some point... but if it gets no attention I'll delete it in a few days.</p>","8047","","8047","","2010-07-06 20:59:12","2012-06-18 21:08:52","Android SDK vs. Adobe AIR: Pros and cons?","<android><air>","3","0","3","",""
"3183631","1","","","2010-07-06 05:13:02","4","1898","<p>I have an app that accesses music and I had at least one user complain that some of his songs are on internal storage and that causes a force close.</p><p>My question is do I have to do 2 calls for each song now or can I make a query that will look at both the internal and external memory?</p>","282475","","1765573","","2013-07-26 13:48:45","2013-07-26 13:48:45","Android Internal and External Storage","<android><storage><android-sdcard>","3","0","1","",""
"3183653","1","","","2010-07-06 05:18:04","2","1170","<p>I have a few doubts about view flipper</p><p>I am using viewflipper to go to another view using scroll_leftanimation.</p><p>i have kept 2 linearlayouts inside the ViewFlipper</p><p>now i want 4 views....</p><p>like 1st view contains 3 btns.</p><p>1st btn click -> 2nd view scrolls in -> back pressed 1st view scrollsback2nd btn click -> 3rd view scrolls in -> back pressed 1st view scrollsback3rd btn click -> 4th view scrolls in -> back pressed 1st view scrollsback</p><p>so, how am i going to arrange 4 linearlayouts to work in flipNext ....</p><p>now ideally 2, 3, 4 views are in only second level of navigation. Iwant to draw a line, point or rectangle when 2, 3, 4 views come up,but they all are different shapes. So what would be the method to drawthat ? </p>","384185","","","","","2010-07-06 07:45:01","Android View Flipper Custom Drawing","<android>","1","0","0","",""
"3183756","1","","","2010-07-06 05:40:45","3","9778","<p>I am new to android platform.please help me out how the Broadcast Receiver and Intent Filter   behaves in android.please explain in simple line or with example.thanks in advance...</p>","366916","","","","","2014-01-13 00:15:35","Android-Broadcast Receiver and Intent Filter","<android><broadcastreceiver><intentfilter>","3","1","1","",""
"3183787","1","3184053","","2010-07-06 05:47:34","1","299","<pre><code>public class ImageAdapter extends BaseAdapter {    private Context mContext;    public ImageAdapter(Context c) {        mContext = c;    }</code></pre><p>Here in this code,what does this <strong>Context</strong>  means and what is the purpose of using this?</p>","384193","","384193","","2010-07-06 07:11:46","2012-08-15 07:29:49","Why is Context used in this piece of code?","<android>","1","0","","","2010-07-06 05:49:06"
"3183800","1","3187153","","2010-07-06 05:51:01","1","582","<p>I'm not sure I'm using glDrawTex_OES correctly.  In fact, I'm sure I'm not because I'm getting a black rectangle on the screen rather than the intended texture.</p><p>To get the silly points out of the way:  Yes, the GL Extension string contains the OES_draw_texture token.  Yes, the texture is loaded into memory/etc. correctly: it displays just fine if I map it to a polygon.</p><p>From reading the various bits of <a href=""http://www.khronos.org/registry/gles/extensions/OES/OES_draw_texture.txt"" rel=""nofollow"">documentation I can find</a> for it, it looks like I need to ""configur[e] the texture crop rectangle ... via TexParameteriv() with pname equal to    TEXTURE_CROP_RECT_OES"".  According to <a href=""http://www.khronos.org/message_boards/viewtopic.php?p=2450&amp;sid=5242c63d39af53a2c39769bc0b04ffbf"" rel=""nofollow"">this post</a> in the khronos forums (best documentation google can find for me), the values for that are ""Ucr, Vcr, Wcr, Hcr. That is, left/bottom/width/height""</p><p>Here's the render code:</p><pre><code>void SetUpCamera( int windowWidth, int windowHeight, bool ortho ) // only called once{  glViewport( 0, 0, windowWidth, windowHeight );  glMatrixMode( GL_PROJECTION );  glLoadIdentity();  if( ortho )  {    float aspect = (float)windowWidth / (float)windowHeight;    float halfHeight = 32;    glOrthof( -halfHeight*aspect, halfHeight*aspect, -halfHeight, halfHeight, 1.0f, 100.0f );  }  else  {    mygluPerspective( 45.0f, (float)windowWidth / (float)windowHeight, 1.0f, 100.0f ); // I don't _actually_ have glu, but that's irrelevant--this does what you'd expect.  }}void DrawTexture( int windowWidth, int windowHeight, int texID ){  // Clear back/depth buffer  glClearColor( 1, 1, 1, 1 );  glClearDepth( 1.0f );  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );  // Next 2 lines probably not necessary, but, you know, sanity check:  glMatrixMode( GL_MODELVIEW );  glLoadIdentity();  // set up texture  glBindTexture( GL_TEXTURE_2D, texID ); // texID is the glGenTexture result for a 64x64 2D RGB_8 texture - nothing crazy.  GLint coords [] = {0, 0, 64, 64};  glTexParameteriv( GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, coords );  // blit? =(  glDrawTexiOES( windowWidth / 2 - 32, windowHeight - 70, 10, 64, 64 );}</code></pre><p>Am I missing something obvious?  Doing anything just plain dumb?</p>","37834","","37834","","2010-07-06 14:33:26","2010-07-06 14:33:26","Problems with glDrawTex_OES","<android><opengl-es><textures><android-ndk><texture2d>","1","0","","",""
"3183814","1","3183990","","2010-07-06 05:55:18","0","3113","<p>I am trying to add ListView items one by one. So if I have say -- 60 items -- the application would add the views to the list view one at a time -- thus showing the user that the application is loading more things. </p><p>This is my code: </p><pre><code>try {        JSONArray j = getTaggsJSON();        Log.v(TAG, String.valueOf(j.length()));        a = new createSpecialAdapter(this, R.layout.individual_tagg_view,                R.layout.list_item, view, j);        ListView v = this.getListView();        v.setStackFromBottom(true);        setListAdapter(a);        new addViewsToList().execute(j);    } catch (UnknownHostException e) {        e.printStackTrace();    } catch (JSONException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    } catch (ServiceException e) {        e.printStackTrace();    }}private class addViewsToList extends AsyncTask&lt;JSONArray, View, List&lt;View&gt;&gt; {    protected List&lt;View&gt; doInBackground(JSONArray... jsonArrays) {        List&lt;View&gt; v = new ArrayList&lt;View&gt;();        Log.v(TAG, String.valueOf(jsonArrays[0].length()));        for (int x = 0; x &lt; jsonArrays[0].length(); x++) {            try {                Log.v(TAG, jsonArrays[0].getJSONObject(x).toString());                v.add(ViewAdapter.createTaggView(jsonArrays[0]                        .getJSONObject(x), c));            } catch (JSONException e) {                e.printStackTrace();            }            publishProgress(v.get(x));        }        return v;    }    protected void onProgressUpdate(View... v) {        Log.v(TAG, ""I'm updating my progress!"");        a.notifyDataSetChanged();    }    protected void onPostExecute(List&lt;View&gt; views) {        Log.v(TAG, ""i'm done!"");        Log.v(TAG, String.valueOf(views.size()));    }}</code></pre><p>So, it looks like my code is printing out the views correctly, and putting them in the list correctly, however my activity displays nothing. What am I doing wrong? I thought setting the adapter before -- when there are no views in the list -- and then updating the adapter that the list was changed was the right way to go.... Obviously not.. Can anyone help me?</p><p>If you need clarification on my questions please let me know. </p><p>EDIT: Here is the adapter code to supplement my question. </p><pre><code>private class SpecialAdapter extends ArrayAdapter&lt;JSONArray&gt; {    JSONArray json;    public SpecialAdapter(Context context, int textViewResourceId,            int listItem, JSONArray j) {        super(context, textViewResourceId);        this.json = j;    }    public View getView(int position, View convertView, ViewGroup parent) {        ViewHolder holder;        Log.v(TAG,""I'm inside the getView method."");        try {            JSONObject info = json.getJSONObject(position);            Log.v(TAG,info.toString());        if (convertView == null) {            LayoutInflater i = (LayoutInflater) RecentTaggs.this                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);            convertView = i.inflate(R.layout.individual_tagg_view, parent,                    false);            holder = new ViewHolder();            holder.username = (TextView) convertView                    .findViewById(R.id.userName);            holder.review = (TextView)convertView.findViewById(R.id.review_text);            convertView.setTag(holder);        } else {            holder = (ViewHolder) convertView.getTag();        }        holder.review.setText(info.getString(""review""));        return convertView;        } catch (JSONException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        return null;    }}</code></pre><p>My output doesn't output any of my Log.v statements, and doesn't show that its even inside the GetView method. </p>","354247","","114066","","2012-01-27 08:47:14","2012-01-27 08:47:14","Use AsyncTask to add items to list view individually","<android><android-listview><android-asynctask>","1","2","1","",""
"3183932","1","3184080","","2010-07-06 06:16:24","4","11888","<p>I am newbie to android. I have client server based application. Server keeps on sending the update notifications to client after every single minute and at client side my app receive those updates and display it using Toast. But now my problem is whenever my client app goes into the background server keeps on sending the update notifications and my client display it as if the application is in foreground. I am not getting how to check that application is running in background.  </p>","212688","","114066","","2010-07-06 06:40:02","2013-12-24 09:10:38","android:how to check if application is running in background","<android>","3","0","2","",""
"3183945","1","3185398","","2010-07-06 06:19:33","2","1745","<p>i'm porting android to an overo gumstix. thus it seems the the omapfb driver has some problems on that platform. it doesn't matter at all, because i want to use udlfb (a driver for usb displays) anyway.</p><p>till today, i wasn't able to figure out how i can define udlfb as default framebuffer.tried <code>make menuconfig</code> and select udlfb there, but no changes when booting the fresh compiled kernel. omapfb still wants to come up.</p><ul><li>so my final question: how do i definethe default framebuffer driver for anandroid kernel?</li></ul><p>thank you for any suggestions to this :-)</p>","368959","","","","","2010-07-06 10:26:02","How to change default framebuffer for Android?","<android><default><framebuffer>","1","0","","",""
"3183957","1","3184031","","2010-07-06 06:21:29","0","570","<p>I have a main class which extends Activity which should spawn a ListActivity and obtain the selection made.So I have an onListItemClick() in the class which extends ListActivity which accepts the selection via getItemAtPosition.</p><p>This ListActivity is started by startActivityForResult.</p><p>Now, since I have already obtained the result in onListItemClick, why do I need onActivityResult() ?? what does it do? </p><p>and where does the intent come in?</p>","381699","","114066","","2010-07-06 06:30:37","2010-07-06 06:38:47","need for onActivityResult() when result is already obtained by onListItemClick()","<android><android-intent>","1","0","","",""
"3184110","1","","","2010-07-06 06:56:33","1","336","<p>I am going to develop a calculator on android platform, it is fine in calculating numbers less than 1000000, when I tried to add 1000000 with 0, the result is ""1.0000E7""?!I try to change the type of result from float to double, but the problem is still here, I try to use long, result becomes normal, but it cannot calculate decimal place anymore....</p>","384248","","114066","","2010-07-06 07:02:23","2010-07-06 07:53:33","Problem in using float on Android","<java><android>","3","2","","",""
"3184196","1","3184237","","2010-07-06 07:09:26","0","250","<p>I need to start an Activity with two different Intent, can I define two Intents In an Activity node?</p><p>An real example is: in my <strong>current</strong> application, I want to start an <strong>main Activity</strong> in another android application, how can I implement such requirement?</p><p>can I add another <strong>Intent-Filter</strong> in the following <strong>Activity</strong> Node?</p>","258500","","","","","2010-07-06 07:16:05","define two intent in An Activity","<android><activity><intentfilter>","1","0","","",""
"3184288","1","","","2010-07-06 07:26:23","0","45","<p>I am developing a Puzzle in Android.The puzzle is something like finding a number.It contains 7 steps.Here I use 7 xml filesEach file is meant for some operationsThe 7th file displays the output.There is a Try again button in the 7th file and when the user clicks on that button, it should  call the 1st xml file and repeat the same process again.The code for that navigation is something like:setcontentView(R.layout.main1); where main1 is the 1st xml file.</p><p>The problem is that, the control goes to the 1st file but the processes can't be repeated.ie. the controls inside that page will be in inactive state.</p><p>Can any one give some suggestions here?</p>","374905","","","","","2010-07-06 07:35:55","Android and XML Usage","<android>","1","0","","",""
"3184300","1","3184894","","2010-07-06 07:28:49","3","6676","<p>I defined an application which is only used from my other application. So I would like to hide the icon of this application, so that the user can't see it on the desktop of his phone (or how do you call the thing where all apps are listed?). My manifest file looks the following way:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""xyz.games.pacman.controller""      android:versionCode=""1""      android:versionName=""1.0""&gt;      &lt;uses-permission android:name=""android.permission.BLUETOOTH""/&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".PacmanGame""                  android:label=""@string/app_name""                  android:screenOrientation=""portrait""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""pacman.intent.action.Launch"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;         &lt;receiver android:name=""xyz.games.pacman.network.MessageListener""&gt;         &lt;intent-filter&gt;            &lt;action android:name=""xyz.games.pacman.controller.BROADCAST"" /&gt;            &lt;/intent-filter&gt;         &lt;/receiver&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre><p>I already read this question:</p><p><a href=""http://stackoverflow.com/questions/1063604/how-to-hide-an-application-icon-in-android-emulator"">http://stackoverflow.com/questions/1063604/how-to-hide-an-application-icon-in-android-emulator</a></p><p>but if i just remove the line </p><pre><code>&lt;category android:name=""android.intent.category.DEFAULT"" /&gt;</code></pre><p>in my manifest, the activity isn't working at all (ActivityNotFoundException in the calling activity).</p><p>Any hints how to solve this problem? I already tried android.intent.category.EMBEDDED but this doesn't work too.</p><p>In the Internet I found CommonsWare answer <a href=""http://osdir.com/ml/Android-Developers/2010-06/msg03617.html"" rel=""nofollow"">http://osdir.com/ml/Android-Developers/2010-06/msg03617.html</a> that it can be done using PackageManager. Unfortunately, it isn't explained how exactly and I couldn't find a solution by browsing the PackageManager API.</p>","","anon","","anon","2010-07-06 08:14:24","2011-07-21 18:16:31","How to hide application icon from the Android Desktop?","<android><manifest>","4","0","2","",""
"3184318","1","3257127","","2010-07-06 07:32:16","1","3563","<p>I'm having trouble getting the GPS's onLocationChanged to run on a different thread. I understand how to manage UI thread when I'm calling a function but with the GPS, I don't actively call the function. </p><p>My intent is to have a light flash every time the GPS receives a reading. I have put this function in a Runnable. I passed this function to a class that implements LocationListener. Then in the main class, I started a new thread that calls requestLocationUpdates. I was hoping that onLocationChanged of the LocationListener would run in a different thread, post to the callback and make the necessary UI effects in the UI thread. Unfortunately, the program crashes every time it tries to call requestLocationUpdates. What's the proper way of doing it?</p><p>Right now it looks something like this</p><p>Main class:</p><pre><code>final Runnable changeLight = new Runnable(){        public void run(){            // do stuff        }    };    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.capture);        status = (ImageView) findViewById(R.id.status);        database = new DatabaseManager(this);        new Thread(){            public void run(){                location = (LocationManager) getSystemService(LOCATION_SERVICE);                listener = new GPSManager(database, changeLight, light, status);                location.requestLocationUpdates(""gps"", 10000L, 0, listener);            }        }.start();    }</code></pre><p>LocationListener class:</p><pre><code>public void onLocationChanged(Location location) {        if (location.getAccuracy() &lt;= 32.0){            light = lightColors.Green;            status.post(callback);            database.insertData(location);        }        else{            light = lightColors.Yellow;            status.post(callback);        }    }</code></pre><p>The exception says Can't create handler inside thread that has not called Looper.prepare()</p>","167638","","167638","","2010-07-06 16:48:43","2012-06-06 12:02:53","Android GPS Callback off UI Thread","<java><android><multithreading><user-interface><gps>","3","0","1","",""
"3184463","1","6754871","","2010-07-06 07:58:20","0","1835","<p>Im getting a IOExeption 'Host is unresolved' on HttpPost. The Endpoint in this case a a computer on my LAN with a webservice. (http://pc259:8080/test/service.asmx). Im using WIFI to my LAN. Does Android know to to resolved computernames?</p><pre><code>StringEntity se = new StringEntity(xmlDataToSend);se.setContentType(""text/xml"");HttpPost httppost = new HttpPost(endPoint);     httppost.setHeader(""Content-Type"",""application/soap+xml"");httppost.setEntity(se);         HttpClient httpclient = new DefaultHttpClient();Log.i(TAG, "" - Before execute"");httpResponse = (BasicHttpResponse) httpclient.execute(httppost);</code></pre>","111093","","","","","2011-07-19 22:27:00","Host is unresolved in LAN","<android><host><unresolved><http-post>","2","3","","",""
"3184528","1","12775271","","2010-07-06 08:08:53","0","1014","<p>GridView gridview = (GridView) findViewById(R.id.gridview);    gridview.setAdapter(new ImageAdapter(this));</p><p>The typical use of this keyword is that it refers to the current object,but in this example what it refers?</p>","384193","","","","","2012-10-08 04:20:31","why is ""this"" keyword used within the setAdapter method in this snippet ?What does it refer?","<android>","3","0","","","2010-07-06 08:09:18"
"3184616","1","","","2010-07-06 08:25:40","0","468","<p>I've been trying to extend my phone profile app to be able to handle the phone's default ringtone.</p><p>When setting my app to use the default ringtone with a system default one, it sets fine. When I try to set a default ringtone which is on /sdcard, the Uri goes in correctly, but when it comes to setting it, it only pulls out the pointer to the devices Settings.System setting which doesn't seem to point to my ringtone media.</p><p>Usually, when setting a system default one, it Toast's the name and Uri as it sets, with no issue, but with an external one, says ""Unknown ringtone"" and the Uri shows us the pointer to the system setting).</p><p>I'm using <code>RingtoneManager.getDefaultType()</code> to get the Uri, then <code>setActualDefaultRingtoneUri()</code> to set it.</p>","320482","","320482","","2010-07-08 14:22:12","2012-11-28 21:43:15","Default ringtone on SD CARD: will not find audio","<android><ringtone><sd-card>","1","0","","",""
"3184672","1","3185328","","2010-07-06 08:35:28","3","4283","<pre>gridview.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView parent, View v, int position, long id) {            Toast.makeText(HelloGridView.this, """" + position, Toast.LENGTH_SHORT).show();        }    });</pre>","384193","","384193","","2010-07-06 08:43:57","2011-01-05 09:06:51","What is the AdapterView<?> means in the OnitemClick() Method?What is the use of other parameters in it?","<android>","2","2","","","2010-07-06 08:35:42"
"3184678","1","","","2010-07-06 08:36:06","11","954","<p>I'm trying to implement both <a href=""http://d.android.com/guide/topics/search/adding-recent-query-suggestions.html"" rel=""nofollow"">recent suggestions</a> and <a href=""http://d.android.com/guide/topics/search/adding-custom-suggestions.html"" rel=""nofollow"">custom suggesions</a> in global search in the same application. They both use the same path in the provider so it doesn't seem like it is possible to return different results for them. For example just recent searches for suggestions and real search results in the Quick Search Box.</p><p>Any idea on how to do this?</p>","253583","","","","","2011-07-17 16:54:39","How to handle both Quick Search Box results and recent suggestions for search?","<java><android>","2","2","3","",""
"3184727","1","3185194","","2010-07-06 08:43:52","0","231","<p>How do I make fields accessible across a package? Currently, even if they are declared public i'm not able to access the fields from another class in the same package.</p>","381699","","243782","","2010-07-06 09:30:59","2010-07-07 09:37:08","accessing fields across a package","<java><android>","2","6","","",""
"3184853","1","3184875","","2010-07-06 09:01:17","0","217","<pre>Toast.makeTest(HelloGridView.this,""Text to be displayed"",Toast.LENGTH.SHORT).show();</pre><p>What is the 'HelloGridView.this' refers? why it is called as appliactioncontext?</p>","384193","","","","","2010-07-06 09:04:16","What is the applicationcontext in makeTest() Method, please explain with the following snippet","<android>","1","2","","","2010-07-06 09:01:27"
"3184860","1","","","2010-07-06 09:02:03","1","1333","<p>I am working with an edit text to support the properties of bold,italic and underline.I got succeed after selecting the text and clicking on bold my text was bold.Now what my requirement is how to remove the bold again after selecting the text and clicking on bold button.</p><p>Regards, Bhavani.G</p><hr><p>Thank you for the reply.Actually, What my need  is if i select some text and clicking on Bold button(I have implemented this with spannable)in edit text/autocomplete text view my text is becoming bold.</p><p>Now,Again selecting the bolded text and by clicking on the bold button it should become normal text.</p><p>To achieve this i should know my text is in bold.How to do this??</p><p>Regards,</p><p>vani </p>","342873","","267","","2011-06-13 07:41:59","2012-02-01 16:54:48","Spannable of android","<android>","2","1","","",""
"3185010","1","3186362","","2010-07-06 09:26:53","0","714","<p>I am new to Android development and have trouble enabling / disabling the wifi &amp; audio services. I get the appropriate manager instance using the getSystemService method. But I don't get any error when enabling wifi using:</p><pre><code>wifiMgr.setWifiEnabled(true);           </code></pre><p>But the wifi is simply not turned on! Similarly I use</p><pre><code>mAudio.setRingerMode(AudioManager.RINGER_MODE_SILENT);ormAudio.setRingerMode(AudioManager.RINGER_MODE_NORMAL);</code></pre><p>But the phone doesn't go to silent mode! Here is my complete code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    try{                final ToggleButton bt = (ToggleButton)findViewById(R.id.bluetooth_button);    final ToggleButton wf = (ToggleButton)findViewById(R.id.wifi_button);    final ToggleButton sb = (ToggleButton)findViewById(R.id.sound_button);    // Check Audio    AudioManager mAudio = (AudioManager) getSystemService(Activity.AUDIO_SERVICE);    soundStatus = mAudio.getRingerMode();    if(soundStatus == AudioManager.RINGER_MODE_NORMAL)        sb.setChecked(true);          // Check WiFi    WifiManager wifiMgr =   (WifiManager) getSystemService(Context.WIFI_SERVICE);    wifiStatus = wifiMgr.isWifiEnabled();    if(wifiStatus)        wf.setChecked(true);          sb.setOnClickListener(new OnClickListener() {                   public void onClick(View v) {            try {                TextView tv = (TextView) findViewById(R.id.result);                 AudioManager mAudio = (AudioManager) getSystemService(Activity.AUDIO_SERVICE);                if(sb.isChecked()) {                    mAudio.setRingerMode(AudioManager.RINGER_MODE_NORMAL);                    tv.setText(""Ringer set to Normal"");                } else {                    mAudio.setRingerMode(AudioManager.RINGER_MODE_SILENT);                    tv.setText(""Ringer set to Silent"");                }            }catch (Exception e) {                e.printStackTrace();            }        }    });    bt.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            try {                TextView tv = (TextView) findViewById(R.id.result);                             if(bt.isChecked())                    tv.setText(""Bluetooth is On!"");                else                    tv.setText(""Bluetooth is Off!"");            } catch (Exception e) {                e.printStackTrace();            }        }    });    wf.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            try {                TextView tv = (TextView) findViewById(R.id.result);                WifiManager wifiMgr =   (WifiManager) getSystemService(Context.WIFI_SERVICE);                if(wf.isChecked()) {                    wifiMgr.setWifiEnabled(true);                                           tv.setText(""Wifi is On!"");                                      } else {                    wifiMgr.setWifiEnabled(false);                    tv.setText(""Wifi is Off!"");                                     }            } catch (Exception e) {                e.printStackTrace();            }        }    });    }catch (Exception e) {        e.printStackTrace();    }}</code></pre><p>I have added the following permissions:</p><pre><code>&lt;uses-permission android:name=""android.permission.CHANGE_WIFI_STATE"" /&gt;&lt;uses-permission android:name=""android.permission.MODIFY_AUDIO_SETTINGS"" /&gt;</code></pre><p>I am using Motorola milestone (android 2.1).. What Am I missing? can anybody point me what is wrong with this code?<br>Thanks in Advance for suggestions and corrections.</p>","185655","","185655","","2010-07-06 10:14:02","2010-07-06 13:02:22","Trouble in Enabling and Disabling services in Android","<android>","1","1","","",""
"3185019","1","","","2010-07-06 09:28:58","1","209","<p>I have a jni module. This module has to link with another .so file.How to wrote my Android.mk?Can I use PRODUCT_COPY_FILES ? It seems this also cause some variable cannot be resolved at compiling time.</p>","206630","","","","","2010-07-06 09:28:58","link another shared library in jni module","<android>","0","0","","",""
"3185103","1","3185895","","2010-07-06 09:40:32","37","41628","<p>I have some problems finding the documentation of the definitions of shapes in XML for Android. I would like to define a simple circle filled with a solid color in an XML File to include it into my layout files. </p><p>Sadly the Documentation on android.com does not cover the XML attributes of the Shape classes. I think I should use an <a href=""http://developer.android.com/reference/android/graphics/drawable/shapes/ArcShape.html"">ArcShape</a> to draw a circle but there is no explanation on how to set the size, the color, or the angle needed to make a circle out of an Arc.</p>","114066","","","","","2014-01-05 23:09:10","How to define a circle shape in an android xml drawable file?","<android><shape>","5","2","6","",""
"3185174","1","","","2010-07-06 09:51:26","0","3737","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2182578/marquee-text-in-android"">marquee text in android</a>  </p></blockquote><p>can we have ticker in android</p>","383640","","","","","2011-01-17 10:35:43","ticker in android","<android>","1","0","2","2011-08-17 10:39:29",""
"3185237","1","6159713","","2010-07-06 10:01:22","6","3200","<p>How can I set backgrounds for each key on the android keyboard.<strong>KeyboardView android:keyBackground</strong> provides one background for all keys. But I want to set different backgrounds for every key.</p>","384328","","","","","2012-10-07 13:15:44","Android keyboard. Key's background","<android><keyboard>","3","1","","",""
"3185264","1","","","2010-07-06 10:05:54","1","3229","<p>I have tried with zero success to get a USB debug connection from a WinXP dev box to a brand X Android 1.6 tablet. I believe I had everything configured correctly on the Android and installed correctly on the dev box, but when the two are connected with a USB cable NOTHING HAPPENS; i.e. Windows finds no new hardware much less a new USB device; therefore, I cannot then install the Android SDK USB drivers on Windows and do the debug thing with Eclipse. </p><p>Either the mfg of the Android tablet device has disabled USB debugging and just didn't remove the UI that appears to enable it -- or I've left out some crucial step(s). (The device manual is 100% Chinese and I'm 0% Chinese, so it's no help. The tablet is very nearly, but not, the model A84 7"" touch screen 'laptop' at 'www.lezestar.com' in case this helps.)</p><p>On the tablet:</p><p>• 'Settings/Application/Development/USB Debugging' is enabled. </p><p>• Tried 'Settings/Application/Development/Allow mock locations' enabled and not.</p><p>• Has 500MB internal flash 'hard disk'</p><p>• Has installed 2G SD card</p><p>• Firmware: 1.6</p><p>• Kernel:   2.6.29-002360g4f8dbbb-dirty</p><p>• Build No: 1.7.3</p><p>On Dev box:</p><p>• Windows XP SP3</p><p>• Device Manager finds no 'new hardware' when XP&lt;-->Android USB cable is connected.</p><p>• Neither USBDeview.exe (Nirsoft) nor USBView.exe (Microsoft) find any evidence of connection with the Android</p><p>• Eclipse Galileo (3.5.2) with Android SDK (for 1.6) and ADV Manager.</p><p>• USB Driver package, rev 3. downloaded using ADV Manager.</p><p>Other:</p><p>• USB ports on both Tablet and dev box successfully connect a USB mouse.</p><p>• Tablet and Windows XP have been rebooted often.</p><p>Is permanently disabling debugging something that Android manufacturors are allowed to do and therefore I'm trying something that can't be done?</p><p>If the mfg has 'disabled' debugging, is there a way to work around this; e.g. download a tool that can change Android OS configuration to reenable it?</p><p>Thanks in advance for ideas on what I've missed or could try. </p><p>Paul S...</p>","384369","","","","","2014-04-05 21:50:08","Device Manager fails to find Android debug USB connection","<android><debugging><connection><usb><failed-installation>","2","0","","",""
"3185318","1","","","2010-07-06 10:15:50","2","393","<p>I have a specific problem. I need to make openintents sensor simulator workon 2.1 emulator. Does anyone has an advice on how to pass around deprecated code and make it work on emulator 2.1. Ty in advance for any help or advice you might have.</p>","384408","","384408","","2010-07-06 12:44:22","2011-06-01 13:05:57","Sensor simulator on 2.1","<android><android-emulator>","1","0","1","",""
"3185422","1","","","2010-07-06 10:30:21","0","566","<p>My project is working fine when i hold my HTC device vertical.But the moment i rotate my screen 90degrees , it throws a force close error.Starts all over again, runs fine untill i again change the orientation.</p><p>How do i handle it ?</p>","344768","","","","","2011-05-30 19:51:04","Handling Screen Orientation","<android>","2","1","","",""
"3185444","1","3185824","","2010-07-06 10:34:18","117","66050","<p>I tried to reinstall an apk</p><pre><code>$adb install -r new.apk</code></pre><p>And it shows the error:</p><pre><code>Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]</code></pre><p>One solution is to uninstall and install the new.apk, that works fine.</p><p>But I'm wondering whether I could re-build an apk and re-install without the uninstallation. Eg. change some config in the AndroidManifest.xml, or not sign the APK, etc.</p><p>It would be great appreciated if you could tell me the whole meaning of the ""INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES"".</p>","234939","","","","","2013-10-16 14:52:23","How to deal with INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES without uninstallation","<android>","6","0","18","",""
"3185559","1","","","2010-07-06 10:52:23","1","628","<p>I'm trying to save an object in a file but the file doesn't appear on the device and I don't get an exception either.</p><pre><code>public static void save(Context ctx) {    Log.i(""App serialization"", ""Saving to settings.ser: "" + ctx.getFileStreamPath(""settings.ser""));    FileOutputStream fos = null;    ObjectOutputStream out = null;    try {        fos = ctx.openFileOutput(""settings.ser"", Context.MODE_PRIVATE);        out = new ObjectOutputStream(fos);        out.writeObject(ApplicationData.settings);        out.flush();        out.close();        //fos.close();        Log.i(""App serialization"", ""Finished writing to settings.ser"");    }    catch(IOException ex) {        ex.printStackTrace();        Log.e(""App serialization"", ""Could not save to settings.ser"");    }}</code></pre><p>If instead I use:</p><pre><code>try {        fos = new FileOutputStream(""/data/data/APP_PACKAGE/settings.ser"");        out = new ObjectOutputStream(fos);</code></pre><p>It works and I can see that the file has been created on the device.</p><p>But this isn't cool and it's not the way to do it because the directory structure may change in the future. </p>","91226","","","","","2010-07-06 12:01:51","android: can't write to files dir but can in package dir","<android><serialization><file>","1","2","","",""
"3185570","1","3185613","","2010-07-06 10:54:02","0","544","<p>How would I rotate a view in degrees? I've got the following code setting up my view...</p><pre><code>                   public class GLLayer extends GLSurfaceView implements SurfaceHolder.Callback,    Camera.PreviewCallback, Renderer {int onDrawFrameCounter=1;int[] cameraTexture;byte[] glCameraFrame=new byte[256*256]; //size of a texture must be a power of 2FloatBuffer cubeBuff;FloatBuffer texBuff;public float startbear;public GLLayer(Context c) {    super(c);    this.setEGLConfigChooser(8, 8, 8, 8, 16, 0);    this.setRenderer(this);    this.getHolder().setFormat(PixelFormat.TRANSPARENT);}public void onDrawFrame(GL10 gl) {    onDrawFrameCounter++;    gl.glEnable(GL10.GL_TEXTURE_2D);    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    bindCameraTexture(gl);    gl.glLoadIdentity();    GLU.gluLookAt(gl, 0, 0, 4.2f, 0, 0, 0, 0, 1, 0);    //gl.glRotatef(onDrawFrameCounter,1,0,0); //Rotate the camera image    //gl.glRotatef((float)Math.sin(onDrawFrameCounter/20.0f)*40,0,1,0); //Rotate the camera image    //gl.glRotatef((float)Math.cos(onDrawFrameCounter/40.0f)*40,0,0,1); //Rotate the camera image    gl.glNormal3f(0,0,1);    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);              gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 4, 4);    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 8, 4);    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP,12, 4);    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP,16, 4);    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP,20, 4);}public void onSurfaceChanged(GL10 gl, int width, int height) {    gl.glViewport(0, 0, width, height);    float ratio = (float) width / height;    gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glLoadIdentity();    gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10);    gl.glMatrixMode(GL10.GL_MODELVIEW);    gl.glLoadIdentity();    GLU.gluLookAt(gl, 0, 0, 4.2f, 0, 0, 0, 0, 1, 0);        }public void onSurfaceCreated(GL10 gl, EGLConfig config) {    startbear = Global.bearing;    gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);    gl.glClearColor(0, 0, 0, 0);    gl.glEnable(GL10.GL_CULL_FACE);    gl.glShadeModel(GL10.GL_SMOOTH);    gl.glEnable(GL10.GL_DEPTH_TEST);    cubeBuff = makeFloatBuffer(camObjCoord);    texBuff = makeFloatBuffer(camTexCoords);            gl.glVertexPointer(3, GL10.GL_FLOAT, 0, cubeBuff);    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, texBuff);    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);}   /** * Generates a texture from the black and white array filled by the onPreviewFrame * method. */void bindCameraTexture(GL10 gl) {    synchronized(this) {        if (cameraTexture==null)            cameraTexture=new int[1];        else            gl.glDeleteTextures(1, cameraTexture, 0);        gl.glGenTextures(1, cameraTexture, 0);        int tex = cameraTexture[0];        gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);        gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_LUMINANCE, 256, 256,   0, GL10.GL_LUMINANCE, GL10.GL_UNSIGNED_BYTE, ByteBuffer.wrap(glCameraFrame));        gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);    }}/** * This method is called if a new image from the camera arrived. The camera * delivers images in a yuv color format. It is converted to a black and white * image with a size of 256x256 pixels (only a fraction of the resulting image * is used). Afterwards Rendering the frame (in the main loop thread) is started by * setting the newFrameLock to true.  */public void onPreviewFrame(byte[] yuvs, Camera camera) {            int bwCounter=0;    int yuvsCounter=0;    for (int y=0;y&lt;160;y++) {        System.arraycopy(yuvs, yuvsCounter, glCameraFrame, bwCounter, 240);        yuvsCounter=yuvsCounter+240;        bwCounter=bwCounter+256;    }}FloatBuffer makeFloatBuffer(float[] arr) {    ByteBuffer bb = ByteBuffer.allocateDirect(arr.length*4);    bb.order(ByteOrder.nativeOrder());    FloatBuffer fb = bb.asFloatBuffer();    fb.put(arr);    fb.position(0);    return fb;}final static float camObjCoord[] = new float[] {            // FRONT             -2.0f, -1.5f,  12.0f,              2.0f, -1.5f,  12.0f,             -2.0f,  1.5f,  12.0f,              2.0f,  1.5f,  12.0f,             // BACK             -2.0f, -1.5f,  8.0f,             -2.0f,  1.5f,  8.0f,              2.0f, -1.5f,  8.0f,              2.0f,  1.5f,  8.0f,             // LEFT             -2.0f, -1.5f,  12.0f,             -2.0f,  1.5f,  12.0f,             -2.0f, -1.5f,  8.0f,             -2.0f,  1.5f,  8.0f,             // RIGHT              2.0f, -1.5f,  8.0f,              2.0f,  1.5f,  8.0f,              2.0f, -1.5f, 12.0f,              2.0f,  1.5f, 12.0f,             // TOP             -2.0f,  1.5f, 12.0f,              2.0f,  1.5f, 12.0f,             -2.0f,  1.5f,  8.0f,              2.0f,  1.5f,  8.0f,             // BOTTOM             -2.0f, -1.5f, 12.0f,             -2.0f, -1.5f,  8.0f,              2.0f, -1.5f, 12.0f,              2.0f, -1.5f,  8.0f,        };        final static float camTexCoords[] = new float[] {            // Camera preview             0.0f, 0.0f,             0.9375f, 0.0f,             0.0f, 0.625f,             0.9375f, 0.625f,            // BACK             0.9375f, 0.0f,             0.9375f, 0.625f,             0.0f, 0.0f,             0.0f, 0.625f,            // LEFT             0.9375f, 0.0f,             0.9375f, 0.625f,             0.0f, 0.0f,             0.0f, 0.625f,            // RIGHT             0.9375f, 0.0f,             0.9375f, 0.625f,             0.0f, 0.0f,             0.0f, 0.625f,            // TOP             0.0f, 0.0f,             0.9375f, 0.0f,             0.0f, 0.625f,             0.9375f, 0.625f,            // BOTTOM             0.9375f, 0.0f,             0.9375f, 0.625f,             0.0f, 0.0f,             0.0f, 0.625f                };                  }</code></pre><p>I'm looking to change my view in degrees.. how would I do so? I assume I'd use <code>glrotate</code> but how would I? (only on the x axis)</p><p>// Just a clarification that I'm in fact looking to do a view transformation so that the world around me would rotate X degrees depending on orientation of the camera device.</p>","358438","","358438","","2010-07-06 13:49:58","2010-07-06 13:49:58","rotate Viewing transformation in degree's (only on the x axis)","<java><android><opengl-es>","1","0","","",""
"3185697","1","3185946","","2010-07-06 11:14:52","1","1707","<p>I have thread in ""onCreate"" which is getting content from web. While the content is getting, I have progress dialog.</p><pre><code>new Thread() {     public void run() {     Get_content() ;    handler.sendEmptyMessage(0);     }     }.start();</code></pre><p>But if I rotate the display (to landscape mode) while this is running, my application gets Force close . In the log I have this:""thread main exiting due to uncaught exception""</p><p>Here is my log:</p><blockquote>  <p>W/dalvikvm(17144): threadid=3: thread exiting with uncaught exception (group=0x40013140)  E/AndroidRuntime(17144): Uncaught handler: thread main exiting due to uncaught exception  E/AndroidRuntime(17144): java.lang.IllegalArgumentException: View not attached to window manager  E/AndroidRuntime(17144): at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:356)  E/AndroidRuntime(17144): at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:201)  E/AndroidRuntime(17144): at android.view.Window$LocalWindowManager.removeView(Window.java:400)  E/AndroidRuntime(17144): at android.app.Dialog.dismissDialog(Dialog.java:268)  E/AndroidRuntime(17144): at android.app.Dialog.access$000(Dialog.java:69)  E/AndroidRuntime(17144): at android.app.Dialog$1.run(Dialog.java:103)  E/AndroidRuntime(17144): at android.app.Dialog.dismiss(Dialog.java:252)  E/AndroidRuntime(17144): at com.webservice.KursnaLista$1.handleMessage(KursnaLista.java:77)  E/AndroidRuntime(17144): at android.os.Handler.dispatchMessage(Handler.java:99)  E/AndroidRuntime(17144): at android.os.Looper.loop(Looper.java:123)  E/AndroidRuntime(17144): at android.app.ActivityThread.main(ActivityThread.java:3948)  E/AndroidRuntime(17144): at java.lang.reflect.Method.invokeNative(Native Method)  E/AndroidRuntime(17144): at java.lang.reflect.Method.invoke(Method.java:521)  E/AndroidRuntime(17144): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)  E/AndroidRuntime(17144): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)  E/AndroidRuntime(17144): at dalvik.system.NativeStart.main(Native Method)  I/dalvikvm(17144): threadid=7: reacting to signal 3  I/ActivityManager(   59): Process com.webservice (pid 17144) has died.</p></blockquote>","346665","","1288","","2011-08-03 17:34:44","2011-08-03 17:34:44","Android thread main exiting","<java><android><multithreading>","1","3","","",""
"3185818","1","","","2010-07-06 11:36:02","1","555","<p>I was wondering if it's possible to get the icon (shortcut) of your app on the home screen during installation instead of inside the standard apps folder ?And I did find out that Android has AppWidgets but I was wondering if it supports ""standard"" widgets as well (javascript/html/css) ?</p>","162147","","1288","","2010-07-06 12:33:53","2010-07-06 12:33:53","Getting App/Widget on Homescreen?","<android><homescreen><appwidget>","1","1","","",""
"3185922","1","","","2010-07-06 11:53:59","0","2363","<p>My objective is to run a glowing animation on an image.I am changing the image alpha to produce this effect.</p><p>I have used basic AlphaAnimation provided in android framework but found that its slowing down other animations. So i extended a class from SurfaceView and created a thread to update it. ( Again here, i am manipulating alpha of the image ).</p><p>Everything seems fine, except that i am not able to draw a transparent image onto SurfaceView.Its showing black color on the transparent areas of the bitmap.</p><pre><code>Canvas mCanvas = holder.lockCanvas(null);Bitmap mybit = BitmapFactory.decodeResource(mFrameLayout.getResources(), R.drawable.icon);mCanvas.drawColor(0, Mode.CLEAR);mCanvas.drawBitmap(mybit, 0, 0, null);holder.unlockCanvasAndPost(mCanvas);</code></pre><p>Thanks in advance.</p>","226946","","235654","","2010-07-06 12:58:27","2011-01-28 00:49:54","Draw a transparent image on surface view","<android><surfaceview>","2","1","","",""
"3185967","1","","","2010-07-06 12:00:04","1","1503","<p>I need to have 2 different images in one view. The <strong><em>GraphicsView(this)</em></strong> is supposed to be an animation (actually an image that rotates it self in the center of the view) and <strong><em>R.layout.main</em></strong> is supposed to be the background of the view (a static image again on the top of the view)</p><p>What I need is an imageview on the top of the view and bellow the animation view I have</p><pre><code>    public class spinball extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(new GraphicsView(this));        setContentView(R.layout.main);}    private static class GraphicsView extends View {        private Bitmap ball;            private int XOffset;            private int YOffset;        private Animation anim;        public GraphicsView(Context context) {            super(context);            ball = BitmapFactory                    .decodeResource(getResources(), R.drawable.ball);            XOffset = ball.getWidth() / 2;            YOffset = ball.getHeight() / 2;        }        private void createAnim(Canvas canvas) {            anim = new RotateAnimation(0, 360, canvas.getWidth() / 2, canvas                    .getHeight() / 2);            anim.setRepeatMode(Animation.RESTART);            anim.setRepeatCount(Animation.INFINITE);            anim.setDuration(10000L);            anim.setInterpolator(new AccelerateDecelerateInterpolator());            startAnimation(anim);        }        @Override        protected void onDraw(Canvas canvas) {            super.onDraw(canvas);            // creates the animation the first time            if (anim == null) {                createAnim(canvas);            }            Path circle = new Path();            int centerX = canvas.getWidth() / 2;            int centerY = canvas.getHeight() / 2;            int r = Math.min(centerX, centerY);            circle.addCircle(centerX, centerY, r, Direction.CW);            Paint paint = new Paint();            canvas.drawBitmap(ball, centerX - jobsXOffset,                    centerY - jobsYOffset, null);        }    }}</code></pre><p>main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    &gt;    &lt;ImageView android:src=""@drawable/static_image""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:background=""#FFFFFF""       /&gt;&lt;/LinearLayout&gt;</code></pre>","383576","","383576","","2010-07-06 13:35:19","2010-07-06 13:35:19","2 different views in android setContentView","<android><animation><imageview>","2","2","","",""
"3186120","1","3186465","","2010-07-06 12:24:31","1","143","<p>When you have a list activity and in onListItemClick() you need to obtain the selected item and then match it against various options, what is the efficient way to do it? switch case cannot be used since I want to match Strings. Is a very long if-else if ladder the only way to do it? </p><p>Basically the question is how to do something that normally would be done in switch statement with Strings.</p>","381699","","114066","","2010-07-06 12:48:03","2010-07-07 13:13:51","How to match efficiently result String with various options?","<java><android>","3","2","","",""
"3186290","1","3186326","","2010-07-06 12:50:48","2","2935","<p>I am developing an application that uses system activity to add a contact to phone's memory. This external activity launches a Toast after saving the contact. Is there any possibility to get rid of it? It would be perfect if I could get a reference to it to call cancel() or cancel all queued Toasts. Is there any Toast manager?</p>","370982","","114066","","2010-07-06 12:55:05","2011-08-29 20:44:46","hide Toast","<android><toast>","3","0","","",""
"3186616","1","","","2010-07-06 13:33:27","1","696","<p>I can't find any documentation on geo fencing, specifically geo-fencing with polygons and dynamic objects. Is this functionality available?</p><p>Thanks in advance.</p>","343315","","21234","","2010-10-04 22:02:14","2011-06-06 21:09:50","Is Geo-fencing with polygons and dynamic objects available on android?","<android><polygons>","1","0","1","",""
"3186641","1","","","2010-07-06 13:35:52","2","3428","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2691235/double-tap-zoom-on-android-mapview"">Double Tap -&gt; Zoom on Android MapView?</a>  </p></blockquote><p>I am newbie Android developer. I am developing an application in which I am using GoogleMaps. I have to implement double tap zoom in GoogleMaps. When I double click on the map it should zoom in. Kindly if it is possible provide a sample code.<br>I have written the following code but I dont know what to add more.</p><pre><code>public class Maps extends MapActivity implements OnGestureListener, OnDoubleTapListener {    private GestureDetector detector;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // MapViewer mapViewer = new MapViewer(null, null);        MapView mapView = (MapView) findViewById(R.id.mapview);        detector = new GestureDetector(this, this);        mapView.setBuiltInZoomControls(true);    }    @Override    protected boolean isRouteDisplayed() {        return false;    }    public boolean onDoubleTap(MotionEvent e) {        mapView.getController().zoomIn();        return false;    }    public boolean onDoubleTapEvent(MotionEvent e) {        return false;    }    public boolean onSingleTapConfirmed(MotionEvent e) {        return false;    }    public boolean onDown(MotionEvent e) {        return false;    }    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {        return false;    }    public void onLongPress(MotionEvent e) {    }    public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {        return false;    }    public void onShowPress(MotionEvent e) {    }    public boolean onSingleTapUp(MotionEvent e) {        return false;    }}</code></pre>","384600","","356895","","2012-09-14 20:50:02","2012-09-28 20:21:23","Double Tap Zoom in GoogleMaps Activity","<android><google-maps><double-click><zooming>","4","2","1","2012-09-29 06:02:13",""
"3186779","1","3187071","","2010-07-06 13:52:39","2","1679","<p>Is there a possibility to navigate between Activities tabs in TabHost using back button? When I press it, I go out of the main Activity to the previous one. </p>","296427","","","","","2014-03-26 09:25:10","Navigation between tabs in TabHost","<android><navigation><android-tabhost>","2","0","0","",""
"3186936","1","3187267","","2010-07-06 14:09:34","0","476","<p>I used a spinner to display a list:</p><p><img src=""http://www.freeimagehosting.net/uploads/65f67186f2.png"" alt=""alt text"" title=""device image""></p><p>At the bottom of the list, there is this grey line. How i can remove it programatically??</p><p>Thanks</p>","","anon","","","","2010-07-06 14:45:54","How to remove button line in Spinner?","<android><spinner>","1","0","","",""
"3186950","1","3188729","","2010-07-06 14:10:46","11","21556","<p>Video streaming using RTSP</p><p>I 'm trying to install a Wowza server on my linux machine to enable the RTSP streaming for my android application. On android client side what sort of changes do I need to make in my application. I 'm using Videoview to simply play a video file stored locally. Now I want to get the video content get streamed through the server that I 've installed. If necessary I can move to any other streaming server as right now I 'm doing a research on streaming servers.</p><p>Thanks</p>","218665","","","","","2013-10-20 17:43:56","Video streaming using RTSP : Android","<android><video-streaming>","2","3","15","",""
"3187036","1","","","2010-07-06 14:20:12","1","1289","<p>I have a problem with the method ""onActivityResult"".I create a new Activity from my main activity:</p><pre><code>Intent intent = new Intent(this, NewActivity.class);startActivityForResult(intent, 0);</code></pre><p>The new Activity is ended like this:</p><pre><code>Intent resultIntent = new Intent();resultIntent.putExtra(""vid"", hmvenues.get(venues[currentPosition]));resultIntent.putExtra(""name"", venues[currentPosition]);setResult(RESULT_OK, resultIntent);finish();</code></pre><p>But the Method onActivityResult seem to be not called</p><pre><code>@Override public void onActivityResult(int requestCode, int resultCode, Intent data) {        Log.d(this.getClass().getName(),""onActivityResult"");   ...}</code></pre><p>Does anyone have an idea, what I did wrong?Thanks!! Seb</p>","384632","","","","","2011-06-17 05:45:43","Android 1.6: onActivityResult is not called","<android>","1","2","1","",""
"3187077","1","","","2010-07-06 14:23:29","1","616","<p>how to develop android app with analog clock for different timezones</p>","384634","","","","","2012-07-05 02:50:25","how to develop android app with analog clock for different timezones","<android>","0","2","1","",""
"3187115","1","3187213","","2010-07-06 14:27:49","1","3855","<p>I'm trying to use the function [context].startSubActivity([intent i]) but that won't compile. Apparently startSubActivity() doesn't exist in Android 2.01? I <em>do</em> see a bunch of startActivity(...) functions, but no startSubActivity, which so many examples provide. Would someone please tell me if it's been deprecated, or maybe I'm just not including some library Eclipse isn't helping me find? :)</p><p>What I'm trying to do is launch a subactivity inside of a TimerTask inside my app.</p><p>Thanks!</p><p>-Auri</p>","363025","","","","","2013-03-13 12:18:26","Android: Where do I find startSubActivity()?","<android>","2","0","","",""
"3187154","1","3187322","","2010-07-06 14:32:30","9","22730","<p>I use a <code>SeekBar</code> in my application and I would like to customize it a little bit. I already figured out how to change the <code>Drawable</code> for the thumb and for the background.</p><p>My question is how to change the size of the <code>SeekBar</code>? If I just change the height of the <code>SeekBar like this, the</code>View<code>is only clipped and it only shows the top piece of the</code>SeekBar`: </p><pre><code>&lt;SeekBar   android:layout_height=""10dip""   style=""@style/seekbar_style"" /&gt;</code></pre><p>How do I change the overall size of the <code>Seekbar</code>? I want it to be much thinner then the standard <code>SeekBar</code>. </p>","114066","","493939","","2012-05-11 05:12:18","2013-07-04 20:06:50","How to customize the look of a SeekBar in Android?","<android><seekbar>","2","1","8","",""
"3187183","1","3189427","","2010-07-06 14:35:57","0","1369","<p>I have an Linear Layout inside the View Flipper. When i fling/swipe the layout the same layout reloads the same layout with the animations slide_left_out and slide_right_in. I just have only one layout view. it has the values the image view and text view. When i swipe the view it  just change the next value to that views. Any Idea?</p>","267269","","","","","2010-07-06 19:54:20","How to Reload the Same layout on View Flipper in Android?","<android><viewflipper>","1","0","0","",""
"3187258","1","3187363","","2010-07-06 14:44:47","0","1680","<p>My target: download files in parallel, and when file downloads complete, I get notifications.</p><p>Those notificaions are suppose to launch an activity when you click on it which gets unique parameters through <code>putExtra</code>.</p><p>The problem is that I can't have different values in each launch of that activity.</p><p>Each time the activity, which is being launched through the notification bar, launches it destroys the extra of the ones which haven't been launched yet (the ones that still appear on the notification bar).</p><p>How do I keep all my notifications with their own parameters?</p><p>Here is my code:</p><pre><code>if (messagesManager == null){    messagesManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);}notification = new Notification(R.drawable.icon, message, System.currentTimeMillis());// for launch activityIntent intent = new Intent(context, DialogActivity.class);intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);intent.putExtra(""fileName"", fileName); //- this is where i put my extra's!!intent.putExtra(""onSdcard"", onSdcard);PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);notification.setLatestEventInfo(context, ""DownloadManager"", message, contentIntent);notification.flags = notification.FLAG_AUTO_CANCEL;int noticeId = generateNotificationId(requestId);messagesManager.notify(noticeId, notification);</code></pre><p>Now this is the dialog activity:  </p><pre><code>protected void onCreate(Bundle savedInstanceState){    // TODO Auto-generated method stub    super.onCreate(savedInstanceState);    Intent i = getIntent();    boolean onSdcard = i.getBooleanExtra(""onSdcard"", true);    String fileName = i.getStringExtra(""fileName"");    ...}</code></pre><p>I tried to use this technique as it was written in another post here, but it didnt work.</p><pre><code>intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);</code></pre>","260511","","1401895","","2013-04-02 17:55:32","2013-04-02 17:55:32","Sending diffrent parameters to pendingIntent through notification","<android><android-notifications>","1","1","","",""
"3187275","1","3187371","","2010-07-06 14:46:49","0","1705","<p>I believe this is pretty trivial but I can't get it to work.<br>I want to display a default image in gallery elements (ImageViews) while their actual image is being fetched from the net.<br>Right now, nothing is shown for an ImageView which its image has yet to arrive. Once it arrives it is immediately shown.<br>What I tried is right after the instantiation of the ImageView to call its setImageResource function like so:  </p><p>final ImageView i = new ImageView(mContext);<br>i.setImageResource(R.drawable.loading);</p><p>But it doesn't seem to work. Below is the full getView() function.<br>Any help is appreciated.<br>Thanks.</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {     final ImageView i = new ImageView(mContext);     i.setImageResource(R.drawable.loading);     // if the drawbale is in the buffer - fetch it from there     Drawable bufferedImage = DataManager.getInstance().getImagesBuffer()[position];     if (bufferedImage != null){         i.setImageDrawable(bufferedImage);         BitmapDrawable drawable = (BitmapDrawable) i.getDrawable();         drawable.setAntiAlias(true);     }     // if drawable is not in buffer - fetch it from the net via AsyncImageLoader     else     {         String imageUrl = DataManager.getInstance().getImageBufferInstance().getImageUrl(position);         Drawable downloadedImage = AsyncImageLoader.getInstance().loadDrawable(imageUrl, new ImageCallback() {         public void imageLoaded(Drawable imageDrawable, String imageUrl) {                if (imageDrawable == null)                {                    imageDrawable = getResources().getDrawable(R.drawable.icon);                }                i.setImageDrawable(imageDrawable);                BitmapDrawable drawable = (BitmapDrawable) i.getDrawable();                drawable.setAntiAlias(true);                    }            });         i.setImageDrawable(downloadedImage);     }     i.setLayoutParams(new CoverFlow.LayoutParams(Utils.getInstance().getScreenWidth() / 2,             Utils.getInstance().getScreenHeight() / 2));     i.setScaleType(ImageView.ScaleType.CENTER_INSIDE);      return i; }</code></pre>","283630","","283630","","2010-07-06 14:52:07","2010-07-06 14:57:43","Android: showing default image in gallery's ImageView while actual image is downloaded","<android><image-gallery>","1","0","1","",""
"3187347","1","","","2010-07-06 14:54:40","0","1147","<p>Does anyone know how to store the album art of a music album into a cache? I already have my album arts fetched from my content resolver. But I would like to store them inside a cache (probably, a hash map) so that it will not need to fetch the images from the content resolver again but from the cache.</p>","372107","","372107","","2010-07-06 15:24:00","2010-12-07 20:28:55","Android album art caching","<android>","1","0","","",""
"3187398","1","","","2010-07-06 15:00:21","2","929","<p>I want to write a program to automatically generate the contacts. I also use a special service to add account on emulator. The same account is used on the telephone. Below is my code:</p><pre><code>ContentValues values = new ContentValues();values.put(RawContacts.ACCOUNT_TYPE, ""localhost"");values.put(RawContacts.ACCOUNT_NAME, ""PC Sync"");Uri rawContactUri = getContentResolver().insert(RawContacts.CONTENT_URI, values);long rawContactId = ContentUris.parseId(rawContactUri);             values.clear();values.put(Data.RAW_CONTACT_ID, rawContactId);values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);values.put(StructuredName.GIVEN_NAME, Gname);values.put(StructuredName.FAMILY_NAME, Fname);values.put(StructuredName.MIDDLE_NAME, Mname);getContentResolver().insert(Data.CONTENT_URI, values);</code></pre><p>The program is working on emulator and adds contacts, but on HTC the program  only process adding no contacts. I can't understand what the problem can be.  </p>","341998","","86860","","2010-07-06 15:02:22","2011-08-17 01:59:26","Program adding contacts on the emulator does not add contacts on the HTC Desire","<android><android-emulator><contacts><htc>","1","4","","",""
"3187651","1","","","2010-07-06 15:23:15","1","967","<p>I am working with an edit text to support the properties of bold,italic and underline.I got succeed after selecting the text and clicking on bold my text was bold.Now what my requirement is how to remove the bold again after selecting the text and clicking on bold button.</p><p>Regards,</p><p>Bhavani.G</p><hr><p>It is not simply setting the flag to do bold and remove the bold.We have to know the text we have selected is in bold and if it is bold then we have to remove the bold by clicking the same button..</p><p>Regards,</p><p>Bhavani</p>","342873","","1288","","2011-11-19 21:21:07","2011-11-19 21:21:07","Android edit text","<android><edittext><fonts>","1","0","","",""
"3187751","1","","","2010-07-06 15:33:35","2","1007","<p>Is there a way to apply a 'resize' animation as opposed to a scale animation in Android?  When using the scale animation, the image or layout being resized is stretched out, this includes the border / stroke outline that is outlines the image.  I have a box, with 2 lines around them, when the animation is applied the stroke appears to grow, this is likely due to the fact that the 'scale' animation is actually scaling the borders/strokes in addition to the drawable.  Is there any way to have the box grow, without having the stroke/border/outline appear to grow as well?  i.e. i just want to resize, but not necessarily 'rescale' the drawable.  note, my drawable is defined in xml...</p>","372405","","","","","2011-12-23 20:52:35","android resize animation","<android><animation><drawable>","2","0","1","",""
"3187771","1","3187859","","2010-07-06 15:35:12","0","129","<p>My goal is to have multiple mp4's stores in different folders on a server.  I want to grab one of the videos from the folder when a certain condition is met.  How would I grab a random video file from a particular folder?  Here is the code I have written:</p><pre><code>public static Uri getVideoPath(String cond){  Uri tempPath;  if((cond.equals(""01""))||(cond.equals(""02""))){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/sunny/"");  }else if((cond.equals(""03""))||(cond.equals(""04""))|| (cond.equals(""05""))){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/some_sun/"");  }else if((cond.equals(""06""))||(cond.equals(""07""))||(cond.equals(""08""))||    (cond.equals(""36""))||(cond.equals(""37""))||(cond.equals(""38""))){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/cloudy/"");  }else if((cond.equals(""09""))||(cond.equals(""10""))||(cond.equals(""27""))||(cond.equals(""28""))){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/light_gray/"");  }else if(cond.equals(""11"")){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/fog/"");  }else if((cond.equals(""12""))||(cond.equals(""13""))|| (cond.equals(""14""))||    (cond.equals(""39""))||(cond.equals(""40""))){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/showers/"");  }else if((cond.equals(""15""))||(cond.equals(""16""))|| (cond.equals(""17""))||    (cond.equals(""40""))||(cond.equals(""41""))){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/thunderstorms/"");  }else if(cond.equals(""18"")){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/rain/"");  }else if((cond.equals(""19""))||(cond.equals(""20""))|| (cond.equals(""21""))||(cond.equals(""43""))){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/flurries/"");  }else if((cond.equals(""22""))||(cond.equals(""23""))||(cond.equals(""44""))){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/snow/"");  }else if((cond.equals(""24""))||(cond.equals(""25""))|| (cond.equals(""26""))){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/ice/"");  }else if(cond.equals(""29"")){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/rain_and_snow/"");  }else if(cond.equals(""30"")){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/hot/"");  }else if(cond.equals(""31"")){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/cold/"");  }else if(cond.equals(""32"")){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/windy/"");  }else if((cond.equals(""33""))||(cond.equals(""34""))||(cond.equals(""35""))){   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/clear/"");  }else{   tempPath = Uri.parse(""http://www.personal.psu.edu/tmv105/video/clear/"");  }     return tempPath; }</code></pre>","2186261","","","","","2010-07-06 16:44:30","How to grab random videos to play under certain conditions","<java><android>","2","0","","",""
"3187817","1","3188417","","2010-07-06 15:41:11","3","5214","<p>In my application, how do I disable the transition animation that shows the new activity layout enter from the right and the old one exit to left?</p><p>Versions 2.0 -> 2.2 if relevant.</p>","82515","","","","","2011-08-02 15:02:57","Android, how to disable the 'wipe' effect when starting a new activity?","<android>","3","5","4","",""
"3187930","1","3193596","","2010-07-06 15:55:48","1","812","<p>My team and I are currently planning to do some Rich Web development for the android and iphone and I am wondering if you guys could share some resources with us. Anything will be welcomed. Thanks in advance.</p>","109849","","","","","2010-08-25 19:16:20","Designing Rich Website for Android & Iphone","<android><xhtml><mobile><iphone-web><mobile-website>","2","0","2","2012-08-22 12:10:26",""
"3187953","1","3553879","","2010-07-06 15:57:51","3","3391","<p>EDIT: the null pointer was due to a badly formed json.</p><p>Hi,</p><p>I'm trying to deserialize json data to an ArrayList of Restaurant object as follows (inpsired by what I found in <a href=""https://sites.google.com/site/gson/gson-user-guide#TOC-Collections-Examples"" rel=""nofollow"">https://sites.google.com/site/gson/gson-user-guide#TOC-Collections-Examples</a>):</p><pre><code>Type listType = new TypeToken&lt;ArrayList&lt;Restaurant&gt;&gt;() {}.getType();ArrayList&lt;Restaurant&gt; objList = gson.fromJson( r, listType );         //(line 141)</code></pre><p>but this gives the error shown at the end of the post.</p><p>It seems that there is some null pointer in listType... Here's a watch of listType:</p><pre><code>""listType""= ImplForType  (id=830061042288)      args= ListOfTypes  (id=830061040752)            list= null          resolvedTypes= Type[1]  (id=830061042800)       loader= PathClassLoader  (id=830060323064)      ownerType0= null        ownerTypeRes= null      rawType= Class (java.util.ArrayList) (id=830002592616)      rawTypeName= ""java.util.ArrayList"" (id=830061042328)    </code></pre><p>What's wrong with my code? How can I do that?</p><p>Thanks</p><p>Jul</p><pre><code>07-06 17:38:48.825: DEBUG/dalvikvm(1337):   JDWP invocation returning with exceptObj=0x4364a4a007-06 17:39:00.525: DEBUG/dalvikvm(1337):   JDWP invocation returning with exceptObj=0x4364b1e807-06 17:39:15.879: WARN/dalvikvm(1337): threadid=17: thread exiting with uncaught exception (group=0x4000fe70)07-06 17:39:15.885: ERROR/AndroidRuntime(1337): Uncaught handler: thread AsyncTask #1 exiting due to uncaught exception07-06 17:39:16.135: DEBUG/dalvikvm(1337): GC freed 3322 objects / 261128 bytes in 114ms07-06 17:39:16.225: ERROR/AndroidRuntime(1337): java.lang.RuntimeException: An error occured while executing doInBackground()07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at android.os.AsyncTask$3.done(AsyncTask.java:200)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.util.concurrent.FutureTask.run(FutureTask.java:122)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.lang.Thread.run(Thread.java:1058)07-06 17:39:16.225: ERROR/AndroidRuntime(1337): Caused by: java.lang.NullPointerException07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at org.apache.harmony.luni.lang.reflect.ListOfTypes.length(ListOfTypes.java:47)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at org.apache.harmony.luni.lang.reflect.ImplForType.toString(ImplForType.java:83)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.lang.StringBuilder.append(StringBuilder.java:209)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:56)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at com.google.gson.JsonDeserializationVisitor.visitUsingCustomHandler(JsonDeserializationVisitor.java:65)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:96)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:73)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:49)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at com.google.gson.Gson.fromJson(Gson.java:379)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at org.digitalfarm.atable.Atable$GetRestaurantData.doInBackground(Atable.java:141)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at org.digitalfarm.atable.Atable$GetRestaurantData.doInBackground(Atable.java:1)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at android.os.AsyncTask$2.call(AsyncTask.java:185)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     ... 4 more</code></pre>","326849","","326849","","2010-07-07 14:24:28","2010-08-24 06:03:00","Deserializing ArrayList of non-generic type using GSON","<android><gson>","1","5","1","",""
"3188059","1","3291606","","2010-07-06 16:11:21","2","2385","<p>I am trying to use progurard with my android applications.The proguardGui accepts an input, and an output, the input requires a jar file. but the APK file for android doesn't contain any jar?</p><p>I tried passing the apk file, and also the dex file inside the apx, but proguard doesn't accept them as an input. proguard only accepts jars, ears, wars, zips so how can i use the proguard gui with my android application?</p>","242769","","","","","2013-06-19 03:52:03","Android & Proguard?","<android><obfuscation><proguard>","2","0","5","",""
"3188070","1","3188253","","2010-07-06 16:13:31","0","764","<p>I'm writing a Music application and I have already gotten the album arts. However, they came up in various sizes. So, how do I standardized the size of the returned bitmap ?</p>","372107","","","","","2013-04-28 10:32:52","Resizing bitmaps","<android>","3","0","3","",""
"3188081","1","","","2010-07-06 16:14:51","1","1933","<p>is there any way to apply an animation to a property of a view? currently, the only animation i am aware of is applying an animation to an entire view.  i'm wondering if i can apply an animation to a property (i.e. layout_width for example)</p>","372405","","","","","2010-07-06 16:22:06","android animate property","<android><animation><properties>","2","0","","",""
"3188169","1","","","2010-07-06 16:25:25","2","82","<p>I'm changing a project from android to bada, but I don't find a class which has the same effect as ""Context"". Any suggestion? </p>","285610","","759866","","2014-02-04 15:45:10","2014-02-04 15:45:10","Is there a class in bada which is similar to ""Context"" in android?","<android><context><bada>","1","1","","",""
"3188170","1","","","2010-07-06 16:25:37","5","2060","<p>I have written a Music player app and it works great but when a flip action happens or when I return the the player view I have to stop the player and restart it at the postion that it was at when the action happened. That all works but it means a breif stop and start.</p><p>How can I run the media player in a different thread and still update my seekbar?</p><p>Thanks</p>","282475","","","","","2010-10-01 07:44:06","Android Media Player Threading","<android><multithreading><media-player>","1","0","3","",""
"3188242","1","3240616","","2010-07-06 16:34:11","3","1252","<p>What Android Api is used to get the scrolling to the left or to the right on the start screen on Android?</p>","25282","","","","","2010-07-13 19:17:44","Android Gesture to that's used on the start screen","<android>","3","1","1","",""
"3188414","1","3189949","","2010-07-06 16:56:24","0","196","<p>The function below is part of the code for Google's Camera app. I didn't understand the logic of the statements in bold. Please help.</p><p>int seconds = intent.getIntExtra(MediaStore.EXTRA_DURATION_LIMIT, 0);            mMaxVideoDurationInMs = 1000 * seconds;</p><p>mMediaRecorder.setMaxDuration(mMaxVideoDurationInMs);</p><p>//this function is to update the recording time</p><p>private void updateRecordingTime() {        if (!mMediaRecorderRecording) {            return;        }        long now = SystemClock.uptimeMillis();        long delta = now - mRecordingStartTime;</p><pre><code>    // Starting a minute before reaching the max duration    // limit, we'll countdown the remaining time instead.    boolean countdownRemainingTime = (mMaxVideoDurationInMs != 0            &amp;&amp; delta &gt;= mMaxVideoDurationInMs - 60000);    long next_update_delay = 1000 - (delta % 1000);    long seconds;    if (countdownRemainingTime) {        **delta = Math.max(0, mMaxVideoDurationInMs - delta);        seconds = (delta + 999) / 1000;**    } else {        **seconds = delta / 1000; // round to nearest**    }    long minutes = seconds / 60;    long hours = minutes / 60;    long remainderMinutes = minutes - (hours * 60);    long remainderSeconds = seconds - (minutes * 60);    String secondsString = Long.toString(remainderSeconds);    if (secondsString.length() &lt; 2) {        secondsString = ""0"" + secondsString;    }    String minutesString = Long.toString(remainderMinutes);    if (minutesString.length() &lt; 2) {        minutesString = ""0"" + minutesString;    }    String text = minutesString + "":"" + secondsString;    if (hours &gt; 0) {        String hoursString = Long.toString(hours);        if (hoursString.length() &lt; 2) {            hoursString = ""0"" + hoursString;        }        text = hoursString + "":"" + text;    }    mRecordingTimeView.setText(text);    if (mRecordingTimeCountsDown != countdownRemainingTime) {        // Avoid setting the color on every update, do it only        // when it needs changing.        mRecordingTimeCountsDown = countdownRemainingTime;        int color = getResources().getColor(countdownRemainingTime                ? R.color.recording_time_remaining_text                : R.color.recording_time_elapsed_text);        mRecordingTimeView.setTextColor(color);    }    // Work around a limitation of the T-Mobile G1: The T-Mobile    // hardware blitter can't pixel-accurately scale and clip at the    // same time, and the SurfaceFlinger doesn't attempt to work around    // this limitation. In order to avoid visual corruption we must    // manually refresh the entire surface view when changing any    // overlapping view's contents.    mVideoPreview.invalidate();    mHandler.sendEmptyMessageDelayed(            UPDATE_RECORD_TIME, next_update_delay);}</code></pre>","381699","","","","","2010-07-07 11:59:11","need help to interpret Google's code for Android Camera app","<android>","1","0","","",""
"3188590","1","","","2010-07-06 17:19:25","2","8156","<p>I have been trying to code and run the hello world application but am not able to get the emulator to boot all the way. Plan b is vb.</p><p>HELP!</p>","376480","","3043","","2012-05-02 21:12:04","2012-05-02 21:12:04","Can I install a visual basic application on android?","<android>","3","1","","",""
"3188719","1","6239007","","2010-07-06 17:35:48","6","3118","<p>I've had a good search for this on here and can't find a solution.</p><p>I have a TextView in a RelativeLayout which contains an integer number.The number will range between 1 and 99 - can anyone tell me how to size the TextView so that its width is always the width of the string ""99"" even if it only contains ""1""?</p><p>I need this because the positions of the components to the right of this TextView depend on its width, so all are position depending on how many digits the TextView contains.</p><p>I don't mind if this is done in XML or code - I just want to avoid having to set the width of a TextView in pixels!</p><p>Thanks for any possible solutions; Please ask if I've missed out any important info!</p>","201703","","","","","2012-05-11 19:38:43","How can I set a minimum width (in characters) for a TextView?","<android><text><rendering>","5","0","","",""
"3188774","1","","","2010-07-06 17:42:41","0","3883","<p>I am trying to display an bitmap I created in and android program, but all the tutorials I find involve either Drawables or XML in order to display them. Can someone show me the steps needed to display an Bitmap in code?</p><p>This is not the entirety of the code, this is just the majority, the rest is related to getting the camera working.</p><pre><code>class Preview extends SurfaceView implements SurfaceHolder.Callback {private SurfaceHolder mHolder;private Camera mCamera;private Paint mPaint;private Drawable bitmap;private Bitmap currentprev;private ImageView mImageView;private Camera.PreviewCallback mPrevCallback = new Camera.PreviewCallback() {        public void onPreviewFrame( byte[] data, Camera Cam ) {                Log.d(""CombineTestActivity"", ""Preview registered"");                Log.d(""CombineTestActivity"", ""Data length = ""                         + data.length );               // currentprev = BitmapFactory.decodeByteArray( data, 0,                //       data.length );               currentprev = BitmapFactory.decodeResource( getResources(),                   R.drawable.creature00 );               if( currentprev == null )                   Log.d(""CombineTestActivity"", ""currentprev is null"" );               if( mImageView == null )                   Log.d(""CombineTestActivity"", ""mImageView is null"" );        //Code fails here, gives null pointer exception                mImageView.setImageBitmap( currentprev );                Log.d(""CombineTestActivity"", ""Preview Finished"" );        }};private OnTouchListener mCorkyListener = new OnTouchListener() {        public boolean onTouch(View v, MotionEvent me) {                Log.d(""CombineTestActivity"", ""touch registered"" );                mCamera.takePicture( null, null, mPicCallback );                return false;        }};private Camera.PictureCallback mPicCallback = new Camera.PictureCallback() {        public void onPictureTaken( byte[] data, Camera mCamera ) {                Log.d(""CombineTestActivity"", ""picture method run"" );        }};Preview(Context context) {    super(context);    // Install a SurfaceHolder.Callback so we get notified when the    // underlying surface is created and destroyed.    mImageView = (ImageView)findViewById(R.id.imageview);    mHolder = getHolder();    mHolder.addCallback(this);    mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);    mPaint = new Paint();    bitmap = context.getResources().getDrawable(        R.drawable.creature00);    if( mImageView == null )        Log.d(""CombineTestActivity"", ""mImageView is null"" );this.setOnTouchListener( mCorkyListener );}</code></pre>","379220","","379220","","2010-07-13 18:02:09","2010-07-13 18:02:09","How do I display an Bitmap class object in android without using XML","<android><image>","2","2","1","",""
"3188853","1","","","2010-07-06 17:53:13","2","1020","<p>I'm looking for a way to launch the native android lock screen from my application. I've looked around and found code about KeyGuardLock and KeyGuardManager but I believe that only locks the keyboard from working.</p><p>REF: <a href=""http://smartandroidians.blogspot.com/2010/03/enabling-and-disabling-lock-screen-in.html"" rel=""nofollow"">http://smartandroidians.blogspot.com/2010/03/enabling-and-disabling-lock-screen-in.html</a></p>","384815","","","","","2014-02-27 06:21:27","Launching Android Native Lock Screen","<android><screen><locking><lockscreen>","1","1","","",""
"3188867","1","","","2010-07-06 17:54:43","2","4099","<p>Trying to grok intents and actions in android and looking through the <a href=""http://developer.android.com/guide/topics/intents/intents-filters.html"" rel=""nofollow"">documentation</a>.But one thing I keep seeing is an intent filter with multiple actions defined. Like this, from the above link:</p><pre><code>&lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.VIEW"" /&gt;    &lt;action android:name=""android.intent.action.EDIT"" /&gt;    &lt;action android:name=""android.intent.action.PICK"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;data android:mimeType=""vnd.android.cursor.dir/vnd.google.note"" /&gt;&lt;/intent-filter&gt;</code></pre><p>But, if you call that activity, how does it choose which action is chosen?</p><p>For that matter, that linked to example has multiple activities that all contain the same actions, ""android.intent.action.VIEW"" for example.  When calling this with something like content://com.google.provider.NotePad/notes how does it even know which activity to use?</p>","194","","","","","2010-07-06 18:27:25","Default when using multiple Actions in Intent-Filter","<android><android-intent>","1","0","","",""
"3188883","1","","","2010-07-06 17:57:32","3","1395","<p>I have a <code>WebView</code> which may contain data that appears to be getting ""auto linked"".  Something that looks like an email address is becoming clickable, even though it's now within an <code>&lt;a&gt;</code> tag or has an <code>onclick</code> attribute.  How do I disable this auto-linking?</p><p>I've looked thorugh the <code>WebView</code> docs, as well as the <code>WebSettings</code> docs, but didn't seem to see anything that mentions this behavior.</p><p><img src=""http://beautifulpixel.com/assets/5554_Fast-20100706-110228.png"" alt=""alt text""></p>","62076","","62076","","2010-07-06 18:02:43","2012-05-16 17:45:56","Preventing autolinking of emails and URLs in an Android WebView","<android><webview>","5","2","3","",""
"3189188","1","","","2010-07-06 18:40:29","4","1680","<p>I am a new developer and have a simple question that I have searched all over for, but have not found a clear answer yet...</p><p>Simply put, I am developing an application that needs to be able to use GPS. The trick is however that I would like to use GPS to get a phone's location even if they have no carrier service. </p><p>With that said I have 2 questions.</p><ol><li><p>Is is possible to get the GPS location of a phone with no carrier service with a wifi connection?</p></li><li><p>Is is possible to get the GPS location of a phone with no carrier service AND no wifi service?</p></li></ol><p>Thanks in advance</p>","384855","","12707","","2010-07-06 18:41:37","2010-07-06 19:18:46","GPS Location without service","<android><gps>","2","0","","",""
"3189390","1","","","2010-07-06 19:05:40","6","3759","<p>I have an expandable list </p><p>so two question  </p><ol><li><p>(I've seen somme similar questionbut never found the answer) How do Ihide the arrow ( group indicator)when there's no children</p><p>I tried to do it in the adapter</p><pre><code>public View getGroupView(int groupPosition, boolean isExpanded, View convertView,ViewGroup parent) {if(getChildrenCount(groupPosition)==0) {      // how do i hide the group indicator ?}</code></pre><p>But I'm stuck So, how can modify thegroup indicator for empty groups ?</p></li><li><p>How to have different behavior whenyou click on the arrow (expands thegroup) vs you click on the title ofthe group (go to an activity) </p></li></ol>","384873","","114066","","2010-07-06 19:42:46","2012-08-28 13:16:05","Expandable List Indicator","<android>","2","1","3","",""
"3189655","1","3189669","","2010-07-06 19:48:56","4","3941","<p>Even explicitly writing e.printStackTrace() it doesn't print to the console, why?</p>","287316","","2684","","2013-05-22 23:21:36","2013-05-22 23:21:36","Why Android doesn't print the stack trace?","<java><android>","4","0","0","",""
"3189893","1","3190124","","2010-07-06 20:17:46","4","1496","<p>I have a webview and i have next previous buttons to get to the next or previous picture.What i want to do if possible is : Can i display the first picture but the webview loads (in the background the other pictures(other URLS) so that are available in the cache when a new picture is needed. Thank you</p>","348058","","","","","2010-07-06 20:51:43","preload webview","<java><android>","1","0","3","",""
"3189973","1","","","2010-07-06 20:29:29","3","468","<p>Looking through forums, it seems that there is not a way to end calls, but on the Android Developers page, the permission PROCESS_OUTGOING_CALLS ""Allows an application to monitor, modify, or abort outgoing calls.""  I can't find any documentation on how to end a call even with this permission.  Is this possible, or is it just a mistake on the page?</p><p><a href=""http://developer.android.com/reference/android/Manifest.permission.html#PROCESS_OUTGOING_CALLS"" rel=""nofollow"">http://developer.android.com/reference/android/Manifest.permission.html#PROCESS_OUTGOING_CALLS</a></p>","374751","","21234","","2010-07-14 14:25:41","2010-08-31 19:52:23","Is it possible for an Android app to end a call that it initiated?","<android>","1","0","1","",""
"3190006","1","8494982","","2010-07-06 20:34:59","2","656","<p>I've written a simple app that opens the camera and supplies a path for saving any captured images.</p><p>The code basically looks like this:</p><pre><code>File file = new File( Environment.getExternalStorage() + ""myimages/"",""my_image.jpg"" );Uri outputUri = Uri.fromFile( file );Intent intent = newIntent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );Intent.putExtra( MediaStore.EXTRA_OUTPUT, outputUri );</code></pre><p>This works perfectly on my Droid. Images are consistently saved at 2592x1936. However, when testing on the Milestone, the images are saved at much smaller sizes such as 320x240 and 1280 x 1900. Using adb logcat, I can see that the image size is set as soon as the photo is taken.</p><p>It seems like there is a default setting on the Milestone causing this behavior.</p><p>Any help would be greatly appreciated.</p><p>Thanks,~Jeremy </p>","230561","","","","","2011-12-13 19:27:49","Android Image Capture Saving Small Sizes on Milestone","<android><image><photo><milestone>","1","0","3","",""
"3190058","1","3190148","","2010-07-06 20:42:18","0","595","<p>Suppose I have a listview with 3 rows.  If the user clicks a button in row 1, it expands a menu (it's just a linear layout that's shown/hidden).  If they then click on an item in row 2, I'd like to be able to collapse the menu in row 1.  Is this possible? If so, how?</p>","372405","","82118","","2010-07-06 21:01:16","2011-07-12 09:15:36","android access listview row from another row","<android><listview>","2","2","","",""
"3190097","1","3193738","","2010-07-06 20:47:19","3","10153","<p>I am just starting out on android development and trying out the HelloAndroid tutorial. I have been stuck for a few days now. Initially, the first time I tried it, everything works perfectly and then I move on the second tutorial everything broke. So I'm trying to go back to the easiest and original tutorial and figure out what is happening.</p><p>There are three main file that I edited:HelloAndroid2.javapackage com.example.HelloAndroid2;</p><pre><code>import android.app.Activity;import android.os.Bundle;public class HelloAndroid2 extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}</code></pre><p>main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/textview""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:text=""@string/hello""/&gt;</code></pre><p>strings.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""hello""&gt;Hello World, HelloAndroid2!&lt;/string&gt;    &lt;string name=""app_name""&gt;HelloAndroid2&lt;/string&gt;&lt;/resources&gt;</code></pre><p>These are all from the tutorial.</p><pre><code>When I run it, the console output is:[2010-07-06 16:37:16 - HelloAndroid2] ------------------------------[2010-07-06 16:37:16 - HelloAndroid2] Android Launch![2010-07-06 16:37:16 - HelloAndroid2] adb is running normally.[2010-07-06 16:37:16 - HelloAndroid2] Performing com.example.HelloAndroid2.HelloAndroid2 activity launch[2010-07-06 16:37:16 - HelloAndroid2] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'HelloWorld'[2010-07-06 16:37:16 - HelloAndroid2] WARNING: Application does not specify an API level requirement![2010-07-06 16:37:16 - HelloAndroid2] Device API version is 8 (Android 2.2)[2010-07-06 16:37:16 - HelloAndroid2] Uploading HelloAndroid2.apk onto device 'emulator-5554'[2010-07-06 16:37:16 - HelloAndroid2] Installing HelloAndroid2.apk...[2010-07-06 16:37:22 - HelloAndroid2] Success![2010-07-06 16:37:22 - HelloAndroid2] Starting activity com.example.HelloAndroid2.HelloAndroid2 on device [2010-07-06 16:37:26 - HelloAndroid2] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.HelloAndroid2/.HelloAndroid2 }</code></pre><p>So, it just gets stuck at the starting: intent...The emulator shows up with the time, date, and the fac that it is charging. I'm developing on Android 2.2.I try to get some data out of LogCat and these are the last few lines:</p><pre><code>07-06 20:37:25.935: INFO/AndroidRuntime(387): NOTE: attach of thread 'Binder Thread #3' failed07-06 20:37:27.265: INFO/ActivityManager(65): Displayed activity com.example.HelloAndroid2/.HelloAndroid2: 1461 ms (total 1461 ms)07-06 20:37:32.376: DEBUG/dalvikvm(114): GC_EXPLICIT freed 562 objects / 31672 bytes in 95ms07-06 20:37:37.386: DEBUG/dalvikvm(197): GC_EXPLICIT freed 82 objects / 7592 bytes in 87ms07-06 20:37:42.386: DEBUG/dalvikvm(250): GC_EXPLICIT freed 26 objects / 1120 bytes in 102ms07-06 20:38:10.437: DEBUG/SntpClient(65): request time failed: java.net.SocketException: Address family not supported by protocol</code></pre><p>So basically, nothing happen on the emulator and it should say HelloAndroid or something like that. Please help.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.example.HelloAndroid2""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".HelloAndroid2""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre>","384964","","384964","","2010-07-07 17:36:05","2012-05-09 04:00:57","helloandroid tutorial error: request time failed","<android>","3","1","1","",""
"3190581","1","3190645","","2010-07-06 22:05:50","0","2989","<p>I think I might be about to ask a dummy question, but I'm still new with Android programming, and I couldn't (despite all my efforts) find my answer on Google.</p><p>The thing is, I'm trying to develop a little game, with 2D Graphics. I want my ""gaming board"" to be at a specific position on my screen, so that I can display in-game informations above and below the box. But since there is beginning to be a lot of Android phones out there, I was thinking about getting ""dynamic"" values so that I can adapt my font size to every device.</p><p>My game is not in full screen (but it could be, it's no big deal), but in a window with no title bar.</p><p>I'm using an extension of the default <code>SurfaceView</code> class, implementing <code>SurfaceHolder.Callback</code>. I tried writing the following method : </p><pre><code>public void getViewSize()    {        VIEW_WIDTH = this.getWidth();        VIEW_HEIGHT = this.getHeight();    }</code></pre><p>but the values returned are zeroes.</p><p>Anyone got an idea (even if it means changing display strategy) ?Thanks a lot.</p>","384994","","","","","2010-07-06 22:16:29","Obtaining SurfaceView dimensions","<android><resolution><surfaceview>","1","1","","",""
"3190623","1","4532554","","2010-07-06 22:12:19","6","8702","<p>I'm working on a research project which involves Bluetooth and the Android OS. I need to make Bluetooth discoverable indefinitely in order for the project to continue. </p><p><em>The Problem:</em>  </p><ul><li>Android limits discoverability to 300 seconds.</li><li>I cannot ask the user every 300 seconds to turn discoverability back on as my application is designed to run in the background without disturbing the user.</li><li><em>As far as I am aware</em>, there is no way to increase the time though Android's GUI. Some sources have called this a safety feature, others have called this a bug. There may be a bit of truth in both...</li></ul><p><em>What I'm Trying / Have Tried:</em></p><ul><li>I'm trying to edit a stable release of <a href=""http://www.cyanogenmod.com"">cyanogenmod</a> to turn the discoverability timer off (it's possible; there's a configuration file that needs to have a single number changed). This isn't working because I'm having verification problems with the resulting package. </li><li>During the past week, I downloaded the <a href=""http://github.com/CyanogenMod"">cyanogenmod source code</a>, changed a relevant class in the hope that it would make Bluetooth discoverable indefinitely, and tried to <a href=""http://wiki.cyanogenmod.com/index.php/Compile_for_dream"">recompile.</a> This did not work because (a) the repo is frequently changed, leading to an unstable code base which fails to compile (OR, it could be that I'm using it incorrectly; just because it looked like it was the code's fault in many instances doesn't mean I should blame it for all the problems I encountered!) and (b) the repo decides to periodically ""ignore"" me (but <strong>not</strong> always, as I have gotten the code base before!), replying to my synchronization/connection attempts with:<blockquote>  <p>fatal: The remote end hung up unexpectedly</li>  </ul><p>As you might imagine, the above two issues are problematic and very frustrating to deal with.<br>  <em>More Info:</em></p></blockquote></p><ul><li>I'm running Android 2.1 via cyanogenmod (v5 I believe). This means the phone is also rooted.</li><li>I have a developer phone, which means that the bootloader is unlocked.</li><li>My phone is an HTC Magic (32B).</li></ul><p><em>The Big Question:</em></p><ul><li>How can I make Bluetooth indefinitely discoverable on Android?</li></ul><p>Thanks for your time and input. I feel like I'm spinning my tires on this issue and I'd like to move past it.</p>","341654","","341654","","2010-07-06 22:25:40","2013-06-22 08:48:09","Make Bluetooth on Android 2.1 discoverable indefinitely","<android><bluetooth><magic><discovery>","5","9","4","",""
"3190812","1","3190973","","2010-07-06 22:57:30","14","3256","<p>A couple questions about the back button (as seen on the emulator)...</p><ol><li><p>Do all Android phones have the back button as a hard, tactile button?</p></li><li><p>If so, is it still recommended to put a back button in your software?</p></li><li><p>Is it possible to change the animation between activities when this back button is pressed? I would like it to be consistent with the animations in my app.</p></li></ol>","382252","","124486","","2013-07-01 05:14:42","2014-04-08 08:34:02","Back button on Android Phones","<android>","2","0","1","",""
"3191080","1","3592700","","2010-07-07 00:12:01","1","443","<p>I have a TableLayout with a tableRow and a horizontal scroll view in the 2nd column, but the right side always gets cut off. IF i have only 1 tableRow, it works, otherwise it goes past the visible area of the screen. To simply and isolate the problem heres an xml file with the guilty culprits. It seems basic but i have been super frustrated trying to get this to work.</p><p>. for some reason Stackoverflow isnt displaying my code correctly, heres a pastebin.<a href=""http://pastebin.com/SVuBA6v9"" rel=""nofollow"">link text</a></p>","385051","","385051","","2010-07-07 17:32:21","2010-08-28 22:13:37","android XML TableLayout issue: horizontal scroller going outside of right side of screen","<android><tablelayout><horizontalscrollview>","1","0","0","",""
"3191087","1","3191114","","2010-07-07 00:13:14","1","120","<p>In my application, I currently have several activities that consist of a TextView and a scrollbar. The only difference between them is the string that the TextView displays. Is there a way to consolidate all of these into one single activity, and depending on how/where the activity is started from, changes the TextView? Perhaps send the name of the string as an argument to startActivity, or something along those lines?</p>","382252","","","","","2010-07-07 06:27:45","Consolidating the number of activities in my Android app","<android>","1","0","","",""
"3191115","1","3200320","","2010-07-07 00:22:41","0","2030","<p>My main class folder was named <code>com.test</code>, I changed it to <code>com.myApplication</code>, and now when I add objects to my layout my <code>R.java</code> won't get updated, all objects that I had before work fine, and they are in <code>R.java</code>, but anything new that I create won't get added to <code>R.java</code>Any idea how to resolve this problem?</p>","242769","","213269","","2010-11-30 13:08:40","2010-11-30 13:08:40","Project won't update R.java?","<android><r.java-file>","1","2","1","",""
"3191203","1","3194469","","2010-07-07 00:51:21","0","460","<p>I thought I'd have a crack at building an Android app having not done any Java for five years (I've been living in MS land).</p><p>So my first project was supposed to be something easy.  A simple login form that calls a WCF service that I already have from another project.</p><p>So I got the whole thing set up OK in Eclipse and the app is running in the AVD.  I have also identified that I need ksoap2 for soap communication as Android devices are constrained.</p><p>I have what is likely to be a simple problem, however.  When I run the app and attempt to simply create a new instance of the ksoap2 PropertyInfo class I get a whole bunch of ClassNotFoundExceptions for things like java.awt.Container and java.applet.Applet.</p><p>I'm obviously setting up my build path wrong somehow but can't figure it out.</p><p>BTW, I' using ksoap2 v2.4 from <a href=""http://code.google.com/p/ksoap2-android/"" rel=""nofollow"">http://code.google.com/p/ksoap2-android/</a></p>","344655","","","","","2011-03-23 16:34:54","Problem using ksoap2 with Android","<java><android><eclipse>","2","0","","",""
"3191221","1","","","2010-07-07 00:57:49","1","497","<p>By default, when in DialogPreference you press BACK button, it mimics that you've pressed NegativeButton.</p><p>I'd like to override that but can't find an easy way except to recreate DialogPreference from scratch (which at the moment seems like an overkill), because I'd like that PositiveButton SET something, NegativeButton to UNSET something, and BACK key to leave things as they were (ie. to not unset something).</p><p>Is there a simple solution to this?</p><p>I've even tried to override showDialog() but: a) its not simple, b) I don't think I should mess too much with internals of OS supplied code like a bunch of private ""m"" variables.</p><p>Thank you for your time...</p>","381466","","","","","2010-07-10 02:28:15","Overriding DialogPreference's default BACK keypress behaviour","<android>","1","0","","",""
"3191310","1","","","2010-07-07 01:29:24","1","1664","<p>In my android app, is there any way to get the total amount of memory my application is taking up, in the code. I'm using lots of large bitmaps, so it must include external allocations as well. I must, however, be able to get the number in the code, so that I can dynamically adjust to fit the budget I have.</p><p>I also need a way to get the total amount I have available (16Mb or 24Mb) as well. </p><p>Thanks!</p>","118241","","","","","2010-07-07 03:12:26","Android Get Total App Memory (Heap + External Allocations)","<java><android>","1","2","1","",""
"3191361","1","","","2010-07-07 01:46:29","2","409","<p>I have a DBHandler class that will be used in several activities to do some crud operations.  created a MyApp class (extends Application) to hold one instantiation of the DBHandler.</p><p>My DBHandler class needs a Context to create the SQLiteOpenHelper to populate the db, etc.</p><p>That's where the problem starts: in my MyApp constructor, I want to instantiate my DBHandler, so I wrote this:</p><pre><code>public MyApp() {    super();    dbh = DBHandler(&lt;WHAT DO I PASS HERE&gt;);}</code></pre><p>I tried getApplicationContext(), getBaseContext(), 'this'... nothing seems to be a fully-instantiated context at this point. I get a NPE when the SQLiteOpenHelper tries ctx.getResources(). </p><p>A workaround: create the DBHandler and set it in the onCreate of my main class. -> UGLY (call me a aesthetician)</p><p>Question: is there a way to do it when Android creates MyApp?</p><p>Thanks!</p>","284556","","","","","2010-07-07 03:09:08","Android: extending android.app.Application","<android>","1","0","","",""
"3191406","1","3191945","","2010-07-07 01:55:15","1","1314","<p>I have a listview that's populated by rows that get their data from a web server. It all works totally fine except I want to have a refresh button to re-download the data. I'm getting the data through an asynctask (getting the data in doinbackground) and then setting the listadapter in onpostexecute. All I do to run the asynctask which should take care of everything is run</p><blockquote>  <p>new PopulateListTask().execute();</p></blockquote><p>However, in my optionsSelect method, creating a new asynctask just like I did in oncreate doesn't do anything. It doesn't even enter doInBackground. I've tried using listView.invalidate() and listView.invalidateViews(). Is there some special way I'm supposed to repopulate a listview?</p><p>My only guess is that since I'm using a custom adapter, my getView method is creating some kind of error, but that wouldn't explain why it's not even entering my asynctask's doInBackground method. Thoughts?</p><p>Edit: Posting some code. This is a trimmed down version.</p><p>`</p><pre><code> private class PopulateListTask extends AsyncTask&lt;Void, Void, ArrayList&lt;Quote&gt;&gt;{ @Override protected ArrayList&lt;Quote&gt; doInBackground(Void... params) {quotes = Helper.getQuotes();return quotes;}@Overrideprotected void onPostExecute(ArrayList&lt;Quote&gt; quotes){setListAdapter(new QuoteAdapter(ctx,R.layout.quote_row,quotes));}}private class QuoteAdapter extends ArrayAdapter&lt;Quote&gt;{    ArrayList&lt;Quote&gt; items;    int resource;    public QuoteAdapter(Context context, int textViewResourceId, ArrayList&lt;Quote&gt; items){        super(context, textViewResourceId, items); this.items = items; this.resource = textViewResourceId;    }    @Override      public View getView(int position, View convertView, ViewGroup parent){      View v = convertView;       LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);            v = vi.inflate(resource,null);        // do stuff with v       return v; }}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()){    case(MENU_REFRESH):        new PopulateListTask().execute(); }</code></pre><p>`  </p><p>Ok hopefully this works, sorry I'm still not totally sure the best way to enter code.</p><p>Edit2:</p><p>I'm getting this in my logcat when executing my asynctask the 2nd time. Any idea what it means? I tried googling to no avail.</p><blockquote>  <p>W/InputManagerService(   52): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43b9dee8</p></blockquote>","375874","","375874","","2010-07-07 04:02:47","2010-07-07 04:33:06","Refreshing a listview","<android><listview><views><refresh><listadapter>","1","2","","",""
"3191602","1","9906303","","2010-07-07 03:00:19","6","4061","<p>My goal is to modify the Launcher application and dynamically modify and change the theme.</p><p>I saw several 'home' apps at <a href=""http://www.cyrket.com/p/android/com.stain46.taghome/"" rel=""nofollow"">http://www.cyrket.com/p/android/com.stain46.taghome/</a>. It looks like they took the default Home(Launcher) and modified it. How did they do that? What do I need to modify to achieve the same thing?</p>","233618","","2291","","2011-11-23 23:40:05","2013-10-04 11:11:29","How to re-build the default ""Launcher"" application?","<android><launcher>","3","0","2","",""
"3191631","1","3191712","","2010-07-07 03:08:22","4","1005","<p>I want to do this programatically:</p><pre><code>&lt;ImageView style=""@style/TitleBarSeparator"" /&gt;</code></pre><p>Where <code>TitleBarSeparator</code> is:</p><pre><code>&lt;style name=""TitleBarSeparator""&gt;    &lt;item name=""android:layout_width""&gt;1px&lt;/item&gt;    &lt;item name=""android:layout_height""&gt;fill_parent&lt;/item&gt;    &lt;item name=""android:background""&gt;@color/title_separator&lt;/item&gt;&lt;/style&gt;</code></pre><p>I've tried:</p><pre><code>new ImageView(getContext(), null, R.style.TitleBarSeparator);</code></pre><p>but it doesn't work.I guess the error comes from passing null as <code>AttributeSet</code> but I am not completely sure.</p>","119895","","","","","2010-07-07 03:33:34","Creating an ImageView with a certain style programatically","<android>","1","0","","",""
"3191759","1","6091206","","2010-07-07 03:44:35","2","1584","<p>i have ubuntu installed on the lenovo s10e netbook. I am not sure if this is related to the issue. I am new to source builds so I would appreciate some direction. I followed instructions on cyanogen's wiki (http://wiki.cyanogenmod.com/index.php/Building_from_source)</p><p>I am stuck on the last step of 'Building CyanogenMod' after starting the build process.</p><pre><code>$make -j4============================================PLATFORM_VERSION_CODENAME=AOSPPLATFORM_VERSION=AOSPTARGET_PRODUCT=genericTARGET_BUILD_VARIANT=engTARGET_SIMULATOR=falseTARGET_BUILD_TYPE=releaseTARGET_BUILD_APPS=TARGET_ARCH=armHOST_ARCH=x86HOST_OS=linuxHOST_BUILD_TYPE=releaseBUILD_ID=OPENMASTER============================================Install: out/host/linux-x86/framework/apicheck.jarInstall: out/host/linux-x86/framework/clearsilver.jarInstall: out/host/linux-x86/framework/droiddoc.jarhost SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so)/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.so when searching for -lz/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.a when searching for -lz/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz/usr/bin/ld: cannot find -lzcollect2: ld returned 1 exit statusmake: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1</code></pre>","290624","","1039608","","2012-05-04 12:47:16","2012-05-04 12:47:16","android build source errors","<android><build-process><linux-kernel><compiler-errors><ubuntu-10.04>","3","3","","",""
"3191850","1","3191890","","2010-07-07 04:07:14","0","1169","<p>I have a MyTouch 3G running Android, which has been rooted. I was wondering if it is possible to install Windows Phone 7 on this phone, or if it is even close to compatible.</p><p>Thanks</p>","291063","","","","","2010-07-07 04:17:07","Install Windows Phone 7 on Android MyTouch 3g?","<android><windows-phone-7>","1","1","","",""
"3192028","1","","","2010-07-07 04:59:34","7","2539","<p>How can I upload images using FTP on Android?</p>","383030","","23897","","2010-07-07 05:02:23","2013-07-23 11:47:14","Uploading images with FTP on Android","<android><ftp>","2","4","","",""
"3192064","1","","","2010-07-07 05:09:15","25","15560","<p>Is the field ""_id"" necessary in Android SQLite?</p>","364979","","114066","","2010-07-15 14:06:20","2014-02-14 08:16:37","About ""_id"" field in Android SQLite","<android><sqlite>","6","0","19","",""
"3192109","1","3217924","","2010-07-07 05:20:42","2","4990","<p>I am new to android. I have to add table row in a dynamic manner.In that row i need to add two child(Textview).But it displays only one textview only(first one).Here is my code</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.widget.LinearLayout;import android.widget.ScrollView;import android.widget.TableRow;import android.widget.TextView;public class DynamicTextView extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ScrollView sv = new ScrollView(this);    LinearLayout ll = new LinearLayout(this);    ll.setOrientation(LinearLayout.VERTICAL);    sv.addView(ll);    for(int i=0;i&lt;30;i++){     TableRow tbrow=new TableRow(this);     TextView tv1=new TextView(this);     tv1.setText(""Dynamic TextView"");     TextView tv2=new TextView(this);     tv2.setText("" No : ""+i);     tbrow.addView(tv1);     tbrow.addView(tv2);     ll.addView(tbrow);    }    setContentView(sv);  }}</code></pre><p>output is:</p><pre><code>   Dynamic TextView   Dynamic TextView   Dynamic TextView   Dynamic TextView   .........   ..........</code></pre>","383489","","","","","2010-07-10 05:10:45","how to add child to tablerow dynamically in android?","<android>","1","0","","",""
"3192119","1","3192153","","2010-07-07 05:23:32","3","364","<p>Suppose an application stores some user related or users favorite records in its local database.  When I upgrade my application, what happens to the db? As an developer, how do I prevent loss of data?</p>","286044","","23897","","2010-07-07 05:27:48","2010-07-07 05:33:06","What happens to my existing application database when I upgrade it to new version in Android","<android><database>","1","0","1","",""
"3192173","1","3193127","","2010-07-07 05:38:48","17","12996","<p>Instead of having a check mark for the icon, I want a custom star (I have checked and unchecked icons). Can this be done through a property? Or must I declare a custom widget that derives from Checkbox?</p>","200477","","","","","2014-03-04 19:54:19","Change icons of checked and unchecked for Checkbox for Android","<java><android><checkbox><icons>","3","0","7","",""
"3192492","1","3192552","","2010-07-07 06:46:22","1","366","<p>The following is my code for SettingsActivity.java. The main activity starts this activity by calling onScreenSettings(this)</p><pre><code>public class SettingsActivity extends ListActivity{static String[] main_settings = {""mode"",                            ""timeout""};static String[] mode = { ""Audio"",                  ""Video"",                  ""Audio/Video""};static String[] timeout = {                        ""1 min"",                        ""5 min"",                        ""10 min""};static String result;static String[] display;boolean settings_selected = false;static String TAG = ""****ALIST****"";public static void onScreenSettings(Activity c){    display = main_settings;    Log.d(TAG,""inside onScreenSettings"");    Intent intent = new Intent(c.getApplication(),SettingsActivity.class);    try{        c.startActivityForResult(intent,1);        Log.d(TAG,""after starting activity in onScreenSettings"");    }catch(Exception e){    }}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Log.d(TAG,""inside onCreate-before setting listview"");    setListAdapter(new ArrayAdapter&lt;String&gt;(this,               android.R.layout.simple_list_item_1, display));        getListView().setTextFilterEnabled(true);        Log.d(TAG,""inside oncreate-after setting listview"");}public void onListItemClick(ListView l, View v, int position, long id){     result = (String) l.getItemAtPosition(position);     if(!settings_selected){         if(result.equals(""mode"")){        display = mode;                  }         else if(result.equals(""timeout"")){        display = timeout;                       }         settings_selected = true;         Log.d(TAG,""if !setting_selected"");     }     else{/*accepting the sub options*/         display = main_settings;//next the main settings must be displayed         if(result.equals(""Audio"")){         }         else if(result.equals(""Video"")){             Log.d(AndroidRecorder.TAG,""inside sub option Video"");         }         else if(result.equals(""Audio/Video"")){         }         settings_selected = false;         Log.d(TAG,""if setting_selected"");     }     Intent intent = new Intent(this.getApplication(),SettingsActivity.class);     try{        startActivityForResult(intent,1);        Log.d(TAG,""after starting activity in ListItemClick"");    }    catch(Exception e){    }}public void onActivityResult(int requestCode, int resultCode,Intent data) {    //nothing to do with the intent here    Log.d(TAG,""inside onActivityResult"");    setResult(RESULT_OK, data);    finish();    Log.d(TAG,""inside onActivityResult-after finish()"");}/*public void onBackPressed(){    Log.d(TAG,""inside onBackPressed"");    finish();    Log.d(TAG,""inside onBackPressed-after finish()"");}*/}//end of ListActivity</code></pre><p>Problem is control is not entering the <code>else /*accepting the sub options*/</code> and I can't figure out why.  As a result, the mode or timeout list is getting displayed again and again and the main_settings is not displayed.Please help.</p>","381699","","105224","","2010-07-07 06:48:55","2010-07-07 06:57:22","problem with ListActivity","<android>","1","0","","",""
"3192582","1","","","2010-07-07 07:01:43","0","2254","<p>I need to add table row by using Java code only (not XML design).</p><p>In that table row I have to add two textview fields. I use the code below.</p><pre><code> TableRow tblrow=new TableRow(this); tblrow.addView(Textview1); tblrow.addView(Textview2);</code></pre><p>But it only displays Textview1. How to view both? </p><p>I am new to Android.</p>","373172","","63550","","2010-09-25 13:27:35","2012-06-12 05:55:02","Add table row dynamically in Android?","<android>","1","0","1","",""
"3192595","1","3193909","","2010-07-07 07:04:43","12","14653","<p>I'm trying to make a layout that is something similar to how the android market is...where say under comments there is what appears to be a <code>ListView</code> but it does not scroll (the whole page scroll but not the comments). I'm not sure if its even a ListView but I want something that looks like the list view (ie. have those divider bars and what not but NOT SCROLLABLE). There are people suggesting to use a <code>LinearLayout</code> instead of a <code>ListView</code> but I also want the items to be clickable and open a new activity. Please help?</p><p>My current layout tree is like so</p><pre><code>&lt;LinearLayout&gt;  &lt;ScrollView&gt;     &lt;RelativeLayout&gt;</code></pre><p>I am looking to put content inside the <code>RelativeLayout</code>.</p>","362476","","114066","","2012-01-27 12:19:27","2014-03-26 15:40:29","Android ListView that does not scroll?","<android><xml><layout><android-listview>","4","0","8","",""
"3192629","1","","","2010-07-07 07:14:50","2","1731","<p>I am having a video resizing issue, I have to build the layout programatically, and here's my code:</p><pre><code>    layout = new RelativeLayout(this);    top = new RelativeLayout.LayoutParams( LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT);    top.addRule(RelativeLayout.ALIGN_PARENT_TOP);    RelativeLayout.LayoutParams middle = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);    middle.addRule(RelativeLayout.BELOW, myText.getId());    bottom = new RelativeLayout.LayoutParams( LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT);    bottom.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);    layout.addView(myText,top);      layout.addView(myVideo,middle);    layout.addView(myButtons,bottom);    setContentView(layout);</code></pre><p>The root layout is a relative layout. myText is a Textview that I want to add at the top of the root layout. Next, I want to add a VideoView below myText. And at the bottom of the root layout, I want to add some buttons. </p><p>myVideo is a LinearLayout defined as below:</p><pre><code>    video = new VideoView(this);    myVideo = new LinearLayout(this);    myVideo.setGravity(0x11);    videoParams = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);    myVideo.setOrientation(LinearLayout.VERTICAL);    myVideo.addView(video,videoParams);</code></pre><p>In portrait mode, the video shows up in the middle with the video occupying the entire width and the right amount of height. In landscape mode, the video occupies the entire screen (which is what I want), and myText does not show up at all. </p><p>Thanks Chris</p>","321927","","321927","","2010-07-07 15:35:33","2010-07-07 15:35:33","Android -- RelativeLayout and LinearLayout -- VideoView resize issue","<android><android-linearlayout><videoview><relativelayout>","0","0","","",""
"3192639","1","3192892","","2010-07-07 07:17:07","-1","188","<p>is Android Email Client supported pop protocols.</p><p>Thanks.</p>","309990","","","","","2010-07-07 08:01:47","is Android Email Client support pop protocols","<android><email>","1","5","","",""
"3192921","1","","","2010-07-07 08:06:56","3","1513","<p>I have a Android phone connected with host computer with USB cable. ADB runs well and I can debug application on phone. The only problem is that the App requires special network setup which I can reach on host but not mobile. Is there a way to let the device send all network operations through ADB and Host network?</p><p>Thanks in advance.Ryan</p>","368496","","","","","2011-08-23 18:38:46","Can phone use host network when debugging on device via Eclipse/ADB?","<android><adb>","2","0","","",""
"3193190","1","3195431","","2010-07-07 08:41:35","4","9636","<p>I need to create all the UI programmatically ""on demand"", this means I can't use any XML. This is the pseudo code of what I do:</p><pre><code>View v = new MyView();activity.setContentView(v);tabHost = new TabHost();....tabHost.setup();TabSpec tabSpec = _tabHost.newTabSpec(page);        tabSpec.setIndicator(title);        tabSpec.setContent((TabContentFactory) this);activity.setContentView(tabHost);</code></pre><p>so when TabContentFactory is called I return the view which is the content view of the current activity. Basically what I do is taking current view and wrapping it in the tabhost.It half works, when I do this I'm able to see the tabbar, but only black view below it, if I click on other tab and then click back then I can see the view, everything works as intended.<br><b>Now why I think it's related to <code>setContentView</code>, because when I do this:</b></p><pre><code>   View v = new MyView();//    activity.setContentView(v); // we don't use it as current content viewtabHost = new TabHost();....tabHost.setup();TabSpec tabSpec = _tabHost.newTabSpec(page);        tabSpec.setIndicator(title);        tabSpec.setContent((TabContentFactory) this);</code></pre><p>Then everything is working perfectly.Any help appreciated, thanks!</p>","118767","","","","","2010-07-07 13:54:51","understanding Activity's setContentView","<android><activity><android-tabhost>","1","0","2","",""
"3193273","1","","","2010-07-07 08:54:31","1","389","<p>I have a top level TabHost that implements the onCreateOptionsMenu method. And I want sub-activities (those within the tabs) to be able to intercept the options menu via onOptionsItemSelected. Like for example, in the options menu I have an item called, ""Edit Note"" and in one tab there is a ListView with a list of all the notes. I want the ""Edit Note"" item to be able to be viewed throughout the application, but the top level TabActivity doesn't know information such as title or id of the note.</p>","200477","","","","","2011-05-06 18:44:08","Intercept onOptionsItemSelected","<java><android><android-tabhost><options-menu>","1","0","","",""
"3193356","1","3193856","","2010-07-07 09:09:50","5","11845","<p>In my application....there are some images like temp1.jpg, temp2.jpg .....upto temp35.jpg,</p><p>so on button clicking, i want to load one-by-one image in ImageView ....i want to do like:</p><blockquote>  <p><strong>cnt=1; <br/> imagename=""temp"" + cnt + "".jpg""; <br/> cnt++;</strong></p></blockquote><p>so my confusion is that ""is there anyway to load an image in imageview from string(imagename variable) like temp1.jpg,etc.""</p>","379693","","","","","2010-11-10 10:19:02","Load Images in ImageView in Android","<android><android-widget><imageview>","4","0","1","",""
"3193377","1","3194391","","2010-07-07 09:13:31","1","1184","<p>If user behind proxy he can set proxy settings in android handset under 'access point option' is there a way i can read proxy settings from android handset?</p>","216431","","380579","","2010-07-07 09:15:54","2012-02-22 20:06:42","Android read handset proxy settings","<android><proxy><settings>","3","0","1","",""
"3193473","1","","","2010-07-07 09:26:06","0","1077","<p>I'm using the follow code, to create a non-scaled, centred image as a background, in a relative layout:-</p><pre><code>RelativeLayout explosionlayout = (RelativeLayout) findViewById (R.id.explosionlayout);explosionlayout.setBackgroundColor(R.color.white);Bitmap myBitmap = BitmapFactory.decodeResource(this.getResources(), R.drawable.bomb);    BitmapDrawable test1 = new BitmapDrawable(myBitmap);    test1.setGravity(Gravity.CENTER);</code></pre><p>The only problem I have, is that the background of the relativelayout is grey, regardless of what I set it to, either via XML or in code.</p><p>Any ideas would be appreciated, thanks.</p>","330770","","286595","","2010-07-07 09:34:34","2010-08-03 02:31:38","Android - How to change grey background created by a BitmapDrawable","<android><background><bitmap><drawable><relativelayout>","1","0","","",""
"3193480","1","3193763","","2010-07-07 09:27:05","1","2106","<p>So I can display Android's contact selecton activity by calling</p><pre><code>startActivityForResult(intent, PICK_CONTACT); </code></pre><p>and i can get the selected contact by overriding onActivityResult  </p><pre><code>public void onActivityResult(int reqCode, int resultCode, Intent data) {   super.onActivityResult(reqCode, resultCode, data); }</code></pre><p>Trouble is onActivityResult is only available when I am calling from an Activity myself. If I am in a DialogPreference for instance how would i get at the selected contact because I do not have an onActivityResult to override ?</p><p>TIA</p><p>Pat Long</p>","63286","","","","","2011-03-07 00:14:29","Calling PICK_CONTACT Intent not from an Activity","<android><android-preferences>","2","0","","",""
"3193585","1","3195548","","2010-07-07 09:43:05","1","1958","<p>I have tried via <code>&lt;a href=""market://search?q=pname:com.google.zxing.client.android""&lt;/a&gt;</code> but it is not working.</p><p>I have also checked in Google Android T-mobile G1 but it does not show me link.</p><p>How can i embed link of android market application link in sms?</p>","385343","","114066","","2010-07-07 14:10:05","2010-07-14 20:08:49","Android market link in SMS","<android><google-play>","2","0","0","",""
"3193615","1","","","2010-07-07 09:47:53","3","1239","<p>You'll have to bear with me, I'm very new to Android and my Java skills are ""rusty"" at best.</p><p>I was pretty excited to get the barcode scan bit working with very little effort indeed, but the camera side of things really isn't proving as easy.</p><p>I've got a main Activity class that calls for a barcode when it starts up;</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button cameraButton = (Button) findViewById(R.id.cameraButton);    cameraButton.setOnClickListener( new OnClickListener(){        public void onClick(View v ){            IntentIntegrator.initiateScan(MakroDroidActivity.this, ""Please scan order barcode"", ""Please scan a valid order barcode"", ""Yes"", ""No"");        }    });}</code></pre><p>Working so far and I correctly handle the intent as shown:</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {             switch(requestCode) {                 case IntentIntegrator.REQUEST_CODE: {                     if (resultCode != RESULT_CANCELED) {                         IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);                         if (scanResult != null) {                             String upc = scanResult.getContents();                            if (upc.startsWith(""ORD""))                            {                                //we have a valid order barcode                                Camera cam = Camera.open();                                cam.takePicture(shutterCallback, rawCallback, jpegCallback);                             }                            else                            {                                IntentIntegrator.initiateScan(MakroDroidActivity.this, ""Please scan again"", ""Please scan a valid order barcode"", ""Yes"", ""No"");                             }                        }                     }                     break;                 }             }         }</code></pre><p>I have the call backs set up (currently with no code in them) but after the barcode is scanned, the device just displays a black screen. I then need to restart the device after debugging the app because the camera is no longer available (I suspect that I have not cleaned up my reference so the camera is locked to my app)</p><p>Can somebody explain to me how I go about using the camera and saving the output to the SD card (I'm planning on using a specific folder on the SD card with something like: </p><pre><code>filepath = filepath + UUID.randomUUID().toString() + "".jpg""; </code></pre><p>to save a new, non-conflicting filename to the folder.</p><p>(Device is a T-Mobile pulse mini (Huawei manufactured I believe) and I have seen other people say there are driver issues with the camera but I am more inclined to believe it is a lack of my understanding rather than a hardware issue.)</p><p>Thanks in advance for any assistance you can give on this.</p>","385382","","","","","2011-06-03 20:48:40","Saving pictures from the camera in Android","<android>","1","0","1","",""
"3193648","1","3496143","","2010-07-07 09:51:35","5","3429","<p>I am writing a live wallpaper and I use the function:</p><pre><code>public void onOffsetsChanged(float xOffset, float yOffset,            float xOffsetStep, float yOffsetStep, int xPixelOffset,            int yPixelOffset)</code></pre><p>To see when the uses swipes across to another screen, and I used xPixelOffset to see how far the screen has moved in pixels, however it does not return the number of pixels I would expect.</p><p>For each of the 5 screens of the desktop it shows the pixel offset to be 0,-80,-160,-240,-320 however I would expect it to be offset by the width of the screen each time (240px rather than 80px)</p><p>Am I missing something?</p>","315998","","645502","","2011-04-30 19:30:15","2012-12-18 18:46:59","Android live wallpaper onOffsetsChanged xPixelOffset doesn't seem to return the real pixel offset","<android><live-wallpaper>","3","0","5","",""
"3193660","1","","","2010-07-07 09:52:46","1","9018","<p>I try to add a table layout from Java code. When there are two fields in a tablerow it displays the first field only. How to display the entire row with all fields?</p><pre><code>  .....  ....  for(int idx=0;idx&lt;4;idx++){      TableRow tbrow   = new TableRow(this);      TextView text_v1 = new TextView(this);      text_v1.setText(""TextView"");      TextView text_v2 = new TextView(this);      text_v2.setText("" Idx : ""+idx);      tbrow.addView(text_v1);      tbrow.addView(text_v2);      linearlayout.addView(tbrow);  }  .........      ........</code></pre><p>How to do this?</p>","373172","","63550","","2010-09-14 18:01:00","2013-10-04 05:49:16","Dynamic table layout in Android?","<android>","2","0","","",""
"3193718","1","11469374","","2010-07-07 10:01:28","1","1031","<p>I'm pretty new to Android development and I'd like to know whether Android supports the above mentioned features which are there in C.</p><p>Thanks in advance.</p>","86605","","316487","","2012-07-13 12:20:15","2012-07-13 12:20:15","Does Android support setjmp/longjmp, access, chdir, getcwd?","<android><android-ndk><c-libraries>","3","0","","",""
"3193815","1","3193916","","2010-07-07 10:17:23","1","799","<p>I have a database that stores the rank of an Item.The rank is an absolute value that will be correct if all the items are taken into account.</p><p>If I only need a subset say four of this items it will give me something like:</p><pre><code>Rank     RowId in the whole Table---------------4         114 8         7170        1683        7</code></pre><p>I now need an int specifying the rank only in the subset where the max rank is the number of items in the subset in my example 1,2,3,4. </p><p>Is there a way to achieve this in my sqlite query? I only need one of the ranks in my Activity. I thought of ordering the results of the query by rank and then somehow get the position of item I want to rank at that moment. But how would I achieve this with sqlite?</p><p>I tried to create a temporary table and insert the subset into it like this: </p><p>CREATE TABLE rank(ID);INSERT INTO position SELECT ID from items WHERE ITEM_ID = 3 ORDER BY POSITION;SELECT RowID from rank WHERE ID = 9;DROP TABLE rank;</p><p>This is working in SQLite Manager and will return the correct number. But if I do this in Android in fails saying that there is no table rank while compiling query</p><pre><code>07-07 13:35:46.150: ERROR/AndroidRuntime(2047): Caused by: android.database.sqlite.SQLiteException: no such table: rank: , while compiling: SELECT RowID from rank WHERE ID = 9</code></pre>","114066","","114066","","2010-07-07 11:46:10","2010-07-07 11:48:57","How can I count the number of rows before a certain row in sqlite?","<android><sqlite>","3","1","","",""
"3193818","1","","","2010-07-07 10:17:31","0","1634","<p>i am making a canvas and setting its background which is an imagei am adding text on it by canvas.Drawtext method which works perfctly alrightnow i want these text to be clickable but i couldnt  find any method</p><p>the other method i could think of was to add text box on canvas add write on click event of these text box but could not find any example related to this can anybody suggest what to do</p>","385417","","","","","2013-12-14 21:13:20","android: how to add button or text box on canvas","<android>","2","0","","",""
"3193965","1","3194432","","2010-07-07 10:46:15","0","3051","<p>what is the Android Email content uri.form the Email Client source code i get the following Uri </p><pre><code>content://com.android.email.provider/bodycontent://com.android.email.provider/messagecontent://com.android.email.provider/syncedMessagecontent://com.android.email.provider/deletedMessagecontent://com.android.email.provider/updatedMessagecontent://com.android.email.provider/accountcontent://com.android.email.provider/accountIdAddToFieldcontent://com.android.email.provider/attachmentcontent://com.android.email.provider/attachment/messagecontent://com.android.email.provider/mailboxcontent://com.android.email.provider/mailboxIdAddToFieldcontent://com.android.email.provider/hostauth</code></pre><p>but not returning cursor when i run the following code.</p><pre><code>Uri uri = Uri.parse(""content://com.android.email.provider/account"");Cursor cursor = mContext.getContentResolver().query(uri, null, null,null,null);</code></pre><p>anyone no how i can access email contents?</p><p>Thanks.</p>","309990","","","","","2013-01-03 20:59:16","Android Email Uri","<android><email>","2","0","0","",""
"3193995","1","","","2010-07-07 10:51:45","1","543","<pre><code>Notification notification = new Notification(icon, tickerText, when); notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent); notification.defaults |= Notification.DEFAULT_SOUND; notification.defaults |= Notification.DEFAULT_VIBRATE; notification.defaults |= Notification.DEFAULT_LIGHTS; notification.flags |= Notification.FLAG_AUTO_CANCEL; notification.flags |= Notification.FLAG_SHOW_LIGHTS; notification.ledARGB = 0xff00ff00; notification.ledOnMS = 300; notification.ledOffMS = 1000; </code></pre><hr><pre><code>Change in manifest :&lt;uses-permission         android:name=""android.permission.VIBRATE""&gt;&lt;/uses-permission&gt; </code></pre><p>I have added the above code. its running without errors. But no effects are seen. Does it run on android 1.5 ???</p>","344768","","243782","","2010-07-07 10:55:41","2010-07-08 11:51:26","Playing ringtone & vibrating phone?","<android>","1","0","","",""
"3193997","1","3195341","","2010-07-07 10:51:55","14","18260","<p>I am exploring capabilities and features of PhoneGap. I have gone through the <a href=""http://www.phonegap.com/about/"">PhoneGap</a> site. Is there any possibility (or) workaround to send text messages and access phonebook information of Android using the PhoneGap framework?</p>","179043","","2153784","","2011-08-28 17:10:56","2013-01-17 21:41:51","Send SMS through PhoneGap on Android","<android><sms><contacts><phonegap>","4","2","11","",""
"3194012","1","","","2010-07-07 10:54:32","0","2417","<p>My loadMap() method generate a canvas.throwIfRecycled exception when i try to load a new map.<br>When i start the game, the initial map loads and work fine though,<br>its only when i try to load a new map that i get the exception ..  </p><p>how can i ""reset"" canvas and the bitmap i use to draw into, so i can startover fresh with them ?<br>here's what i use to create and draw my maps:</p><pre><code>picDest = Bitmap.createBitmap(width*tileSize, height*tileSize, Bitmap.Config.RGB_565);canvas = new Canvas(picDest);for (int y = 0; y &lt; height; y++) {  for (int x = 0; x &lt; width; x++) {    // process tile stuffs here ...    /*    col = ....:    row = ....;    */    pic[x][y]= Bitmap.createBitmap(sheet, col*tileSize, row*tileSize, tileSize, tileSize);    canvas.drawBitmap(pic[x][y],x*tileSize,y*tileSize,bitmPaint);   }}</code></pre><p>so basicaly once i created and used picDest and canvas,<br>i cannot figure how to reset it all for when i want to load a new map..  </p><p>tnx</p>","377783","","","","","2011-04-21 03:40:45","how can i ""reset"" the canvas (and the bitmap used to draw into) so i can draw a new bitmap into the canvas?","<android><canvas><bitmap>","2","0","","",""
"3194112","1","","","2010-07-07 11:10:56","2","1201","<p>In my application I have a number of Activity classes. When I run on emulator (or install to a device) a corresponding number of program shortcuts show up in the programs menu. Why does this happen and how can I avoid it?Many thanks.</p>","385457","","159462","","2010-07-07 11:13:44","2010-07-07 13:42:05","Multiple program shortcuts from one application","<android><activity><shortcuts>","2","0","1","",""
"3194210","1","3194229","","2010-07-07 11:24:26","0","379","<p>I am getting (what I believe) is a string from my hashmap and need to return this from my method as a Uri in order to use it in a VideoView.  Here is my method that gets the string from my hashmap:</p><pre><code>public static Uri getVideoPath(String cond){        Log.d(DEB_TAG, ""*********Inside of getVideoPath"");        HashMap hm = createHashmap();        Log.d(DEB_TAG, ""********Value of hm is "" + hm.get(cond));        Uri tempPath = (Uri) hm.get(cond);        return tempPath;    }</code></pre><p>I get a value for my ""hm.get(cond)""  of this ""http://www.personal.psu.edu/tmv105/video/sunny/sunny.mp4""  I get no value for ""tempPath"" which is the value that I am passing over to the call of this method like this: (mVid is my VideoView)</p><pre><code>mPath = LayoutConditions.getVideoPath(wd.getCurrentIconCode());mVid.setVideoURI(mPath);mVid.requestFocus();mVid.start();</code></pre><p>Any ideas how I might handle this?  Thanks in advance for any help provided!</p>","2186261","","","","","2010-07-07 11:27:05","How to change a string to Uri","<android><uri>","1","0","","",""
"3194522","1","","","2010-07-07 12:13:09","0","601","<p>Warning</p><pre><code>**07-07 15:24:25.021: WARN/ActivityManager(57): Activity is launching as a new task, so cancelling activity result.**07-07 15:24:25.681: WARN/ActivityManager(57): Activity pause timeout for HistoryRecord{43cccce8 com.tcs.QuickNotes/.QuickNotesHome}07-07 15:24:27.392: INFO/AudioPathIn onActivityResult(1370):  onActivityResult07-07 15:24:27.410: INFO/requestCode(1370): requestCode107-07 15:24:27.420: INFO/resultCode(1370): **resultCode0**</code></pre><p>My code</p><pre><code>@Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        super.onActivityResult(requestCode, resultCode, data);        Log.i(""AudioPathIn onActivityResult"","" onActivityResult""+audioFilePath.getText().toString());        Log.i(""requestCode "",""requestCode""+requestCode);        Log.i(""resultCode "",""resultCode""+resultCode);        if(requestCode == 1)        {            if(resultCode == RESULT_OK)            {                Audioflag=1;                audioFilePath.setVisibility(View.VISIBLE);                String defaultToneStatus = data.getStringExtra(""DefaultTone"");                if(defaultToneStatus.equals(""false""))                {                    audioFilePath.setText(AudioRecorder.getFilePath());                }                else                {                    defaultAudioToneFlag = 1;                    audioFilePath.setText(""-"");                }            }else            {                Audioflag=0;            }        }    }</code></pre><p>Its not entering the above code. Result code is always 0;</p><p>Code from where control is being returned :</p><pre><code>public class AudioRecorder extends Activity implements OnClickListener {    String p = null;    static String filePath,FlagFromEdit,primaryIdFromEdit;    static int pId;    static int audioFlag;    Intent intent;    CheckBox defaultRingtone;    MyRecorder recorder;    /** Called when the activity is first created. */    @Override        public void onCreate(Bundle savedInstanceState)     {        /** Called when the activity is first created. */        super.onCreate(savedInstanceState);        setContentView(R.layout.voicenote);        audioFlag=0;        intent=getIntent();        p = intent.getStringExtra(""primaryiid"");        pId = (Integer.parseInt(p));        Log.v(""p"", ""pid"" +pId);        setResult(RESULT_CANCELED);//      FlagFromEdit=intent.getStringExtra(""FlagFromEdit"");//      primaryIdFromEdit=intent.getStringExtra(""PrimaryId"");        defaultRingtone = (CheckBox)findViewById(R.id.Cb_defaultRingtone);        defaultRingtone.setOnClickListener(this);        Button btn_record = (Button)findViewById(R.id.btn_record);        btn_record.setOnClickListener(btnListenerRecord);        Button btn_stop = (Button)findViewById(R.id.btn_stop);        btn_stop.setOnClickListener(btnListenerStop);        Button btn_play = (Button)findViewById(R.id.btn_play);        btn_play.setOnClickListener(btnListenerPlay);        Button btn_save = (Button)findViewById(R.id.btn_save);        btn_save.setOnClickListener(btnListenerSave);    }    private OnClickListener btnListenerRecord = new OnClickListener()    {        public void onClick(View v)         {            try            {                recorder = new MyRecorder(""voice/"" + pId + """");                recorder.start();                Toast.makeText(getBaseContext(),""Recording started !"", Toast.LENGTH_LONG).show();            }             catch (Exception e)            {                e.printStackTrace();            }        }    };     private OnClickListener btnListenerStop = new OnClickListener()    {        public void onClick(View v)        {            MediaPlayer mp = new MediaPlayer();            try             {                recorder.stop();                Toast.makeText(getBaseContext(),""Stop ! IsPlaying : "" + mp.isPlaying(), Toast.LENGTH_LONG).show();            }             catch (Exception e)            {                e.printStackTrace();            }        }    };     private OnClickListener btnListenerPlay = new OnClickListener()    {        public void onClick(View v)        {             MediaPlayer mp = new MediaPlayer();             try             {                mp.setDataSource(""/sdcard/voice/""+ pId + "".3gp"");// set data-source                mp.prepare();// prepare                mp.start();                Toast.makeText(getBaseContext(), ""Playing File no : ""+pId, Toast.LENGTH_LONG).show();            }            catch (Exception e)            {                e.printStackTrace();            }            Toast.makeText(getBaseContext(), "" Is playing ? : ""+ mp.isPlaying(),                    Toast.LENGTH_LONG).show();        }    };    private OnClickListener btnListenerSave = new OnClickListener()    {        public void onClick(View v)         {            try            {                //              String fileName = ""/sdcard/voice/""+ pId + "".3gp"";                //              Intent intentSave =  new Intent(getBaseContext(),AddToDoList.class);                //              intentSave.putExtra(""SavedFile"", fileName);                //              intentSave.putExtra(""CalledFrom"", ""AudioRecorder"");                //              startActivity(intentSave);                audioFlag=1;                Toast.makeText(AudioRecorder.this,""File saved successfully !"",Toast.LENGTH_LONG).show();                Intent intent = new Intent();                intent.putExtra(""DefaultTone"", ""false"");                setResult(RESULT_OK,intent);                finish();            }             catch (Exception e)            {                e.printStackTrace();            }        }    };    public static int getAudioFlag()    {        return audioFlag;    }    public static String getFilePath()    {        filePath =""/sdcard/voice/""+ pId + "".3gp"";        return filePath;    }    public static void playAudioFile(Context ctx,String pId)    {        MediaPlayer mp = new MediaPlayer();         try         {            Log.i(""playaudiofile"",""file being played"");            //Toast.makeText(ctx,""file being played"",Toast.LENGTH_LONG).show();            Toast.makeText(ctx, ""Playing File no : ""+pId, Toast.LENGTH_LONG).show();            mp.setDataSource(""/sdcard/voice/""+ pId + "".3gp"");// set data-source            mp.prepare();// prepare            mp.start();        }        catch (Exception e)        {            Toast.makeText(ctx, "" No file was assigned "", Toast.LENGTH_LONG).show();            e.printStackTrace();        }    }    @Override    public void onClick(View arg0) {        // TODO Auto-generated method stub        Toast.makeText(AudioRecorder.this,""Default ringtone set !"",Toast.LENGTH_LONG).show();        Intent intent = new Intent();        intent.putExtra(""DefaultTone"", ""true"");        setResult(RESULT_OK,intent);        finish();       }}</code></pre>","344768","","244296","","2010-07-07 12:24:53","2010-07-07 13:27:22","Not getting desired value in ""onActivityResult""","<android>","1","1","","",""
"3194686","1","","","2010-07-07 12:35:34","1","538","<p>we have an application that need to interact with mail.For that, our customer want us to : - Retrieve the Activesync parameters the user have entered on the general parameters of the phone.- Send the mail in a silent way using these activesync parameters.- Be able to read and parse a possible reply to the mail on the Exchange server.</p><p>I  know that it may cause severe security issue (retrieve a private password from an application is not a good practice..), but i can't find any clue on the sdk to communicate and send mail via activesync.</p><p>If anyone have some informations, i would be glad to hear about it.</p><p>Thanks a lot</p><p>Antoine</p>","382043","","380579","","2010-07-07 12:39:35","2010-07-07 17:42:57","How to send a mail via Activesync from an android app?","<android><email><activesync>","1","0","0","",""
"3194784","1","","","2010-07-07 12:51:53","0","562","<p>i was working on webview following the link <a href=""http://developer.android.com/resources/tutorials/views/hello-webview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-webview.html</a> and it is working fine but the problem is i cant view the whole page i mean that it is horizontally not scrollable.</p><p>how can i view the whole page by scrolling both horizontally and vertically?</p><p>Activity</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.KeyEvent;import android.webkit.WebView;import android.webkit.WebViewClient;public class HelloWebView extends Activity {    /** Called when the activity is first created. */    WebView mWebView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    mWebView = (WebView) findViewById(R.id.webview);    mWebView.getSettings().setJavaScriptEnabled(true);    mWebView.loadUrl(""http://www.google.com"");    mWebView.setWebViewClient(new HelloWebViewClient());}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; mWebView.canGoBack()) {        mWebView.goBack();        return true;    }    return super.onKeyDown(keyCode, event);}private class HelloWebViewClient extends WebViewClient {    @Override    public boolean shouldOverrideUrlLoading(WebView view, String url) {        view.loadUrl(url);        return true;    }}</code></pre><p>}</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;WebView  xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/webview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:scrollbars=""horizontal|vertical""/&gt;</code></pre>","314426","","314426","","2010-07-09 08:20:05","2011-04-13 06:51:19","webview in android","<java><android>","2","0","","",""
"3194860","1","3196439","","2010-07-07 13:02:08","3","2615","<p>I need to connect my android to a bluetooth device. I use the BluetoothChat sample from Google.</p><p>I had some trouble to do this with a Google Nexus one, because the Nexus was making the connection but disconnects right after. I need to initiate twice time the connection as workaround (see connectionLost()).</p><p>Now, it works well on the Nexus One and on the HTC Desire too.</p><p>My problem is the disconnection at application exit. It works fine on the Nexus one, the connection is closed, but not on the HTC Desire. I add the inputstream/outputstream close function in addition to the socket close. Have a look at the ""stop()"" function.</p><pre><code>package xxx.yyy.zzz;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.lang.reflect.Method;import java.util.UUID;import activities.Act_Main;import android.bluetooth.BluetoothAdapter;import android.bluetooth.BluetoothDevice;import android.bluetooth.BluetoothSocket;import android.content.Context;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.util.Log;/** * This class does all the work for setting up and managing Bluetooth * connections with other devices. It has a thread that listens for * incoming connections, a thread for connecting with a device, and a * thread for performing data transmissions when connected. */public class BluetoothService {    // Debugging    private static final String TAG = ""BluetoothService"";    private static final boolean D = true;    // Member fields    //private final BluetoothAdapter mAdapter;    private final Handler mHandler;    private ConnectThread mConnectThread;    private ConnectedThread mConnectedThread;    private int mState;    private String mBTAddress;    private boolean isStop = false;    // Constants that indicate the current connection state    public static final int STATE_NONE = 0;       // we're doing nothing    public static final int STATE_LISTEN = 1;     // now listening for incoming connections    public static final int STATE_CONNECTING = 2; // now initiating an outgoing connection    public static final int STATE_CONNECTED = 3;  // now connected to a remote device    /**     * Constructor. Prepares a new Act_Main session.     * @param context  The UI Activity Context     * @param handler  A Handler to send messages back to the UI Activity     */    public BluetoothService(Context context, Handler handler)    {        //mAdapter = BluetoothAdapter.getDefaultAdapter();        mState = STATE_NONE;        mHandler = handler;    }    /**     * Set the current state of the connection     * @param state  An integer defining the current connection state     */    private synchronized void setState(int state)    {        if (D) Log.d(TAG, ""setState() "" + mState + "" -&gt; "" + state);        mState = state;        // Give the new state to the Handler so the UI Activity can update        mHandler.obtainMessage(Act_Main.MESSAGE_STATE_CHANGE, state, -1).sendToTarget();    }    /**     * Return the current connection state. */    public synchronized int getState()    {        return mState;    }    /**     * Start the ConnectThread to initiate a connection to a remote device.     * @param device  The BluetoothDevice to connect     */    public synchronized void connect(String BTAddress)    {        mBTAddress = BTAddress ;        // Get the BLuetoothDevice object        BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(BTAddress);        if (D) Log.d(TAG, ""connect to: "" + device);        // Cancel any thread attempting to make a connection        if (mState == STATE_CONNECTING)            if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}        // Cancel any thread currently running a connection        if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}        // Start the thread to connect with the given device        mConnectThread = new ConnectThread(device);        mConnectThread.start();        setState(STATE_CONNECTING);        isStop = false ;    }    /**     * Start the ConnectedThread to begin managing a Bluetooth connection     * @param socket  The BluetoothSocket on which the connection was made     * @param device  The BluetoothDevice that has been connected     */    public synchronized void connected(BluetoothSocket socket, BluetoothDevice device)    {        if (D) Log.d(TAG, ""connected"");        // Cancel the thread that completed the connection        if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}        // Cancel any thread currently running a connection        if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}        // Start the thread to manage the connection and perform transmissions        mConnectedThread = new ConnectedThread(socket);        mConnectedThread.start();        // Send the name of the connected device back to the UI Activity        Message msg = mHandler.obtainMessage(Act_Main.MESSAGE_DEVICE_NAME);        Bundle bundle = new Bundle();        bundle.putString(Act_Main.DEVICE_NAME, device.getName());        msg.setData(bundle);        mHandler.sendMessage(msg);        setState(STATE_CONNECTED);    }    /**     * Stop all threads     */    public synchronized void stop()    {        isStop = true ;        if (D)            Log.d(TAG, ""stop"");        if(mConnectThread != null)        {            mConnectThread.cancel();            Thread moribund = mConnectThread;            mConnectThread = null;            moribund.interrupt();        }        if(mConnectedThread != null)        {            mConnectedThread.cancel();            Thread moribund = mConnectedThread;            mConnectedThread = null;            moribund.interrupt();        }        setState(STATE_NONE);    }    /**     * Write to the ConnectedThread in an unsynchronized manner     * @param out The bytes to write     * @see ConnectedThread#write(byte[])     */    public void write(byte[] out)    {        // Create temporary object        ConnectedThread r;        // Synchronize a copy of the ConnectedThread        synchronized (this)        {            Log.d(TAG, ""BT_SEND_MESSAGE"");            if (mState != STATE_CONNECTED)                return;            r = mConnectedThread;        }        // Perform the write unsynchronized        r.write(out);    }    /**     * Indicate that the connection attempt failed and notify the UI Activity.     */    private void connectionFailed()    {        try        {            synchronized (this)            {                this.wait(3000);            }            connect(mBTAddress);        }        catch(InterruptedException ex)        {            Log.e(TAG, ""WAIT_EXCEPTION:""+ ex.getMessage());        }    }    /**     * Indicate that the connection was lost and notify the UI Activity.     */    private void connectionLost()    {        if (!isStop)            connect(mBTAddress);    }    /**     * This thread runs while attempting to make an outgoing connection     * with a device. It runs straight through; the connection either     * succeeds or fails.     */    private class ConnectThread extends Thread    {        private final BluetoothSocket mmSocket;        private final BluetoothDevice mmDevice;        public ConnectThread(BluetoothDevice device)        {            mmDevice = device;            BluetoothSocket tmp = null;            // Get a BluetoothSocket for a connection with the            // given BluetoothDevice            try            {                tmp = device.createRfcommSocketToServiceRecord(UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB""));            }            catch (Exception e)            {                Log.e(TAG, ""create() failed"", e);            }            mmSocket = tmp;        }        public void run()        {            Log.i(TAG, ""BEGIN mConnectThread"");            setName(""ConnectThread"");            // Always cancel discovery because it will slow down a connection            //mAdapter.cancelDiscovery();            // Make a connection to the BluetoothSocket            try            {                // This is a blocking call and will only return on a successful connection or an exception                mmSocket.connect();            }            catch (IOException e)            {                connectionFailed();                // Close the socket                try                {                    mmSocket.close();                }                catch (IOException e2)                {                    Log.e(TAG, ""unable to close() socket during connection failure"", e2);                }                return;            }            // Reset the ConnectThread because we're done            synchronized (BluetoothService.this)            {                mConnectThread = null;            }            // Start the connected thread            connected(mmSocket, mmDevice);        }        public void cancel()        {            try            {                mmSocket.close();            }            catch (IOException e)            {                Log.e(TAG, ""close() of connect socket failed"", e);            }        }    }    /**     * This thread runs during a connection with a remote device.     * It handles all incoming and outgoing transmissions.     */    private class ConnectedThread extends Thread {        private BluetoothSocket mmSocket;        private InputStream mmInStream;        private OutputStream mmOutStream;        public ConnectedThread(BluetoothSocket socket) {            Log.d(TAG, ""create ConnectedThread"");            mmSocket = socket;            InputStream tmpIn = null;            OutputStream tmpOut = null;            // Get the BluetoothSocket input and output streams            try {                tmpIn = socket.getInputStream();                tmpOut = socket.getOutputStream();            } catch (IOException e) {                Log.e(TAG, ""temp sockets not created"", e);            }            mmInStream = tmpIn;            mmOutStream = tmpOut;        }        public void run()        {            Log.i(TAG, ""BEGIN mConnectedThread"");            byte[] buffer;            int bytes = 0;            // Keep listening to the InputStream while connected            while (true)            {                try                {                    //Clear buffer                    buffer = new byte[1024];                    // Read from the InputStream                    bytes = mmInStream.read(buffer);                    // Send the obtained bytes to the UI Activity                    mHandler.obtainMessage(Act_Main.MESSAGE_READ, bytes, -1, buffer).sendToTarget();                }                catch (IOException e)                {                    //String bufferStr = new String(buffer, 0, buffer.length);                    Log.e(TAG, ""disconnected"", e);                    connectionLost();                    break;                }            }        }        /**         * Write to the connected OutStream.         * @param buffer  The bytes to write         */        public void write(byte[] buffer)        {            try            {                mmOutStream.write(buffer);            }            catch (IOException e)            {                Log.e(TAG, ""Exception during write"", e);            }        }        public void cancel()        {            if (mmOutStream != null)            {                try {mmOutStream.close();} catch (Exception e) { Log.e(TAG, ""close() of outputstream failed"", e); }                mmOutStream = null;            }            if (mmInStream != null)            {                try {mmInStream.close();} catch (Exception e) { Log.e(TAG, ""close() of inputstream failed"", e); }                mmInStream = null;            }            if (mmSocket != null)            {                try {mmSocket.close();} catch (Exception e) { Log.e(TAG, ""close() of connect socket failed"", e); }                mmSocket = null;            }        }    }}</code></pre><p>Thanks in advance for your help.</p><p>JJ</p>","337141","","","","","2010-08-31 07:26:55","How to disconnect a bluetooth connection (HTC Desire)","<android><connection><multithreading><bluetooth><close>","3","1","1","",""
"3195020","1","3195057","","2010-07-07 13:19:09","0","842","<p>Is it possible implement an Android application as a <strong>web service</strong>?</p><p>On the official site I've read:</p><blockquote>  <p><em>Note: If you want to develop a server-side application, we recommend  that you implement your application as  a servlet running in a servlet engine  like Tomcat or full-blown JSEE  container like Geronimo. If you prefer  to implement a server-side application  based on our HttpService, we'll assume  that you know what you're doing and  that you don't need help in figuring  out which interceptors need to be  configured.</em></p></blockquote><p>How can I implement this? <strong>Apache TOMCAT</strong> can run on Android?</p>","385561","","114066","","2010-07-07 14:16:32","2012-11-16 08:07:59","Android application as Web Service","<android><web-services>","2","2","1","",""
"3195040","1","3195462","","2010-07-07 13:20:56","1","2399","<p>I am using a <code>Gallery</code> based Cover-flow, as suggested <a href=""http://www.inter-fuser.com/2010/02/android-coverflow-widget-v2.html"" rel=""nofollow"">here</a>.<br>Is there an event that can be caught, which indicates that a single shift (either left or right) has been made in my gallery/cover-flow?<br>To be clear, if I gave the gallery a decent swipe and my center (selected) image has changed 8 times, I would like to catch this event 8 times.  </p><p><code>OnFling()</code> just indicates a single swipe - regardless how many items have shifted.<br>Getting <code>getSelectedItemPosition()</code> before and after the swipe doesn't help since I need to do some work on every shift.<br>It will also be nice while I am at it, to get the direction of the shift - either right or left.  </p>","283630","","592025","","2012-10-30 11:59:44","2012-10-30 11:59:44","Android Gallery: how to detect that an item has shifted in Gallery (and shift direction)","<android><gallery><coverflow>","1","0","","",""
"3195155","1","3195546","","2010-07-07 13:30:20","2","1394","<p>I have the following problem. My main activity consists of a ListView populated with the data obtained from a web service. When the main activity is first loaded, in case the data can't be retrieved from the web, I want to display a dialog with 2 buttons, 'Retry' and 'Cancel'. If the user clicks on 'Reply', the reload data method is called, and if there's any exception, the dialog should appear again.</p><p>I haven't found a way yet to implement my desired behavior.     </p><pre><code>@Overrideprotected void onResume() {   super.onResume();   Log.i(""ItemListActivity"", ""onResume()"");   if(isNewInstance) {      reloadItems();      isNewInstance = false;   }}private void reloadItems() {   try {       itemService.reloadItems();       items = itemService.getItemList();       listAdapter.notifyDataSetChanged();     } catch (Exception e) {       showDialog(RETRY_DIALOG);                   }}protected Dialog onCreateDialog(int id) {   switch(id) {      case RETRY_DIALOG:         return new AlertDialog.Builder(this).setTitle(R.string.retryDialog_title)         .setPositiveButton(R.string.retryDialog_retry, new DialogInterface.OnClickListener() {                @Override                public void onClick(DialogInterface dialog, int which) {                    reloadItems();                }            })            .setNegativeButton(R.string.retryDialog_quit, new DialogInterface.OnClickListener() {                @Override                public void onClick(DialogInterface dialog, int which) {                    finish();                }            })            .create();    }    return null;}</code></pre><p>The first time the reloadItems() is called from onResume() and an exception is encountered, the dialog is displayed. But when I click the ""Retry"" button and this time  reloadItems() is called from the dialog's onclicklistener, the dialog isn't displayed second time, I guess because the onclicklistener will return only after the the reloadItems() has returned the second time.</p><p>I tried to run reloadItems() in a new thread from onClick(), but the code still runs in the main thread. If I run reloadItems() from onResume() in a new thread, the code runs in a new thread.</p><p>What I also noticed while debugging is that the dialog isn't showed right after showDialog(RETRY_DIALOG) returns, only after the reloadItems() returns. </p><p>As what I want to do is quite common behavior I'm sure that there is a ""best practice"" solution to this. I'm totally new to Android and I'm not used with this style.</p>","170143","","114066","","2010-07-07 14:14:52","2010-07-07 14:14:52","Android Retry/Cancel Dialog","<android>","1","0","0","",""
"3195310","1","4181314","","2010-07-07 13:44:24","0","4801","<p>HI, </p><p>Is it possible to support zooming of a WebView (similar to the default browser) when the user pinches and moves their fingers closer / further away. Im using 2.2 and tought this would be possible using the ScaleGestureDetector. THe problem is that I can't seem to find a method to set the scale. WebView.getScale() returns the current scale which changes through zoomIn() and ZoomOut() but I can't find setScale() or an option to set zooming by default and let the OS handle it. </p><p>Andy</p>","376338","","","","","2013-07-20 07:35:16","Android WebView Zooming using the ScaleDetector","<android><webview><zooming>","3","0","1","",""
"3195534","1","","","2010-07-07 14:06:33","0","2181","<p>How can I implement Facebook login in android?</p>","336070","","309308","","2010-07-07 14:09:04","2010-08-08 02:24:19","How to implement Facebook login in android","<android><facebook>","2","0","1","",""
"3195585","1","3197241","","2010-07-07 14:13:43","1","1760","<p>Doing some R&amp;D for my company.  We are trying to have a listView that contains an imageview, and two edit boxes for each entry in the listview.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:orientation=""horizontal""  android:isScrollContainer=""true""  android:focusableInTouchMode=""false""  android:focusable=""false""&gt;  &lt;ImageView android:id=""@+id/imgView""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:maxWidth=""100dp""  android:maxHeight=""100dp""/&gt;  &lt;LinearLayout   android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:orientation=""vertical""&gt;    &lt;EditText android:id=""@+id/img_title""    android:hint=""Title""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:minWidth=""150dp""/&gt;    &lt;EditText android:id=""@+id/img_desc""    android:hint=""Description""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:minWidth=""150dp""/&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>This is the layout file I am attempting to use for the item that will be within the listview.  Within the getView of our ImageAdapter (which extends ArrayAdapter),I am attempting to use the LayoutInflater to inflate the xml, which I then store into a ViewGroup.  I findViewByID() to get the imageView in the xml, and set the properties of the imageView that we would like.</p><p>If we keep inflating this xml file, all the id's will be the same.  Here is our issues.</p><ol><li>If we remove a list item with acontext menu, it actually removesthe incorrect one.  Testing showsthat it's mostly the last one added,but not always.</li><li>The EditText's do not respond to keyboard input. On occasion, they're store some data, usually always ""bbb"".</li></ol><p>We have more issues, but we'll post back after we get these more serious errors fixed.</p><pre><code>public View getView(int position, View convertView, ViewGroup parent)    {        final ImageView imageView;        //InputStream is = null;        final Context mContext = super.getContext();        final AdapterItem item = super.getItem(position);        final Uri imageUri = item.getUri();        ViewGroup viewGroup = null;        try        {            //-- If the view has not been created yet.            if (convertView == null)            {                /*                 * Build the ImageView from the URI with some custom                 * view settings.                 */                viewGroup = (ViewGroup) LayoutInflater.from(mContext).inflate(R.layout.mediauploadobject, null);                imageView = (ImageView) viewGroup.findViewById(R.id.imgView);                //imageView.setLayoutParams(new GridView.LayoutParams(IMAGE_WIDTH, IMAGE_HEIGHT));                imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);                imageView.setPadding(IMAGE_PADDING_LEFT, IMAGE_PADDING_TOP,                        IMAGE_PADDING_RIGHT, IMAGE_PADDING_BOTTOM);                imageView.setDrawingCacheEnabled(true);                imageView.setClickable(true);                imageView.setFocusable(true);                imageView.setFocusableInTouchMode(true);                imageView.setSaveEnabled(false);                //the following two lines are required for the menu to popUp                imageView.setOnLongClickListener(new LongClickListener());                imageView.setOnCreateContextMenuListener(new LongClickMenu());                imageView.setOnClickListener(new ShortClickListener());                //the following two lines are required to put a boarder around the images                imageView.setOnTouchListener(new PictureOnTouchListener());                imageView.setOnFocusChangeListener(new PictureOnFocusChangeListener());                //-- Keep a reference to the ImageView by tagging it.                imageView.setTag(imageUri);            }else            {                //-- R-E-C-Y-C-L-E recycle!                viewGroup = (ViewGroup) convertView;                imageView = (ImageView) viewGroup.findViewById(R.id.imgView);            }            //-- Lazy load the images so the user doesn't have to wait for all of the querying non-sense            //   that happens behind the scenes.            imageView.setImageResource(android.R.drawable.gallery_thumb);            imageView.post(new ImageLoader(imageUri, imageView));                       //-- Be VERY careful when changing this code. Due to heap size issues,            //   the size of the bitmap image MUST be modified with the            //   provided BitmapFactory.Options or the program will            //   crash often and frequent.            //post            //-- AJG 7/1/2010 added this assignment so we aren't always setting these preferences every            //   iteration            convertView = viewGroup;        }catch(Throwable t)        {            Log.e(TAG, t.toString());            return null;                    }finally        {            //try{if(is != null)is.close();}catch(Exception squish){}        }        return viewGroup;    }</code></pre>","385565","","385565","","2010-07-07 14:52:32","2010-07-07 17:20:33","Adding a viewGroup to a ListView?","<android><listview>","1","3","","",""
"3195633","1","3196263","","2010-07-07 14:20:37","0","830","<p>HelloI'm trying to move a circle inside a custom component, and it only moves when I click a button outside of the custom component.I touch and drag the circle, it does nothing, but as soon as I click on the button (that has nothing to do with the custom component) it gets updated (drawn) to the location where I stopped touching...Should I be calling some draw update thing on the custom component?I have Override the onTouchEvent and, among others, the onDraw.The onTouch checks for DOWN, MOVE (updates circle position) and UP just updates the beingDragged boolean. The onDraw draws a circle at the position captured on the MOVE event..What am I missing??Thanks!</p>","385627","","385627","","2010-07-07 14:50:06","2010-07-07 15:27:40","Trying to move a circle with Touch","<java><android><touch>","1","0","","",""
"3195664","1","3196801","","2010-07-07 14:23:49","2","5058","<p>I'm working on a service for my application whose purpose is to allow easy access to various web services we are running. The service is used to maintain a login state across any applications that want to use it so the user only has to log in once when the service is first started.</p><p>What is the best way to go about making the service run asynchronously and call back to the application when it is finished. Currently I am using static classes that extend Thread such as</p><pre><code>private static class LogInAsync extends Thread {    private Handler handler;    private CallbackWrapper wrapper;    private Context context;    protected LogInAsync(Context context, Handler handler, CallbackWrapper wrapper) {        this.handler = handler;        this.wrapper = wrapper;        this.context = context;    }    public void run() {        loginState = true;        wrapper.setResponse(Types.NOTHING, Functions.LOG_IN, null);        handler.post(wrapper);    } }</code></pre><p>And to make it easy to call</p><pre><code>public static void logIn(Context context, ResponseListener callback) {    (new LogInAsync(context, new Handler(), new CallbackWrapper(callback))).start();}</code></pre><p>But these functions can only be called by my own application. I want anyone to be able to make a one or two line function call and be able to handle the response easily, preferably in a simple callback method.</p><p>I figure it has to be done using Intents to start the Threads, but if I do that I can't pass a callback.</p>","370556","","","","","2010-07-07 16:25:24","How do I create an Android Service with callbacks?","<android>","2","0","5","",""
"3195668","1","3195924","","2010-07-07 14:24:06","7","10365","<p>So I've created an Activity subclass called CustomTitlebarActivity. Essentially, each main activity in my app will have a custom titlebar with many common features such as a Home button, a title, a search button, etc. In my current implementation, I am still explicitly using an include statement in the layout XML for each CustomTitlebarActivity:</p><pre><code>&lt;include layout=""@layout/titlebar"" /&gt;</code></pre><p>It seems natural that I should be able to do this within CustomTitlebarActivity. I have two questions: What code can replace this include tag, and where should I put the code? (My first instinct would be to put it in CustomTitlebarActivity's setContentView method.)</p><p>On a related note, I would appreciate insight into better ways to reuse android UI code (even if, per se, the titlebars need to vary slightly between activities.)</p>","127422","","948041","","2012-03-16 07:22:33","2012-12-03 12:15:59","Android programmatically include layout (i.e. without XML)","<java><android><include>","2","0","7","",""
"3195821","1","3197041","","2010-07-07 14:42:21","1","965","<p>I have a HorizontalScrollView that has lots of views and images inside it.The issue is that if I have lots of stuff inside it I will get a 'java.lang.OutOfMemoryError: bitmap size exceeds VM budget'</p><p>is there any way to use some kind of cache, or add/remove stuff as I move left/right so its not on memory all the time?</p><p>Thanks</p>","237115","","","","","2010-07-07 16:54:02","Android - how to improve HorizontalScrollView that has lots of views/images inside","<android><performance><memory>","2","0","","",""
"3195836","1","3551677","","2010-07-07 14:43:15","5","3460","<p>I need to retrieve the orientation of my phone. At the moment i wrote this : </p><pre><code>public void onSensorChanged(SensorEvent event) {  switch (event.sensor.getType()){  case Sensor.TYPE_MAGNETIC_FIELD:    this.mag_vals = event.values.clone();    this.sensorReady = true;    break;  case Sensor.TYPE_ACCELEROMETER:    this.acc_vals = event.values.clone();    break;  }  if (this.mag_vals != null &amp;&amp; this.acc_vals != null &amp;&amp; this.sensorReady) {    this.sensorReady = false;    float[] R = new float[ProjectConstants.SIZE_MATRIX];    float[] I = new float[ProjectConstants.SIZE_MATRIX];    SensorManager.getRotationMatrix(R, I, this.acc_vals, this.mag_vals);    SensorManager.getOrientation(R, this.actual_orientation);    ...  </code></pre><p>This code allows me to get the orientation of the phone if i leave the phone on a flat surface and i rotate it over the surface.</p><p>What i did not understand is why if i move the phone upwards the value of <code>this.actual_orientation[0]</code> ,which is the rotation on the zed axis as described [here][1], the value increases although there was no rotation.</p><p>Did someone know what happens?</p><p><strong>EDIT</strong></p><p>Another strange thing..</p><p>I tried my application in the office at work and it had the strange behaviour i described before..I tried in the same office(same situation) a compass app that i took from the market and it has the same behaviour of mine..when i moved the phone upwards the value changed consistently..I tried in the same office(same situation) the i-phone compass and it didn't have that strange behaviour!</p><p>Then when i arrived at home i tried both, my application and the compass app of my android phone, and they worked!!even if i move upwards the phone the value are stable...</p><p>Thanks a lot.</p><p>[1]: http://developer.android.com/reference/android/hardware/SensorManager.html#getOrientation(float[], float[])</p>","302798","","302798","","2010-07-07 17:24:04","2012-03-31 00:01:53","Android - SensorManager strange behaviour of getOrientation","<android><orientation><accelerometer><sensor><magnetometer>","2","0","0","",""
"3196013","1","3295247","","2010-07-07 15:02:01","1","1204","<p>I have been tasked with updating my teams dev. environment. This environment will be used to develop and test J2ME and Android mobile applications. I am looking at NetBeans 6.8 and Eclipse 3.6. Do you have any recommendations for why either of these would be good or bad for this? (aka mobile plugin problems, compatibility issues, ease of setup/maintenance for team members, high quality mobile dev. support, etc.)</p><p>I am just trying to get some additional opinions from those who have made this decision before me.</p>","330013","","","","","2011-12-14 15:12:05","IDE pros and cons for J2ME and Android development","<android><eclipse><ide><netbeans><java-me>","6","0","1","2011-09-01 13:28:04",""
"3196129","1","3197282","","2010-07-07 15:13:43","1","1442","<p>I am using VideoView to play an mp4 video.  I would like to give the user the option of watching this video with sound or mute the sound if he/she chooses.  I do not use the mediaController allowing the user to stop and play, I have ""touch"" events controlling this.</p><p>UPDATE:  I have a menu that I have added a ""mute"" icon to.  Now I am trying to figure out how to add the mute to this button.  I am reading some info on from the Android AudioManager, in particular the setStreamMute.  Here is what the API's say:</p><pre><code>  public void  setStreamMute  (int streamType, boolean state)</code></pre><p>Since: API Level 1</p><p>Mute or unmute an audio stream.</p><p>The mute command is protected against client process death: if a process with an active mute request on a stream dies, this stream will be unmuted automatically.</p><p>The mute requests for a given stream are cumulative: the AudioManager can receive several mute requests from one or more clients and the stream will be unmuted only when the same number of unmute requests are received.</p><p>For a better user experience, applications MUST unmute a muted stream in onPause() and mute is again in onResume() if appropriate.</p><p>This method should only be used by applications that replace the platform-wide management of audio settings or the main telephony application.ParametersstreamType  The stream to be muted/unmuted.state   The required mute state: true for mute ON, false for mute OFF </p>","2186261","","2186261","","2010-07-07 17:16:32","2010-07-07 19:00:12","Supplying option to user to play video with or without audio","<android><video><audio>","2","0","","",""
"3196219","1","3196452","","2010-07-07 15:23:58","7","7515","<p>i have read about the issue of getView called multiple times and all the answers. However, i don't find a solution for my problem.</p><p>I have a list where rows have two states: read or not. Well, i want to the items seen for first time have a different color and when i scroll the list, they change their color to ""read state"". </p><p>In order to do this, in the method getView of my adapter i set a field isRead when the row for that item is painted. But the problem is the following: since the method getView is called multiple times the field is marked as read and when the list is shown in the screen it appears  as if it had already been read.</p><p>Any idea to fix this problem?</p><p>Thanks</p>","258863","","","","","2011-12-11 20:26:12","Android Adapter multiple getView","<android><adapter>","4","0","3","",""
"3196222","1","3196676","","2010-07-07 15:24:23","15","15412","<p>I'm new to Android development, and I've been playing around with it a bit.  I was trying to create a program that has a small database-like collection of never-changing data.  In C#, my currently best language, I'd use a List of a custom class and serialize that to an xml file, then read that into my application at runtime.  I found the /xml resource folder in Android, but I'm not sure how I would go about doing what I'm envisioning. What would be the best way to go about doing this?</p><p>The data will never need to change.  Example:</p><pre><code>Blob   | A  | B----------------Blob 1 | 23 | 42Blob 2 | 34 | 21</code></pre><p>I know that's laid out like a table, but using a database doesn't really make sense to me because the data will never change, and I would need a way to store it to initially populate the database <em>anyway</em>.</p><p>So basically I'm looking for a way to store somewhat-complex static data in my application.  Any ideas?</p><p>EDIT: I also saw the /raw folder.  So I could store things in /res/raw or /res/xml.  But I'm not sure what would be the best way to store/parse the data...</p>","134502","","134502","","2012-02-19 20:30:30","2012-09-17 20:05:53","Store static data in Android - custom resource?","<android><xml><android-resources><android-parser><android-pullparser>","3","0","10","",""
"3196511","1","8916111","","2010-07-07 15:53:02","13","10077","<p>I've been looking to create a custom keyboard for my application.At first, i started to look at the SoftKeyboard for the SDK examples, but reading the Android Developer Group led me to this post :</p><blockquote>  <p>This is really not how the input  method framework is supposed to work.   An  IME should be a generic input  facility, not for a particular  application.   If you need some  app-specific input, you should build  it into your UI  rather than pushing  it out to a generic IME.</p></blockquote><p>So does anyone know how to build and app-specific input within the UI ?I mean, is there a way to extend the Keyboard app or something and use it only in my application ?</p><h2>Features needed for the keyboard :</h2><p>Shift key to display some other keysSpecial keys like square root or PIect..</p><p>Well, if you have any idea, thanks a lot for helping me out !</p><p>PS : an ugly solution could be to make a table of ImageButton for example, but i wanted to make something clean.</p>","439486","","","","","2012-10-12 12:38:34","Android: Custom Keyboard built in an application","<android><input><keyboard>","4","0","5","",""
"3196634","1","3212547","","2010-07-07 16:05:45","5","2763","<p>I followed instructions from <a href=""http://source.android.com/source/download.html"">here</a>. After <code>$ repo sync</code> I tried to build it with <code>$ make</code>, but got this error:</p><pre><code>host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so) /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.so when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.a when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz /usr/bin/ld: cannot find -lz collect2: ld returned 1 exit status make: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1 </code></pre><p>Using Ubuntu 10.04 LTS. Any help appreciated.</p><p><strong>UPD:</strong> I found a <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg103299.html"">discussion</a>, that claims, that problem could be that I'm having 64bit libs on my 32bit system.</p><pre><code>$ ls -l /usr/lib/libz.so lrwxrwxrwx 1 root root 20 2010-07-07 17:08 /usr/lib/libz.so -&gt; /lib/libz.so.1.2.3.3$ file /lib/libz.so.1.2.3.3/lib/libz.so.1.2.3.3: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped</code></pre><p>How do I figure out, if that libz.so.1.2.3.3 is the right lib, and in case I have to replace it with the right one, how do I do it?</p><p>Also, <code>$ arch</code> says, I have an i686 architecture. Machine, I'm using is Lenovo ThinkPad SL500 with Core 2 DUO CPU.</p>","163423","","163423","","2010-07-09 11:25:18","2013-07-10 13:22:11","Android build failure","<android><ubuntu><make><compilation>","3","2","3","",""
"3197029","1","3197243","","2010-07-07 16:52:52","0","437","<p>Can someone please help me find a list of flags that are needed by PathMeasure.getMatrix()</p><p>[http://developer.android.com/reference/android/graphics/PathMeasure.html#getMatrix(float, android.graphics.Matrix, int)][1]</p><p>[1]: <a href=""http://developer.android.com/reference/android/graphics/PathMeasure.html#getMatrix(float"" rel=""nofollow"">http://developer.android.com/reference/android/graphics/PathMeasure.html#getMatrix(float</a>, android.graphics.Matrix, int)</p><p>thanks</p>","381258","","381258","","2010-07-07 17:06:25","2010-07-07 17:20:38","Android PathMeasure getMatrix() - Help finding flags","<android><path>","1","0","","",""
"3197082","1","3251219","","2010-07-07 16:59:19","0","3588","<p>Last night, my app was working just fine streaming audio files with the MediaPlayer in my app. I came into work this morning and it wont play any audio file and I havent changed my code at all. here is the error log that it is printing out via LogCat. Also, the audio file still exists and plays fine on anything else.</p><pre><code>07-07 09:53:39.559: INFO/ActivityManager(92): Starting activity: Intent { flg=0x800000 cmp=com.Harvest.org/.MediaPlayerActivity (has extras) }07-07 09:53:39.759: ERROR/(840): A component of name 'OMX.qcom.video.decoder.avc' already exists, ignoring this one.07-07 09:53:39.759: ERROR/(840): A component of name 'OMX.qcom.video.decoder.mpeg4' already exists, ignoring this one.07-07 09:53:39.759: ERROR/(840): A component of name 'OMX.qcom.video.decoder.h263' already exists, ignoring this one.07-07 09:53:39.759: ERROR/(840): A component of name 'OMX.qcom.video.decoder.vc1' already exists, ignoring this one.07-07 09:53:39.759: ERROR/(840): A component of name 'OMX.qcom.video.encoder.avc' already exists, ignoring this one.07-07 09:53:39.759: ERROR/(840): A component of name 'OMX.qcom.video.decoder.divx' already exists, ignoring this one.07-07 09:53:39.759: ERROR/(840): A component of name 'OMX.qcom.video.encoder.mpeg4' already exists, ignoring this one.07-07 09:53:39.759: ERROR/(840): A component of name 'OMX.qcom.video.encoder.h263' already exists, ignoring this one.07-07 09:53:39.759: ERROR/(840): A component of name 'OMX.qcom.audio.decoder.Qcelp13' already exists, ignoring this one.07-07 09:53:39.759: ERROR/(840): A component of name 'OMX.qcom.audio.decoder.evrc' already exists, ignoring this one.07-07 09:53:39.759: INFO/StagefrightPlayer(840): setDataSource('http://media.libsyn.com/media/harvest/SM100627.mp3')07-07 09:53:40.769: WARN/AudioSystem(92): AudioFlinger server died!07-07 09:53:40.769: WARN/AudioSystem(92): AudioPolicyService server died!07-07 09:53:40.769: INFO/ServiceManager(53): service 'media.audio_flinger' died07-07 09:53:40.769: INFO/ServiceManager(53): service 'media.player' died07-07 09:53:40.769: INFO/ServiceManager(53): service 'media.camera' died07-07 09:53:40.769: INFO/ServiceManager(53): service 'media.audio_policy' died07-07 09:53:40.769: WARN/IMediaDeathNotifier(912): media server died07-07 09:53:40.769: WARN/IMediaDeathNotifier(912): media server died07-07 09:53:40.769: ERROR/MediaPlayer(912): error (100, 0)07-07 09:53:40.779: WARN/System.err(912): java.io.IOException: Prepare failed.: status=0x6407-07 09:53:40.779: WARN/System.err(912):     at android.media.MediaPlayer.prepare(Native Method)07-07 09:53:40.779: WARN/System.err(912):     at com.Harvest.org.MediaPlayerService.setDataSource(MediaPlayerService.java:97)07-07 09:53:40.779: WARN/System.err(912):     at com.Harvest.org.MediaPlayerActivity$2.onServiceConnected(MediaPlayerActivity.java:292)07-07 09:53:40.779: WARN/System.err(912):     at android.app.ActivityThread$PackageInfo$ServiceDispatcher.doConnected(ActivityThread.java:1247)07-07 09:53:40.779: WARN/System.err(912):     at android.app.ActivityThread$PackageInfo$ServiceDispatcher$RunConnection.run(ActivityThread.java:1264)07-07 09:53:40.779: WARN/System.err(912):     at android.os.Handler.handleCallback(Handler.java:587)07-07 09:53:40.779: WARN/System.err(912):     at android.os.Handler.dispatchMessage(Handler.java:92)07-07 09:53:40.779: WARN/System.err(912):     at android.os.Looper.loop(Looper.java:123)07-07 09:53:40.779: WARN/System.err(912):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-07 09:53:40.779: WARN/System.err(912):     at java.lang.reflect.Method.invokeNative(Native Method)07-07 09:53:40.779: WARN/System.err(912):     at java.lang.reflect.Method.invoke(Method.java:521)07-07 09:53:40.779: WARN/System.err(912):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-07 09:53:40.779: WARN/System.err(912):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-07 09:53:40.779: WARN/System.err(912):     at dalvik.system.NativeStart.main(Native Method)07-07 09:53:42.279: ERROR/AudioService(92): Media server died.07-07 09:53:42.279: INFO/ServiceManager(92): Waiting for sevice media.audio_flinger...07-07 09:53:43.279: INFO/ServiceManager(92): Waiting for sevice media.audio_flinger...07-07 09:53:44.279: INFO/ServiceManager(92): Waiting for sevice media.audio_flinger...07-07 09:53:44.439: INFO/AudioHardwareQSD(951): audience_a1026 init OK07-07 09:53:44.439: INFO/AudioHardwareQSD(951): set_tpa2018d1_parameters() not present07-07 09:53:44.439: INFO/HTC Acoustic(951): libhtc_acoustic.so version 2.0.1.2.07-07 09:53:44.439: INFO/HTC Acoustic(951): open /system/etc/AdieHWCodecSetting.csv success.07-07 09:53:44.439: INFO/HTC Acoustic(951): ADIE table version: PASSION_HTC_2009101907-07 09:53:44.439: ERROR/HTC Acoustic(951): Update ADIE table ID 007-07 09:53:44.439: ERROR/HTC Acoustic(951): Update ADIE table ID 207-07 09:53:44.439: ERROR/HTC Acoustic(951): Update ADIE table ID 507-07 09:53:44.439: ERROR/HTC Acoustic(951): Update ADIE table ID 707-07 09:53:44.439: ERROR/HTC Acoustic(951): Update ADIE table ID 807-07 09:53:44.439: ERROR/HTC Acoustic(951): Update ADIE table ID 1007-07 09:53:44.439: ERROR/HTC Acoustic(951): Update ADIE table ID 5107-07 09:53:44.439: ERROR/HTC Acoustic(951): Update ADIE table ID 5307-07 09:53:44.439: INFO/HTC Acoustic(951): read_adie_para_from_file success.07-07 09:53:44.449: DEBUG/HTC Acoustic(951): ioctl ACOUSTIC_UPDATE_ADIE success07-07 09:53:44.449: INFO/HTC Acoustic(951): open /system/etc/AudioBTID.csv success.07-07 09:53:44.449: INFO/HTC Acoustic(951): BT ID table version: PASSION_HTC_2009110507-07 09:53:44.449: DEBUG/AudioHardwareQSD(951): mNumBTEndpoints = 2507-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Default (tx,rx)=(9,10)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Default Car-kit (tx,rx)=(9,10)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name JKDAP3265 (tx,rx)=(1003,1103)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name JKDAP3264 (tx,rx)=(1004,1104)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name HTC BH M200 (tx,rx)=(1005,1105)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name BH M300 (tx,rx)=(1006,1106)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Jabra BT530 (tx,rx)=(1007,1107)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Jabra BT5010 (tx,rx)=(1008,1108)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Jabra BT3030 (tx,rx)=(1009,1109)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Nokia BH-208 (tx,rx)=(1010,1110)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Nokia BH-703 (tx,rx)=(1011,1111)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Nokia BH-103 (tx,rx)=(1012,1112)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Samsung WEP410 (tx,rx)=(1013,1113)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name 3xxPlantronics (tx,rx)=(1014,1114)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name 6XXPlantronics (tx,rx)=(1015,1115)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name 8XXPlantronics (tx,rx)=(1016,1116)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Motorola H710 (tx,rx)=(1017,1117)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Motorola H12 (tx,rx)=(1018,1118)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Motorola S9 (tx,rx)=(1019,1119)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name HBH-IV840 (tx,rx)=(1020,1120)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name HBH-PV710 (tx,rx)=(1021,1121)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name HBH-DS220 (tx,rx)=(1022,1122)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name HBH-DS980 (tx,rx)=(1023,1123)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name Nexus One Car Dock (tx,rx)=(1024,1124)07-07 09:53:44.449: ERROR/AudioHardwareQSD(951): BT name END (tx,rx)=(1162429505,1146045279)</code></pre>","204263","","","","","2010-07-14 23:02:28","android Media Player stopped working","<android><media-player>","1","0","1","",""
"3197227","1","3197916","","2010-07-07 17:18:59","1","376","<p>so, i've been working on this same stupid thing for a while now. some folks here have helped me get it to the point it is but now i've got to move farther forward... but first, my code:</p><pre><code>package com.mhe.test.scan;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;public class main extends Activity {  /** Called when the activity is first created. */  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button myScanButton = (Button) findViewById(R.id.myScanButton);    totalbox = (EditText) findViewById(R.id.tBox);            myScanButton.setOnClickListener(new Button.OnClickListener() {      public void onClick(View v) {        Intent intent = new Intent(""com.google.zxing.client.android.SCAN"");        intent.putExtra(""SCAN_MODE"", ""PRODUCT_MODE"");        startActivityForResult(intent, 0);      }    });  }        private EditText totalbox;  @Overridepublic void onActivityResult(int requestCode, int resultCode, Intent intent) {    if (requestCode == 0) {      if (resultCode == RESULT_OK) {      final String contents = intent.getStringExtra(""SCAN_RESULT"");        if ( totalbox != null );        totalbox.setText(contents);        Context context = getApplicationContext();        CharSequence text = ""Successful Scan"";        int duration = Toast.LENGTH_SHORT;        Toast toast = Toast.makeText(context, text, duration);        toast.show();        Button myTotalButton = (Button) findViewById(R.id.myTotalButton);        myTotalButton.setOnClickListener(new Button.OnClickListener() {            public void onClick(View view)  {                Intent pass = new Intent(view.getContext(), Result.class);                    startActivityForResult(pass, 0);               }            });      } else if (resultCode == RESULT_CANCELED) {        if ( totalbox != null );          totalbox.setText(""bummer"");      }          }  }}</code></pre><p>so anyhow, what i'd like to happen is upon a successful scan, the result is loaded into the EditText totalbox. then the 'myTotalButton' is clicked and will pass the result to the next activity 'Result.class'. right now i'm just trying to get it to switch to the new activity. If the<br>    <code>Button myTotalButton = (Button) findViewById(R.id.myTotalButton);        myTotalButton.setOnClickListener(new Button.OnClickListener() {            public void onClick(View view)  {            Intent pass = new Intent(view.getContext(), Result.class);                    startActivityForResult(pass, 0);</code></p><p>code is there, it FCs. otherwise, the rest of it works fine. any suggestions/assistance would be helpful. I feel like i am missing something stupid that i will smack myself for.</p>","379048","","","","","2010-07-07 20:31:18","Cannot locate source?","<android>","3","3","1","",""
"3197335","1","3197456","","2010-07-07 17:34:27","138","64398","<p>I'm looking to make a service which I can use to make calls to a web based rest api.  I've spent a couple of days looking through stackoverflow.com, reading books and looking at articles whilst playing about with some code and I can't get anything which I'm happy with.</p><p>Basically I want to start a service on app init then I want to be able to ask that service to request a url and return the results.  In the meantime I want to be able to display a progress window or something similar.</p><p>I've created a service currently which uses IDL, I've read somewhere that you only really need this for cross app communication, so think these needs stripping out but unsure how to do callbacks without it.  Also when I hit the <code>post(Config.getURL(""login""), values)</code> the app seems to pause for a while (seems weird - thought the idea behind a service was that it runs on a different thread!)</p><p>Currently I have a service with post and get http methods inside, a couple of AIDL files (for two way communication), a ServiceManager which deals with starting, stopping, binding etc to the service and I'm dynamically creating a Handler with specific code for the callbacks as needed.</p><p>I don't want anyone to give me a complete code base to work on, but some pointers would be greatly appreciated; even if it's to say I'm doing it completely wrong.  I'm pretty new to Android and Java dev so if there are any blindingly obvious mistakes here - please don't think I'm a rubbish developer, I'm just wet behind the ears and would appreciate being told where I'm going wrong.</p><p>Anyway, code in (mostly) full (really didn't want to put this much code here, but I don't know where I'm going wrong - apologies in advance):</p><pre><code>public class RestfulAPIService extends Service  {final RemoteCallbackList&lt;IRemoteServiceCallback&gt; mCallbacks = new RemoteCallbackList&lt;IRemoteServiceCallback&gt;();public void onStart(Intent intent, int startId) {    super.onStart(intent, startId);}public IBinder onBind(Intent intent) {    return binder;}public void onCreate() {    super.onCreate();}public void onDestroy() {    super.onDestroy();    mCallbacks.kill();}private final IRestfulService.Stub binder = new IRestfulService.Stub() {    public void doLogin(String username, String password) {        Message msg = new Message();        Bundle data = new Bundle();        HashMap&lt;String, String&gt; values = new HashMap&lt;String, String&gt;();        values.put(""username"", username);        values.put(""password"", password);        String result = post(Config.getURL(""login""), values);        data.putString(""response"", result);        msg.setData(data);        msg.what = Config.ACTION_LOGIN;        mHandler.sendMessage(msg);    }    public void registerCallback(IRemoteServiceCallback cb) {        if (cb != null)            mCallbacks.register(cb);    }};private final Handler mHandler = new Handler() {    public void handleMessage(Message msg) {        // Broadcast to all clients the new value.        final int N = mCallbacks.beginBroadcast();        for (int i = 0; i &lt; N; i++) {            try {                switch (msg.what) {                case Config.ACTION_LOGIN:                    mCallbacks.getBroadcastItem(i).userLogIn( msg.getData().getString(""response""));                    break;                default:                    super.handleMessage(msg);                    return;                }            } catch (RemoteException e) {            }        }        mCallbacks.finishBroadcast();    }    public String post(String url, HashMap&lt;String, String&gt; namePairs) {...}    public String get(String url) {...}};</code></pre><p>A couple of AIDL files:</p><pre><code>package com.something.androidoneway interface IRemoteServiceCallback {    void userLogIn(String result);}</code></pre><p>and </p><pre><code>package com.something.androidimport com.something.android.IRemoteServiceCallback;interface IRestfulService {    void doLogin(in String username, in String password);    void registerCallback(IRemoteServiceCallback cb);}</code></pre><p>and the service manager:</p><pre><code>public class ServiceManager {    final RemoteCallbackList&lt;IRemoteServiceCallback&gt; mCallbacks = new RemoteCallbackList&lt;IRemoteServiceCallback&gt;();    public IRestfulService restfulService;    private RestfulServiceConnection conn;    private boolean started = false;    private Context context;    public ServiceManager(Context context) {        this.context = context;    }    public void startService() {        if (started) {            Toast.makeText(context, ""Service already started"", Toast.LENGTH_SHORT).show();        } else {            Intent i = new Intent();            i.setClassName(""com.something.android"", ""com.something.android.RestfulAPIService"");            context.startService(i);            started = true;        }    }    public void stopService() {        if (!started) {            Toast.makeText(context, ""Service not yet started"", Toast.LENGTH_SHORT).show();        } else {            Intent i = new Intent();            i.setClassName(""com.something.android"", ""com.something.android.RestfulAPIService"");            context.stopService(i);            started = false;        }    }    public void bindService() {        if (conn == null) {            conn = new RestfulServiceConnection();            Intent i = new Intent();            i.setClassName(""com.something.android"", ""com.something.android.RestfulAPIService"");            context.bindService(i, conn, Context.BIND_AUTO_CREATE);        } else {            Toast.makeText(context, ""Cannot bind - service already bound"", Toast.LENGTH_SHORT).show();        }    }    protected void destroy() {        releaseService();    }    private void releaseService() {        if (conn != null) {            context.unbindService(conn);            conn = null;            Log.d(LOG_TAG, ""unbindService()"");        } else {            Toast.makeText(context, ""Cannot unbind - service not bound"", Toast.LENGTH_SHORT).show();        }    }    class RestfulServiceConnection implements ServiceConnection {        public void onServiceConnected(ComponentName className, IBinder boundService) {            restfulService = IRestfulService.Stub.asInterface((IBinder) boundService);            try {            restfulService.registerCallback(mCallback);            } catch (RemoteException e) {}        }        public void onServiceDisconnected(ComponentName className) {            restfulService = null;        }    };    private IRemoteServiceCallback mCallback = new IRemoteServiceCallback.Stub() {        public void userLogIn(String result) throws RemoteException {            mHandler.sendMessage(mHandler.obtainMessage(Config.ACTION_LOGIN, result));        }    };    private Handler mHandler;    public void setHandler(Handler handler) {        mHandler = handler;    }}</code></pre><p>Service init and bind:</p><pre><code>// this I'm calling on app onCreateservicemanager = new ServiceManager(this);servicemanager.startService();servicemanager.bindService();application = (ApplicationState)this.getApplication();application.setServiceManager(servicemanager);</code></pre><p>service function call:</p><pre><code>// this lot i'm calling as required - in this example for loginprogressDialog = new ProgressDialog(Login.this);progressDialog.setMessage(""Logging you in..."");progressDialog.show();application = (ApplicationState) getApplication();servicemanager = application.getServiceManager();servicemanager.setHandler(mHandler);try {    servicemanager.restfulService.doLogin(args[0], args[1]);} catch (RemoteException e) {    e.printStackTrace();}...later in the same file...Handler mHandler = new Handler() {    public void handleMessage(Message msg) {        switch (msg.what) {        case Config.ACTION_LOGIN:            if (progressDialog.isShowing()) {                progressDialog.dismiss();            }            try {                ...process login results...                }            } catch (JSONException e) {                Log.e(""JSON"", ""There was an error parsing the JSON"", e);            }            break;        default:            super.handleMessage(msg);        }    }};</code></pre>","264276","","264276","","2013-03-28 15:51:42","2014-04-10 15:56:26","Restful API service","<android><web-services><api><rest>","10","3","191","",""
"3197401","1","","","2010-07-07 17:45:01","1","272","<p>Android provides a lot of Intents in the base OS and packages.  How do I determine the arguments (that is, Data, Extras, etc.) to send to an Intent?  For example, you can open the Settings app to show the Application Info for a particular app using this intent:</p><pre><code>String pkgname = ""com.example.application""; // whatever the app isIntent it = new Intent(Intent.ACTION_VIEW);it.setClassName(""com.android.settings"", ""com.android.settings.InstalledAppDetails"");it.putExtra(""com.android.settings.ApplicationPkgName"", pkgname);it.putExtra(""pkg"", pkgname);</code></pre><p>The problem is that I only know that those <code>Extra</code>s are right because I stole them from someone else's source.  How could I have found that out by myself?</p><p>Even looking at the source code, I can see the ClassName to use, as it's in AndroidManifext.xml as an action, but I'm not seeing anything that points me towards ""pkg"", which is apparently the appropriate <code>Extra</code> to be used for this with Froyo, the longer for previous versions.</p>","147202","","","","","2010-07-07 18:08:19","How to determine the expected arguments for an Android Intent?","<android><android-intent>","1","0","1","",""
"3197430","1","3197637","","2010-07-07 17:49:46","2","3904","<p>I tried to set anchor tag mailto attribute like</p><pre><code>&lt;a href='mailto:info@company.com'&gt;info@company.com&lt;/a&gt;</code></pre><p>in webview.  when i run the app on simulator and click on the link it is showing ""Unsupported Action ..""</p><p>How i can set mailto attribute work out in android webview....</p><p>Thanks </p>","341443","","341443","","2010-07-07 18:03:01","2012-01-28 17:42:35","how to set anchor tag mailto: attribute in webview, android","<android><android-emulator><android-widget>","3","1","1","",""
"3197547","1","3286295","","2010-07-07 18:05:13","3","10213","<p>I followed the tutorial <a href=""http://phonegap.pbworks.com/Getting-started-with-Android-PhoneGap-in-Eclipse"" rel=""nofollow"">here</a> but when I create the project in Eclipse, i get an error ""invalid resource directory name. Resource: ""drawable-hdpi"" path ""/HelloAndroid/res"" type ""Android AAPT Problem""</p>","372346","","","","","2013-02-02 04:59:13","Error ""Invalid resource directory name"" when trying to create android app with phonegap in eclipse","<android><eclipse><phonegap>","3","0","","",""
"3197584","1","","","2010-07-07 18:09:34","2","548","<p>I have a <code>ListView</code> that displays a set of notes, each with varying ammounts of data (i.e. some have a due date, others don't).</p><p>Currently, each view in the list is a <code>RelativeLayout</code> containing a <code>TextView</code> for each field, plus two <code>Button</code> and a <code>CheckBox</code>.  I then simply hide the unused fields by setting visible false on each one.</p><p>This has worked well, but I'm about to add a lot more data fields to the notes and inflating that many unneeded views for each row will surely kill my app. I need a more dynamic solution.</p><p>I've decided the best way to go is to create a custom view.  How can I implement/design my view so that it can display a variable number of text fields without creating/destroying textviews each time (which would be quite expensive and worse than my current situation), or maintaining a large pool of hidden textviews?</p>","131871","","119895","","2010-07-07 18:28:50","2010-07-07 20:00:58","How to implement custom view with variable fields?","<android><listview><android-layout><custom-view>","2","0","1","",""
"3197814","1","","","2010-07-07 18:42:08","2","1613","<p>I'm using URLConnection to connect to the main server. The server implements digest authentication. If I connect to the server with java library, the connection is successful. But if I use the same code for android, the connection is rejected for the reason - username and password do not match.</p><p>Here is the code for my Java project:</p><pre><code>import java.io.BufferedReader;import java.io.InputStreamReader;import java.net.Authenticator;import java.net.PasswordAuthentication;import java.net.URL;import java.net.URLConnection;public class Connect {    static StringBuilder sb;    public static void main(String args[]) {        String strURL = ""http://hostserver/"";        final String username = ""username"";        final String password = ""password"";        Authenticator.setDefault(new Authenticator() {            protected PasswordAuthentication getPasswordAuthentication() {                PasswordAuthentication pa = new PasswordAuthentication (username, password.toCharArray());                System.out.println(pa.getUserName() + "":"" + new String(pa.getPassword()));                return pa;            }        });        BufferedReader in = null;        StringBuffer sb = new StringBuffer();        try {            URL url = new URL(strURL);            URLConnection connection = url.openConnection();            in = new BufferedReader(new InputStreamReader(connection.getInputStream()));            String line;            while ((line = in.readLine()) != null) {                sb.append(line);            }        } catch (java.net.ProtocolException e) {            sb.append(""User Or Password is wrong!"");            e.printStackTrace();        } catch (Exception e) {            e.printStackTrace();        } finally {            try {                if (in != null) {                    in.close();                }            } catch (Exception e) {                System.out.println(""Exception"");            }        }        System.out.println(""The Data is: "" + sb.toString());    }}</code></pre><p>The above code works fine and I'm able to connect to my host server which is implementing digest authentication. I'm unable to use the same code for Android to connect. Here is my android code:</p><pre><code>import java.io.BufferedReader;import java.io.InputStreamReader;import java.net.Authenticator;import java.net.PasswordAuthentication;import java.net.URL;import java.net.URLConnection;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class Connect extends Activity {    static StringBuilder sb;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String strURL = ""http://hostserver/"";        final String username = ""username"";        final String password = ""password"";        Authenticator.setDefault(new Authenticator() {            protected PasswordAuthentication getPasswordAuthentication() {                PasswordAuthentication pa = new PasswordAuthentication (username, password.toCharArray());                // System.out.println(pa.getUserName() + "":"" + new String(pa.getPassword()));                return pa;            }        });        BufferedReader in = null;        StringBuffer sb = new StringBuffer();        try {            URL url = new URL(strURL);            URLConnection connection = url.openConnection();            in = new BufferedReader(new InputStreamReader(connection.getInputStream()));            String line;            while ((line = in.readLine()) != null) {                sb.append(line);            }        } catch (java.net.ProtocolException e) {            sb.append(""User Or Password is wrong!"");            e.printStackTrace();        } catch (Exception e) {            e.printStackTrace();        } finally {            try {                if (in != null) {                    in.close();                }            } catch (Exception e) {                System.out.println(""Exception"");            }        }        Log.d(""DATA"", sb.toString());    }}</code></pre><p>If the same code works for Java, it should also work for Android.</p><p>The code loops in the Authenticator as it finds username and password not matching in the Android code for some reason which in fact are correct. The code runs perfect for Java project. </p>","385860","","1401895","","2013-04-02 18:21:38","2013-05-14 22:44:07","UrlConnection working with Java code but not for Android - use in Digest Authenticated Server","<android>","3","2","","",""
"3197926","1","3204065","","2010-07-07 18:59:10","0","312","<p>I know that the best to start service is </p><pre><code>startService(new Intent(this, MyService.class  ));</code></pre><p>How can I send my application context also when I am starting a new service?</p>","366489","","23199","","2010-07-07 19:02:09","2010-07-08 13:29:54","starting a service in Android","<android><service>","3","1","","",""
"3198125","1","3198236","","2010-07-07 19:26:34","2","353","<p>My android app will work for both normal and hdpi device. I don't want to create two sets of images assets for normal and hdpi screen. </p><p>So, could I just create image assets for hdpi only, and use them for both normal and hdpi device. Of course, the hdpi images will be auto scaled to fit normal screen devices. Is it OK? How much performance overhead will be caused by auto scaling hdpi images to fit normal screens?</p><p>Thanks.</p>","256239","","","","","2010-07-07 20:41:20","Concern on performance overhead for image scale","<android>","3","0","","",""
"3198338","1","","","2010-07-07 19:58:30","3","1301","<p>I am attempting to put my C++ program onto an Android phone but have run into several problems with the library linking. It seems most of the useful information I find on this topic through google is outdated (<a href=""http://honeypod.blogspot.com/2007/12/shared-library-hello-world-for-android.html"" rel=""nofollow"">motz</a>) or simply does not account for the complexity of my program. I have been able to run simple C programs but fail when attempting to use libraries outside of Android's Bionic/libc. </p><p>So my questions are:</p><ul><li>Is it possible to port pre-existing *.so libraries onto Android? If so, how could I do this without seg faulting?</li><li>Should I be using the CodeSourcery compiler (arm-none-linux-gnueabi-*)?</li><li>How can I work around the lack of a seperate pthread library?</li></ul><p>Please help me out! Thanks.</p><p>-Scott</p>","385928","","","","","2012-04-18 09:32:21","Porting a C/C++ program into Android","<android><cross-platform><shared-libraries><native><android-ndk>","2","0","1","",""
"3198365","1","3198406","","2010-07-07 20:02:55","2","659","<p>My Android app needs to retrieve information about a contact (namely, phone number and name.) I wrote some code using <code>getContentResolver().query()</code> In the results, I am seeing that the name is being returned, and other information like when I last contacted that person, but not the phone number. What am I doing wrong?</p><p>The code:</p><pre><code>Log.w(""MyApp"", ""requesting "" + phonesUri.toString());Cursor contactCursor = context.getContentResolver().query(person, null, null, null, null);contactCursor.moveToFirst();for (int i = 0; i &lt; contactCursor.getColumnCount(); i ++) {   Log.w(""MyApp"", contactCursor.getColumnName(i) + "": "" + contactCursor.getString(i));}</code></pre><p>which outputs this:</p><pre><code>W/MyApp (21477): requesting content://contacts/people/169/phonesW/MyApp (21477): times_contacted: 6W/MyApp (21477): custom_ringtone: nullW/MyApp (21477): primary_organization: nullW/MyApp (21477): phonetic_name: W/MyApp (21477): status: nullW/MyApp (21477): label: nullW/MyApp (21477): number: nullW/MyApp (21477): type: nullW/MyApp (21477): mode: nullW/MyApp (21477): last_time_contacted: 1278113641980W/MyApp (21477): display_name: (name removed for privacy)W/MyApp (21477): im_handle: nullW/MyApp (21477): _id: 169W/MyApp (21477): number_key: nullW/MyApp (21477): starred: 0W/MyApp (21477): primary_email: nullW/MyApp (21477): name: (name removed for privacy)W/MyApp (21477): primary_phone: nullW/MyApp (21477): im_account: nullW/MyApp (21477): notes: W/MyApp (21477): im_protocol: nullW/MyApp (21477): send_to_voicemail: 0</code></pre>","92631","","","","","2010-07-07 20:08:54","Can't get a phone number in my Android App","<java><android>","1","0","1","",""
"3198408","1","3198603","","2010-07-07 20:09:08","2","950","<p>I have the following problem:My app has a thread that updates the game state. The app needs to make a change to the state of the View object, triggered by this thread.The documentation for View states that it should only be modified from the UI thread, and that a Handler should be used to place and handle events.</p><p>Yet, there is a function post() in View where I can post a Runnable object that will execute in the UI thread without involvement of Handler. Can I not call this function from threads other than the UI thread??</p><p>I'm confused!</p>","17424","","","","","2010-07-07 20:49:27","Android: Posting events to message queue of View","<android><view>","2","1","","",""
"3198558","1","","","2010-07-07 20:34:21","1","1353","<p>I have a TextView .I am using it like a link by using </p><pre><code>t2.setMovementMethod(LinkMovementMethod.getInstance()) </code></pre><p>for this textview in .java files so that it blinks when I clicks, but I want the color of textview to be changed when clicked. I used </p><pre><code>t2.setLinkTextColor(0xff0000)</code></pre><p>but does not work. my code is as follows: </p><pre><code>public class TextHyperLink extends Activity implements OnClickListener{ /** Called when the activity is first created. */     TextView t2;     @Override public void onCreate(Bundle savedInstanceState)     {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);         t2 = (TextView) findViewById(R.id.text2);                                                                      t2.setMovementMethod(LinkMovementMethod.getInstance());         t2.setLinkTextColor(0xff0000);         t2.setOnClickListener(this);    }    public void onClick(View arg0) {        // TODO Auto-generated method stub        if(arg0==t2)        {        //  t2.setColor()    //      System.out.println(""Link TextViewwwwww"");        }    }    }</code></pre><p>my xml</p><pre><code>&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/text2""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""@string/link_text_manual""    android:textColorLink=""#FFFF00""    /&gt;  </code></pre><p>Can any one help me in solving this issue.?</p>","385939","","297762","","2010-07-07 20:45:03","2010-07-07 20:52:50","TextView Color does not change on Click","<android><android-widget>","1","0","","",""
"3198690","1","","","2010-07-07 20:50:20","0","627","<p>in Don Park's example :http://donpark.org/blog/2009/01/24/android-client-side-oauth</p><p>I am confused about step2.</p><p>there is such a lane:</p><pre><code>OAuthAccessor defaultClient() {String callbackUrl = ""icecondor-android-app:///"";OAuthServiceProvider provider =  defaultProvider(ctx);OAuthConsumer consumer = new OAuthConsumer(callbackUrl, consumerKey,                                consumerSecret, provider);OAuthAccessor accessor = new OAuthAccessor(consumer);OAuthClient client = new OAuthClient(new HttpClient4());}</code></pre><p>I dont know where did we send request for request token?where is the return ? should we return accessor? </p><p>I think there should be something like client.excute(request_url and parameters) ? </p>","365384","","","","","2010-07-07 21:00:23","android OAuth question, how to send request for request token","<android><oauth>","1","0","","",""
"3198751","1","3198788","","2010-07-07 20:57:34","0","475","<p>I'm trying to write an Android widget that shows how much data has been transferred over 3G/WIFI/EDGE but I can't seem to find the API call, even though other widgets do this.  Does anyone know what the API calls are to get the data usage?</p>","385983","","","","","2010-07-07 21:01:45","How do you find out how much data has been transferred over Wifi, 3G or EDGE on Android?","<android>","1","0","1","",""
"3199020","1","3199066","","2010-07-07 21:33:05","0","1919","<p>I'm trying to display an image above and below a grid. This is the initial screen with Logo on top, 4 buttons as a grid view then image on the bottom. With my current code the bottom image is not displaying at all. Also I would like to stick the bottom image ""bottomboxes"" to the bottom of the display.</p><p></p><pre><code>&lt;ImageViewandroid:layout_height=""wrap_content""android:layout_width=""wrap_content""android:paddingTop=""20dp""android:src=""@drawable/stuffbox"" android:gravity=""center""/&gt;&lt;GridView android:id=""@+id/gridview""android:paddingTop=""10dp""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:columnWidth=""40dp""android:numColumns=""2""android:verticalSpacing=""10dp""android:horizontalSpacing=""10dp""android:stretchMode=""columnWidth""android:gravity=""center""/&gt;&lt;ImageViewandroid:layout_height=""wrap_content""android:layout_width=""wrap_content""android:src=""@drawable/bottomboxes"" android:paddingTop=""20dp""/&gt;&lt;/LinearLayout&gt;</code></pre>","385854","","","","","2010-07-08 22:34:30","How to display an ImageView above and below a GridView?","<android><xml>","1","0","","",""
"3199057","1","3199070","","2010-07-07 21:38:05","1","593","<p>For my next application, I'd like a ListView to form part of the app. Specifically, I'd like it to be the top half of the screen. Having looked through the documentation, I've only been able to find full screen list views, ie with the list taking up the full screen.</p><p>Is there any way of doing ListViews differently? I know there must be, but I'm unsure how to implement them myself. Does anyone have any pointers?</p>","386018","","","","","2010-07-07 21:39:35","ListView forms part of an activity, rather than the activity?","<android>","1","0","1","",""
"3199262","1","3200192","","2010-07-07 22:01:21","4","2867","<p>I'm trying to display <code>versionName</code> using below code</p><pre><code>PackageManager pkm = getPackageManager();PackageInfo pki = pkm.getPackageInfo(""com.example"", PackageManager.GET_CONFIGURATIONS);String tempCurrentVersion = pki.versionName;</code></pre><p>But I'm getting exception at <code>PackageManager.GET_CONFIGURATIONS</code> as <code>NameNotFoundException</code></p><p>Please tell me how i can solve this issue.</p><p>Thanks</p>","341443","","39709","","2011-09-03 10:44:28","2012-01-23 23:00:09","Name not found exception at PackageManager.GET_CONFIGURATIONS","<android><android-emulator><android-widget>","2","0","","",""
"3199375","1","","","2010-07-07 22:24:52","7","5391","<p>Is there a way to define a 9 patch drawable in an android xml file?  The reason I ask, is that when you apply a scale animation to a drawable w/ a stroke on it, the stroke appears to thicken.  I'd like to make the stroke stay the same size as the animation plays...</p>","372405","","","","","2013-04-04 10:00:17","android 9 patch drawable xml","<android><xml><drawable><nine-patch>","1","1","1","",""
"3199499","1","3206827","","2010-07-07 22:47:54","5","3832","<p>Can someone explain me how I would be able to imitate the default browser when trying to download .apk from the net?</p><p>So far I have this:</p><pre><code>WebView webview;@Overridepublic void onCreate(Bundle icicle)        {        super.onCreate(icicle);        setContentView(R.layout.main);        webview = (WebView) findViewById(R.id.webview);        webview.setWebViewClient(new HelloWebViewClient());        WebSettings webSettings = webview.getSettings();        webSettings.setSavePassword(false);        webSettings.setSaveFormData(false);        webSettings.setJavaScriptEnabled(true);        webSettings.setSupportZoom(false);        webview.setDownloadListener(new DownloadListener() {            public void onDownloadStart(final String url, String userAgent,            String contentDisposition, String mimetype,            long contentLength) {            Toast.makeText(testapp.this, url, Toast.LENGTH_LONG);            }            });        webview.loadUrl(""http://dacp.jsharkey.org/TunesRemote-r2.apk"");               }</code></pre><p>I've already added the permission to use the internet. Are there any other permissions that I need to add? Am I doing the DownloadListener incorrectly? </p><p>Thank you in advance!</p>","386074","","","","","2011-01-18 20:01:40","How to imitate default browser to download .apk files from webview?","<android><download><webview><apk>","1","0","1","",""
"3199904","1","3201129","","2010-07-08 00:31:39","2","2706","<p>I am a new to Android stuff. I am creating an application that contains a list view that will get dynamically populated. My requirement is when the list is empty, I would like to show a message. I don't want to create additional views just for displaying this message. Is there any nice way to do this? Any suggestions?</p>","386123","","","","","2010-07-08 08:46:39","How to display a message when the list view is empty in android","<android><listview>","2","0","1","",""
"3199910","1","3199961","","2010-07-08 00:33:42","5","4226","<p>I developed a game on Android. I am currently saving most of the game stats in a Database. However the app does not utilize more than a single row in the DB. I am now interested in introducing some new stats but this will cause my DB to re-install and thus clear out everyone's progress. In order to avoid this in the future I am considering storing the game stats with SharedPreferences instead. My question is how many different things can be stored that way before it becomes a problem. In total I would be storing around 40 values, all integers.</p>","386126","","","","","2010-07-08 01:25:11","Android SharedPreferences limitations?","<android><database><storage><sharedpreferences>","2","0","1","",""
"3200069","1","6012324","","2010-07-08 01:17:53","13","24336","<p>I'm using <code>@font-face</code> to display League Gothic on a website, but it's not showing up on Android 1.6. Here's my code, generated with <a href=""http://www.fontsquirrel.com/fontface/generator"">Font Squirrel's @font-face generator</a></p><pre><code>@font-face {    font-family: 'LeagueGothicRegular';    src: url('/fonts/League_Gothic-webfont.eot');    src: local('?'), url('/fonts/League_Gothic-webfont.woff') format('woff'), url('/fonts/League_Gothic-webfont.ttf') format('truetype'), url('/fonts/League_Gothic-webfont.svg#webfont') format('svg');    font-weight: normal;    font-style: normal;}font-family:'LeagueGothicRegular',Impact,Charcoal,sans-serif;</code></pre><p>It's not a big deal if <code>@font-face</code> isn't supported (I read that <code>@font-face</code> support is gone completely in Android 2). But League Gothic is quite condensed, so I would like to specify a better fallback font for Android than the default sans-serif so the design doesn't completely break.</p><p>Something like this would be perfect:<a href=""http://www.droidfonts.com/info/droid-sans-condensed-fonts/"">http://www.droidfonts.com/info/droid-sans-condensed-fonts/</a></p><p>But I can't find a definitive list of the default fonts that come with Android, and the name I should use to reference them in CSS.</p><p><strong>EDIT</strong>The answers so far missed the point (or I worded the question badly) - what I'm after is a list of system fonts that ship with Android. Something <a href=""http://daringfireball.net/2007/07/iphone_fonts"">like this</a> for Android.</p>","91934","","880021","","2012-09-18 14:00:45","2013-06-04 05:45:51","CSS fonts on Android","<android><css><font-face>","3","4","13","",""
"3200228","1","3200236","","2010-07-08 01:59:06","0","1169","<p>I am trying to create a <code>Service</code>for my application which will negotiate Bluetooth connections and data. I want this service's lifecycle to start and end with the <code>Application</code>, but still be able to have specific <code>Activities</code> listen for events that occur within this service (in addition an <code>Activty</code> should be able to call specific methods of the <code>Service</code> to write data or query connection state).</p><p>I started by creating AIDL interfaces for my callbacks and service, but I can't figure out exactly what I'm doing.</p><p>How is the best way to go about this? Thanks.</p><p><strong>EDIT</strong>: To be clear, I do not specifically need (or want) more than one process for my application. Right now I don't have more than one; I'm just using AIDL because it is <a href=""http://stackoverflow.com/questions/2463175/how-to-have-android-service-communicate-with-activity"">the only way I know of</a> for a <code>Service</code> to communicate with an <code>Activity</code>.</p>","2359478","user370382","2359478","user370382","2010-07-08 02:04:21","2010-07-08 02:04:21","Android - Service with Application lifecycle","<android><service><activity><aidl>","1","0","1","",""
"3200298","1","","","2010-07-08 02:23:39","0","183","<p>I made a very simple site with PHP+MySQL that let's users add professors to a database and post comments. </p><p>I want to use a framework like <a href=""http://www.sencha.com/"" rel=""nofollow"">Sencha</a> to make my website 'mobile friendly'. Thing is, I'm not sure if that will do what I want or if there's something better for my simple application. </p><p>What I would like:</p><ul><li>Relatively easy way to get a nice 'mobile friendly' layout.</li><li>Ability to execute SQL commands for writing and displaying data.</li></ul><p>I'm not looking for something powerful with a lot of features, I'm looking for something relatively newbie friendly that will do this task. </p><p>Any recommendations? Suggestions? Anything else (beside the tutorials on the framework's page and a Javascript tutorial) I should read?</p>","186909","","309086","","2012-10-23 10:18:07","2012-10-23 10:18:07","Getting started with web development for mobile applications, suggestions?","<android><iphone><mobile-website>","1","0","","",""
"3200300","1","3201917","","2010-07-08 02:23:58","3","878","<p>I know I can set DEBUG in Android's ADB by typing:</p><p>adb shell setprop log.tag.MyTag DEBUG</p><p>What I'm wondering is if there is a way to set debug for all my classes that do logging instead of having to type the above multiple times:</p><p>adb shell setprop log.tag.MyTag1 DEBUG<br/>adb shell setprop log.tag.MyTag2 DEBUG<br/>adb shell setprop log.tag.MyTag3 DEBUG<br/>adb shell setprop log.tag.MyTag4 DEBUG<br/></p><p>Something like:</p><p>adb shell setprop log.tag.* DEBUG</p><p>I'm using Eclipse for developing, but I'm currently setting the DEBUG through the command line adb.</p><p>Thanks,Kevin</p>","171452","","","","","2010-07-08 08:47:08","Is there a way to set DEBUG for all tags in Android's ADB?","<android><eclipse><debugging><adb>","1","0","","",""
"3200432","1","3201256","","2010-07-08 03:03:02","1","309","<p>i would like to show my database on a listview in android, but the data is not showing.</p><p>Arrival.java    package one.two;</p><pre><code>import java.io.IOException;import java.util.ArrayList;import java.util.List;import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class Arrival extends ListActivity{    private ListView listView;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        ArrayList&lt;String&gt; retList = new ArrayList&lt;String&gt;();        System.out.println(""Start onCreate Function\n"");        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        System.out.println(""In onCreate Function\n"");        System.out.println(""In of GetData\n"");        DBAdapter db = new DBAdapter(this);         System.out.println(""DB Open\n"");        db.open();        System.out.println(""DB Opened\n"");        retList = getData();        System.out.println(""Out of GetData\n"");        // force count no. of records in table        // dump to check index        int cnt = 2;        int i=0;        for (i = 0; i&lt;cnt; i++)            System.out.println(retList.toString());        System.out.println(""Array 2 String\n"");        Cursor c = db.getCursor();        listView = (ListView) findViewById(android.R.id.list);         setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.id.list));        ArrayAdapter&lt;String&gt; mAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.id.list);        this.setListAdapter(mAdapter);        System.out.println(""Show List\n"");        db.close();    }    public static ArrayList&lt;String&gt; getData()     {        ArrayList&lt;String&gt; items = DBAdapter.getAllTitles();        // titles ???? redundant        //ArrayList&lt;String&gt; titles = new ArrayList&lt;String&gt;(items);        System.out.println(""Return a LIST titles\n"");         return items;        }    }</code></pre><p>DBAdapter.java</p><pre><code>package one.two;import java.util.List;import android.app.ListActivity;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteDatabase.CursorFactory;import java.util.ArrayList;public class DBAdapter{    public String status = ""status"";    public String id = ""id"";    public String arrival = ""arrival"";    public String destination = ""destination"";    public String ferry = ""ferry"";    private static String DB_PATH = ""/data/data/one.two/databases/"";    private static final String DATABASE_NAME = ""ferry.db"";    private static final String DATABASE_TABLE = ""port"";    public static Context context;    public Cursor c;    public static SQLiteDatabase DbLib;    //overloaded non-null constructor    public DBAdapter(Context context)     {        DbLib = context.openOrCreateDatabase(DATABASE_NAME,  SQLiteDatabase.CREATE_IF_NECESSARY,null);        System.out.println(""OpenOrCreateDB Done"");    }    public class DatabaseHelper extends SQLiteOpenHelper    {        Context context;        DatabaseHelper(Context context)        {            super(context, DATABASE_NAME, null, DATABASE_VERSION);            this.context = context;        }//end constructor DatabaseHelper        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion,                int newVersion)        {        }//end onUpgrade()        @Override        public void onCreate(SQLiteDatabase db)        {        }//end onCreate()    }// end class DatabaseHelper    private static DatabaseHelper DBHelper;    //private static SQLiteDatabase DbLib;    private static final int DATABASE_VERSION = 1;    //// context brought up /////////////    //private final Context context;        /*public void DBAdapter() throws SQLException        {            String myPath = DB_PATH + DATABASE_NAME;            db = SQLiteDatabase.openDatabase(myPath, null,                    SQLiteDatabase.OPEN_READONLY);        }//end DBAdapter()*/        public static ArrayList&lt;String&gt; getAllTitles()        {            ArrayList&lt;String&gt; port = new ArrayList&lt;String&gt;();                Cursor c=null;                c = DbLib.query(""port"",                        new String[] { ""status"", ""id"", ""arrival"",                                ""destination"", ""ferry"" }, null, null,                        null, null, null);                try {                    if (c!=null) { // start - when there is at least 1 record                        System.out.println(""Cursor is NOT NULL"");                        int i =0;                        for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext())                         {                            // Assign database cursor.records to arraylist                            port.add(i,c.getString(0));                            port.add(i,c.getString(1));                            port.add(i,c.getString(2));                            port.add(i,c.getString(3));                            port.add(i,c.getString(4));                            i = i + 1;                        }                    } // end - where there is at least 1 record                } finally {                    if (c!=null) {                    c.close();                }                }               return port;        }//end getAllTitles()        public void open() {            //Open the database            String myPath = DB_PATH + DATABASE_NAME;            DbLib = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);        }        public Cursor getCursor(){            return c;        }        public void close()        {            DbLib.close();        }}//end class DBAdapter</code></pre><p>main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/widget0""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextViewandroid:id=""@+id/widget32""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Ferry Hub""android:textSize=""25sp""android:textStyle=""bold""android:textColor=""#ff009999""android:layout_x=""97px""android:layout_y=""15px""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/widget35""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Arrival Time""android:layout_x=""116px""android:layout_y=""48px""&gt;&lt;/TextView&gt;&lt;Buttonandroid:id=""@+id/widget36""android:layout_width=""96px""android:layout_height=""40px""android:text=""Back""android:layout_x=""101px""android:layout_y=""299px""&gt;&lt;/Button&gt; &lt;ListView               android:id=""@android:id/list""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""&gt;&lt;/ListView&gt;&lt;/AbsoluteLayout&gt;</code></pre>","358218","","","","","2010-07-08 06:50:43","What am i missing in my code?","<android><database><eclipse><sqlite><listview>","1","1","","",""
"3200505","1","","","2010-07-08 03:29:16","3","8594","<p>I have tried many different way and search all over the internet to find a tutorial to use JTwitter with OAuth.  Here are the following step I have accomplish</p><p>Download both Jtwitter and SignpostAdd them as Jars in the Java Builder</p><p>Created a simple button that run</p><pre><code>public class ShareGenerator extends Activity {    private static final String JTWITTER_OAUTH_KEY = ""this_is_populated"";    private static final String JTWITTER_OAUTH_SECRET = ""this_is_populated"";    Button menupopButton;     @Override        public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);  setContentView(R.layout.share);  this.setContentView(R.layout.share);  this.txShare = (TextView)this.findViewById(R.id.lblshare);  this.menupopButton = (Button)this.findViewById(R.id.menupop);  menupopButton.setOnClickListener(new View.OnClickListener()  {       public void onClick(View v)       {          TwitterSend();      }  });      }</code></pre><p>and I have my class</p><pre><code>public void TwitterSend () {                 OAuthSignpostClient client = new OAuthSignpostClient(JTWITTER_OAUTH_KEY, JTWITTER_OAUTH_SECRET, ""oob"");                    Twitter jtwit = new Twitter(""bob"", client);                    // open the authorisation page in the user's browser                    client.authorizeDesktop();                    // get the pin                    String v = client.askUser(""Please enter the verification PIN from Twitter"");                    client.setAuthorizationCode(v);                    // Optional: store the authorisation token details                    Object accessToken = client.getAccessToken();                    // use the API!                    jtwit.setStatus(""Messing about in Java"");             }</code></pre><p>However I can't even get the OAuth screen to pop up.  It crashes when it get there. Can anyone help me at least see the OAuth screen?  I do have the import set correctly.</p>","123759","","","","","2012-09-20 17:05:13","Simple JTwitter for Android example","<android><oauth><jtwitter>","3","3","4","",""
"3200551","1","3200631","","2010-07-08 03:51:40","38","14335","<p>I'm trying to make a list containing names. This list should be modifiable (add, delete, sort, etc). However, whenever I tried to change the items in the ArrayAdapter, the program crashed, with <code>java.lang.UnsupportedOperationException</code> error. Here is my code:</p><pre><code>ListView panel = (ListView) findViewById(R.id.panel);String[] array = {""a"",""b"",""c"",""d"",""e"",""f"",""g""};final ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1, array);adapter.setNotifyOnChange(true);panel.setAdapter(adapter);Button button = (Button) findViewById(R.id.button);button.setOnClickListener(new OnClickListener() {   @Override   public void onClick(View v) {      adapter.insert(""h"", 7);   }});</code></pre><p>I tried insert, remove and clear methods, and none of them worked. Would someone tell me what I did wrong?</p>","386217","","85950","","2013-02-08 00:55:16","2013-02-08 00:55:16","Unable to modify ArrayAdapter in ListView: UnsupportedOperationException","<android><android-arrayadapter>","1","0","4","",""
"3200679","1","3244427","","2010-07-08 04:32:45","0","640","<p>I have just started with android in Eclipse and now i want to do the same in netbeans 6.8, i Configured netbeans with all the (andoird's)jar files..etc..whatever it asked me to do.,now it is possible to open the android project in the my netbeans 6.8, but the problem that i get now,</p><p>While i try to start new Android Project,Its getting opened and in the console ,its saying that build is successful,after i code the simple helloworld app and once i clean and build the app,its showing me as Build failed..Please help me to rectify the same..</p><p>I am very much annoyed becos of this problem for the last 2 days..</p><p>This is the error that i got...</p><pre> Created dir: C:\Android Practices\workspace\AndroidApplication2\dist=C:\Android was unexpected at this time. C:\Android Practices\workspace\AndroidApplication2\nbproject\build-impl.xml:411: exec    returned: 255BUILD FAILED (total time: 0 seconds)</pre>","384193","","","","","2010-07-14 13:49:37","I am getting BUILD FAILED ,When i try to deploy Android Application in Netbeans 6.8","<android>","1","1","","","2010-07-08 04:34:37"
"3200691","1","3200765","","2010-07-08 04:37:15","15","14220","<p>When a button is clicked, the following method is run:</p><pre><code>public void createTableRow(View v) {  TableLayout tl = (TableLayout) findViewById(R.id.spreadsheet);  TableRow tr = new TableRow(this);  LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);  tr.setLayoutParams(lp);  TextView tvLeft = new TextView(this);  tvLeft.setLayoutParams(lp);  tvLeft.setBackgroundColor(Color.WHITE);  tvLeft.setText(""OMG"");  TextView tvCenter = new TextView(this);  tvCenter.setLayoutParams(lp);  tvCenter.setBackgroundColor(Color.WHITE);  tvCenter.setText(""It"");  TextView tvRight = new TextView(this);  tvRight.setLayoutParams(lp);  tvRight.setBackgroundColor(Color.WHITE);  tvRight.setText(""WORKED!!!"");  tr.addView(tvLeft);  tr.addView(tvCenter);  tr.addView(tvRight);  tl.addView(tr, new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));}</code></pre><p><code>R.id.spreadsheet</code> is an xml TableLayout. I can see from debugging that the method is being accessed, but nothing is drawn to the screen. What gives? Do I need to reset the Content View somehow?</p>","382252","","","","","2012-12-28 10:53:33","Dynamically add TableRow to TableLayout","<android>","1","0","6","",""
"3200694","1","","","2010-07-08 04:38:13","6","3170","<p>I am having trouble popping all activities off the stack using Intent.FLAG_ACTIVITY_CLEAR_TOP and android:launchMode=""singleInstance"".</p><p>In my application activity A, launches activity B (via startActivity) which in turn launches activity C (via startActivity).  On activity C the user presses a menu item to return to activity A.  When they arrive at activity A, I want only A on the stack such that if they click the back button they return to the home screen (desktop).</p><p>This is the code that I am currently using when the user presses a button to return to A:</p><pre><code>Intent i = new Intent(this, A.class);i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);startActivity(i);</code></pre><p>All activities are defined as android:launchMode=""singleInstance"" in the project manifest.</p><p>My code doesn't seem to work though.  Once I'm back on activity A if I click the back button I return to activity C.  Am I misunderstanding how to use Intent.FLAG_ACTIVITY_CLEAR_TOP?</p>","233202","","","","","2010-07-08 08:29:40","How do I clear all Activities from the stack?","<android><android-manifest>","2","1","1","",""
"3200710","1","3210295","","2010-07-08 04:43:16","1","3431","<p>I am using tab view in one of my activity. I want to change the drawable of the tabs on the basis of their selection. So it is like this -- I have 4 images T11, T12, T21, T22. I want to set the image T11 and T22 initially with tab 1 selected. Now I want to change the images to T12 and T21 as soon as I select Tab 2. </p><p>So far I tried using via an xml file of drawable type:</p><p>drawable for left tab( tab1) --</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;item android:state_window_focused=""false"" android:state_enabled=""true""  style=""?attr/left_active"" /&gt; &lt;item android:state_window_focused=""false"" android:state_enabled=""false""  style=""?attr/left_inactive"" /&gt; &lt;item android:state_pressed=""true"" android:state_enabled=""true""  style=""?attr/left_active"" /&gt; &lt;item android:state_pressed=""true"" android:state_enabled=""false""  style=""?attr/left_inactive"" /&gt;&lt;/selector&gt;</code></pre><p>Drawable for Tab right(Tab2) -- </p><pre><code> &lt;item android:state_window_focused=""false"" android:state_enabled=""true""  style=""?attr/right_active"" /&gt; &lt;item android:state_window_focused=""false"" android:state_enabled=""false""  style=""?attr/right_inactive"" /&gt; &lt;item android:state_pressed=""true"" android:state_enabled=""true""  style=""?attr/right_active"" /&gt; &lt;item android:state_pressed=""true"" android:state_enabled=""false""  style=""?attr/right_inactive"" /&gt;</code></pre><p>In activity:</p><pre><code>TabHost tabHost = getTabHost();tabHost.addTab(tabHost.newTabSpec(""tab1"").setIndicator(""Tab1"", getResources().getDrawable(R.drawable.left)).setContent(new Intent(this, Left.class)));tabHost.addTab(tabHost.newTabSpec(""tab2"")    .setIndicator(""Tab2"", getResources().getDrawable(R.drawable.right))    .setContent(new Intent(this, Right.class)));tabHost.setCurrentTab(1);</code></pre><p>Please help...</p>","152867","","366898","","2012-06-26 12:17:05","2012-06-26 12:17:05","Change the drawable of tabs on selection -- android","<android><tabs><drawable>","2","0","1","",""
"3200757","1","","","2010-07-08 04:57:07","0","757","<p>I've got a broadcast receiver that gets triggered when a notification my app created is clicked.  When that broadcast receiver is started it completes a task then tries to bring of the sms conversations.  It works fine on the emulator, however when I try it on a droid incredible it crashes with the following message</p><pre><code>07-07 22:57:23.901: WARN/ActivityManager(81): Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.mms/.ui.ConversationList } from ProcessRecord{460a37f8 6949:msc.test/10081} (pid=6949, uid=10081) requires null07-07 22:57:51.661: ERROR/AndroidRuntime(6949): java.lang.RuntimeException: Unable to start receiver msc.test.notifyclear: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.mms/.ui.ConversationList } from ProcessRecord{460a37f8 6949:msc.test/10081} (pid=6949, uid=10081) requires null07-07 23:18:29.391: ERROR/AndroidRuntime(7729): Caused by: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.mms/.ui.ConversationList } from ProcessRecord{46452720 7729:msc.test/10081} (pid=7729, uid=10081) requires null</code></pre><p>The code just looks like the following</p><pre><code> public void onReceive(Context _context, Intent _intent)     {// do stuff try         {             Intent intent = new Intent(Intent.ACTION_MAIN);             intent.addCategory(Intent.CATEGORY_LAUNCHER);             intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK );             intent.setClassName(""com.android.mms"", ""com.android.mms.ui.ConversationList"");             _context.startActivity(intent);         }         catch(ActivityNotFoundException e)         {            //handle except         }}</code></pre>","48784","","1232277","","2013-01-03 07:33:22","2013-01-03 07:33:22","Error starting conversation list activity from broadcast receiver on deveice","<android><broadcast><broadcastreceiver>","0","2","","",""
"3200897","1","3229510","","2010-07-08 05:37:19","3","1071","<p>I want to be able to get some reference to the curent object being drawn</p><pre><code>@Override        public void draw(Canvas canvas, MapView mapView,boolean shadow) {            //Log.i(""DRAW"",""MARKER"");            super.draw(canvas, mapView, false);        }</code></pre><p>Above is my draw method and I want to extend the draw method to write the title underneath each item for example.  This would require the .getTitle() method from the OverlayItem.  Possibly some tracking of objects outside of this method but not sure where to put it....</p>","103999","","103999","","2010-07-08 05:44:03","2010-07-12 14:53:35","Get current OverlayItem being drawn","<android><android-mapview><itemizedoverlay><overlayitem>","1","0","1","",""
"3201027","1","","","2010-07-08 06:03:05","4","476","<p>I am writing some files to SD card. My android version is 2.1. I am not setting any  permission in the manifest file but it allows me to write to sd card.</p><p>Please let me know why this behavior. only WRITE_EXTERNAL_STORAGE in manifest controls write to SD card or any other configuration i need to do.</p><p>thanksGururaja B O</p>","304046","","106534","","2010-07-08 06:05:15","2010-07-08 06:16:01","Writing to SD card","<android><android-manifest>","1","0","1","",""
"3201404","1","3201805","","2010-07-08 07:20:38","4","2616","<p>How would I go about getting an array of all the files in a specific directory on the sdcard, i.e. /ringtones/?</p>","385931","","385931","","2010-07-08 07:32:28","2011-12-14 15:15:02","Getting the Contents of a Specific Directory on the SDCard","<android><sd-card>","3","0","1","",""
"3201535","1","3228787","","2010-07-08 07:42:06","0","144","<p>I have few activities in android application with inbox Textview in the title.</p><p>I want to implement something like Inbox(Number of messages) to be shown on each screen</p><p>any one guide me what is the suitable way to show number of messages in each screen title bar?</p><p>one of my friend is calling webservice after 10 seconds again and again to achieve this functionality but I don't think it is a suitable way.</p>","249991","","759866","","2014-01-06 13:33:44","2014-01-06 13:33:44","Suggestions for inbox notifications in android?","<android>","1","1","","2011-12-14 18:18:11",""
"3201637","1","","","2010-07-08 08:00:13","2","1757","<p>I have an activity with a <code>HorizontalScrollView</code>. When it opens, I start filling this view (or rather, a container layout inside it) with another views. This is done from another thread by using <code>handler.post</code>. </p><p>The views are added in bunches of 15, and when there are no more views to add, I start updating them with new data (this is a kind of streaming data from a server).</p><p>The problem is that the scrollview is empty until all of the views are added. As soon as they are all added and start updating, the scrollview gets drawn.</p><p>How do I refresh it in the process of adding views? I don't want the screen to be empty for 3 seconds while all of the views are added.</p><p>Thanks a lot.</p><p><strong>UPDATE</strong>: turned out this problem is not specific for <code>HorizontalScrollView</code>, this is the case for any generic layout.</p>","125805","","125805","","2010-07-08 08:57:00","2011-03-19 16:06:09","Refresh layout while filling it","<android><refresh><horizontalscrollview>","2","0","","",""
"3201643","1","3203765","","2010-07-08 08:01:01","12","25717","<p>What is the best approach when using default Android drawables? Should I use <code>android.R.drawable</code> or should I copy the drawables in my project and use <code>R.drawable</code>?</p><p>Is there any risk, that in a newer version of Android, some of the default drawables are removed or resized? Or, affect in some negative way, the look of my app? Also, which of the drawables in the Android source code are considered ""stable"" and should be relied on?</p><p>I'd rather not copy the drawables because I think that the look of the app should be consistent with the Android version used. So, for example, for version 1.6 it should use the default Android bitmaps for version 1.6.</p>","292263","","","","","2013-05-02 18:55:13","How to use default Android drawables","<android><drawable>","6","0","1","",""
"3201719","1","3201802","","2010-07-08 08:12:52","0","240","<p>Let's start with an example: <a href=""http://weloveastrid.com/"" rel=""nofollow"">http://weloveastrid.com/</a></p><p>As you can see, their promotional screenshots are surrounded by a picture of an actual hardware - Nexus One in this case. Is the usage, for purely commercial reasons, of those pictures of existing hardware legal? Do I have to ask a manufacturer for permission?</p><p>In spirit of the question above, if you've got personal experience with that, how could I get hold of high quality pictures of Android phones?</p>","19082","","114066","","2010-07-08 08:26:16","2010-07-08 08:36:25","Legality of phone pictures in ads","<android><legal><terms-of-use>","2","3","","2013-07-10 03:24:18",""
"3201757","1","3333244","","2010-07-08 08:18:03","1","1614","<p>I'm doing Major Project on my final year and I'm very new to Android plus I;m not good at codings. I need help with my login page. I've created something like a database connection java file which is this:</p><pre><code>    package one.two;import java.util.List;import android.app.ListActivity;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;import java.util.ArrayList;    public class UserDB     {     public String KEY_USERNAME = ""Username"";     public  String KEY_PASSWORD = ""Password"";     public String KEY_LNAME = ""LastName"";     public String KEY_FNAME = ""FirstName"";     private static final String DATABASE_NAME = ""Users"";     private static final String DATABASE_TABLE = ""User"";     private static final int DATABASE_VERSION = 1;     private static Context context;     private static DatabaseHelper DBHelper;     private static SQLiteDatabase db;     public UserDB(Context ctx)     {      this.context = ctx;      DBHelper = new DatabaseHelper(context);     }     private static class DatabaseHelper extends SQLiteOpenHelper     {      DatabaseHelper(Context context)      {       super(context, ""Users"", null, 1);      }      @Override      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)      {      }      @Override      public void onCreate(SQLiteDatabase db)      {      }     }//end DatabaseHelper     // ---opens the database---     public UserDB open() throws SQLException     {      db = DBHelper.getWritableDatabase();      return this;     }     // ---closes the database---     public void close()     {      DBHelper.close();     }    }</code></pre><p>I've already created a database for users using SQLite. The database name is Users and the table is called User. The records inside the table are Username, Password, LastName, FirstName. I've inserted one user's info into the database. The problem is I do not know whether my UserDB.java is correct.</p><p>And I've also created login.java. Hardcoded Login page:</p><pre><code>    package one.two;import android.app.Activity;import android.content.Intent;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.GridView;import android.widget.ListView;import android.widget.TextView;public class Login extends Activity implements OnClickListener{ UserDB db = new UserDB(this);/** Called when the activity is first created. */ private EditText etUsername; private EditText etPassword; private Button btnLogin; //private Button btnRegister; private TextView lblResult;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.login);     // Get the EditText and Button References        etUsername = (EditText)findViewById(R.id.usernametxt);        etPassword = (EditText)findViewById(R.id.passwordtxt);        btnLogin = (Button)findViewById(R.id.btnLogin);        //btnRegister = (Button)findViewById(R.id.btnRegister);        lblResult = (TextView)findViewById(R.id.msglbl);        //Cursor c = (Cursor) db.getAllTitles();        Button btnArrival = (Button) findViewById(R.id.btnRegister);     btnArrival.setOnClickListener(this);    // Set Click Listener    btnLogin.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {  // Check Login  String username = etUsername.getText().toString();  String password = etPassword.getText().toString();  if(username.equals(""guest"") &amp;&amp; password.equals(""guest"")){   lblResult.setText(""Login successful."");  } else {   lblResult.setText(""Login failed. Username and/or password doesn't match."");  } }}); }    public void onClick(View v) {   Intent intent = new Intent(this, DatabaseActivity.class);   startActivity(intent);}}</code></pre><p>So I want to know how I should apply the database connection on the login.java. Should I insert database connection something like db.Open();? I studied ASP.Net a few months back and I kind of forget most of what I've learnt.</p><p>So how should I open the database connection on login.java and how to check with database whether the user enters the right username and password?</p>","380770","","126562","","2010-07-26 08:24:16","2013-05-31 08:33:55","Database connection, check data, login page","<sql><android><database>","1","3","","",""
"3201763","1","3207971","","2010-07-08 08:19:28","1","278","<p>Since I published a large update to one of my apps I have received hundreds of crash report, all from different motorola phones. The stack trace does not pass through my app:</p><pre><code>EXCEPTIONjava.lang.NullPointerExceptionat android.content.res.Configuration.updateFrom(Configuration.java:269)at android.content.res.Resources.updateConfiguration(Resources.java:1257)at android.app.ActivityThread.handleConfigurationChanged(ActivityThread.java:3701)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1907)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4246)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>It only happens once, the first time the user starts the app. I think the problem comes from this piece of code below. This code does so that the app always uses english when started, but then the user can choose to use another language that is saved at Constant.LOCALE in my SharedPreferences. The first time the program is started, the ""else""-clause is executed, it might be there that the problem occurs. But really, the strangest thing is that I cant find other people that have problems with only motorola phones. Do note that it works flawlessly on all other phones.</p><pre><code>public static void setCorrectLanguage(final Context context, final SharedPreferences preferences, final Editor editor) {    final Resources resource = context.getResources();    final Configuration cf = resource.getConfiguration();    final String choosenLanguage = preferences.getString(Constant.LOCALE, null);    final DisplayMetrics dm = resource.getDisplayMetrics();    if(choosenLanguage != null) {        cf.locale = new Locale(choosenLanguage);        resource.updateConfiguration(cf, dm);    } else {        cf.locale = new Locale(""en"");        resource.updateConfiguration(cf, dm);        editor.putString(Constant.LOCALE, ""en"");        editor.commit();    }}</code></pre>","249871","","","","","2010-07-08 21:00:56","Motorola specific crash on Android when using Configuration","<android><motorola>","1","1","1","",""
"3201807","1","","","2010-07-08 08:25:25","1","732","<p>It seems there is a size limit when opening up pages using Android's WebView object.  I am opening an HTML file in the 'Assets' folder.  I have used the method myWebView.loadUrl(""file://android_assets/index.html"").</p><p>It works fine for a test html page but the real HTML I need page calls a JavaScript file that is over 1MB (dont ask why so big).  I get an error stating that the .js page cannot be loaded.</p><p>I have heard that I could use the openContentURI() method, but the main page i am opening up is not the problem.  The problem lies with a subsequent included JavaScript file.  </p><p>Any idea how I can get this to work ?</p>","70711","","70711","","2010-07-08 08:47:33","2010-07-08 08:47:33","How to overcome Android WebView file size limit when loading a file","<android><android-webview>","0","3","1","",""
"3201843","1","","","2010-07-08 08:30:45","4","3781","<p>I've a very simple <strong>Android</strong> app, similar to fingerpaint application. I'mdrawing some lines on the screen with my finger.</p><p>My problem is that, app closes itself randomly, taking me back toAndroid home screen.</p><p>Only log I can see on LogCat is that line:</p><pre><code>(Warning) Tag: InputManagerService: Got RemoteException sending setActive(false) notification to pid 4962 uid 10077.</code></pre><p>No exception is thrown.</p><p>I've tried compiling project against Android 2.0, 2.1 and 2.2...</p><p>I've tried disabling debuggable attribute in manifest.</p><p>I'm having this problem on both Nexus One and 2.2 Emulator.</p>","386408","","85514","","2010-07-08 08:32:42","2010-08-30 08:48:06","Randomly closing app - InputManagerService: Got RemoteException sending setActive(false) notification","<android><remoteexception>","1","3","1","",""
"3201918","1","3206148","","2010-07-08 08:47:25","1","975","<p>I have xml file that looks like this:</p><pre><code> &lt;ns:retrieveLastResponse&gt; &lt;ns:return xsi:type=""ax21:MinusEntry""&gt; &lt;ax21:entrydate&gt;2010-07-02T17:29:35.492+02:00&lt;/ax21:entrydate&gt; &lt;ax21:minus&gt;true&lt;/ax21:minus&gt;  &lt;ax21:password&gt;SECRET&lt;/ax21:password&gt;  &lt;ax21:text&gt;Some text&lt;/ax21:text&gt;&lt;ax21:username&gt;John Doe&lt;/ax21:username&gt; &lt;/ns:return&gt;&lt;/ns:retrieveLastResponse&gt;</code></pre><p>I'm trying to parse it with sax like this:</p><pre><code>try {        URL rssUrl = new URL(""ADDRESS OF WS THAT RETURNS XML FILE"");         SAXParserFactory mySAXParserFactory = SAXParserFactory.newInstance();        SAXParser mySAXParser = mySAXParserFactory.newSAXParser();        XMLReader myXMLReader = mySAXParser.getXMLReader();        RSSHandler myRSSHandler = new RSSHandler();        myXMLReader.setContentHandler(myRSSHandler);        InputSource myInputSource = new InputSource(rssUrl.openStream());        //InputSource myInputSource = new InputSource(rssUrl.openConnection().getInputStream());        myXMLReader.parse(myInputSource);        //result.setText(myRSSHandler.getMessages().get(0).getDesc());        result.setText(Integer.toString(myRSSHandler.getMessages().size()));    } catch (MalformedURLException e) {        // TODO Auto-generated catch block        e.printStackTrace();        result.setText(""Cannot connect RSS!"");    } catch (ParserConfigurationException e) {        // TODO Auto-generated catch block        e.printStackTrace();        result.setText(""Cannot connect RSS!"");    } catch (SAXException e) {        // TODO Auto-generated catch block        e.printStackTrace();        result.setText(""Cannot connect RSS!"");    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();        result.setText(""Cannot connect RSS!"");    }}private class RSSHandler extends DefaultHandler{    private List&lt;Message&gt; messages;         private Message currentMessage;    private StringBuilder builder;    public List&lt;Message&gt; getMessages(){        return this.messages;    }    @Override    public void startDocument() throws SAXException {        messages = new ArrayList&lt;Message&gt;();        builder = new StringBuilder();    }    @Override    public void endDocument() throws SAXException {        // TODO Auto-generated method stub    }    @Override    public void startElement(String uri, String localName, String qName,            Attributes attributes) throws SAXException {        super.startElement(uri, localName, qName, attributes);        // TODO Auto-generated method stub        if (localName.equalsIgnoreCase(""ns:return"")){            Log.d(""XML"",""Zacetek xmla"");            this.currentMessage = new Message();        }    }    @Override    public void endElement(String uri, String localName, String qName)            throws SAXException {        super.endElement(uri, localName, qName);        if (this.currentMessage != null){            if (localName.equalsIgnoreCase(""ax21:entrydate"")){                Log.d(""XML"",""Vstop v datum"");                currentMessage.setDate(builder.toString());            } else if (localName.equalsIgnoreCase(""ax21:minus"")){                currentMessage.setMin(builder.toString());            } else if (localName.equalsIgnoreCase(""ax21:text"")){                currentMessage.setDesc(builder.toString());            } else if (localName.equalsIgnoreCase(""ax21:username"")){                currentMessage.setUser(builder.toString());            }            else if(localName.equalsIgnoreCase(""ns:return"")){                messages.add(currentMessage);                           }            builder.setLength(0);                     }        }    @Override    public void characters(char[] ch, int start, int length)            throws SAXException {        // TODO Auto-generated method stub        super.characters(ch, start, length);        builder.append(ch, start, length);    }</code></pre><p>But my list of messages is always empty, my log messages that are inside endElement and startElement are never displayed. How can i check if the program gets the xml file at all or am i parsing it incorectly?</p>","324417","","","","","2010-07-08 17:03:54","SAX parsing in android","<java><android><sax>","2","3","","",""
"3201984","1","3202045","","2010-07-08 08:58:14","0","6440","<p>I've modified my previous code for login. </p><pre><code>package log1.log2;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;public class Login extends Activity implements OnClickListener{    UserDB db = new UserDB(this);/** Called when the activity is first created. */    private EditText etUsername;    private EditText etPassword;    private Button btnLogin;//private Button btnRegister;    private TextView lblResult;    @Override           public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);     // Get the EditText and Button References        etUsername = (EditText)findViewById(R.id.usernametxt);        etPassword = (EditText)findViewById(R.id.passwordtxt);        btnLogin = (Button)findViewById(R.id.btnLogin);        //btnRegister = (Button)findViewById(R.id.btnRegister);        lblResult = (TextView)findViewById(R.id.msglbl);        //Cursor c = (Cursor) db.getAllTitles();        Button btnArrival = (Button) findViewById(R.id.btnRegister);        btnArrival.setOnClickListener(this);    // Set Click Listener    btnLogin.setOnClickListener(new OnClickListener() {    @Override    public void onClick(View v) {        db.open();        // Check Login        String username = etUsername.getText().toString();        String password = etPassword.getText().toString();        if(username.equals("""")){            if(password.equals(""""))                onClick();            else            {                lblResult.setText(""Wrong password"");            }               } else {            lblResult.setText(""Username does not exist. Please register."");        }                   db.close();    }  });    }         public void onClick(View v)    {           if (v.getId() == R.id.btnLogin)         {            Intent intent = new Intent(this, Test.class);            startActivity(intent);        }         else        {            Intent intent = new Intent(this, Home.class);            startActivity(intent);        }                    }       }</code></pre><p>As you can see, I've left a blank on my if..else. I do not know how to apply an <code>sql</code> statement to check the user and password. </p><pre><code>if(username.equals(""sqlstatement"")){            if(password.equals(""sqlstatement""))                onClick();            else            {                lblResult.setText(""Wrong password"");            }     } else         lblResult.setText(""Username does not exist. Please register."");</code></pre><p>I've insert <code>onClick</code>(); to direct to the other method so that the user will be directed to another page by using the <code>onClickListener</code> method, intent. But I'm having trouble doing that and so I thought that my code is wrong or there should be another way to direct to the other page once the user entered the correct username and password.</p><p>Before that, what should I do so that there would be a <code>database</code> connection? Or have I created a connection by inserting <code>db.Open()</code>? </p><p>I need to know the codes needed to be inserted the if..else statement.</p><p>Another basic stuff I want to know is how to set the text on the password <code>edittext</code> box to dots instead of the actual text.</p>","380770","","1248044","","2013-05-23 11:59:33","2013-05-23 11:59:33","Android Login page, database connection and checking of username and password. Edit text set to dots?","<sql><android><database>","1","1","1","",""
"3202092","1","3202739","","2010-07-08 09:13:09","0","566","<ul><li><p>how do you change the image of an ImageButton during runtime?for Button, you can say setText(""some text"")for ImageButton is there any setImage() such that I can change the image  during runtime?</p></li><li><p>where do you place the pictures? drawable hdpi,ldpi,mdpi..what exactly is the difference between all of them?</p></li></ul>","381699","","381699","","2010-07-14 04:08:13","2010-07-14 04:08:13","ImageButton usage and changing pictures","<android>","1","0","","",""
"3202176","1","","","2010-07-08 09:23:37","1","1741","<p>I'd like to make a Gallery in android. In order to set the adapter in need to get the gallery which I defined in my xml file. Im doing that as:Gallery g = (Gallery) findViewById(R.id.gallery1);But with this code I can't compile my project, since I get the Error ""Cannot cast from View to Gallery"". My xml-file looks like this:""</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""   android:orientation=""vertical""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   &gt; &lt;Gallery android:id=""@+id/gallery1""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:gravity=""bottom"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Anybody knows how to solve my problem? Thanks a lot</p>","386463","","267269","","2010-07-08 10:57:42","2010-07-08 10:57:42","Android: Cannot cast from View to Gallery","<android><view><gallery><android-gallery>","2","0","","",""
"3202281","1","3202361","","2010-07-08 09:35:02","2","4915","<p>i'm newbie for android dev, now i want explore file handling in android, for example how to write a file (ie. sample.txt) and which location, how to read back it, can this file can be view manually</p><p>thanks in advance</p>","142636","","","","","2010-07-08 09:45:45","android file handling","<android><file>","1","0","","",""
"3202332","1","","","2010-07-08 09:41:39","0","990","<p>How did you support both landscape and portrait for appwidget? the layout of appwidget will never change when orientate the device from landscape to portrait. by the way, would you please tell me which device support both landscape and portrait for appwidget?</p>","386474","","","","","2013-01-11 10:03:50","the same problem as ""Android widget different portrait and landscape orientation""","<android><widget><android-widget><screen-orientation>","2","0","","",""
"3202366","1","3211166","","2010-07-08 09:46:13","1","1623","<p>i did wifi scanning for android, but now i want this wifi scanning run at set interval period, how this can be done, can any provide any snippets,</p><p>thanks in advance</p>","142636","","","","","2011-12-06 02:45:41","how about android interval","<android><multithreading><intervals>","2","0","1","",""
"3202414","1","","","2010-07-08 09:53:43","0","115","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3202243/what-does-portable-hotspot-mean"">What does &ldquo;Portable Hotspot&rdquo; mean ?</a>  </p></blockquote><p>What does the term ""Portable Hotspot"" mean, in reference to Android Froyo 2.2? The description given on the website seems vague. </p><p>How does it actually work?</p>","373049","","995926","","2012-05-05 13:37:36","2012-05-05 13:37:36","Meaning of ""Portable Hotspot""","<android><android-2.2-froyo>","0","2","","2010-07-08 12:39:50",""
"3202460","1","3205134","","2010-07-08 09:59:15","2","741","<p>I recently started to play arround with Android. One of the first things I tried to achieve was creating a dynamic TableLayout. Searching the web, I found some sample code at <a href=""http://en.androidwiki.com/wiki/Dynamically_adding_rows_to_TableLayout"" rel=""nofollow"">http://en.androidwiki.com/wiki/Dynamically_adding_rows_to_TableLayout</a> which I copied into my activity.</p><p>So my Activity now looks like this:</p><pre><code>public class FooActivity extends Activity {  @Override  protected void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.foo);      /* Find Tablelayout defined in main.xml */      TableLayout tl = (TableLayout)findViewById(R.id.myTableLayout);      for(int i= 0; i &lt; 9; i++){           /* Create a new row to be added. */           TableRow tr = new TableRow(this);           tr.setLayoutParams(new TableRow.LayoutParams(                          LayoutParams.FILL_PARENT,                          LayoutParams.WRAP_CONTENT));           tr.setBackgroundColor(Color.MAGENTA);                /* Create a Button to be the row-content. */                Button b = new Button(this);                b.setText(""Dynamic Button"");                b.setLayoutParams(new LayoutParams(                          LayoutParams.FILL_PARENT,                          LayoutParams.WRAP_CONTENT));                /* Add Button to row. */                tr.addView(b);      /* Add row to TableLayout. */      tl.addView(tr,new TableLayout.LayoutParams(                LayoutParams.FILL_PARENT,                LayoutParams.WRAP_CONTENT));    }  }}</code></pre><p>my foo.xml in the layouts folder looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/myTableLayout""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt; &lt;TableRow      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""&gt;      &lt;Button android:text=""Static Button""/&gt; &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>When I now start my app in the emulator, none of the dynamicly added rows are visible. I just see the static button which has been defined in the foo.xml file. With an attached debugger, I've been able to see that my code gets executed and the rows are added to the tablelayout object. However, the added rows aren't rendered.</p><p>Any ideas?</p>","125649","","","","","2010-07-08 15:18:24","Dynamicly added Rows aren't visible","<android>","1","0","1","",""
"3202490","1","3245104","","2010-07-08 10:02:45","2","4032","<p>i'm having trouble working out the returned values of the below code pMeasure = PathMeasure, m = Matrix, distCount is the distance along the path</p><pre><code>pMeasure.getMatrix(distCount, m, 0x01 | 0x02); m.getValues(float[] values)</code></pre><p>float[2] &amp; float[5] are position x &amp; y respectively but i can't figure out the rest</p><p>any help once again appreciated.</p>","381258","","381258","","2010-07-14 09:57:51","2013-03-22 15:01:09","Android Matrix, what does getValues() return?","<android><path><matrix>","2","0","0","",""
"3202549","1","3209173","","2010-07-08 10:11:13","0","356","<p>I'm trying to set up a style that I'll use for my text entry boxes on forms in my application. I've got a basic style, TextEntry, and extensions such as TextEntry.Name. Here's what I want to do:</p><pre><code>&lt;style name=""PgoTextEntry""&gt;      &lt;item name=""android:textAppearance""&gt;@style/PingoText.White&lt;/item&gt;      &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;      &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;      &lt;item name=""android:background""&gt;@drawable/textentrybox3&lt;/item&gt;      &lt;item name=""android:textColorHint""&gt;@color/PingoHintColor&lt;/item&gt;&lt;/style&gt;&lt;style name=""PgoTextEntry.Name""&gt;      &lt;item name=""android:inputType""&gt;android:textPersonName | android:textCapWords&lt;/item&gt;&lt;/style&gt;</code></pre><p>Problem is, that this causes an error, 'String types not allowed ...' It doesn't like me oring the two values textPersonName and textCapWords together.</p><p>Any ideas how I can do this so I don't have to put the inputType in for every entry field by hand?</p><p>Thanks</p>","303340","","303340","","2010-07-09 01:09:00","2010-07-09 01:09:00","How can I or values together in a style item?","<android><coding-style><android-widget>","1","0","","",""
"3202627","1","3202982","","2010-07-08 10:22:54","2","7195","<p>i have a camera Activity after which i take a picture  and saving it to gallery and uploading to the server My upload  code  is not working, i need  help on this?</p><p>// image capture</p><pre><code>Intent intent = new Intent(""android.media.action.IMAGE_CAPTURE"");startActivityForResult(intent, 0);</code></pre><p>//image Saving</p><pre><code>if(requestCode==0&amp;&amp;resultCode==RESULT_OK){    Bundle extras = data.getExtras();    Bitmap b = (Bitmap) extras.get(""data"");    ImageView mImg;    mImg = (ImageView) findViewById(R.id.head);    mImg.setImageBitmap(b);    // save image to gallery    Shot = ""HeadShot""; //Long.toString(System.currentTimeMillis());    MediaStore.Images.Media.insertImage(getContentResolver(), b, Shot, NAME);}</code></pre><p>//Upload to  the server</p><pre><code>public void Upload(String url, HttpEntity imgdata) throws Exception, Exception {    DefaultHttpClient client = new DefaultHttpClient();    HttpPost post = new HttpPost(url);    post.setHeader(""Content-Type"", ""bitmap; charset=utf-8"");    post.setURI(new URI(url));    post.setEntity(imgdata);    HttpUriRequest request = post;    HttpResponse response = client.execute(request);    HttpEntity entity = response.getEntity();    return entity.getContent();}</code></pre>","164850","","206877","","2014-01-22 11:30:50","2014-01-22 11:30:50","Uploading a bitmap to the server with http protocol","<android>","3","3","2","",""
"3202749","1","","","2010-07-08 10:43:03","4","17885","<p>I have to achieve that the Touch Scroll on the ViewFlipper. For Example. I have two Images. At First, ViewFlipper shows an First Image. Now I Flung the view from right to left. The First Image view Slide out left and the Second Slide in from Left. I can achieve it By this <a href=""http://stackoverflow.com/questions/937313/android-basic-gesture-detection"">Post</a>. But I want to Scroll the image. That is, on the Action_Move Event I want to do Touch Scroll. For Example, when I move the touch from right to left it will flung how much the touch moves. on that time the output should show both images partly. </p><p>How to do that? What I have to measure the Screen levels(height &amp; width). Example codes are more helpful.</p>","267269","","322020","","2012-05-24 13:03:49","2013-05-30 08:46:53","Touch Scroll on View Flipper in Android?","<android><viewflipper><android-gallery>","2","0","6","",""
"3202823","1","","","2010-07-08 10:55:19","1","1216","<p>I want to pop up the software keyboard when the user presses the search hardware search key.</p><p>At the moment I use the following function with doesn't seem to work for the search key but which does work for the back key:The logging doesn't get even tiggered through the search key.</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {        if(keyCode == KeyEvent.KEYCODE_BACK){            Log.v(TAG, ""On back key press"");            renderPrevious();        return false;        }        if(keyCode == KeyEvent.KEYCODE_SEARCH){            Log.v(TAG, ""On search key press"");            this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);        return false;        }        return true;    }</code></pre><p>I have no text field but want to handle the input directly myself if that matters.</p>","25282","","147141","","2011-03-30 11:17:44","2011-07-11 09:52:49","Bringing up SoftKeyboard on android","<android>","3","0","","",""
"3202939","1","","","2010-07-08 11:10:37","4","3209","<p>Let's suppose that we have the following scenario: something is playing on an android device (an mp3 par example, but it could be anything that use the audio part of an android device). From an application (android application :) ), I would like to intercept the audio stream to analyze it, to record it, etc. From this application (let's say ""the analyzer"") I don't want to start an mp3 or something, all I want is to have access to the audio stream of android.</p><p>Any advice is appreciated, it could a Java or C++ solution.</p>","386555","","","","","2014-02-01 19:57:50","How can I intercept the audio stream on an android device?","<java><c++><android>","1","3","2","",""
"3203009","1","3203034","","2010-07-08 11:22:47","0","950","<p>I'm developing Android 2.2 application and I'm going to use <em>Preference.OnPreferenceChangeListener</em> interface.</p><p>I've added the following piece of code to my preference activity:</p><pre><code>Preference somePref = findPreference(SOME_PREF);    somePref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {                @Override                public boolean onPreferenceChange(Preference preference,                        Object newValue) {                    // some code here                    return true;                }            });</code></pre><p>If I use 1.6 Java compiler with 1.6 source code level, then everything is perfectly fine. But if I change the level of source code to 1.5 then I've got an error message:</p><blockquote>  <p>The method onPreferenceChange(Preference, Object) of type new Preference.OnPreferenceChangeListener(){} must override a superclass method</p></blockquote><p>The question is: why?</p>","199041","","","","","2010-07-08 11:25:53","Different behaviour of @Override in OnPreferenceChangeListener.onPreferenceChange method of Android 2.2 application depending on source code level","<java><android>","1","0","1","",""
"3203030","1","3203071","","2010-07-08 11:25:05","2","253","<p>This is my first question at stackoverflow :-). However, I've started to Android programming some weeks ago and now I have get into a problem that I will describe below.</p><p>Problem:I have a background-image for the whole screen. Inside this LinearLayout I have another LinearLayout with Buttons inside. How can I (without to start a new activity) load another buttons and make the first buttons disappear. The Buttons have a drawable background-image assigned to the specific button.</p><p>Like: I have a menu; play, options and quit. When I for example click on Options, the Options should load, and the play-button, options-button and quit-button should disappear.</p><p>All I want to become is to remain the background-image without to create a new activity and always can load a bunch of new buttons depending on the button that was clicked on.</p><p>For now I have created a new activity for the new buttons that should appear for example: Exit -> Do you want to Exit? Yes or no., then I also have done so the new acitivty loads another xml-layout-resource file, with the same background as before. This is what I want to change to a smoother resolution.</p>","386562","","386562","","2010-07-31 17:34:07","2010-07-31 17:34:07","How to do a Sub-menu without a new Acitivity? Android programming","<java><android>","1","1","","",""
"3203214","1","3203476","","2010-07-08 11:52:45","3","236","<p>I have a service that is listening to some events.When that event happens, it shows a screen by startActivity(intent)</p><p>When the user finishes doing something on that screen, the code calls finish()but instead of 'closing' the complete application, it shows the main/launcher activity.</p><p>I mean, whats the best way to remove all app screens from current view?or any way to go around this?</p>","178016","","244296","","2010-07-08 12:41:54","2010-07-08 12:48:15","Activity remains on screen Android","<android>","3","0","1","",""
"3203257","1","","","2010-07-08 11:56:20","3","591","<p>In android docs, it is said that 140 still is ldpi, but when I change dpi to 140, I find mdpi resource is retrieved, can someone have idea? thanks a lot.</p><p>btw, I read the code about how to get resource, seems ldpi's max dpi value is 131.25? Does google post the wrong doc?</p>","386606","","","","","2011-06-19 19:49:01","android: can 140 dpi will get mdpi resource?","<android>","1","0","","",""
"3203438","1","3203776","","2010-07-08 12:19:15","0","565","<p>I am developing an application and I would like to use the control that I can see in the Photos application and the Desk Clock (on an HTC Desire).</p><p>The one I am referring to is the bar along the bottom of the screen that has various icons in it. When you press on an icon, the bubble moves along the bar to the icon you have pressed and the icon is then shown in colour.</p><p>What is the name of this control? </p>","134340","","","","","2010-07-08 12:56:48","Android menu controls","<android>","2","0","","",""
"3203641","1","","","2010-07-08 12:42:11","0","400","<p>Hi<br>I'm trying to set a shape defined in XML as view's background. Here's it:</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""android:shape=""rectangle""&gt;&lt;gradient    android:startColor=""#fcfcfc""    android:endColor=""#cfcfcf""    android:angle=""270"" /&gt;&lt;padding    android:left=""10dp""    android:top=""10dp""    android:right=""10dp""    android:bottom=""10dp"" /&gt;&lt;stroke    android:width=""3dp""    android:color=""#aaaaaa""&gt;&lt;/stroke&gt;&lt;corners    android:radius=""1dp"" /&gt;&lt;/shape&gt;</code></pre><p>Although I've defined padding in the shape when I set it as a background to layout shape's edge completely match view's edge. Is it possible to make shape not to fill entire view?</p><p>Thanks</p>","218783","","218783","","2010-07-08 12:50:57","2011-06-30 18:08:21","Setting drawable defined in XML as view's background in Android","<android><layout>","1","0","","",""
"3203662","1","3246643","","2010-07-08 12:44:07","1","115","<p>I'm working on an archiving mechanism of my application's log files and would like some advice.</p><p><strong>What I want to do:</strong> When receiving a LogEntry, the LogListenerService will save it in a buffer and at some point it will print all the log entries in a file. When the file reaches a certain size an archiving service is called that will zip the contents of the log files and clean it.</p><p>I've implemented most of the functionality but have some questions:</p><ol><li>How do I go about defining the ideal size of the buffer?</li><li>How do I make sure the log file size is kept under a given ""maximum size""?</li></ol><p>Thanks</p>","108876","","108876","","2010-07-08 15:51:59","2010-07-14 13:41:57","Archiving mechanism","<android>","2","0","0","",""
"3203680","1","","","2010-07-08 12:45:30","0","511","<p>I want to assign an image to one of the buttons in my activity?</p><p>How can i achieve that??And for that where shall I place image.jpeg or any other image file?</p>","379749","","766108","","2012-08-22 06:11:32","2012-08-22 06:25:30","How to assign an image to a button?","<android><image><button>","3","0","","",""
"3203690","1","","","2010-07-08 12:46:52","0","1667","<p>I'm working on a game that requires drawing to SurfaceView'sCanvas. I'm using SurfaceHolder to obtain Canvas to draw to, andperform drawing in a separate thread. Everything I draw displayscorrectly except for this one animation.</p><p>Here is the animation definition (it is in res/drawable/my_animation.xml:</p><p></p><p>and here is how I draw it to the Canvas:</p><p>AnimationDrawable ad = (AnimationDrawable)getResources().getDrawable(R.drawable.my_animation);ad.draw(canvas);ad.start();</p><p>but only the first frame ever appears on the screen.</p><p>What am I missing?</p><p>Thank you</p>","386659","","127880","","2011-07-15 14:19:34","2014-02-21 06:36:28","animation does not start in canvas on android ","<android><animation><canvas>","4","0","","",""
"3203694","1","3203719","","2010-07-08 12:47:01","23","25521","<p>I have already read some articles and searched on Google, but I failed to do it.</p><p>My problem is regarding the font-face.</p><p>In Android, there are only 4 attributes in <code>""android:typeface""</code>: Normal, Sans, Serif, Monospace.</p><p>So what do I have to do to use ""Verdana"" in my application? </p><p>Please suggest me a correct way to use this font in my Android application.</p>","379693","","469983","","2011-11-25 14:10:58","2014-02-06 09:26:28","Custom Fonts in Android","<android><fonts><android-widget>","4","3","13","",""
"3203716","1","","","2010-07-08 12:49:31","1","1508","<p>I have added a mute button to a menu on my application and am wondering if it is possible to store the user's latest preference of either muted or unmuted for use when he/she reopens the application.  </p><p>Here is the code I am using for setting mute or umute:</p><pre><code>public void isMute() {      if(mIsMute){              mAm.setStreamMute(AudioManager.STREAM_MUSIC, false);          mIsMute = false;      }else{          mAm.setStreamMute(AudioManager.STREAM_MUSIC, true);          mIsMute = true;      }    }</code></pre>","2186261","","2186261","","2010-07-08 13:30:51","2010-07-08 16:22:49","Store Application Preference Android","<android>","1","0","","",""
"3203721","1","","","2010-07-08 12:50:35","3","373","<p>I'm developing an Android application and have one account authenticator with preferences.But when I add two accounts of my type, then the preferences are shared between them. How can I define preferences, so that they could be set for each account separately?</p><p>Thanks in advance!</p><p>Przemek</p>","199041","","","","","2011-10-21 13:33:50","Account preferences in Android 2.2 per account, not account type","<android><android-2.2-froyo><android-sdk-2.2>","1","0","1","",""
"3203869","1","3203941","","2010-07-08 13:07:12","2","3245","<p>Is there any way to set my sliding drawer on top of other elements in my layout? I have an ImageView which is intended for an album art and I would like to have a sliding drawer overlay at the bottom of that ImageView.</p>","372107","","","","","2011-08-28 23:02:31","SlidingDrawer on top","<android>","2","0","1","",""
"3203920","1","3204044","","2010-07-08 13:12:45","6","3546","<p>Right now I have two buttons. Each one needs to produce a different sound. In the future, there will probably be about 8 buttons, but for now just two. </p><pre><code>public class MyActivity extends Activity {     public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            final Button btnDrum1 = (Button) findViewById(R.id.btnDrum1);            btnDrum1.setOnClickListener(new OnClickListener() {                public void onClick(View v) {                     MediaPlayer mp = MediaPlayer.create(this, R.raw.drum1);                        mp.start();                        mp.release();                }            });            final Button btnCym1 = (Button) findViewById(R.id.btnCym1);            btnCym1.setOnClickListener(new OnClickListener() {                public void onClick(View v) {                     MediaPlayer mp = MediaPlayer.create(this, R.raw.cym1);                            mp.start();                            mp.release();                }            });        }    }</code></pre><p>Originally i didn't have mp.release() and it would play the sound properly, but eventually the app would crash due to running out of memory. Now with the mp.release() it doesn't crash, but sometimes it doesn't play the sound when clicked.</p><p>Is this the most efficeient way to play a sound when button is clicked? Is it extensible?</p>","386680","","249871","","2013-04-18 06:59:10","2013-11-26 20:28:43","most efficient way to play a sound when button is clicked","<android><button><audio>","2","0","4","",""
"3204036","1","3209799","","2010-07-08 13:25:40","12","11298","<p>I have a question: How can I place a hyperlink WITHIN a text-block of normal text? I have some text and in the text I mention a URL and I want this URL to be in a different color, underlined and click-able.</p><p>I know hyperlinks in android can be placed with ""Linkify""..and i have referred <a href=""http://developer.android.com/reference/android/text/util/Linkify.html""> android docs </a> page</p><p><strong>Consider the same above paragraph with ""android docs"" i want to display in android.....</strong></p>","379693","","709626","","2012-06-11 05:40:00","2012-06-11 05:40:00","Hyperlink in Android","<android><hyperlink><anchor>","3","0","3","",""
"3204080","1","","","2010-07-08 13:31:51","1","332","<p>How can I make my own UI defining my properties?</p>","379749","","244296","","2010-07-08 13:34:35","2010-07-08 13:42:41","Making user-defined UI","<android><user-interface>","1","3","1","",""
"3204101","1","","","2010-07-08 13:34:19","0","335","<p>Hi all I am trying to add my motorola milestone device into PC and debug in the device. When i put the usb cable, the device opens in data storage mode and opens the folder. But when i do a ""adb devices"" i dont see any device.</p><p>i did the usb_driver fresh installation guide, but it returned ""windows could not find a better driver than currently installed"" I havd pointed to sdpath/usb_driver</p><p>what's wrong and how to resolve this ?</p><p>Thanks in advance</p>","384185","","","","","2010-07-08 13:53:22","android device not recognised","<android>","2","0","","",""
"3204110","1","3204235","","2010-07-08 13:35:17","1","821","<p>I have to run a very simple query like this in SQLite3.</p><pre><code>INSERT OR REPLACE INTO tblPhoneList(Phone, PeopleId, StorageType) VALUES('+91912345789', '1','1');</code></pre><p>But whatever I do, the number is stored as 91912345789. The + prefix is ignored.The field <code>Phone</code> is a <code>String</code>. Why does it ignore the + prefix?Is there anyway to avoid this?</p><p>P.S. This code is run inside Android</p><p>EDIT:This is the schema of the table</p><pre><code>CREATE TABLE tblPhoneList(Phone STRING PRIMARY KEY ON CONFLICT REPLACE, StorageType INTEGER, PeopleId INTEGER, FOREIGN KEY(PeopleId) references tblPeople(id));</code></pre>","177890","","177890","","2010-07-08 14:13:09","2010-07-08 14:23:46","SQLite3 storing String which contains only numbers","<sql><android><sqlite><sqlite3>","5","2","","",""
"3204305","1","3204543","","2010-07-08 13:58:35","1","1390","<p>I'm trying to make test-program that opens a website by pushing a button. I have made a listener and everything, my problem is just that, the url-opening-script makes an error and tells me ""Uri cannot be resolved"". Here's the script I use to open up an webpage:</p><pre><code>Intent browserIntent = new Intent(""android.intent.action.VIEW"",Uri.parse(""http://www.google.com""));  startActivity(browserIntent);</code></pre><p>I have the <code>import android.app.Activity;</code>, <code>import android.content.Intent;</code> and <code>import android.content.ContentUris;</code> (maybe the last one isn't needed) so I can't find out what's wrong...</p><p>I hope someone knows what I've done wrong, or forgot to import...</p><p>P.S. I've used this pages to get to where I am:  </p><p><a href=""http://stackoverflow.com/questions/2201917/android-open-url-from-code"">http://stackoverflow.com/questions/2201917/android-open-url-from-code</a><br><a href=""http://stackoverflow.com/questions/3004515/android-sending-an-intent-to-browser-to-open-specific-url"">http://stackoverflow.com/questions/3004515/android-sending-an-intent-to-browser-to-open-specific-url</a></p>","386719","","114066","","2010-07-08 14:22:58","2013-02-22 08:56:51","Android - Need help opening a url in the phone's default browser","<android><url><web-browser><android-intent>","2","3","1","",""
"3204369","1","3204527","","2010-07-08 14:04:23","3","4921","<p>I hear that the Android's desktop is an application that I can change.I'm searching for some information about how to do that.</p>","287316","","287316","","2011-08-25 17:18:16","2011-08-25 17:18:16","How to change default Android's Desktop application?","<android>","2","2","2","",""
"3204476","1","3229148","","2010-07-08 14:13:36","8","12465","<p>I've been looking for a solution to this for hours, but I can't find any.</p><p>Basically, I want to upload, from my android device, files to an http website. However, I have no clue whatsoever how to do this. I'm using java on the device, and I would like to use PHP on the server-side of things. I just want to upload the files, not do anything fancy with them on the server.</p><p>Can anyone provide code and/or a good link to what I need? I have little to no experience in this, and I am at a loss.</p><p>Thanks,NS</p><p>PS. I have no experience in PHP coding.</p>","777890","","777890","","2010-07-08 14:21:22","2013-11-09 07:25:58","Android file uploader with server-side php","<java><php><android><file-upload>","3","0","12","",""
"3204518","1","3211601","","2010-07-08 14:16:56","0","148","<p>another new problem described below:</p><p>When I press home button when music STILL plays, it closes correctly, but when the sound (that is five seconds long) has finished and I press home button, it gives me a force close. I have tried an else-statement; with no luck.</p><pre><code>protected void onStop() {    super.onStop();    if(mp.isPlaying()){        mp.pause();    }}</code></pre><p>there my variable mp is a MediaPlayer linked to this <code>mp = MediaPlayer.create(getBaseContext(), R.raw.mainsound);</code> </p><p>Ideas?</p>","386562","","","","","2010-07-09 10:06:25","force close when music stops - Android","<java><android>","2","3","","",""
"3204774","1","3215027","","2010-07-08 14:43:26","8","4419","<p>My small startup is planning to start development of an android app in september.  My CEO wants to register the name for the app beforehand.  Is it possible to do so?</p>","403477","","","","","2010-07-09 17:22:12","How can you reserve a name for an application?","<android>","1","5","10","",""
"3204796","1","","","2010-07-08 14:46:05","4","1865","<p>I am currently in the research phase of my project on Android.I am interested in developing indoor custom maps application.There are 2 problems I am currently facing in this1) I can't use GPS as it won't work in the indoor settings like a building or a mall and 2) I can't use Google Maps API as I need to show my location on a indoor custom map(like a floorplan of a building).I am assuming here that I have the custom map of the building or mall.</p><p>Now my goal is to find location of the Android phone using some methods and display it on the custom map.To find the location I have following options,</p><p>1.Use of bluetooth dongles or trasmitters-I am assuming that bluetooth dongles or trasmitters are kept at known locations on the custom map and I know the coverage area for all of them.I will use methods like RSSI to get nearest dongle from my Phone.The problem here is I dont know how do I use this information to plot the location of my phone on the map.I have heard of shape files for Windows Mobile which are used for this purpose.Don't know how I can make use of them in Android.</p><p>2.Use of Wi-Fi Access Points - Similar to Bluetooth.But cost is more than Bluetooth.</p><p>Can anyone please suggest some solutions to these problems.</p><p>Thanks.</p>","355833","","","","","2013-10-04 03:30:59","Indoor Custom Maps Application","<android><google-maps><map><bluetooth><wifi>","2","0","3","",""
"3204852","1","","","2010-07-08 14:51:31","29","81105","<p>I am trying to add <code>TextViews</code> to my xml-defined layout in code.I have a xml-sheet, where a lot of <code>Views</code> are defined. But I have to add some views in code, so a create a <code>LinearLayout</code> in the xml-sheet:</p><pre><code>&lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content""android:id=""@+id/info""android:layout_height=""wrap_content"" android:orientation=""vertical""&gt;&lt;/LinearLayout&gt;</code></pre><p>And in this layout, I like to add my <code>TextView</code>:</p><pre><code>    View linearLayout =  findViewById(R.id.info);    //LinearLayout layout = (LinearLayout) findViewById(R.id.info);    TextView valueTV = new TextView(this);    valueTV.setText(""hallo hallo"");    valueTV.setId(5);    valueTV.setLayoutParams(new LayoutParams(            LayoutParams.FILL_PARENT,            LayoutParams.WRAP_CONTENT));    ((LinearLayout) linearLayout).addView(valueTV);</code></pre><p>But I only get the following error message:</p><pre><code>: java.lang.ClassCastException: android.widget.TextView</code></pre><p>How can I do it?</p><p>Thanks for you help.Martin</p>","386787","","601868","","2012-02-09 13:52:41","2014-02-22 21:37:43","Android: Add a textview to linear layout programmatically","<java><android><xml><android-linearlayout>","5","3","8","",""
"3204934","1","3229199","","2010-07-08 15:00:07","4","4919","<p>Here's the problem. In my app, I have 5 tabs which contains activities. In each of them, I have to show differents screens. For example, the main activity of a tab is a listview, and when I click on one of its item, I want to display a second screen with an other listview, that will display an other screen when the user will select an item etc.</p><p>So I knew that activities in tabs are not easy to manage, but I really think that I needed this solution. Indeed, each screen must contain a back button, which will return to the previous screen, with the previous state (the same position in the list).</p><p>To start new activities inside the tabs, I used the technique described here <a href=""http://gamma-point.com/content/android-how-have-multiple-activities-under-single-tab-tabactivity"" rel=""nofollow"">http://gamma-point.com/content/android-how-have-multiple-activities-under-single-tab-tabactivity</a></p><p>It works mostly well, but I encounter a problem to go back to the previous activities. My solution at the moment consists in starting the previous activity like it's described on this website, but without any flag.</p><p>So here are my two real problems:  </p><ul><li><p>When I try to go back to the first and main activity of the tab, it seems that a new instance is created, even if I use the flag <i>Intent.FLAG_ACTIVITY_CLEAR_TOP</i>. So when I do several roundtrips between this activity and the next one, i obtain a StackErrorOverFlow.  </p></li><li><p>Because the activities are accessible from differents activities, I have to memorize the parents activities all the time, by giving them in the intents. It's really heavy when I have a succession of 5 or 6 screens, I have to memorize the grand grand parent if the activity... I really appreciate if I just could call the last Activity started by the localActivityManager.</p></li></ul><p>Thanks for your help,and if I'm not understandable, please, let me know !</p>","386745","","386745","","2010-07-09 14:35:48","2010-09-24 15:58:15","How to manage multiples activities under a single tab of TabActivity","<android>","3","0","6","",""
"3204969","1","","","2010-07-08 15:02:50","2","655","<p>I've got a moderately complex Android application where I'm handling rotation myself through onConfigurationChanged rather than restarting the activity.  After using the device or emulator for a while (many rotations) I start to see the application laying out incorrectly intermittently (it retains it's portrait width while in landscape mode)</p><p>I added trace logging statements to all the ""onAction"" events in the activity and I see two distinct flows:</p><p><strong>Correct:</strong></p><ol><li>onConfigurationChanged</li><li>onMeasure <b>(with old width)</b></li><li>onLayout</li><li>onMeasure <b>(with new width)</b></li><li>onSizeChanged</li><li>onLayout</li><li>onDraw</li></ol><p>When the layout is incorrect I see this flow</p><p><strong>Incorrect:</strong></p><ol><li>onMeasure <b>(with new width)</b></li><li>onSizeChanged</li><li>onLayout</li><li>onDraw</li><li>onConfigurationChanged</li><li>onMeasure <b>(with new width)</b></li><li>onLayout</li><li>onDraw</li></ol><p>Looking at the messages getting dispatched I think I see part of the problem:  I see 3 important messages getting posted:</p><ul><li>MessageType 1003 --> New Size for mWinFrame</li><li>MessageType 1000 --> New Measure/Layout pass (uses the size of mWinFrame)</li><li>MessageType 118  --> Configuration Change, kickoff a onConfigurationChanged. </li></ul><p>When the layout is correct the order seems to be 118, 1003, 1000.  When it's wrong the order seems to be 1003, 1000, 118, so it gets measured with the new width before onConfigurationChanged happens.</p><p>For extra bonus confusion, when the layout is incorrect it immediately becomes correct when  I attach hierarchy viewer and dump the hierarchy, but does not become correct no matter how many times I request relayout and/or invalidate in onPreDraw.</p><p><strong>Questions:</strong></p><p>1) Even given the out-of-order calling, I do get the onConfigurationChanged eventually and request a relayout which happens with the new width and height, why would that not result in an update on screen?</p><p>2) Why would the posting order of those messages change over time?  I never see this on a fresh boot, but start to see it when the phone / emulator has been ""running for a while"".</p>","386756","","386756","","2010-07-08 15:31:41","2011-03-08 20:05:09","Race Condition in performTraversals and onConfigurationChanged results in incorrect layout?","<android><screen-rotation>","1","0","2","",""
"3205056","1","4538348","","2010-07-08 15:11:03","5","2593","<p>I am using the following code</p><pre><code>class CustomWebViewClient extends WebViewClient {    Context context;    ProgressDialog pd = null;    public CustomWebViewClient (Context c){        context = c;    }    public void onPageFinished(WebView view, String url){        pd.dismiss();    }    public boolean shouldOverrideUrlLoading(final WebView view, final String url) {        pd = ProgressDialog.show(context, """", ""pageload. Please wait..."", true);        view.loadUrl(url);          return true;    } }</code></pre><p>When I click a link in the WebView, the dialog appears and the page begins to load, however when the page is finished loading, the dialog is still on the screen. Obviously the code is simple enough, but I cant figure this out. Also, I guess I should add that the links being clicked have a few redirects, but I am not sure if that is related to the cause here.</p><p>How can I do this right?</p>","122105","","1500667","","2012-07-30 09:27:20","2012-07-30 09:27:20","Android Webview loading dialog not being dismissed","<java><android><webview><progressdialog>","4","1","1","",""
"3205129","1","3205286","","2010-07-08 15:17:53","1","352","<p>I work with Eclipse and implement some applications using the Android Emulator.</p><p>I'd like to know:</p><ol><li>is it possible to extend Android APIs with other .jar file?</li><li>If it's possible, how can I extend the APIs? I just have to add libraries to the project or do I copy it to the $ANDROID_HOME/platforms/android-8/tools/lib</li></ol>","385561","","114066","","2010-07-08 15:48:21","2010-07-08 15:48:21","Extends Android APIs","<android>","1","0","","",""
"3205191","1","3305276","","2010-07-08 15:23:06","11","31855","<p>I need to get the mjpeg stream from an IP camera, anyone know the right way do it? I googled a bit and I find this example</p><p><a href=""http://www.anddev.org/mjpeg_on_android_anyone-t1871.html"">http://www.anddev.org/mjpeg_on_android_anyone-t1871.html</a></p><p>but I've been stucked when I tried to get the stream from another activity called by the main activity. Here the code:</p><p>Main acitivity</p><pre><code>package com.test;public class IntentTest extends Activity {    /** Called when the activity is first created. */    ListView myListView = null;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        myListView = (ListView)findViewById(R.id.listView);        final ArrayList&lt;String&gt; items = new ArrayList&lt;String&gt;();        items.add(""00408C944B9A"");        final ArrayAdapter&lt;String&gt; aa;        aa = new ArrayAdapter&lt;String&gt;(this,                android.R.layout.simple_list_item_1,                items);        myListView.setAdapter(aa);        myListView.setOnItemClickListener(listClicked);    }    private OnItemClickListener listClicked = new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position, long id) {            // TODO Auto-generated method stub            Intent i = new Intent(IntentTest.this, OtherActivity.class);            i.putExtra(""MAC"", myListView.getItemAtPosition(position).toString());            startActivity(i);                 }    };}</code></pre><p>Second activity</p><pre><code>package com.test;import com.test.mjpeg.mjpegsample.MjpegView.*;import com.test.parser.JSONParse;public class OtherActivity extends Activity {    /** Called when the activity is first created. */    private MjpegView mv;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Bundle extras = getIntent().getExtras();        if (extras != null){            String mac = (String)extras.get(""MAC"");            Log.i(""Other"", ""----&gt;"" + mac);            TextView tv = (TextView)findViewById(R.id.textView);            tv.setText(mac);            String URL = ""myurl"";            requestWindowFeature(Window.FEATURE_NO_TITLE);            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                     WindowManager.LayoutParams.FLAG_FULLSCREEN);            mv = new MjpegView(this);            setContentView(mv);                    mv.setSource(MjpegInputStream.read(URL));            mv.setDisplayMode(MjpegView.SIZE_BEST_FIT);            mv.showFps(true);              }    }    public void onPause() {        super.onPause();        mv.stopPlayback();    }}</code></pre>","386823","","1233435","","2012-03-20 09:15:31","2013-11-01 16:13:29","Android and MJPEG","<android><mjpeg><ip-camera>","3","0","25","",""
"3205339","1","3205405","","2010-07-08 15:36:41","95","36008","<p>I can't figure this out. Some apps have a EditText (textbox) which, when you touch it and it brings up the on-screen keyboard, the keyboard has a ""Search"" button instead of an enter key.</p><p>I want to implement this. How can I implement that Search button and detect press of the Search button?</p><p><strong>Edit</strong>: found how to implement the Search button; in XML, <code>android:imeOptions=""actionSearch""</code> or in Java, <code>EditTextSample.setImeOptions(EditorInfo.IME_ACTION_SEARCH);</code>. But how do I handle the user pressing that Search button? Does it have something to do with <code>android:imeActionId</code>?</p>","47493","","47493","","2010-07-08 15:42:45","2013-09-19 17:31:43","Android: how to make keyboard enter button say ""Search"" and handle its click?","<android>","1","1","27","",""
"3205384","1","3205491","","2010-07-08 15:41:51","5","7752","<p>I have an activity where a bunch of buttons are placed inside TableLayout, not unlike a dial pad. During some operations I need to temporarily disable the buttons. To my unpleasant surprise doing <code>TableLayout.setEnabled(false)</code> has no effect on the nested buttons. Am I stuck with setting each individual button or is there a nifty (better) way to achieve the same? </p>","135946","","741249","","2012-05-02 12:29:55","2012-05-02 12:29:55","Android: mass enable/disable buttons","<android><button><tablelayout>","3","0","","",""
"3205387","1","3205439","","2010-07-08 15:42:39","1","10700","<p>I'm creating a spinner in my layout xml files and setting an string array to this spinner. If I change the textstyle of the spinner the text is not affected by the changes. </p><p>I read in the googlegroups that a spinner has no text and therefore the textstyle can not be changed and I have to change the style of the textview that is shown in the spinner. But how can I do that. Preferably in my xml file.</p>","114066","","","","","2014-02-20 20:10:55","How do I change the text style of a spinner?","<android><layout><spinner>","5","0","4","",""
"3205554","1","3206100","","2010-07-08 15:58:26","1","420","<p>How can I fill the screen with 2 horizontal colors, such that the down one will get 10% of the screen? (like a toolbar)?</p><p>I'm trying modify the <a href=""http://file:///home/wellington/Android/android-sdk-linux_86/docs/resources/tutorials/views/hello-linearlayout.html"" rel=""nofollow"">Linear Layout example</a> to:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;  &lt;LinearLayout      android:orientation=""horizontal""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:layout_weight=""1""&gt;      &lt;TextView          android:text=""green""          android:gravity=""center_horizontal""          android:background=""#00aa00""          android:layout_width=""wrap_content""          android:layout_height=""fill_parent""          android:layout_weight=""1""/&gt;      &lt;TextView          android:text=""blue""          android:gravity=""center_horizontal""          android:background=""#0000aa""          android:layout_width=""wrap_content""          android:layout_height=""fill_parent""          android:layout_weight=""1""/&gt;  &lt;/LinearLayout&gt;  &lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_weight=""1""&gt;    &lt;TextView        android:text=""single row""        android:textSize=""15pt""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""/&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>but if change the</p><pre><code>android:layout_height=""fill_parent""</code></pre><p>for</p><pre><code>android:layout_height=""wrap_content""</code></pre><p>on the down ""panel""(is it a panel?) the text is not shown complete.</p>","287316","","287316","","2010-07-08 16:45:57","2010-07-08 16:57:47","How to fill 10% of the Android screen?","<android>","1","0","","",""
"3205636","1","3205692","","2010-07-08 16:05:50","4","105","<p>What is the best way to share a file between two ""writer"" services in the same application?</p><p><strong>Edit:</strong>Sorry I should have given more details I guess.</p><p>I have a Service that saves entries into a buffer. When the buffer gets full it writes all the entries to the file (and so on). Another Service running will come at some point and read the file (essentially copy/compress it) and then empty it.</p>","108876","","108876","","2010-07-08 16:38:04","2010-07-08 18:32:53","Locking file across services","<java><android><multithreading><concurrency>","2","1","","",""
"3205804","1","3205878","","2010-07-08 16:23:50","1","858","<p>I have a problem and that is my SplashScreen I have. It is built as an intro and after 3 seconds it shows the main menu of the program.Anyway, if I press down Back or Home button during the time the SplashScreen shows, it closes, but the activity I have chosen to follow after the SplashScreen will still run after the three seconds.</p><p>My code: <strong>**<em>UPDATED CODE</em>**</strong></p><pre><code>    Handler ur = new Handler();    myRun = new Runnable() {            public void run() {                         mainIntent = new Intent(SplashScreen.this,MyApp.class);                    SplashScreen.this.startActivity(mainIntent);                    SplashScreen.this.finish();                     overridePendingTransition(R.anim.fadein,                            R.anim.fadeout);                }    };    ur.postDelayed(myRun, SPLASH_DISPLAY_TIME);}protected void onStop() {    super.onStop();    ur.removeCallbacks(myRun);}</code></pre><p>Even if I have an onStop() in this SplashScreen, the next activity will still run after the SPLASH_DISPLAY_TIME. </p><p><strong>Since I changed the code I got Force Close after I pressed the Home button and the SplashScreen disappeared, also, I cannot launch my second activity.</strong> </p>","386562","","386562","","2010-07-08 18:40:01","2010-07-08 22:56:44","stop the following activity if home key or pressed back is pressed - Android","<java><android>","1","0","","",""
"3205965","1","","","2010-07-08 16:41:17","0","101","<p>Please help!  Thanks in advance.</p><p>I loaded ""android-sdk_r06-windows"". I also install JavaSDK. When I click ""SDK setup"", I got:</p><p>&lt;&lt;https://dl-ssl.google.com/android/repository/repository.xml, reason: HTTPS SSL error. You might want to force download through HTTP in the settings.>>></p><p>If I directly go to ""https://dl-ssl.google.com/android/repository/repository.xml"", my web page show source code:</p><p>I am blocked.</p>","386908","","8078","","2010-07-08 16:41:56","2011-05-02 14:49:18","can not set up SDK","<android>","2","0","","",""
"3206190","1","3206651","","2010-07-08 17:09:29","1","1272","<p>I want to draw a picture (bmp,jpg,png) into the canvas (using the onDraw() method) of a class that extends the View class. I would like to be able to draw parts of the picture, not the whole at once.</p><p>I would really appreciate an example.</p>","386946","","","","","2010-07-08 18:11:10","Drawing a picture in android","<android><view><canvas><drawing><image>","1","2","","",""
"3206198","1","3260512","","2010-07-08 17:10:10","3","3182","<p>Hello im tryin to use Twitter with OAuth but i receive this exception </p><p><strong>Authorization failed (server replied with a 401). This can happen if the consumer key was not correct or the signatures did not match.</strong> </p><p>im using this sample<a href=""http://code.google.com/p/oauth-signpost/wiki/TwitterAndSignpost"" rel=""nofollow"">http://code.google.com/p/oauth-signpost/wiki/TwitterAndSignpost</a></p><p><strong>Error Line:</strong>String authUrl = provider.retrieveRequestToken(consumer, OAuth.OUT_OF_BAND);</p>","","Alexi","","Alexi","2010-07-08 17:31:18","2013-11-21 07:49:32","Android Twitter with oauth-signpost error Authorization failed (server replied with a 401)","<android><twitter><oauth>","2","3","1","",""
"3206273","1","3206570","","2010-07-08 17:21:24","2","556","<p>I have class A, with methods foo and bar, that are implemented by A1 and A2. The functionality in both A1 and A2 is the same. In other words:</p><pre><code>   public class A {       public int foo() { return 0; };       public int bar() { return 1; };   }    class A1 extends A {              public int AnotherFooFunction() { return foo(); }        public int AnotherBarFunction() { return bar(); }    }    class A2 extends A {         public int AnotherFooFunction() { return foo(); }        public int AnotherBarFunction() { return bar(); }    }</code></pre><p>Is it better to keep the code in this fashion, or to swap out those virtual methods as static methods? (In Java, everything non-final/non-private is considered virtual, right?)</p><p>According to the <a href=""http://developer.android.com/guide/practices/design/performance.html#prefer_static"" rel=""nofollow"">Designing for Performance</a> section in the Android Developer Docs, I should swap out these virtual methods for static ones.  So the above becomes:</p><pre><code>   public class A {        public int foo() { return 0; };        public int bar() { return 1; };   }    class A1 extends A {              public int AnotherFooFunction() { return A.foo(); }        public int AnotherBarFunction() { return A.bar(); }    }    class A2 extends A {         public int AnotherFooFunction() { return A.foo(); }        public int AnotherBarFunction() { return A.bar(); }    }</code></pre><p>Is this how it ""ought"" to be? I fully realize that I may be misinterpreting this paragraph in the docs.</p>","213345","","","","","2010-07-08 18:28:25","Static method calls to derived types over virtual implementations? (Android)","<java><android><performance><static><virtual>","2","1","","",""
"3206276","1","3206348","","2010-07-08 17:21:59","1","961","<p>How can I query Android contact (in android 2.1) based on a phone number?</p><p>I used to use People.CONTENT_URI (before android 2.1) but that is now deprecated.</p><p>Thank you.</p>","286802","","","","","2010-07-08 17:35:09","How can I query Android contact based on a phone number?","<android>","1","1","","",""
"3206311","1","3206498","","2010-07-08 17:30:00","4","2976","<p>So I have a listview and I want to add different ""sections"" to it. I understand how addHeaderView works and it's straight forward, but is there a way to add section headers? Like let's say I have an alphabetical list, is there a way to mark the top of each section of letters? The list is dynamic though, so I won't know when/where I'll need a section header until I get to that point.</p>","375874","","","","","2012-06-10 13:51:11","Adding headers to an Android listview","<android><listview>","3","0","3","",""
"3206503","1","3207633","","2010-07-08 17:54:00","5","867","<p>I created a Hello world app but get this strange error:</p><pre><code>The project cannot be built until the build path errors are resolved</code></pre><p>I haven't changed the project, jut created it and tried to run it.</p>","172861","","","","","2011-10-20 01:41:24","Eclipse - HelloWorld - Android error?","<android><eclipse>","6","2","0","",""
"3206643","1","3206861","","2010-07-08 18:10:06","8","4559","<p>I am trying to turn a couple buttons into a reusable component in Android.  I have successfully gotten the XML / UI portion working, but I can't figure out how to make code behind it reusable between activities, short of recoding it everywhere.  I am new to Android, so I apologize if this is obvious.</p><p>I've already reviewed this post several times: <a href=""http://www.curious-creature.org/2009/03/01/android-layout-tricks-3-optimize-part-1/comment-page-1/#comment-3863"">Android layout Tricks 3 - Part 1</a> but it seems to be missing a few files, and I do not have enough experience to rebuild them.</p><p>A dumbed down version of my main layout:</p><pre><code>  &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;WebView android:id=""@+id/webview""         android:layout_width=""fill_parent""        android:layout_height=""375px""         android:layout_alignParentTop=""true"" /&gt;        &lt;include layout=""@layout/navbar""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>and then of my ""component"":</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;merge xmlns:android=""http://schemas.android.com/apk/res/android""&gt;      &lt;LinearLayout               android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_alignParentBottom=""true""            android:gravity=""center""&gt;            &lt;ImageButton android:id=""@+id/Button1""                 android:layout_width=""71px""                android:layout_height=""wrap_content""                android:background=""@drawable/button1""                              android:layout_alignParentBottom=""true"" /&gt;            &lt;ImageButton android:id=""@+id/Button2""                 android:layout_width=""75px""                android:layout_height=""wrap_content""                android:background=""@drawable/button1""                  android:layout_toRightOf = ""@+id/Button1""                android:layout_alignParentBottom=""true"" /&gt;                      &lt;/LinearLayout&gt;        &lt;/merge&gt;</code></pre><p>If you have any additional critiques on my XML, I would appreciate that too.</p>","357499","","","","","2010-07-08 21:48:51","Reusing layout XML and the code behind","<android>","2","0","3","",""
"3206727","1","3207316","","2010-07-08 18:23:40","0","911","<p>this Android code worked fine before, but i'm having problems for some reason.  here is the request i'm trying to make:</p><p><a href=""https://www.google.com/reader/api/0/token"" rel=""nofollow"">https://www.google.com/reader/api/0/token</a></p><p>i'm getting 400:Bad Request as a response, and i'm not sure why. isn't this the correct URL for requesting a token?  the auth token is being passed as a header in all requests now, and i can request feed list, and it works just fine, so there's nothing wrong with the auth code.  what gives?</p><p>in addition, i can request a token in a normal browser, like Chrome, and get a token as a response body.  so the request itself is not the problem.  i just can't figure out what is wrong with my requests in code...</p>","329993","","","","","2011-01-21 01:49:53","Google Reader API request token, get 400:Bad Request","<android><apache><http><google-reader><google-account>","1","2","","",""
"3206765","1","3206860","","2010-07-08 18:28:30","20","13635","<p>What I want to do is I am working on a game of life program.  I want to take the time delay and make it a preference, but I want to make it available for people to type in a specific time.  The number can be in miliseconds or seconds.  </p><p>However I'm a little stuck on how to proceed, I haven't been able to find a simple preference that already handles this, but there might be one.  Is there an easy way to make this preference and confirm that the entered data is an integer or afloat?</p>","511852","","372","","2010-07-09 03:51:54","2014-01-08 22:02:33","Number Preferences in Preference Activity in Android","<android><android-preferences><preferenceactivity>","4","0","7","",""
"3207021","1","3208017","","2010-07-08 19:04:32","3","824","<p>When the mobile screen locks, its shown a time and date widget.I'm trying to how it using DigitalClock, but I can show only time.Any idea how to show date either (with this or other built-in widget)?</p><p>--update</p><p>I found some pages talking about alternatives to Android Calendar, but I don't find Android Calendar widget nowhere..</p>","287316","","","","","2010-07-08 21:07:06","How to do Android's DigitalClock show the date?","<android>","1","0","3","",""
"3207047","1","","","2010-07-08 19:09:09","4","1371","<p>My friend and I have a wireless robot dog connected to a wifi networkwhich our computer is plugged into. The computer is running anAndroid emulator and we are trying to send a UDP packet to thewireless robot dog. If the dog receives it, it should start sendingUDP packets back. The program we wrote works outside of the emulator,and using Wireshark, we see that the packet is sent to the correct IPaddress and the correct MAC address for the robot. When we attempt tosend the packet from the emulator, the dog does not respond how itshould if it received the packet. In Wireshark we can see that theemulator sends the packet to the correct IP address for the dog, butnot the correct MAC address. It is sending it to the MAC address ofthe router we are plugged into. We want to specify the packet so thatit sends to the correct MAC address but we cannot figure out how to dothis. Any help would be great</p>","387063","","","","","2011-06-12 18:41:35","Why can't we send a UDP packet from an Android emulator?","<android><networking><udp><android-emulator><packet>","1","3","","",""
"3207097","1","3208009","","2010-07-08 19:17:17","2","334","<p>Is there another equivalent of Timer for android which is thread safe?Using the timer causes problems in my application while updating the gui, most of the time it complains that gui is being updated from another thread, i tried using handlers but that didn't fix the problem.</p>","242769","","12707","","2010-07-08 19:42:40","2010-07-08 21:05:56","Does a thread safe timer exist?","<android><multithreading><timer>","1","3","1","",""
"3207317","1","","","2010-07-08 19:43:09","1","647","<p>How to block outgoing and incoming text messages in Android. any help closer to this question will be appreciated. thank you.</p>","357349","","","","","2010-07-08 19:43:09","how to block text messages in android","<android>","0","3","","",""
"3207414","1","3207653","","2010-07-08 19:55:54","1","1413","<p>I want a TextView which adjusts the font size so that the text in the view will automatically expand (or shrink) to fill the full width of the view. I thought I might be able to do this by creating a customised TextView which overrides onDraw() as follows:</p><pre><code>public class MaximisedTextView extends TextView {    // (calls to super constructors here...)    @Override    protected void onDraw(Canvas canvas) {        super.onDraw(canvas);        TextPaint textPaint = this.getPaint();        Rect bounds = new Rect();        String text = (String)this.getText(); // current text in view        float textSize = this.getTextSize();  // current font size        int viewWidth = this.getWidth() - this.getPaddingLeft() - this.getPaddingRight();        textPaint.getTextBounds(text, 0, text.length(), bounds);        int textWidth = bounds.width();        // reset font size to make text fill full width of this view        this.setTextSize(textSize * viewWidth/textWidth);    }}</code></pre><p>However, this sends the app into an endless loop (with the text size growing and shrinking slightly each time!), so I'm clearly going about it the wrong way. Does the call to setTextSize() trigger an invalidate so that onDraw is called again, endlessly?</p><p>Is there a way I can prevent the recursive call (if that's what is happening)? Or should I be going about it a completely different way?</p>","342943","","","","","2010-07-08 22:19:18","TextView.onDraw causing endless loop","<android>","2","0","1","",""
"3207769","1","","","2010-07-08 20:35:13","2","3547","<p>I have a TextView that is part of a ListView row item.  In that TextView, i have some HTML rendered using Html.fromHtml().  I'm wondering if there is a way to do what is effectively an <code>&lt;hr&gt;</code> tag within the html so that it'll render a horizontal line in between 2 items within the TextView.  is this even possible?</p>","372405","","759866","","2013-12-27 11:49:38","2013-12-27 11:49:38","Android TextView with HTML & separator","<html><android><textview>","2","0","3","",""
"3208061","1","","","2010-07-08 21:15:15","4","6498","<p>I am trying to use this query to read the contacts on the SIM.</p><pre><code>            cur = managedQuery(Uri.parse(""content://icc/adn"")                ,null                ,null                ,null                ,null                );</code></pre><p>The application has READ_CONTACTS and WRITE_CONTACTS permissions. Yet, the query returns an exception.</p><pre><code>java.lang.NullPointerException    at android.os.Parcel.readException(Parcel.java:1224)    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:160)    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)    at android.content.ContentProviderProxy.bulkQuery(ContentProviderNative.java:369)    at android.content.ContentProviderProxy.query(ContentProviderNative.java:388)    at android.content.ContentResolver.query(ContentResolver.java:202)    at android.app.Activity.managedQuery(Activity.java:1502)    at com.example.delirious.delirio.onCreate(delirio.java:38)    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)    at android.app.ActivityThread.access$2200(ActivityThread.java:126)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:123)    at android.app.ActivityThread.main(ActivityThread.java:4595)    at java.lang.reflect.Method.invokeNative(Native Method)    at java.lang.reflect.Method.invoke(Method.java:521)    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)    at dalvik.system.NativeStart.main(Native Method)</code></pre><p>What's wrong?</p>","377486","","","","","2013-05-08 09:27:53","Android: how to access the SIM contact table using the SDK?","<java><android><sim-card>","3","4","2","",""
"3208100","1","3208157","","2010-07-08 21:22:19","0","444","<p>When implementing download function it work but during file saving to sdcard i get the following</p><p>Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.</p><p>Also  IO Exception occure</p><p>W(14495:0x389f) java.io.FileNotFoundException: /sdcardW(14495:0x389f)         at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:244)W(14495:0x389f)         at java.io.FileOutputStream.(FileOutputStream.java:97)W(14495:0x389f)         at java.io.FileOutputStream.(FileOutputStream.java:168)W(14495:0x389f)         at java.io.FileOutputStream.(FileOutputStream.java:147)</p>","386064","","","","","2010-07-08 21:30:43","Writing to SDCARD problem in Android?","<java><android><buffer>","1","2","","",""
"3208189","1","3208296","","2010-07-08 21:35:54","0","128","<p>I want to more easily be able to create an application and test it. Is it possible to build it right on the HTC Evo phone?</p>","216743","","","","","2014-01-26 12:39:48","Is it possible to create an android application right on the HTC Evo phone?","<android><htc>","2","0","","",""
"3208208","1","3208315","","2010-07-08 21:38:25","0","4017","<p>Is there an easy method to send the app to my phone or do I have to do it using debugging from the development computer while being connected to the phone? </p><p>Also, do I really have to sign, version, prepare and publish the application before I can actually use it on the phone? Or, can I use it on just my phone without publishing it to the world?</p>","216743","","","","","2013-06-27 04:40:20","If I develop an application in Eclipse how do I send the app to my phone?","<android><htc>","5","0","","",""
"3208445","1","3210263","","2010-07-08 22:23:48","7","1177","<p>I am working on an Android app that has multiple screens the user will need to navigate between and I am curious what the best practices are when switching between those screens.  I am torn between creating a new Activity for each screen and simply changing the view (setContentView(R.layout.whatever)).  The screens all share at least some variable values so I'm leaning toward changing views and using class level variables, but I'm worried a single activity could become very large and confusing with logic for multiple screens in a single file.  I'd like to keep the code clean and separated, but I also don't want to be passing several variables around between views if that isn't needed.</p><p>Being new to Android development, I'm hoping some more experienced members of the community could share their thoughts and let me know how best to handle it.</p><p>Thanks!</p><p>Note: I wasn't planning on using a viewflipper.  My thought was to use a button click event and then call setContentView() to a new view for the page I wanted to bring up next.</p><p>Example: My application starts up using R.layout.main as it's view.  User clicks the Help button and it calls a method that runs setContentView(R.layout.help); to display the help screen as opposed to switching to a help activity.</p>","387212","","387212","","2010-07-09 00:16:27","2011-02-26 08:58:53","Android - Activities vs Views","<android><design>","2","0","2","",""
"3208708","1","","","2010-07-08 23:12:07","1","1284","<p>How would one go about setting the homescreen wallpaper from an image on the SDcard? </p><p>i.e.:</p><pre><code>try {    wallpaperManager.setResource(""/sdcard/wallpaper/olive.jpg"");    finish();} catch(IOException e) {    e.printStackTrace();} </code></pre><p>hasn't worked, returned an error: 'The method setResource(int) in the type WallpaperManager is not applicable for the arguments (String)'</p>","385931","","298479","","2012-06-21 09:55:52","2012-06-21 09:55:52","Setting the Wallpaper from an Image on the SDCard","<android><sd-card>","1","0","1","",""
"3208812","1","3240669","","2010-07-08 23:32:45","1","1279","<p>I just wrote a little game for droid. I was thinking I would put some put some adds in it and release it for free and maybe I'd make a buck or two.</p><p>I'm wondering what I need to do before I sign up for this.</p><p>First, I live in Canada.  I assume there might be some sort of problem getting paid from the US?</p><p>I do not have a company.  Can I just make up a name to use for now, and if I start making money then I can register the company name and get a business licence later? (Claiming any profits as personal income on my taxes until I do, of course.)</p><p>Should I set up a business bank account?</p><p>What else am I missing?</p>","102526","","21234","","2011-09-03 12:37:48","2011-09-03 12:37:48","What to do before releasing an application on the Android market place?","<android><legal><google-play>","4","1","2","",""
"3208861","1","","","2010-07-08 23:43:34","2","3301","<p>i'm sending an http request to the google reader api and getting an unusual response code.  following the documentation, i've requested an auth code and included it in the header of every request.  after performing the login, and getting an auth code, i tried accessing this url, which is part of the documentation:</p><p><a href=""http://www.google.com/reader/api/0/stream/items/contents"" rel=""nofollow"">http://www.google.com/reader/api/0/stream/items/contents</a></p><p>when i send the request, i get a 411 status code, which is supposed to mean ""Length Required"".  the length, as i've found, is supposed to be the length, in octets, of the message body.  there is no message body in this request.  there is only a single header, the POST parameter i=""item id"" and the URL itself.  i tried setting the ""Content-Length"" header to ""0"" and also to ""-1"" to no avail.</p><p>what's really interesting is that this same code worked fine before google changed their authorization procedure.  it's apparent they've changed something else...</p><p>so my question is what EXACTLY would cause a 411 response code and how can i prevent it?</p>","329993","","","","","2012-03-30 03:18:17","HTTP Response 411 Length Required, Http Client 4.0.1 Android","<android><http><httpclient><google-reader>","2","0","1","",""
"3208897","1","","","2010-07-08 23:50:29","5","5110","<p>I have a ListView with a custom list adapter.  In the getView() method, am using the ViewHolder 'pattern' as shown in the API Demos for ListView14.java.  When i first render the list it seems to load correctly.  However, the issue i'm running into is that when i scroll the list, i'm seeing the data for the list show up in the wrong rows (i.e. a TextView that should be in row 10 is showing up in row 2 for example).  However, when I do not use the viewholder, and instead call findViewById() every time, then the list view renders correctly.</p>","372405","","","","","2013-11-25 10:27:08","android listview viewholder. when to use it, and when not to","<android><listview><listviewitem>","4","0","","",""
"3208933","1","","","2010-07-08 23:59:48","1","494","<p>I'm looking for some input on how to go about a problem I have. We have a device that has binary data that it needs to send out (they are mainly just symbols, but in a custom binary format) over ethernet. I need to intercept this data on the phone and display the symbols over google maps. I'm just wondering the best way to go about this, I have a few ideas but am not sure if they are possible or feasable:</p><ol><li>Is it possible for the phone to connect directly to the device if the device had some sort of server running on it, then poll for new data? If so, what is the protocol needed to be able to direct connect like that?</li><li>Perhaps modify the device software to send data to the phone(s) in SMS data message format? Im not sure if it is possible for software to ""spoof"" an SMS to a phone when it is not a phone itself?</li><li>Have the device software upload all its binary data to a ftp/http server that is sitting out there somewhere, have the phone(s) connect to that server and poll for new data periodically?</li></ol><p>I'm brand new to android development, basically all I want to do is grab this binary data from the device on my phone and parse/display it over google maps. How do any of those ideas sound, or is there a much easier way I am overlooking? Thanks!</p>","387266","","","","","2010-07-09 19:03:27","Get Binary Data from external device on Android Phone","<android><android-ndk><ethernet>","2","0","1","",""
"3209000","1","3210730","","2010-07-09 00:21:54","2","322","<p>I am developing a Twitter client application. As with other twitter clients, I would like to display the relative time of tweet with respect to the current time. I am using a list view and a Simple adapter that binds to an arraylist which stores the tweet information. If I calculate the relative time and store a string, I will be just storing static data which will never get updated. How should I update this data?? Is there any way to do this?</p>","386123","","","","","2010-07-09 07:45:31","Updating the relative time in android","<android><time><relative>","1","0","","",""
"3209304","1","3210245","","2010-07-09 01:53:48","3","2807","<p>I have an Android app that saves a text file directly onto the phone, in the app's install directory. I need to allow the user to create a new email, attaching this saved text file. When I start the intent to send the email, everything shows up in Gmail correctly, but the attachment does not get sent. All of my searches on stack overflow seem to only deal with attaching an image file from the SD card. Below is the code that I used. Please let me know if I have done something incorrectly.</p><pre><code>File myFile = new File(getFilesDir() + ""/"" + ""someFile.txt"");FileOutputStream stream = null;if( file != null ){    steam = openFileOutput(""someFile.txt"", Context.MODE_WORLD_READABLE);    stream.write(some_data);    Uri uri = Uri.fromFile(myFile);    Intent sendIntent = new Intent(Intent.ACTION_SEND);    sendIntent.setType(""text/plain"");    sendIntent.putExtra(Intent.EXTRA_SUBJECT, subject);    sendIntent.putExtra(Intent.EXTRA_TEXT, email_text);    sendIntent.putExtra(Intent.EXTRA_STREAM, uri);    file.close();    startActivity(Intent.createChooser(sendIntent, ""Email:""));}</code></pre><p>I've also tried sendIntent.setType(""application/octet-stream""); but that didn't make a difference. I'm at a loss for why the file doesn't attach and get sent.</p><p>Any ideas?</p>","449070","","","","","2012-02-28 22:24:27","How to attach a text file stored locally in app directory","<android>","2","0","1","",""
"3209448","1","","","2010-07-09 02:37:43","1","275","<p>When I plug my Android Backflip into my computer, WIndows 7 recognizes it but it never shows up in Eclipse's DDMS. I have the USB Debugging checked under Development on the phone and I can see virtual devices I create just fine in DDMS but never anything at all for Backflip.</p><p>Does anyone know of something else that needs to be done? I see some things talking about special tasks for Linux but I am running Microsoft Windows 7!</p><p>Thanks!</p>","443654","","","","","2010-07-09 03:16:17","Eclipse DDMS not recognizing my Backflip","<android>","1","0","","",""
"3209456","1","","","2010-07-09 02:40:51","0","91","<p>How would I add a listener so that when a preference is changed (i.e. CheckBoxPreference) some method is executed (i.e. Toast)</p><p>Preferences.java</p><pre><code>public class Preferences extends PreferenceActivity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    addPreferencesFromResource(R.xml.preferences);}}</code></pre><p>Main.java</p><pre><code>[...]SharedPreferences preferences;preferences = PreferenceManager.getDefaultSharedPreferences(this);[...]</code></pre>","385931","","","","","2010-07-09 02:49:06","Run Method when Preference is Updated","<android>","1","0","","",""
"3209677","1","","","2010-07-09 03:46:28","2","2232","<p>I need to load, and update image from URL. </p><p>Using AsyncTask, Iam able to load image from URL bt i need to reload image from url for every 10 secs.</p><p>Please help me how i can solve this issue. </p><p>Thanks in advance</p>","341443","","341443","","2010-07-20 20:21:23","2010-07-28 10:59:29","streaming image from url, android","<android><android-emulator><android-widget>","2","0","","",""
"3209830","1","3209861","","2010-07-09 04:26:52","3","527","<p>My code works like this to list all items in my String array - itemsarray</p><pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.row,        R.id.label, itemsarray));</code></pre><p>However, I know by this call that I only want to list the first X number of items from itemsarray.  How can I load only the first X items form itemsarray into the ListAdapter?</p>","293565","","","","","2010-07-09 04:35:42","Want to load part of an array into android ListAdapter","<android><listview><listadapter>","1","0","","",""
"3209912","1","3965393","","2010-07-09 04:49:00","3","1580","<p>I'm parsing an input stream coming from Facebook. I'm using something like</p><pre><code>BufferedReader in =    new BufferedReader(new InputStreamReader(url.openStream(), ""UTF-8""));</code></pre><p>And then <code>in.readLine</code> to actually read from the stream.</p><p>The stream seems to have Unicode characters already encoded in ASCII, so I see things like \u00e4 (with \u actually being two discrete ASCII characters). Right now, I'm fishing for ""\u"" and decoding the subsequent two hex bytes, turn them into a char and replace the string with them, which is obviously the worst way to do it.</p><p>I'm sure there's a cool way to use a native function to decode the special characters as the stream is being read (I was hoping it could be done on the InputStreamReader layer). But how?</p>","345717","","","","","2010-10-19 04:44:59","More elegant way to decode \u0000 Unicode in an input stream","<android><unicode>","2","3","1","",""
"3209943","1","3210758","","2010-07-09 04:58:24","2","1250","<p>When and How do you use the ListPreferences? Is it an alternate for ListActivity, listView?</p><p>How do you decide whether this is the better choice?</p>","381699","","","","","2010-07-09 07:49:27","List Preference and Shared Preferences","<android>","1","0","","",""
"3209954","1","3210072","","2010-07-09 05:01:36","2","1298","<p>anybody found an easy way to change the number of elements in a menu row?</p><p>I have 5 MenuItems. They are put in row 1 with two, and row 2 with three items. </p><p>Is there an easy way to make row 1 to have three items and row 2 to have two items? </p><p>Thanks!Llappall</p>","284556","","","","","2010-07-09 05:42:23","Android: number of MenuItems in a row","<android><menu><menuitem>","1","0","","",""
"3210042","1","3217752","","2010-07-09 05:27:04","3","704","<p>I need to create a contacts application that mimics the native android contacts application. The applications needs to be ported on all the android devices and should support the fields that a native application contains.</p><p>I need to know what all fields does the Content provider supports and how does it deal with the devices in which the stock contacts application is modified (e.g HTC Hero )</p>","366053","","","","","2010-07-10 03:49:42","Creating Android Contacts Application","<android>","1","0","","",""
"3210061","1","3210150","","2010-07-09 05:33:20","1","672","<p>I want to disable the view change on device rotation for the time being. Its giving foreclose error when i rotate the device and starts all over again.</p><p>I have used tab activity everywhere.</p><p>How should i proceed ?</p>","335429","","","","","2010-07-09 06:03:35","Handling Device Rotation","<android>","3","1","","",""
"3210198","1","3210221","","2010-07-09 06:04:10","18","37541","<p>I know that the topic was discussed <a href=""http://stackoverflow.com/questions/1554099/slow-android-emulator"">here</a> last year, but I am hoping that someone has since found a fix.  The emulator is simply not working for me anymore.  It took 15 minutes or so to load hello world a few days ago, and now I can't get it to load a simple MapsDemo from the api samples no matter how long I wait.  </p><p>I'm using eclipse with the android plugin (sdk and avd manager). My pc is 2.31 GHz quadcore with 8GB ram and windows 7 x64.  Nothing is being logged in LogCat apparently.  </p><p>Are there any alternatives or certain fixes I can try before buying a phone?  I'd just upgrade my phone to an HTC Incredible and debug from the phone, but Verizon won't have any for at least a month and I'd really like to have my app out by then.</p>","216363","","597607","","2011-08-17 12:43:21","2012-01-18 06:14:57","Unbearably slow android emulator -- is there a fix?","<android><android-emulator>","5","4","2","",""
"3210294","1","3210715","","2010-07-09 06:24:21","13","9326","<p>I am working on Android since last 7 months....Also knowing brief about I-phone application.</p><p>In Android, There is a bad layout editor in Eclipse, but it's neither good nor User Friendly as I-phone Interface Builder is. </p><p>Is there any visual designer that would be on par with the iPhone ""Interface Builder"" ?</p><p>Ya, <strong><em>DroidDraw</em></strong> is there but not that much user friendly as Interface Builder of I-Phone...</p>","379693","","379693","","2010-07-19 04:31:20","2012-06-21 03:53:52","Interface Builder(User Interface Designer) for Android","<android><interface-builder><android-layout>","2","2","1","",""
"3210337","1","4713576","","2010-07-09 06:33:17","6","14770","<p>I want to create an interface that has one or two listviews that ultimately span the entire screen with two rows.  How can I change their height so that they take up 50% of the screen, vertically?</p><p>If it's along the same lines, I'd love to know how to do this regardless of orientation.</p><p>With regards to width; let us say I have two listviews, each with one row.  They span the entire screen as described above.  The lower listview has two clickable items within it that each take up 50% of the screen space, <em>horizontally</em>.</p><p>Is that possible?  If so, how?</p>","327547","","327547","","2010-07-09 06:40:43","2011-01-17 13:19:15","In Android, how can I set a ListView item's height and width?","<java><android><listview><height><width>","1","0","3","",""
"3210402","1","","","2010-07-09 06:46:57","2","560","<p>I'm beginner with android and developing an application in android to connect to facebook and upload photo using the android facebook sdk.</p><p>Problem is when I login I'm getting an allow permission window. When I click <code>allow</code>, its not giving any action.</p><p>Any ideas on the problem? </p>","387455","","368070","","2011-03-21 06:20:09","2011-03-21 06:20:09","facebook android allow permission window problem","<android><facebook>","1","0","","",""
"3210599","1","","","2010-07-09 07:24:50","10","18388","<p>I am trying  to add Views to a linear layout programmatically.</p><pre><code>    LinearLayout layout     = (LinearLayout) findViewById(R.id.info);    String [] informations  = topOffer.getInformations();    TextView informationView;    View line = new View(this);    line.setLayoutParams(new LayoutParams(1, LayoutParams.FILL_PARENT));    line.setBackgroundColor(R.color.solid_history_grey);    for (int i = 0; i &lt; informations.length; i++) {        informationView = new TextView(this);        informationView.setText(informations[i]);        layout.addView(informationView, 0);        layout.addView(line, 1);    }</code></pre><p>First, I have only added the informationsView, and everything worked fine. Butt after adding also the line-View, it crashed with the following error:</p><p>java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.</p><p>So I tried addView(View v, int index), but it crashed with the same message...</p><p>Has somebody a solution?</p><p>Thanks,Martin</p>","386787","","","","","2011-08-23 16:35:54","Android: Add two text views programmatically","<java><android><android-linearlayout>","2","0","2","",""
"3210666","1","","","2010-07-09 07:35:12","0","372","<p>I am having a problem in UI. I have Two  edit textfields on UI and 1 Add Button. And functionality of a button is totake values from edit text fields and add them to list. The issuewhich I am facing right now is that I don't know how to show that list(List is not displayed when app UI shows for first time). And size oflist will increase as we add data in list.</p>","387489","","243782","","2010-07-09 07:53:59","2010-07-09 07:53:59","Populate ListView in Runtime in android","<android>","0","2","","",""
"3210769","1","3445995","","2010-07-09 07:50:45","5","6500","<p>Hi Guys though i got the Screen Size by using the following from a activity,</p><pre><code>Display display = getWindowManager().getDefaultDisplay();</code></pre><p>But the same thing is not working from a service (for obvious reasons, i know!) but i desperately need to get the display size from a service. Can some1 please explain me any other way for getting the ScreenSize??</p><p>So i guess as far as i see, there is no way we can get the Screen size from the service. Wat i have done as of now is to start the activity atleast 1ce by default and store the actual screen size in pixels in the shared preferences. I use the shared preferences to get the value when the service starts.</p><p>Is this the only way it'll work out??? Cant we by any means get the screen size from the service??</p>","238071","","238071","","2010-07-20 05:07:33","2012-10-29 00:21:42","Android Get Screen dimensions from Service","<android><service><size><screen>","4","6","3","",""
"3211088","1","3228639","","2010-07-09 08:36:45","1","4001","<p>I came across a mobile application which performs voice and video quality test to give a measure of the quality of voice/video experience over an IP connection. The test calculates the values of Jitter, Packet loss etc. for the remote stream.</p><p>I am curious to know how this is being done? What would it take to write such an Mobile application?</p><p>Help in any form is appreciated.</p><p>Thanks.</p>","236128","","","","","2014-03-17 14:59:48","How to calculate Packet loss, Jitter and QoS parameters of video over an IP connection?","<android><video-streaming><qos>","1","0","2","",""
"3211171","1","3211894","","2010-07-09 08:54:36","1","1207","<p>I am playing around a bit with peer-to-peer communication with android devices.</p><p>I have written a basic program that creates a listening ServerSocket on each phone using the application. Using the application you can also connect to other devices that is listening, by connecting to the remote ServerSocket. Nothing strange about that.</p><p>My problem is that it seems that the listening port is not open for connection on different devices. I can connect to my HTC Desire, works like a charm. But connecting to a HTC Hero I get timeout, same if I try to connect to the emulator. But connection FROM the emulator to the Desire and FROM the Hero to the Desire works like a charm. Whats up with this? No security apps is installed and both devices(and the emulator) is running 2.1.</p>","387543","","","","","2010-07-09 10:50:32","Android ServerSocket ports, connection timeout problem","<java><android><sockets><android-emulator>","1","0","","",""
"3211177","1","","","2010-07-09 08:55:32","2","828","<p>I've been working on this few days ago, but I need some guide here (I'm newbie to Android programming).</p><p>In Api Demos there are 3 examples explaining how to fill a ExpandableList with data, one with arrays, other with List and the third with 2 cursors.</p><p>So, suppose I want to have for example 3 categories: Video, Audio and Images and I want to fill this parents with MediaStore.Video cursor, MediaStore.Images cursor ... </p><p>Should I have to create an personalized adapter for this? Because for Video Audio and Images y can create an array of Strings, but for the content inside in those categories I have to make a cursor to get the data and then fill inside the parents.</p><p>Suggestions?</p><p>Thx</p>","387544","","","","","2011-05-26 18:53:14","ExpandableList in Android","<android><expandablelistview>","1","1","2","",""
"3211265","1","","","2010-07-09 09:09:38","1","2795","<p>I've been trying to connect two Android devices (2.1) via TCP sockets.The vital part of the code:</p><p>Server:ServerSocket serverSocket = new ServerSocket(SERVERPORT);</p><p>Client:Socket socket = new Socket(serverAddr, SERVERPORT);</p><p>The weird thing is I can make it work if the client is an emulator, but the same code fails if running both of them on real devices.The failure in the client side is:</p><pre><code> java.net.SocketException: No route to host     at org.apache.harmony.luni.platform.OSNetworkSystem.connectSocketImpl(Native Method)     at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:114)     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:245)     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:220)     at java.net.Socket.startupSocket(Socket.java:780)     at java.net.Socket.(Socket.java:314)</code></pre><p>I tried with WIFI and mobile net too, they were in the same subnet both times, INTERNET permission is given, the server is addressed through its real 192.168.. IP.<br>I am planning to change the socket implementation with setCustomSocketImplFactory().<br>The problem is crucial in the process of implementing MSRP protocol to Android.<br>Can anyone give me some advice?  </p>","387484","","1288","","2011-05-20 15:55:19","2011-05-20 15:55:19","connecting two android devices via TCP sockets","<android><sockets><tcp>","1","2","","",""
"3211375","1","3211523","","2010-07-09 09:26:54","2","10083","<p>I'm implementing the onBackPressed() method in my activity. It's crucial to my app that I have this functionality. But, the control never enters this function. It enters onPause() instead, when I press the back button.</p><p>But the problem is I can't have the same logic in onPause() because when I call another activity, the current activity calls onPause() and I don't want it to execute what should be in onBackPressed().</p><p>Please help.</p><pre><code>public void onBackPresed(){   Log.d(TAG,""inside onBackPressed()"");       if(STATE == PREVIEW){       } }</code></pre>","381699","","215568","","2010-07-09 11:49:40","2010-07-09 16:48:20","onBackPressed() not being executed","<android>","3","4","0","",""
"3211713","1","3217967","","2010-07-09 10:24:34","2","585","<p>I am working on an Android application which is supposed to play videos over HTTP on Android devices. Before we setup a server to host the video files just wanted a few things clarified:</p><p>As per the developer documentation, Android supports .mp4 and .3gp container formats for video. If we use H.263(video) - AAC LC (Audio) audio-video codec used for our media files will we be able to play the video by passing the URL to MediaPlayer class?</p><p>I did a little experiment and passed URL of one of the video files(.mp4) to the MediaPlayer class and got the following error:  </p><blockquote>  <p>Command PLAYER_INIT completed with an  error or info  PVMFErrContentInvalidForProgressivePlayback</p></blockquote><p>From the docs, I came to know that for progressive playback, the video's index (e.g moov atom) should be at the start of the file.</p><p>Questions:<br>1. How do we make our videos Android-ready?<br>2. What are the different considerations that we need to make?</p><p>Please help.</p><p>Thanks. </p>","236128","","","","","2013-05-13 07:08:23","Making Video files Android ready for playback over HTTP","<android><video><video-encoding>","2","2","","",""
"3211746","1","3212650","","2010-07-09 10:27:38","1","1827","<p>The side bar in eclipse shows a red cross on the title of my project folder but there are no such signs in the directories below it in hierarchy. In which particular file does error exist? How can I know that?</p><p>Error log shows: Current file is not a match for the given config.</p>","172543","","172543","","2010-07-09 11:37:03","2013-09-26 14:03:49","Cannot find the culprit file in my android project even after expanding the main folder","<android><eclipse>","5","4","","",""
"3211917","1","3212120","","2010-07-09 10:54:03","1","199","<p>0</p><p>in my case i hav to navigate frm 1 screen to nthr aftr the timer is completed ... i hav 2 classes named test.java and test2.java!! inside Test.java class i hav created a class named Timer and in that in onFinish() method wen i write</p><p>startActivity(new Intent(this,Test2.class)); finish();</p><p>eclipse shows an error ""The constructor Intent(test.MyTimer, Class) is undefined""</p><p>what shall i do??</p>","379749","","","","","2010-07-09 11:24:01","android - navigating frm 1 screen to anothr, done using Intent but eclipse gives some error","<android><android-intent>","1","1","","",""
"3211924","1","","","2010-07-09 10:54:53","1","36","<p>i want to dispaly text views n other stuff on 1 screen and when ny1 of those is selected i want to go another screen which already has textviews and radiobuttons on it???</p><p>how do i do that???</p>","379749","","","","","2010-07-09 11:22:46","android - defining elemnts of any layout on a new screen (activity)","<android><activity><android-intent>","1","0","","",""
"3211927","1","3281239","","2010-07-09 10:55:24","6","4073","<p>I want to display images inside single select when it appears inside dialog.</p><p><img src=""http://www.freeimagehosting.net/uploads/bfb1c90d61.png"" alt=""alt text""></p><p>How can I do it?</p>","216431","","244296","","2010-07-19 19:29:06","2010-07-19 19:29:06","android image inside single select","<android><select>","3","0","1","",""
"3211964","1","","","2010-07-09 11:00:30","2","1271","<p>I am using official android facebook SDK (downloaded from here: <a href=""http://github.com/facebook/facebook-android-sdk"" rel=""nofollow"">http://github.com/facebook/facebook-android-sdk</a>).</p><p>When the program reaches the line Facebook facebook = new Facebook(); i get ""java.lang.NoClassDefFoundError: com.facebook.android.Facebook"".</p><p>I created a facebook project from sources downloaded and in my project I added the facebook project in buildpath (in Eclipse right click on my project -> Properties -> Java build path -> Projects -> add projects -> I choosed the facebook project). The project builds ok, I have no errors.</p><p>Any suggestions?Thank you all.</p>","387647","","405906","","2010-10-30 16:32:57","2011-09-27 17:15:15","Android Facebook SDK - java.lang.NoClassDefDefFoundError","<java><android><facebook>","2","1","","",""
"3211974","1","3212094","","2010-07-09 11:01:53","8","7183","<p>I have a list with some Belgian cities with diacritic characters: (Liège, Quiévrain, Franière, etc.) and I would like to transform these special characters to compare with a list containing the same names in upper case, but without the diacritical marks (LIEGE, QUIEVRAIN, FRANIERE)</p><p>What i first tried to do was to use the upper case:</p><p><code>LIEGE.contentEqual(Liège.toUpperCase())</code> but that doesn't fit because the Upper case of <code>Liège</code> is <code>LIÉGE</code> and not <code>LIEGE</code>.</p><p>I have some complicated ideas like replacing each characters, but that sound stupid and a long process.</p><p>Any idea on how to do that in a smart way?</p>","327402","","63011","","2012-09-05 10:06:19","2012-10-17 11:48:50","Ignoring diacritic characters when comparing words with special caracters (é,è,...)","<java><android><string><replace><diacritics>","6","3","5","",""
"3211978","1","3212070","","2010-07-09 11:02:29","3","2602","<p>friends,</p><p>i am trying to check internetconnectivity in android and using following code</p><pre><code>final ConnectivityManager conn_manager = (ConnectivityManager)             this.getSystemService(Context.CONNECTIVITY_SERVICE);            final NetworkInfo network_info = conn_manager.getActiveNetworkInfo();            if ( network_info != null &amp;&amp; network_info.isConnected() )             {                return true;            }            else            {                return false;            }</code></pre><p>but it gives me network/ wifi connectivity if wifi is connected it gives me true and if internet is not connected then it also gives me true.</p><p>any one guide me what is the solution?</p>","249991","","","","","2012-02-10 03:15:53","How to check internet connectivity in android?","<android>","3","0","4","",""
"3211980","1","6146500","","2010-07-09 11:02:49","4","2822","<p>I'd like to add a context menu on an entire Android WebView. I have the following code:</p><pre><code>registerForContextMenu(findViewById(R.id.webview));...public void onCreateContextMenu (ContextMenu menu, View v, ContextMenuInfo menuInfo) {   super.onCreateContextMenu(menu, v, menuInfo);   if (v.getId() == R.id.webview) {              //display context menu   }}</code></pre><p>I noticed that the context menu is only displayed when a long press is done on a link in the webpage rendered by the WebView. When a long press is done in an empty area of the web view (an empty or text only area of the web page) the context menu is not displayed.</p><p>Any idea about how to display a context menu for the entire webpage and not only for links?</p>","332563","","","","","2011-05-27 00:17:12","Context Menu on Android WebView","<android><contextmenu><webview>","1","2","3","",""
"3212153","1","","","2010-07-09 11:28:52","1","225","<p>I am new to Android development.</p><p>I have a requirement to record video through front and back cameras of android device. The default Android simulator doesn't support this video recording.</p><p>Please tell me how to run and test the video recording. Tell me if there are any simulators available.</p><p>Thank you!</p>","365184","","6461","","2010-07-09 11:36:09","2013-10-14 13:12:37","Android video simulator","<android><video><media><simulator><recording>","1","3","","",""
"3212254","1","3212308","","2010-07-09 11:47:50","2","2715","<p>i want to call a new activity from within an inner class which is defined in d class which extends Activity....the piece of written in one of the methods of that Inner class is::</p><p>Intent intent = new Intent(this, Test2.class);       startActivity(intent);</p><p>Test2 is placed inside the same package as my main clas is placed and eclipse is showing me d error  ""The constructor Intent(test.MyTimer, Class) is undefined"".......</p><p>what is the solution??</p>","379749","","","","","2010-07-09 12:29:37","android- calling Intent from an Inner class","<android><class><activity><android-intent>","2","0","","",""
"3212264","1","","","2010-07-09 11:48:53","1","1879","<p>Is there a way to get an instance of the activity that has called the currently running activity from the intent object that has been passed to it?eg. if A has called B, I would like to retrieve A's instance from the intent in B's onCreate method.As Activity is not Serializable i am not able to pass the instance in the extras bundle.Any help on this would be great</p><p>Thanks.</p>","376182","","","","","2011-05-09 14:00:42","Get an instance of activity that starts another from intent","<android>","2","0","","",""
"3212528","1","11030875","","2010-07-09 12:26:26","1","289","<p>I have a listview with headers as you can see here : <a href=""http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/"" rel=""nofollow"">http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/</a>  </p><p>I would like to redefine the scroll behavior, to always let the current header on the top of the list. So if I have 20 items under my header, the listview scrolls on these items, keeping the header on screen, and then, the next header comes and takes the place of the previous one.  </p><p>Is there a method to do that ?</p>","386745","","","","","2012-06-14 10:07:34","How to redefine the scroll in a listview","<android>","1","2","1","",""
"3212543","1","","","2010-07-09 12:29:13","2","3624","<p>I'm currently writing an Android game using surfaceView. I've optimized the game as much as possible and it runs quite smoothly. However, I have collision detection incorporated which is a bit messy. I would like to do collision detection by reading pixels directly from the canvas. Is this possible to do? The closest to this that I have found was to attach a new bitmap to the canvas using setBitmap. Then when I drew to the canvas, the bitmap would be updated. Would this be the way to go? Thanks.</p>","387721","","","","","2012-07-12 20:27:18","Get Pixel Values from Android Canvas","<android><canvas><bitmap><save>","3","0","","",""
"3212588","1","","","2010-07-09 12:35:39","4","337","<p>I see that there are many options for ORM tools:<a href=""http://stackoverflow.com/questions/371538/any-good-orm-tools-for-android-development"">http://stackoverflow.com/questions/371538/any-good-orm-tools-for-android-development</a></p><p>But do any of them help you to create Content Providers quickly?</p><p>If not, what tools exist?</p>","108495","","","","","2012-04-20 16:56:36","Are there Android tools that assist in creating content providers?","<android><android-contentprovider>","2","0","2","",""
"3212663","1","","","2010-07-09 12:45:58","0","441","<p>wat changes do i hav 2 make in AndroidManifest.xml if am calling an intent....</p><p>m calling Intent frm an Inner class method defined inside class which extends name test.javai wanna disply content mentioned in class named Test2.java......</p><p>n both classes r in same package.....</p><p>n hw can i define textvies n radiobuttons n othr stuff on dat new intent...how do i exactly do it???</p>","379749","","","","","2010-07-09 12:51:40","android- changes to be made in AndroidManifest.xml while calling intent","<android><android-intent>","2","2","","",""
"3212688","1","3213133","","2010-07-09 12:49:14","5","6620","<p>I use MediaPlayer for playing a single mp3 song from network. Data source is a HTTP URL.</p><p>Let's assume we have following playing state.</p><p>Song duration: 1:00</p><p>Current progress: 0:10</p><p>Current buffering progress 0:30</p><p>Let's say I want to skip some part of a song and seek forward. I do it with MediaPlayer.seekTo() method. If I seek to buffered position (0:20) it is performed correctly. But if I seek to a position which has not been buffered yet (0:40) the MediaPlayer behaves odd. It indicates immediately that it has seeked correctly without waiting for a buffer to fill. In fact it continues playing at the same position where it was before seeking. From now on MediaPlayer.getCurrentPosition() method returns wrong position. When playing reaches its end and OnCompletionListener.onCompletion callback is called the current media player position is much higher than entire song duration.</p><p>Any ideas for solving this?</p>","387710","","","","","2010-09-16 01:52:56","MediaPlayer.seekTo() does not work for unbuffered position","<android><media-player>","3","0","2","",""
"3212758","1","","","2010-07-09 12:57:44","2","1923","<p>What android phone would you recommend for development purposes? Not to use as a main phone.</p>","387740","","","","","2010-07-09 13:48:00","Cheap android phone for development?","<android>","3","0","1","2010-07-09 15:31:59",""
"3212770","1","3212790","","2010-07-09 12:59:10","1","865","<p>can I assume that, if a phone runs Android 2.0, it also supports OpenGL ES 2.0 and thus the graphic hardware has full support for programmable shaders?</p><p>IOW, does Android 2.0 as a platform mandate OpenGL ES 2.0 support? Or is it optional?</p>","118015","","","","","2010-07-09 13:01:39","Android 2.0 and OpenGL ES 2.0 support","<android><opengl-es>","1","3","1","",""
"3212792","1","3212859","","2010-07-09 13:02:01","0","3226","<p>friends,</p><p>I'm running into an issue when i try to call webservice and the server/internet is not available. It appears that theconnection is taking a long time to timeout</p><p>can i set timout manually to show error messgage to user?</p><p>any help would be appreciated.</p>","249991","","","","","2014-03-03 12:13:51","how to implement request timeout in android?","<android>","3","0","","",""
"3212836","1","3213731","","2010-07-09 13:07:41","0","91","<p>I'd like a bit of advice on how to retrieve, process and store data.</p><p>I'm building an app which gets finds the nearest laser tag site to where you are. The adderss data is stored (due to some bad design) in one field in an external database, with it's country coming from another table (told you it was a bad design). I may change where it's getting it's data from if I can, as it currently requires a lot more JSON parsing.</p><p>Anyway, as I've got the address, I need to get the locations and put them on the map. As there's several hundred sites to add, it takes a while to request the co-ordinates for all of them, and process them etc.</p><p>So my question is this: would it be better to use the google georeader on android, which <a href=""http://code.google.com/p/android/issues/detail?id=8816"" rel=""nofollow"">I'm having problems with</a>, or to use a web server to send the requests via google's http geocoding requests.</p><p>Also, would it be better to then store the data on the phone and check for updates every time it loads, or just not store anything on the phone and get all the data every time it loads?</p><p>Ta muchly!</p>","376164","","","","","2010-07-09 14:47:21","Android server load advice","<android><optimization><geocoding><server-load>","1","0","","",""
"3212941","1","3213097","","2010-07-09 13:22:27","1","899","<p>i have a severe problem with eclipse, where i need to compile a somewhat larger class. by ""larger"" i mean, the class has about 5000 lines of code...</p><p>problem is that on saving this project, eclipse takes several seconds (30-40) to ""build the workspace"". to be exact, it says ""50%"" and keeps saying that for 30-40 seconds. then, it breaks with the following error:</p><p>[console]:</p><p><code>[2010-07-09 15:28:39 - Dex Loader] Unable to execute dex: null</code></p><p><code>[2010-07-09 15:28:39 - myProject] Conversion to Dalvik format failed: Unable to execute dex: null</code></p><p>[problems window]:</p><p><code>Conversion to Dalvik format failed: Unable to execute dex: null</code></p><p>this error is reproducible and keeps popping up until i comment out several thousands LOC, so that the file still has this 5k LOC, but ~2000 of them are comments. THEN it works...</p><p>i know that 5000 LOC are no really good programming style, but i need to do it this way for now ... (i have to write this much records to a sqlite database and since sqlite doesnt feature multiple sql-queries in one rawQuery-command i have to execute a single rawQuery() for each and every data record i need to push into the db.... - until i write a file reader to read this data from a file (that needs verification etc)), i'm stuck with this solution...)</p><p>how do i get eclipse and the android sdk to accept files this big?</p><p>(system: ubuntu 10.04 x86, eclipse 3.6)</p>","370969","","370969","","2010-07-09 13:30:05","2010-07-09 13:38:14","eclipse fails to ""build workspace"" on large android files...?","<java><android><eclipse><dalvik>","1","2","","",""
"3213028","1","3213073","","2010-07-09 13:31:16","2","156","<p>At the moment I want to have three columns in my database for Notes:</p><pre><code>ID | Title | Content</code></pre><p>The table could have a few hundred entries.I want to be able to search for parts of the content. When <code>Content</code> is ""this is a test sentence"" and the user searches for ""test"" or even ""te"" then the row should be displayed.Is it okay to store this information in an SQLlite3 database or is there a way to have better performance? </p>","25282","","243782","","2010-07-09 13:36:14","2010-07-09 13:43:17","Android Search in Data","<sql><android>","2","2","","",""
"3213205","1","3236201","","2010-07-09 13:48:18","21","21375","<p>The most important things i want to know are the device type, the os version, if it has a hardware keyboard  and maybe the screen resolution. but if you know other useful debug information please add them :)</p><p>i found this for the os version:</p><pre><code>string+=""OS Version: ""+System.getProperty(""os.version"");</code></pre><p>how do i get the other properties?</p>","165106","","","","","2013-10-09 08:19:53","How to detect system information like os or device type","<android><logging><properties><debugging>","3","0","8","",""
"3213260","1","3214842","","2010-07-09 13:54:02","2","336","<p>I have an application that creates a notification with sound when a specific text comes in. To do this, I detect the current ringerMode, change the ringerMode to normal, play the sound, and then quickly return the ringer back to its original setting. Here is the code:</p><p>public static AudioManager audio;</p><pre><code>    audio = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);ringMode = audio.getRingerMode();        if (ringMode &lt; 2)        //Checks to see if the phones ringer is set to silent, or vibrate            audio.setRingerMode(2);        //vibrates phone in a pattern        long[] pattern = {0, 25};        //long[] pattern = {0, 1000, 100, 100, 100, 100, 100, 1000};         v.vibrate(pattern, -1);         final int HELLO_ID = 1;        mNotificationManager.notify(HELLO_ID, notification);        //delays return back to original volume so notification can be heard        Handler handler = new Handler();          handler.postDelayed(new Runnable() {               public void run() {                   audio.setRingerMode(ringMode);              }          }, 4000);        }</code></pre><p>This works completely fine in an activity, but not in this notification service, and is currently placed in the onStart method. uses-permission android:name=""android.permission.MODIFY_AUDIO_SETTINGS""  has also been added to the manifest. Any ideas? Thanks</p>","381508","","381508","","2010-07-09 14:03:11","2010-07-09 16:55:15","Accessing ringer mode does not work inside a service","<android><notifications>","1","0","0","",""
"3213360","1","","","2010-07-09 14:06:08","2","967","<p>I'm developing for Android 2.2, and a bit confused as to how ReentrantLocks work.  Can the following code ever throw an IllegalMonitorStateException?  I ask because I don't see how it can--according to the API, tryLock returns true if and only if the lock is successfully obtained--but occasionally the unlock() command does.  </p><pre><code>public void lockDemo() {    ReentrantLock myLock = new ReentrantLock();    if (myLock.tryLock()) {        System.out.println(""Lock obtained"");        myLock.unlock();    }}</code></pre>","328511","","","","","2010-07-10 10:13:50","ReentrantLock Exceptions","<java><android><multithreading>","3","2","","",""
"3213427","1","3213459","","2010-07-09 14:13:10","5","4275","<p>I'm developing an Android application that I'd like to be compatible with 1.5 (SDK version 4). I'm testing the application on 2.2 (SDK version 8). To do this, I'm including in the manifest file the line</p><pre><code>&lt;uses-sdk android:minSdkVersion=""4"" android:targetSdkVersion=""8"" /&gt;</code></pre><p>I thought this would allow me to use the newest manifest elements and APIs, but I'm getting a compile error whenever I try to use them. For example, I try to define the element <code>installLocation</code> to allow the app to be installed on the SD card, but Eclipse gives me the error</p><blockquote>  <p>No resource identifier found for attribute 'installLocation' in package 'android'</p></blockquote><p>Is there something else I have to do to get this to work? If I can't get this to work, what benefit is defining <code>targetSdkVersion</code>?</p>","277799","","","","","2010-07-09 14:27:36","Not able to use new resource identifiers in Android with targetSdkVersion defined in manifest","<android>","2","0","1","",""
"3213584","1","","","2010-07-09 14:29:55","1","930","<p>I want to show a list of items when the user clicks an overlay item on a map. The user should be able to select any of these items and edit them. The list can have many items (more than that can fit in one active screen) therefore it needs to be scrollable. </p><p>Any ideas will be appreciated. </p><p>Thanks in advance. </p>","306346","","","","","2010-07-09 15:13:47","Creating a floating, editable and scrollable list in Android","<android><listview><editable><scrollable>","1","0","","",""
"3213741","1","3218946","","2010-07-09 14:48:06","4","4016","<p>In my activity I show the camera preview on a surfaceView. It works perfectly fine on Nexus One and HTC Desire, but on Samsung Galaxy S I see strange lines, weird proportions and everything three times. see the Screenshot below.</p><p>The issue seems to be similar to this one:<a href=""http://stackoverflow.com/questions/2053440/camera-preview-on-androd-strange-lines-on-1-5-version-of-sdk"">camera preview on android - strange lines on 1.5 version of sdk</a>but none of the comments there helped. I tried to swap height,width for the camera parameters, but not much of a difference.</p><p>(Side note: my activity is always in landscape mode, fixed. I have that fix in my manifest as screenOrientation parameters, in case that matters somehow).</p><p>The code of my SurfaceHolderCallback (the relevant inner class in my activity):</p><pre><code>class SurfaceHolderCallback implements SurfaceHolder.Callback {    private static final int IMAGE_WIDTH = 512;    private static final int IMAGE_HEIGHT = 384;    private static final String ORIENTATION = ""orientation"";    private static final String ROTATION = ""rotation"";    private static final String PORTRAIT = ""portrait"";    private static final String LANDSCAPE = ""landscape"";    public void surfaceCreated(SurfaceHolder holder) {        camera = Camera.open();         //Surface.setOrientation(Display.DEFAULT_DISPLAY,Surface.ROTATION_90);                    Parameters p = camera.getParameters();        p.setPictureSize(IMAGE_WIDTH, IMAGE_HEIGHT);        p.set(ORIENTATION, PORTRAIT);        p.set(ROTATION, 90);        // p.setPreviewSize(640, 480);        Camera.Size s = p.getSupportedPreviewSizes().get(0);        Log.d(APP, ""preview params "" + s.width +""/""+ s.height);                    p.setPreviewSize( s.width,s.height );        p.setPictureFormat(PixelFormat.JPEG);        p.set(""flash-mode"", ""auto"");        camera.setParameters(p);        try {            camera.setPreviewDisplay(surfaceHolder);        } catch (Throwable ignored) {            Log.e(APP, ""set preview error."", ignored);        }    }    public void surfaceChanged(SurfaceHolder holder, int format, int width,                               int height) {        if (isPreviewRunning) {            camera.stopPreview();        }        try {            camera.startPreview();        } catch(Exception e) {            Log.d(APP, ""Cannot start preview"", e);            }        isPreviewRunning = true;    }    ...</code></pre><p><img src=""http://i.stack.imgur.com/Nk0vb.png"" alt=""alt text""></p>","241475","","640517","","2013-04-18 00:22:21","2013-04-18 00:22:21","Camera preview on Android - strange on Samsung Galaxy S","<android><camera>","2","0","3","",""
"3213746","1","3213845","","2010-07-09 14:49:21","4","6416","<p>I have a Contact Activity which is derived from ListActivity, which displays list of contacts, and on click of item, a new Activity Message Activity derived fromListActivity is initialized. </p><p>Now I know, I can pack some information in Bundle and pass it before creating activity, butis there a way I can get instance of ""ContactActivity"" in onCreate method of ""MessageActivity""?</p>","164850","","","","","2011-09-15 07:34:41","How to get ""calling"" Activity instance from called Activity?","<android><activity>","2","0","1","",""
"3213789","1","3215305","","2010-07-09 14:54:08","14","4402","<p>I'm new to Android ndk and i didn't understand yet which are the differences between static and shared library. Could you explain me what these differences are? When developing a library how could i choose one of them?</p><p>Thanks a lot</p>","302798","","","","","2013-04-26 03:40:57","Android-ndk: difference between static and shared library","<android><static><shared><android-ndk>","1","0","2","",""
"3213899","1","","","2010-07-09 15:05:09","12","7133","<p>I am developing an Android app which enables the user to upload a file to services like Twitpic and others.The POST upload is done without any external libraries and works just fine. My only problem is, that I can't grab any progress because all the uploading is done when I <em>receive</em> the response, not while <em>writing</em> the bytes into the outputstream.Here is what I do:</p><pre><code>URL url = new URL(urlString); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoInput(true); conn.setDoOutput(true); conn.setUseCaches(false); conn.setRequestMethod(""POST""); conn.setRequestProperty(""Connection"", ""Keep-Alive""); conn.setRequestProperty(""Content-Type"", ""multipart/form-data;boundary="" + boundary); DataOutputStream dos = new DataOutputStream(conn.getOutputStream());</code></pre><p>Then I write the form data to dos, which is not so important here, now. After that I write the file data itself (reading from ""in"", which is the InputStream of the data I want to send):</p><pre><code>while ((bytesAvailable = in.available()) &gt; 0){  bufferSize = Math.min(bytesAvailable, maxBufferSize); byte[] buffer = new byte[bufferSize]; bytesRead = in.read(buffer, 0, bufferSize); dos.write(buffer, 0, bytesRead);} </code></pre><p>After that, I send the multipart form data to indicate the end of the file. Then, I close the streams:</p><pre><code>in.close(); dos.flush(); dos.close(); </code></pre><p>This all works perfectly fine, no problem so far. My problem is, however, that the whole process up to this point takes about one or two seconds no matter how large the file is.The upload itself seems to happen when I read the response:</p><pre><code>DataInputStream inStream = new DataInputStream(conn.getInputStream());</code></pre><p>This takes several seconds or minutes, depending on how large the file is and how fast the internet connection.My questions now are:1) Why doesn't the uplaod happen when I write the bytes to ""dos""?2) How can I grab a progress in order to show a progress dialog during the upload when it all happens at once?</p><p>/EDIT:1) I set the Content-Length in the header which changes the problem a bit, but does not in any way solve it:Now the whole content is uploaded after the last byte is written into the stream. So, this doesn't change the situation that you can't grab the progress, because again, the data is written at once.2) I tried MultipartEntity in Apache HttpClient v4. There you don't have an OutputStream at all, because all the data is written when you perform the request. So again, there is no way to grab a progress.</p><p>Is there anyone out there who has any other idea how to grab a process in a multipart/form upload?</p>","387855","","387855","","2010-07-12 16:52:47","2012-03-28 07:24:35","Can't grab progress on http POST file upload (Android)","<android><http><post><upload><progress>","4","2","12","",""
"3213921","1","","","2010-07-09 15:07:11","1","624","<p>It appears that my WebView is ALWAYS FULL screen and doesn't respect the layout . </p><p>Also, Activity menus are not the ones I set but the browsers. </p><p>If the URL is  www.google.com in mobile mode or stackoverflow.comit appears to work ok !?!</p><p>But once you click on Classic mode or any other web site in mobile/regular it takes up the whole screen.</p><p>It works ok with loadData.</p><p>Thanks in advance!!</p><p>Any ideas ?</p><p>Michael</p><p>I am testing on an 2.1 android emulator.</p><p>Code snippet .........</p><pre><code>setContentView(R.layout.mainactivity);WebView webV = (WebView)findViewById(R.id.webview);webV.setInitialScale(30);webV.loadUrl(getString(R.string.app_url));</code></pre><p>Layout ....</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent android:layout_height=""fill_parent""&gt;&lt;TextView android:id=""@+id/label""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:text=""Type here:""/&gt; &lt;WebView xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/webview"" android:layout_width=""wrap_content""android:layout_height=""wrap_content"" android:layout_below=""@id/label""/&gt; &lt;/RelativeLayout&gt;</code></pre>","387860","","236136","","2010-07-09 15:31:01","2010-07-09 15:59:20","WebView Bug - Not Sizing correctly","<android><webview>","1","0","","",""
"3214026","1","6792488","","2010-07-09 15:21:12","16","18940","<p>When I start my (soon-to-be) android game (from eclipse) it opens, but immediately force-closes.</p><p>Logcat says:</p><pre><code>07-09 17:12:35.709: ERROR/AndroidRuntime(3866): Uncaught handler: thread main exiting due to uncaught exception07-09 17:12:35.719: ERROR/AndroidRuntime(3866): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.anselm.eickhoff.rhythm/org.anselm.eickhoff.rhythm.RhythmGameActivity}: java.lang.ClassNotFoundException: org.anselm.eickhoff.rhythm.RhythmGameActivity in loader dalvik.system.PathClassLoader@4001e74007-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2497)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at android.app.ActivityThread.access$2200(ActivityThread.java:126)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at android.os.Handler.dispatchMessage(Handler.java:99)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at android.os.Looper.loop(Looper.java:123)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at android.app.ActivityThread.main(ActivityThread.java:4595)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at java.lang.reflect.Method.invokeNative(Native Method)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at java.lang.reflect.Method.invoke(Method.java:521)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at dalvik.system.NativeStart.main(Native Method)07-09 17:12:35.719: ERROR/AndroidRuntime(3866): Caused by: java.lang.ClassNotFoundException: org.anselm.eickhoff.rhythm.RhythmGameActivity in loader dalvik.system.PathClassLoader@4001e74007-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2489)07-09 17:12:35.719: ERROR/AndroidRuntime(3866):     ... 11 more</code></pre><p>the interesting line here is (I think):</p><pre><code>07-09 17:12:35.719: ERROR/AndroidRuntime(3866): Caused by: java.lang.ClassNotFoundException: org.anselm.eickhoff.rhythm.RhythmGameActivity in loader dalvik.system.PathClassLoader@4001e740</code></pre><p>Which surprises me, because I have this class (in the right package)</p><p><em>edit:</em> to clarify, added the first line which I had omitted (together with the imports)</p><pre><code>package org.anselm.eickhoff.rhythm;...public class RhythmGameActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    @Override    public void onPause() {    }}</code></pre><p>and that's all it does!</p><p>I also registered it in the manifest:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""org.anselm.eickhoff.rhythm""      android:versionCode=""1"" android:versionName=""pre-alpha""&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true"" android:hasCode=""false""&gt;    &lt;activity android:name="".RhythmGameActivity""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p><em>edit:</em> this all has started since I renamed the activity from RhythmGame to RhythmGameActivity, but I am pretty sure I replaced all the references so maybe it is still wrongly chached somewhere? (I tried refreshing and cleaning the project)</p><p>Your help is really appreciated - im stuck!</p>","387873","","387873","","2010-07-09 17:39:08","2013-02-28 18:08:18","android force close: ClassNotFoundException for Activity class","<android>","11","3","6","",""
"3214030","1","","","2010-07-09 15:21:31","0","943","<p>I have a trouble to parse this piece of JSON </p><pre><code>{  ""00408C88A2E6"": {    ""id"": ""00408C88A2E6"",    ""name"": ""pippo""},    ""00408C91188B"": {      ""id"": ""00408C91188B"",      ""name"": ""pluto""    },    ""00408C944B99"": {      ""id"": ""00408C944B99"",      ""name"": ""minni""    },    ""00408C944BA0"": {      ""id"": ""00408C944BA0"",      ""name"": ""topolino""    }</code></pre><p>I need to get all the key ""id"" and ""name"", I tried with an iterator but I was able to retrive just the first dicts (00408C88A2E6,00408C91188B...), could anyone give me any hint? Thank you</p><p>Edit:I'm using org.json and to parse this I tried in this way</p><pre><code>            JSONObject jsonChannels = getHttpJson(url_user_cam);    ArrayList&lt;String&gt; al = new ArrayList&lt;String&gt;();    Log.i(LOG_TAG, jsonChannels.toString());    try{        Iterator&lt;String&gt; iterator =  jsonChannels.keys();        while (iterator.hasNext() ){            al.add(iterator.next());        }    }catch(Exception e){        Log.e(LOG_TAG, e.toString());    }   </code></pre><p>with this piece of code my intent is to get the first dict (""00408C88A2E6"") after make it I need to access to ""id"" and ""name"" element, hwo can i do it?</p>","386823","","386823","","2010-07-11 13:26:33","2010-07-11 13:26:33","Parse simple JSON","<java><android><json><json-decode>","1","4","","",""
"3214424","1","3214459","","2010-07-09 16:03:35","67","23608","<p>When I run layoutopt on a specific xml file, I get this:</p><pre><code> This tag and its children can be replaced by one &lt;TextView/&gt; and a compound drawable</code></pre><p>What change should be done for the following xml code:</p><pre><code>&lt;LinearLayout android:id=""@+id/name_layout""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:gravity=""center_vertical""                android:background=""@drawable/grouplist_single_left_grey_area"" &gt;                &lt;ImageView android:id=""@+id/photo_image""                    android:layout_width=""@dimen/thumbnail_width""                    android:layout_height=""@dimen/thumbnail_height""                    android:paddingBottom=""5dip""                    android:paddingTop=""5dip""                    android:paddingRight=""5dip""                    android:paddingLeft=""5dip""                    android:layout_marginRight=""5dip""                    android:clickable=""true""                    android:focusable=""true""                    android:scaleType=""fitCenter""                    android:src=""@*android:drawable/nopicture_thumbnail""                    android:background=""@drawable/photo_highlight"" /&gt;                &lt;TextView android:id=""@+id/name""                    android:paddingLeft=""5dip""                    android:layout_weight=""1""                    android:layout_width=""0dip""                    android:layout_height=""wrap_content""                    android:gravity=""center_vertical""                    android:textAppearance=""?android:attr/textAppearanceLarge"" /&gt;            &lt;/LinearLayout&gt;</code></pre><p>This is how it looks on the screen:</p><p><img src=""http://i.stack.imgur.com/QRANh.jpg"" alt=""enter image description here""></p><p>The camera icon is the default. Clicking on that will give the user an option to choose another image.</p>","349330","","664177","","2013-04-16 14:46:17","2014-02-17 07:48:42","android layoutopt: This tag and its children can be replaced by one <TextView/> and a compound drawable","<android><layout>","7","1","15","",""
"3214434","1","3214794","","2010-07-09 16:04:19","3","274","<p>Is there any way in Android to determine whether a device is running Sense UI? I'm working on an app that is working fine with vanilla Android, but Sense UI is messing with layouts and sizes. I'd like to be able to see whether the device is running Sense UI and so I can take appropriate action.</p>","2030","","","","","2010-07-09 16:49:34","Is there a way to detect whether Sense UI is running on a device?","<android><htcsense>","1","0","0","",""
"3214451","1","","","2010-07-09 16:05:21","0","363","<p>I have 3 classes in my App.</p><ol><li>Class A extends Activity </li><li>class B extends BroadcastReceiver</li><li>Class C extends Service.</li></ol><p>When I run the App. which one of this will be called first, I know android doesn't have a entry point.  I am blocking the incoming call in class B , and I am calling the service from activity > this service will call BroadcastReceiver > here is where I block the calls. When I run the code from eclipse to Droid, it is constantly blocking the call, even before I start the App. does any one know the reason. Thank you very much . </p>","357349","","1606729","","2013-02-23 18:52:22","2014-02-20 19:51:55","Which class is called first Activity ,BroadcastReceiver or Service?","<android>","1","2","","",""
"3214531","1","3306646","","2010-07-09 16:15:55","6","5782","<p>We are currently working on an instrumentation test suite which runs on our build server, but while the tests pass on a dev machine using a normal Android emulator, the builds fail on the build server since there we only run a headless emulator with the -no-window flag.</p><p>The failure occurs when trying to invoke the InstrumentationTestCase.sendKeys() method to programatically open the options menu. The error is:</p><blockquote>  <p>Permission denied: injecting key event from pid 646 uid 10026 to window Window{43d55100  paused=false} owned by uid 1000</p></blockquote><p>We then found out that there's a INJECT_EVENTS permission, but setting it in the manifest had no effect. In fact in the log we saw this output:</p><blockquote>  <p>Not granting permission android.permission.INJECT_EVENTS to package com.qype.radar (protectionLevel=2 flags=0x6644)</p></blockquote><p>does that mean this permission is useless?</p><p>We also tried to let the instrumentation test app and the app under test share the same Linux user ID using android:sharedUserId and run in the same process (android:process -- we weren't sure if that was already the case), but still no luck.</p><p>Does this mean it's currently impossible to run instrumentations which contain key events on a headless emulator, or are we missing something?</p>","127013","","","","","2011-03-17 23:47:42","how to send key events to a headless emulator in an instrumentation test?","<android><testing><build-automation><emulator><instrumentation>","2","3","4","",""
"3214728","1","3215106","","2010-07-09 16:41:44","3","1874","<p>Is there a good way (proper way, or effective way) to debug slow running code?</p><p>I have a thread which runs multiple loops and then recurses and my code is running very slow.</p><p>Is there a good way to debug different loops or sections of code to find out which is running slowest?</p><p>If the debugger already does this, can someone please explain how,</p><p>Many thanks</p>","381258","","","","","2010-07-09 17:30:22","Android - Debug slow running code","<android><debugging><performance>","2","1","","",""
"3214753","1","","","2010-07-09 16:45:03","0","321","<p>i created a custom layout where i have a couple  of LinearLayout in a ScrollView. Problem is when i set my SetContentView to my custom Layout (when the application starts), the emulator gives an error and force closes! i don't know why. i have tried with another custom layout or set it to main and it seems to work fine.</p><p>any ideas what could be wrong?</p><hr><p>yes i meant to say the app is crashing. here is the xml code for the custom layout: (too many spinners!)</p><p><p>android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:orientation=""vertical""  android:padding=""10dp""></p><pre><code>&lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""@string/Name""    android:id=""@+id/name""    android:textSize=""18sp""    android:gravity=""center""&gt;&lt;/TextView&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:padding=""10dp""    &gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:id=""@+id/Picker""        android:text=""@string/drinkText""        android:textColor=""#303030""&gt;    &lt;/TextView&gt;    &lt;View        android:layout_height=""5dp""/&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:id=""@+id/TimePicker""        android:text=""@string/TimeText""        android:textColor=""#303030""&gt;    &lt;/TextView&gt;    &lt;View         android:layout_height=""20dp""/&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:id=""@id/EndPicker""        android:text=""@string/EndText""        android:textColor=""#303030""&gt;    &lt;/TextView&gt;    &lt;View        android:layout_height=""5dp""/&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:id=""@id/sortPicker""        android:text=""@string/sortText""        android:textColor=""#303030""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;LinearLayout     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:padding=""10dp""    android:orientation=""horizontal""&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Categories:""        android:id=""@+id/CategorySelect""/&gt;    &lt;Spinner        android:id=""@+id/categorySpinner""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:drawSelectorOnTop=""true""        android:prompt=""@string/categoriesPrompt""        android:visibility=""visible""/&gt;&lt;/LinearLayout&gt;&lt;LinearLayout     android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:padding=""10dp""&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Priority:""        android:id=""@+id/prioritySelect""/&gt;    &lt;Spinner        android:id=""@+id/prioritySpinner""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:drawSelectorOnTop=""true""        android:prompt=""@string/priorityPrompt""        android:visibility=""visible"" android:layout_weight=""0.0""/&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""State:""        android:id=""@+id/stateSelect""/&gt;    &lt;Spinner        android:id=""@+id/statusSpinner""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:drawSelectorOnTop=""true""        android:prompt=""@string/statusPrompt""        android:visibility=""visible""/&gt;&lt;/LinearLayout&gt;&lt;LinearLayout    android:orientation=""horizontal""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:padding=""10dp""&gt;&lt;TextView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Reminder:""    android:id=""@+id/Reminder""/&gt; &lt;Spinner        android:id=""@+id/remindSpinner""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:drawSelectorOnTop=""true""        android:prompt=""@string/remindPrompt""        android:visibility=""visible""/&gt;&lt;/LinearLayout&gt;&lt;LinearLayout     android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10dp""    android:background=""#FF303030""&gt;    &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:text=""suggestions:""        android:typeface=""sans""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p></p>","316843","","50049","","2011-09-01 08:26:29","2011-09-01 08:26:29","Android Emulator Force closes when loading Custom Layout","<android>","0","3","","",""
"3214823","1","3214915","","2010-07-09 16:53:13","2","657","<p>What is the best way to debug an android application?Every once in a while the application crashes, an it says application has stopped unexpectedly, it never says why it crashes, or where in my code, what's the bet way to find the reason for crashes, and exceptions?</p>","242769","","","","","2010-07-10 02:42:09","Android Debugging?","<android><debugging>","3","0","","",""
"3214861","1","3215044","","2010-07-09 16:57:31","4","6228","<p>Can any one help in that problem</p><p>when i try that code</p><pre><code>File routesRoot = Environment.getExternalStorageDirectory();            if (!routesRoot.canWrite())                System.out.println(""can't write root"");            if (!routesRoot.canRead())                System.out.println(""can't read root"");</code></pre><p>when run program both can't write /read occure</p><p>I have set permission to access sdcard what is the problem ??</p>","386064","","","","","2012-02-10 18:46:38","Can't read/write to sdcard in Android","<java><android>","2","2","","",""
"3215075","1","3215116","","2010-07-09 17:27:59","0","265","<p>I have a app that has call blocking feature in it and that work is done by class BroadcastReceiver. When I install this app, the call is blocked always no matter what. How to get rid of this? I want this app to be active only when App is up and running . If I stop the service the App should not block the call. Thank you any help will be appreciated. </p>","357349","","","","","2010-07-09 17:31:51","BroadcastReceiver active all the time","<android>","1","0","","",""
"3215518","1","3241228","","2010-07-09 18:31:54","0","341","<p>I'm developing an app for Android in Eclipse. Currently I target API level 3, but I was mistakenly testing on an Android 1.6 emulator (API level 4). On 1.6 it worked fine, but on 1.5 my ListView with CHOICE_MODE_SINGLE does not select items when they are clicked on. </p><p>Here's my listview XML:</p><pre><code>&lt;ListView     android:layout_height=""wrap_content""     android:layout_width=""fill_parent""     android:layout_weight=""1""     android:id=""@+id/ListDomains""     android:layout_margin=""5px""     android:choiceMode=""singleChoice""     android:clickable=""false""    android:focusable=""true""    android:focusableInTouchMode=""true""    android:descendantFocusability=""beforeDescendants""&gt;&lt;/ListView&gt;</code></pre><p>Here's the XML for the items in the listview:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;CheckedTextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content""     android:id=""@+id/domain_list_value""    android:checkMark=""?android:attr/listChoiceIndicatorSingle""     android:textAppearance=""?android:attr/textAppearanceLarge""     android:layout_width=""fill_parent"" &gt;&lt;/CheckedTextView&gt;</code></pre><p>I created a custom ArrayList adapter to let me customize getView. Here's the code for DomainArrayAdapter:</p><pre><code>public class DomainArrayAdapter extends ArrayAdapter&lt;char[]&gt; {    private LayoutInflater mInflater;    public DomainArrayAdapter(Context context, int textViewResourceId,            List&lt;char[]&gt; objects) {             super(context, textViewResourceId, objects);            mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        if(convertView == null){            convertView = mInflater.inflate(R.layout.domain_list, null);        }        char[] text = super.getItem(position);        ((CheckedTextView)convertView).setText(text, 0, text.length);        return convertView;    }}</code></pre><p>All of this code works fine compiled against API level 3 and run on an Android 1.6 emulator. However, run against a 1.5 emulator, items in the ListView do not check when clicked on.</p><p>Any ideas?</p>","386036","","","","","2010-07-13 20:26:31","ListView not checking items on Android 1.5","<android>","1","0","","",""
"3215538","1","3215566","","2010-07-09 18:35:32","4","3815","<p>I have a POJO, and a (currently not-yet-built) class that will return Lists of it. I'd like to automatically generate the code necessary for the POJO to be accessed as a Map. Is this a good idea, is it possible to do automatically, and do I need to do this manually for every POJO I want to treat this way?</p><p>Thanks,Andy</p>","321041","","","","","2013-04-17 11:30:31","Generate Map<String,String> from POJO","<java><android><pojo><listactivity>","2","0","2","",""
"3215546","1","3215669","","2010-07-09 18:36:14","1","977","<p>I am using Eclipse 3.5 for Jave EE Developers. Plugins installed include: Android Development Tools, Adobe Flash Builder 4, PDT, PyDev. I have problem with running the application I built. </p><p>I can start a new project, add a button, and run it on an AVD. Then I add another button, try to run it on AVD, and Eclipse says <strong>1) gen folder is missing</strong>, <strong>2) there are errors with build path</strong>.</p><p>I can get ride of the first error by simply refreshing the project in the left pane, but the second error always sticks around. I searched <a href=""http://androidcommunity.com/forums/f4/new-developer-small-problems-need-help-29532/"" rel=""nofollow"">online</a> and on StackOverflow <a href=""http://stackoverflow.com/questions/3029679/android-helloworld-build-path-error"">here</a> and <a href=""http://stackoverflow.com/questions/2551591/build-path-error-in-eclipse-for-android"">here</a>, although several people have the same problem, there is no definite solution I can find. </p><p>Can somebody who fixed this problem successfully tell me how?</p>","179385","","","","","2011-11-14 11:02:19","Eclipse 3.5 + ADT: build path errors","<android><eclipse><eclipse-plugin><buildpath>","1","0","","",""
"3215575","1","3216295","","2010-07-09 18:40:19","1","237","<p>I've just started playing around with android, so pardon me if this is a totally stupid question. </p><p>I'm trying to create a simple text based game in which I ask a question based on a movie. The list of movie's is in a text file which I've included in res/raw. So basically I want to have a default string, say ""Who acted in"", followed by the name of the movie. Could I have the first string (along with a submit button etc) in my res/layout/main.xml file, and follow that with the movies name, after I've extracted it from the text file in my activity, or does the layout <B>have</B> to be defined in one place only?</p><p>Thanks..</p>","388025","","","","","2010-07-09 20:23:50","Can I create a layout using the xml file and code within the activity?","<android>","1","0","1","",""
"3215791","1","3223591","","2010-07-09 19:09:33","4","1797","<p>Im using seek bar to control volume of the device. Im able to change the volume of the device using thumb of the seek bar just by dragging it on touch pad. </p><p>But when user presses volume(side) keys i need to set seek bar thumb position accordingly.</p><p>Hw i can do this please let me know </p><p>Thanks</p>","341443","","341443","","2010-07-11 15:31:13","2011-07-21 19:55:41","seekbar thumb position change when user press device volume keys","<android><android-emulator><android-widget>","1","2","","",""
"3215889","1","","","2010-07-09 19:25:09","4","2232","<p>I'm trying to implement pinch-zoom in an app I'm making and am having issues with the onTouch event. It appears that the pointer up &amp; down actions do not fire immediately, like you won't get a pointer up or down until an action move occurs. So what happens if both fingers hit the screen nearly simultaneously is that the 2nd finger (should be pointer(1)) gets a move action before pointer down is called, making the code think it's a DRAG not a pinch zoom. Anyone else seen this? Anyway around it? Thanks.</p>","388068","","","","","2012-11-23 17:40:10","onTouch event sometimes not firing ACTION_POINTER_DOWN","<android>","4","0","2","",""
"3215949","1","","","2010-07-09 19:33:30","2","1446","<p>My activity contains data retrieved from internet. I want the activity to automatically refresh its content every 5 minute. What is the best way to implement it? Should I use java's Timer and TimerTask?</p><p>Thanks.</p>","256239","","","","","2010-07-09 20:21:03","What is the best way to implement auto refresh of contents in an activity?","<android>","1","1","1","",""
"3216017","1","","","2010-07-09 19:45:35","4","994","<p>I have a standard <code>&lt;select&gt;</code> and would like to open it when a user clicks on another element. It's pretty simple in a regular browser and even on the iphone, but for some reason nothing working on Android.</p><p>I've tried the click and focus events, and also tried changing the size attribute of the select but none of these worked.</p><p>Has anyone accomplished this before?</p>","130434","","","","","2010-07-09 20:17:58","Opening a select box using js in Android web browser","<javascript><jquery><android>","1","0","1","",""
"3216033","1","3216146","","2010-07-09 19:48:24","2","7092","<p>In the image below, i want the textview in red to be vertically centered, I would like to keep using just RelativeLayout not any LinearLayouts, I think i can figure out how to do this with LinearLayout but do not want to use these.  </p><p>This is all based off of the examples i found here <a href=""http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html"" rel=""nofollow"">android devleper's blog - Android Layout Tricks #1</a></p><p><img src=""http://i29.tinypic.com/2rmku52.jpg"" alt=""alt text""></p><p>Here is my xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""?android:attr/listPreferredItemHeight""    android:padding=""6dip""&gt;    &lt;ImageView android:id=""@+id/icon"" android:layout_width=""wrap_content""        android:layout_height=""fill_parent""         android:layout_alignParentTop=""true""        android:layout_alignParentBottom=""true""         android:layout_alignParentRight=""true""        android:src=""@drawable/chevron"" /&gt;    &lt;TextView android:id=""@+id/rightText"" android:layout_width=""55px""        android:layout_height=""fill_parent"" android:layout_toLeftOf=""@id/icon""        android:layout_alignParentTop=""true""        android:layout_alignParentBottom=""true""        android:textSize=""14dip""        android:text=""$15.99"" /&gt;    &lt;TextView android:id=""@+id/secondLine"" android:layout_width=""wrap_content""        android:layout_height=""26dip"" android:layout_toLeftOf=""@id/rightText""        android:layout_alignParentBottom=""true""        android:layout_alignParentLeft=""true""         android:text=""Simple application that shows how to use RelativeLayout"" /&gt;    &lt;TextView android:layout_width=""fill_parent"" android:id=""@+id/firstLine""        android:layout_height=""wrap_content"" android:layout_toLeftOf=""@id/rightText""        android:layout_alignParentLeft=""true"" android:layout_alignParentTop=""true""        android:layout_above=""@id/secondLine""        android:layout_alignWithParentIfMissing=""true"" android:gravity=""center_vertical""        android:singleLine=""true""        android:ellipsize=""end""        android:maxLines=""1""        android:textSize=""13dip""        android:text=""My Application that has a really long title  asdfsdf asdf sdf asdf"" /&gt;&lt;/RelativeLayout&gt;</code></pre>","202064","","","","","2010-07-09 20:02:08","Vertically Center TextView in RelativeLayout","<android><textview><relativelayout>","1","0","","",""
"3216169","1","","","2010-07-09 20:05:05","13","10605","<p>I am developing an android application where we are using WebView to display Web page being served from Web Server. Everything is working fine except with the problem that when i am using the soft keyboard and switched to numeric key entry and move from first field to next field, the keyboard layout automatically changed to alphanumeric.</p><p>Is there any way using which i can pull up virtual keyboard in numeric mode only when i need to enter numbers only?</p><p>Thanks and Regards.</p>","388093","","1226310","","2012-05-01 02:17:44","2012-10-29 08:41:27","Numeric Soft Keyboard on Android","<android><keyboard>","4","1","6","",""
"3216294","1","3217786","","2010-07-09 20:23:23","47","15245","<p>I am creating an <code>EditText</code> object which I then try to reference in a unit test. What is the best way to add a new <code>id</code> to <code>R.id</code> for this dynamically created object, so that I can later reference it via <code>findViewById()</code> in the unit test?</p>","372405","","656600","","2013-07-23 10:02:37","2013-07-23 10:02:37","programatically add id to R.id","<android><edittext><unit-testing>","1","0","10","",""
"3216346","1","3220818","","2010-07-09 20:30:32","0","578","<p>I have an android application that parses some HTML, downloads an image, and displays it. I'm using an <code>AsyncTask</code> to do the HTML parsing and image downloading, but that shouldn't be relevant. I never have a problem when I'm on WiFi on my phone, when I'm using the Eclipse debugger on my phone, or when I'm using the emulator. When I have my phone on the cell network (even with pretty good reception), the image sometimes fails to display.</p><p>I'm having a hard time figuring out what is wrong, since the problem cannot be reproduced in the debugger. Does anyone have any idea what could be wrong?</p><p>Thanks!</p><p><strong>Update:</strong> I have narrowed it down to the image downloading function. This way my original code:</p><pre><code>private Bitmap downloadImage(String url) {        Bitmap image = null;        debug = """";        try {            URL image_url = new URL(url);            HttpURLConnection image_connection = (HttpURLConnection) image_url                    .openConnection();            image_connection.connect();            InputStream image_stream = image_connection.getInputStream();            debug = image_stream.available()+"""";            image = BitmapFactory.decodeStream(image_stream);        } catch (Exception e) {            Log.e(""downloadImage"", ""Exception: ""+e.getMessage());        }        return image;}</code></pre><p>I have also tried using the code from this tutorial, but the same bug showed up.</p><p><a href=""http://www.devx.com/wireless/Article/39810/1954"" rel=""nofollow"">http://www.devx.com/wireless/Article/39810/1954</a></p><p>At this point I think it must have to do with Verizon, but I'm not sure how to figure out what's going on. I wish there was something like Wireshark for Android. I've given my code to a friend of mine on T-Mobile with the G1 and a friend on Sprint with the EVO. I have the Droid Eris on Verizon.</p>","118391","","118391","","2010-07-12 15:57:18","2010-07-12 15:57:18","Android app works on WiFi, in debug mode, or on emulator, not on cell network","<android><android-emulator><html-parsing><android-asynctask>","1","4","","",""
"3216386","1","3217997","","2010-07-09 20:38:14","6","3660","<p>How can i display a simple animation?</p><p>Let's say there is a button on the screen with margin left of 200, and margin top of 200.I need to set the margin left, and top of this button to 0 and show a simple animation.</p><p>So basically a simple animation on a button from position 200,200 to position 0,0</p>","242769","","","","","2010-07-10 06:32:23","Android ==> Simple Animation?","<android><animation>","2","0","","",""
"3216479","1","3216542","","2010-07-09 20:52:44","1","260","<p>I don't have an Android device. Is there any way to see the Google Android Market - on the emulator, on the Web, in a specialized client (<em>a la</em> iTunes)?</p>","219159","","","","","2011-02-14 15:47:13","Android market sans device","<android><google-play>","2","1","","",""
"3216692","1","6253664","","2010-07-09 21:30:03","37","9594","<p>I was pretty excited to see how easy it is to set up Google Analytics with my app, but the lack of documentation has me sitting with a few questions. The only information that I can find is right from the documentation <a href=""http://code.google.com/mobile/analytics/docs/android/"">here</a>, which only looks at reporting PageViews and Events from one Activity. I want to report PageViews and Events across multiple Activities in my app.</p><p>Right now in the onCreate() of all of my activities, I am calling:</p><pre><code>    tracker = GoogleAnalyticsTracker.getInstance();    tracker.start(""UA-xxxxxxxxx"", this);</code></pre><p>And in the onDestroy() of all of my activities:</p><pre><code>    tracker.stop();</code></pre><p>I then track PageViews and Events as needed, and Dispatch them along with another HTTP request I am performing. But I'm not so sure this is the best way. Should I be calling start() and stop() in each activity, or should I only call start() and stop() in my main launcher activity?</p>","259645","","","","","2013-03-08 11:52:15","Google Analytics in Android app - dealing with multiple activities","<android><google-analytics>","7","1","44","",""
"3216714","1","","","2010-07-09 21:34:11","2","1261","<p>I am having issues with the getCheckedItemPositions call for ListView.  The first call works but subsequent calls returned the same results even if the previous checked items were unchecked.  </p><p>eg.</p><p>first call: positions 0 &amp; 1 are checked, result shows 0 &amp; 1 are checked2nd call: position 0 &amp; 1 are unchecked, result still shows 0 &amp; 1 are checked.  </p><p>Is this a bug or getCheckedItemPositions doesn't work this way?  Can someone clarify please?  Thanks!  </p>","375791","","","","","2012-11-21 17:18:04","ListView getCheckedItemPositions call issue","<android><listview>","3","0","","",""
"3216981","1","3218266","","2010-07-09 22:37:03","0","799","<p>i'm working on a android app that will display Strings to the user, and the user then has the option to add one to a favorite list. I have searched and searched and cannot find the proper way of doing this. I did get one open source project, everything worked until the user removed a favorite. The database would clear the row of data, but when a new row is added, it would behave as if the deleted row still had data, leaving blanks in the favorite list.</p><p>this is my insert method</p><pre><code>  public long insertString(String newString)   {    ContentValues newStringValue = new ContentValues();    newStringValue.put(KEY_STRING, newString);    return db.insert(DATABASE_TABLE, null, newStringValue);  }</code></pre><p>the long returned will always increment even if i use the remove method:</p><pre><code> public boolean removeString(long _rowIndex)  {    return db.delete(DATABASE_TABLE, KEY_ID + ""="" + _rowIndex, null) &gt; 0;  }</code></pre><p>if i try to remove the third index, and the user removed a question at the third index, the method returns false, is there a way to completely remove all rows with no data?</p>","388000","","12707","","2010-07-09 22:44:56","2013-03-11 06:51:44","saving an ArrayList<String> state in a SQLiteDatabase (Android)","<android><database><sqlite>","3","0","","",""
"3217220","1","","","2010-07-09 23:59:38","12","2451","<p>I want to create an activity with a title bar at top and a navigation bar at bottom. I used <code>include</code> to include the title bar layout and the navigation bar layout into the main layout as you can see below. The result is that both the title bar and navigation bar go to the top of the screen. Could someone tell me why? Thanks!</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/home_widget"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""     android:background=""@drawable/background""&gt;    &lt;include android:id=""@+id/title_bar"" layout=""@layout/title_bar""         android:layout_alignParentTop=""true"" /&gt;    &lt;include android:id=""@+id/navigation_bar"" layout=""@layout/navigation_bar""         android:layout_alignParentBottom=""true""/&gt; &lt;/RelativeLayout&gt;</code></pre><p>[Edit]I didn't find the root cause. But the following works:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/home_widget""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:background=""@drawable/background""&gt;&lt;RelativeLayout android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:layout_alignParentTop=""true""    android:id=""@+id/title_bar"" &gt;    &lt;include layout=""@layout/title_bar"" /&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:layout_alignParentBottom=""true""    android:id=""@+id/navigation_bar"" &gt;    &lt;include layout=""@layout/navigation_bar"" /&gt; &lt;/RelativeLayout&gt;</code></pre>","256239","","152993","","2012-01-12 19:57:05","2012-01-12 19:57:05","What's wrong with my include in RelativeLayout?","<android><android-layout>","2","2","2","",""
"3217256","1","3436842","","2010-07-10 00:11:13","2","1652","<p>I have an Android ListView, backed by an ArrayAdapter.  When the user clicks on an item in the list, that item is removed.  This all appears to work fine, you can click on each item until there are no items left.</p><p>However, it all goes wrong once text filtering occurs.  Once the list has been filtered once, even if that filter is cleared, all subsequent calls to remove(Object) on the adapter fail to remove the item from the visible list.  I've tried calling ListView.clearTextFilter() before removing the item, calling it after removing the item, and not calling it all.  There's no difference.</p><p>I've looked through the source for ArrayAdapter.java and it seems that once filtering is set, the adapter uses one collection to respond to queries but updates a different one.  I can see no obvious way to get it to revert its behaviour.  Is this a bug or am I missing something?</p>","5171","","","","","2010-08-17 00:01:20","Removing items from Android ListView/ArrayAdapter doesn't work after text filtering","<android><listview><android-arrayadapter>","1","1","1","",""
"3217343","1","3220979","","2010-07-10 00:45:14","4","1336","<p>I'm currently working with OpenGL ES 1.1 and using the DrawElements convention along with Vertex, Normal, Texture Coordinate, and Index arrays.</p><p>I recently came across this while researching the idea of using Normal/Bump mapping which I previously though impossible with OpenGL ES:<a href=""http://iphone-3d-programming.labs.oreilly.com/ch08.html"" rel=""nofollow"">http://iphone-3d-programming.labs.oreilly.com/ch08.html</a></p><p>I can generate an object-apace normal map already from my 3D modeler, but what I'm not completely clear on is whether or not the Normal coordinates array will be necessary any longer if implementing a 2nd texture unit for normal mapping, or will Lighting + Color Texture Combined with a Normal map via the DOT3_RGB option be all that is required?</p><p>EDIT - After researching DOT3 Lighting a bit further, I'm not sure if the answer given by ognian is correct. This page, <a href=""http://www.3dkingdoms.com/tutorial.htm"" rel=""nofollow"">http://www.3dkingdoms.com/tutorial.htm</a> gives an example of it's usage and if you look at the ""Rendering &amp; Final Result"" section bit of code, there is no normal array ClientState for Normal Arrays is never enabled.</p><p>I also found this post here, <a href=""http://stackoverflow.com/questions/1894351/what-is-dot3-lighting"">http://stackoverflow.com/questions/1894351/what-is-dot3-lighting</a> which explains it well... but leads me to another question. In the comments, it's stated that instead of translation of normals, you translate light direction. I'm confused about this as if I have a game with a stationary wall... why would I move the light around just for one model? Hoping someone can give a good explanation of all of this...</p>","351060","","351060","","2010-07-10 19:06:22","2010-07-10 21:56:03","Normal Maps vs. Normal Coordinates","<android><opengl-es><android-ndk>","2","0","1","",""
"3217541","1","3220027","","2010-07-10 02:07:23","1","542","<p>Is there a way to look at LogCat when the app is running on a device on DeviceAnywhere?</p><p>ThanksChris</p>","321927","","","","","2010-07-10 16:48:37","Android App DeviceAnywhere LogCat","<android><device><logcat>","2","0","","",""
"3217643","1","5001265","","2010-07-10 02:59:43","29","19534","<p>I'm trying to build an Android project that has some dependencies.  The jar files are in the lib/ directory.  I can build the project by adding those jar file to my classpath, but of course it Force Closes in the emulator because those libraries aren't present.</p><p>I'm doing this from the command line with ant (<strong>not</strong> in eclipse).  How can I make it include those libraries in the apk from the command line?</p>","2262822","","","","","2013-05-24 19:04:23","How to add external jar libraries to an android project from the command line","<android><ant><jar>","9","0","10","",""
"3217711","1","3217717","","2010-07-10 03:31:41","3","2268","<p>my question is kinda related to this question: <a href=""http://stackoverflow.com/questions/3216169/numeric-soft-keyboard-on-android"">http://stackoverflow.com/questions/3216169/numeric-soft-keyboard-on-android</a></p><p>BUT, the question above isnt answered, so here i am.</p><p>Theres a EditText that when it gets touched or has focus, i want the Software Keyboard to show up by default as NUMERIC! Of course, you can switch back to ALPHANUMERIC, but i want to force it to show up as NUMERIC.</p><p>Thanks guys</p>","2443607","","","","","2010-07-10 03:35:31","Soft Keyboard - Numeric Only","<android><keyboard><edittext><numeric>","1","0","","",""
"3217720","1","3221391","","2010-07-10 03:36:49","2","929","<p>I'm creating my first android app (or attempting to anyway) and i have a question i can't seem to find the answer to.</p><p>I would like to allow users to enter a separate set of preferences for each item in a list view.  I have the PreferenceScreen working, but it maintains the same preferences for every item (i.e. changing 1 item results in changes to all others as well).</p><p>To give a more detailed example:Say i have a list of cars:* Car 1* Car 2* Etc...</p><p>I would like to be able to click on ""Car 1"" and get a PreferencesScreen to specify ""Make"", ""Model"", ""Color"" for just that car, instead of having those entries stored globally for the whole app.</p><p>Is this possible?</p><p>Thanks for your help!</p><p>//N</p>","388271","","388271","","2010-07-11 00:35:03","2012-07-13 23:30:30","Individual Preferences for each item in a ListView?","<android><listview><preferences><android-preferences>","2","2","0","",""
"3217741","1","3217867","","2010-07-10 03:46:30","10","6625","<p>Hi I am new to this android programing.</p><p>I need to add my application to home screen as shortcut programmatic.</p><p>Please give the idea for that. If possible please tell me how to manage existing shortcuts(deleting and adding some more shortcuts)</p>","388269","","","","","2014-03-28 11:41:07","How to add application shortcuts programitically in android","<android>","3","1","4","",""
"3217886","1","","","2010-07-10 04:53:57","6","6096","<p>The options menu has a translucent background and I would like to make it solid and non-transparent.  Is there a way?</p>","318031","","","","","2013-05-02 02:06:08","Is is possible to make the Android options menu background non-translucent?","<android>","4","0","1","",""
"3217925","1","3218294","","2010-07-10 05:10:49","11","3521","<p>I am trying to make APP native code for Android.The Native code is in cplusplus.Whenever I try to make, the following error appears.</p><blockquote>  <p>H236Plus.cpp:135: error: exception handling disabled, use -fexceptions to enable</p></blockquote><p>How do I use -fexceptions to enable exception handling, and where do i use it?</p>","254504","","8976","","2010-07-10 13:25:13","2013-12-06 09:20:16","Enable Exception C++","<c++><android><makefile><make><android-ndk>","4","1","2","",""
"3217942","1","","","2010-07-10 05:17:25","10","12487","<p>I have an app that I have running a media player and I want to resume the activity from my apps home activity.</p><p>I can successfully do this by adding the following flags to the startActivity Call:</p><pre><code>myIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);</code></pre><p>I am worried that this is not an ideal way to do things since it took me a long time to find it. It made me think that no one uses it very much.</p><p>Are there any pitfalls to using this method?</p><p>Thanks for your help</p>","282475","","","","","2013-10-17 13:01:03","Android Intent.FLAG_ACTIVITY_SINGLE_TOP AND Intent.FLAG_ACTIVITY_CLEAR_TOP","<android><android-intent>","1","1","2","",""
"3217999","1","3220807","","2010-07-10 05:39:05","3","1864","<p>Using code from open source MusicDroid with the following code that I found during a search for this problem, I can only get mp3 files that are in the root directory /sdcard/</p><pre><code>File home = Environment.getExternalStorageDirectory();if (home.listFiles( new Mp3Filter()).length &gt; 0) {    for (File file : home.listFiles( new Mp3Filter())) {        songs.add(file.getAbsolutePath());    }    ArrayAdapter&lt;String&gt; songList = new ArrayAdapter&lt;String&gt;          (this,R.layout.song_item,songs);    setListAdapter(songList);}</code></pre><p>How can I get all the mp3 files from the card (in any directory) into my 'songs' list?</p>","293565","","","","","2013-01-02 18:17:40","How can I get a list of all mp3 files on the sd card regardless of directory in android?","<android><file>","1","1","0","",""
"3218091","1","","","2010-07-10 06:17:02","1","271","<p>we published our first update in the Android Market yesterday (the app is called Appie). All steps were taken in correct order and the status in the developers console is: Published</p><p>Current users receive the update notification but get an error download failed when trying to update. Any ideas why this error occurs? Is there any way to analyze if this is an error caused by the apk or it is an Android Market bug?</p><p>Thanks,James</p>","388312","","","","","2011-01-31 12:33:15","Update error in Android market:download unsuccesful","<android>","0","1","","",""
"3218127","1","","","2010-07-10 06:32:07","1","2024","<p>I am new to this Android application Programing.</p><p>I need to know the thing that, disable and hiding of one application from application menu list.</p><p>instead of deleting the entire application, that need to do some other changes to hide and disabling any application from menu list.</p>","388269","","","","","2010-07-10 11:52:12","hide one application in application menu of android","<android>","2","0","1","",""
"3218296","1","10911262","","2010-07-10 07:32:19","1","4877","<p>I want to send a broadcast from a new thread is start.</p><p>This is what i tried :</p><pre><code>        new Thread(new Runnable() {        public void run() {            //some other code for timing.            // ..            // ..            Intent broadcastIntent = new Intent();            broadcastIntent.setAction(Intent.ACTION_ANSWER);            this.sendBroadcast(broadcastIntent);        }    }).start();</code></pre><p>But ofcourse i need context..this won't work.How can i handle this.</p>","368598","","","","","2013-09-17 01:41:53","sending broadcast intent from runnable","<android><multithreading><broadcast>","2","0","1","",""
"3218459","1","3218563","","2010-07-10 08:24:33","0","669","<pre><code>public void startGameButtonClicked(View view) {    final TextView shadow = (TextView) findViewById(R.id.main_menu_start_game_button_shadow);    final Animation animation = AnimationUtils.loadAnimation(this, R.anim.main_menu);    shadow.startAnimation(animation);    /** Ugly prototype pausing */    final long startTime = System.currentTimeMillis();    while ((System.currentTimeMillis() - startTime) &lt; 600) {        Log.i(""test"", Boolean.toString(animation.hasEnded()));    }    final Intent intent = new Intent();    intent.putExtra(EXTRA_BUTTON_ID, START_GAME_BUTTON);    setResult(RESULT_OK, intent);    finish();}</code></pre><p>My animation has duration = 400, how can i pause everything except animation after calling shadow.startAnimation(animation); ?I asking becouse, as you can see - animation is set for button click action, which kills current activity, so animation isnt shown completely.</p>","367786","","241590","","2010-07-10 08:31:44","2010-12-20 09:32:55","How can i pause executing code until animation finishes","<java><android>","1","0","","",""
"3218465","1","3219088","","2010-07-10 08:27:14","1","984","<p>There are a number of posts (both here &amp; elsewhere) about why a MapView might not be displaying tile info (personally, I've liked <a href=""http://stackoverflow.com/questions/1809507/android-hello-mapview-tutorial-map-tiles-do-not-load"">http://stackoverflow.com/questions/1809507/android-hello-mapview-tutorial-map-tiles-do-not-load</a>, but there are other good ones, too).</p><p>My question is slightly different: I'm not getting tile info to show up (on my handset or in the emulator), and I'm looking for advice on what to try in order to debug this problem.  As far as I can tell I've correctly located my debug.keystore, and used the Java JDK keytool to get the signature from it, which I then plugged into the Google web page, and then plugged THAT key back into my XML file.  The app runs ok, it just doesn't display any tiles.</p><p>I was hoping that if I did something wrong here I'd see an error message in, say, logcat (or an exception that Eclipse might catch) that would confirm that this is the source of the error.</p><p>So here's my question - what would y'all recommend someone try in order to figure out what the actual problem is?</p>","250610","","","","","2010-07-10 11:54:57","MapView doesn't display tiles - debugging strategies?","<android>","1","1","","",""
"3218469","1","3218572","","2010-07-10 08:28:20","1","1026","<p>I have just started working on my first Android application and am going ok. I have managed to get the app to locate my current position on a map and place the blue circle there. I can see the satellite icon in the notification bar working (satellite dish with rays coming off it).</p><p>I am very new to android phones altogether but upon being done with my app I just exit it by either using the back key or the home key which works fine, however I notice the satellite icon is still working. Going back to my phone an hour later the GPS is still running. This of course sends the phone battery flat very quickly.</p><p>I assume unlike iPhone that Android apps can run in the background and this is still running. How do I get my app to stop using GPS when it is no longer on the map view?</p><p>Here is an example of what I have done so far:</p><pre><code>//find and initialise map viewprivate void initMapView() {    map = (MapView) findViewById(R.id.map);    controller = map.getController();    map.setSatellite(false);    map.setBuiltInZoomControls(true);}//start tracking the position on the mapprivate void initMyLocation() {    final MyLocationOverlay overlay = new MyLocationOverlay(this, map);    overlay.enableMyLocation();    //overlay.enableCompass(); does not work in emulator    overlay.runOnFirstFix(new Runnable() {        public void run() {            //zoom in to current location            controller.setZoom(8);            controller.animateTo(overlay.getMyLocation());        }    });    map.getOverlays().add(overlay);}</code></pre><p>Do I need to disable something when I leave the map view? if so, how?</p><p>Cheers guys</p>","387317","","","","","2013-12-06 14:57:58","First Android app uses GPS location and maps, but runs battery flat","<android><google-maps><gps>","2","0","0","",""
"3218520","1","3218542","","2010-07-10 08:42:32","0","2876","<p>How can i access an Adroid drawable by a variable?ExampleI have  drawables :[ logo1.png logo2.png ... logoN.png];Is there a way so i can do that?</p><pre><code>String logopicker=""1"";logo.setImageResource(R.drawable.**logo+logopicker**);</code></pre><p>Well i know this code will never run but you get the idea of what i want to do. Thank you</p>","348058","","179850","","2011-02-21 19:11:06","2011-02-21 19:11:06","How can i access an Android drawable by a variable","<android>","1","0","3","",""
"3218713","1","3218725","","2010-07-10 09:57:17","0","340","<p>I am iPhone application developer, many people told me to join with the android application development, as it's future is far better comparing to iphone.</p><p>As I am iPhone developer, I prefers to be stay with iPhone , but in reality is it true that android is being far better comparing to iPhone ?? </p><p>I can't say as I've never done android programming, so any one can tell me who's applications are better in all aspects?</p>","288738","","","","","2010-07-10 10:42:36","Which is better comparing iPhone and Android?","<iphone><android><ios4>","6","8","","2010-07-10 10:50:31",""
"3218733","1","3218793","","2010-07-10 10:08:53","8","15710","<p>I'm developing an Android Application that has three very similar Activities. I would like the user to be able to switch between them by swiping left and right on the screen. This is how I managed that up to now:</p><p>I followed this <a href=""http://android-journey.blogspot.com/2010/01/android-gestures.html"">post</a></p><p>Then I changed the method onSwipe() in this way:</p><pre><code>@Override public void onSwipe(int direction) {  Intent intent = new Intent();  switch (direction) {  case SimpleGestureFilter.SWIPE_RIGHT:   intent.setClass(this, TodoTodaySheet.class);   break;  case SimpleGestureFilter.SWIPE_LEFT:   intent.setClass(this, TrashSheet.class);   break;  }  startActivity(intent); }</code></pre><p>It works but I'm not completely satisfied with this. Moreover, I don't know if this is the correct approach.</p><p>I would like to have a behavior like the one on Home apps, when switching desktop. Therefore I would like a smoother animation and the appearance of the called activity from the right direction, eg. from the left side of the screen when swiping on the right.</p><p>Any hints? Thank you very much.</p>","237076","","","","","2013-03-25 15:00:57","Android: How to switch between Activities like switching desktops in Home app?","<android><gui><activity><effects><swipe>","2","2","3","",""
"3218798","1","","","2010-07-10 10:31:07","2","1796","<p>I'm trying to get swipe the Web Views like list view swipe.... from left to right. I've followed the way that showed <a href=""http://www.codeshogun.com/blog/2009/04/16/how-to-implement-swipe-action-in-android/"" rel=""nofollow"">here</a>. </p><p>Also I've set the <code>webviews</code> in the <code>viewflipper</code> </p><pre><code>&lt;ViewFlipper xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/flipper"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout&gt;        &lt;WebView xmlns:android=""http://schemas.android.com/apk/res/android""            android:id=""@+id/webview1"" android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" /&gt;        &lt;WebView xmlns:android=""http://schemas.android.com/apk/res/android""            android:id=""@+id/webview2"" android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" /&gt;    &lt;/LinearLayout&gt;</code></pre><p>but I think the <code>onTouchEvent</code> of webView does not work here.</p><pre><code>    @Override    public boolean onTouchEvent(MotionEvent event) {        if (gestureDetector.onTouchEvent(event))            return true;        else            return false;    }</code></pre>","2438460","","2438460","","2010-07-11 11:35:51","2010-12-05 13:25:55","can't swipe webview?","<android><webview><android-webview>","1","0","2","",""
"3218985","1","","","2010-07-10 11:26:31","6","1043","<p>I have a practical seminar this semester, and I want to use ontology on Android application. I choose Protege owl ontology as a ontology API and this tool worked in normal Java project. But when I tried to import this jar files which for the owl ontology API in Android project.It will fail and I haven't found any solutions in the Internet.Can you help me? Thanks in advanced!</p>","388409","","","","","2012-11-05 17:35:15","Using Protege owl ontology on Android","<android><ontology><owl><protege>","2","1","2","",""
"3219032","1","3975631","","2010-07-10 11:41:36","3","1506","<p>I wrote some code that mute the phone whenever an incoming call is received.When the phone in vibrate mode I use the following code to stop the phone vibration:</p><pre><code>Vibrator vib = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);vib.cancel();</code></pre><p>While it worked on my Nexus One with android 2.1, it seems that it doesn't stop the vibration on an HTC Desire handset with android 2.1.Have someone encountered this issue?</p><p>Doron</p>","388400","","","","","2011-02-02 04:10:16","android Phone Vibration doesn't stop using cancel method","<android><vibrate><vibration>","2","0","1","",""
"3219085","1","3219262","","2010-07-10 11:54:33","2","3439","<p>I read carefully the good UI practice from the Google Dev Blog; <a href=""http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html"" rel=""nofollow"">http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html</a></p><p>and I found that they are right and twitter is an application that I really love for its User Friendly Interface ( like the Google IO app too)</p><p>As I spend most of my time developping the interface of my application, I found that a waste of time and the results are quite bad. I think that a lot of dev's like me have maybe a lack of photoshop skills and ""ergonomy"" ( does this word exist in english?).</p><p>I have read also on Twitter Blog that the application would be Open source: <a href=""http://blog.twitter.com/2010/04/twitter-for-android-robots-like-to.html"" rel=""nofollow"">http://blog.twitter.com/2010/04/twitter-for-android-robots-like-to.html</a></p><p>But I havn't heard about any code release.</p><p>As there are to many things to care, regarding to the Google dev blog, I would like to know if there is an open source application that could learn me how to use all these pattern ( search bar, moving bitmaps, QuickActions, etc.)</p><p>I know that the answer to my question is not a simple line of code, but maybe an open source project or reference application to learn how to do the UI tricks as simple as they are on the Twitter app.</p><p>Thank a lot for any guide/blog/code sample.</p>","327402","","","","","2010-07-10 12:55:04","Good UI practice in Android, are there some sample code?","<android><user-interface><ergonomics>","1","0","2","",""
"3219150","1","3219270","","2010-07-10 12:14:57","2","10994","<p>I have a text file in my res/raw directory. I want to read the file line by line, but FileReader and BufferedReader fail, because of Android's security restriction. How else can I do it?</p>","293847","","","","","2012-02-13 11:33:21","How to read a local (res/raw) file line by line?","<android><file><readline><filereader>","2","2","","",""
"3219205","1","","","2010-07-10 12:37:42","6","1843","<p>I am draw some canvas charts on the android webview, and use javascript to change chart just by hiding and showing, and also change the title by reset its innerHTML. </p><p>The title is just a normal html tag  <code>""&lt;div id='title'&gt;&lt;/div&gt;""</code>, </p><p>The problem is that the page does not render well when I switch charts, for example. when I choosed to display the next chart and change the title's innerHTML, the title seems 'remembered' its previous innerHTML and it looks like one text overlapped another.</p><p>If I manually change my phone's orientation, it seems make the webview redraw its content (not refresh), then everything will be fine. </p><p>Any idea on this? or can I simulate the orientation change event to make my webview redraw its page to work around it?</p>","238061","","","","","2011-08-02 14:10:36","Weird problem on android webview with canvas","<android><html5><canvas><charts><draw>","2","0","3","",""
"3219253","1","3219307","","2010-07-10 12:51:50","35","22173","<p>I have a multi-line <code>EditText</code>:</p><pre><code>&lt;EditText     android:layout_gravity=""center""    android:id=""@+id/txtMessage""    android:layout_height=""wrap_content""    android:layout_below=""@+id/lblMessage""    android:layout_width=""wrap_content""    android:width=""250dip""    android:text=""""    android:maxLength=""760""    android:lines=""4""&gt;&lt;/EditText&gt;</code></pre><p>Now the content is aligned to the middle. And I'd like to have the content aligned to the top like this:</p><p><img src=""http://img28.imageshack.us/img28/3972/edittext.png"" alt=""vertically aligned text example""></p><p>Is there a property to do that?</p>","388437","","356895","","2012-08-16 17:01:00","2013-01-05 05:15:36","Vertical content align in Android EditText","<android><layout><edittext><android-xml><layout-gravity>","2","0","1","",""
"3219663","1","3219889","","2010-07-10 14:57:44","0","164","<p>When I'm using the device and click on my <strong>debug</strong> the application is lunched in my device but I cant see the break points  .</p><p>In the debug window the application whom run is shown for a second and then disappear and I cant debug my application on the device . </p><p>Did I miss something ? can someone please explain me what I did wrong and correct me </p>","368440","","244296","","2010-07-10 15:14:41","2010-07-10 16:00:46","cant see breakpoints when I want to debug using device","<android><debugging>","1","0","","",""
"3219672","1","3220794","","2010-07-10 15:00:36","10","31633","<p>I am trying to reduce the size of images retrieved form the camera (so ~5-8 mega pixels) down to one a a few smaller sizes (the largest being 1024x768). I Tried the following code but I consistently get an <code>OutOfMemoryError</code>.</p><pre><code>Bitmap image = BitmapFactory.decodeStream(this.image, null, opt);int imgWidth = image.getWidth();int imgHeight = image.getHeight();// Constrain to given size but keep aspect ratiofloat scaleFactor = Math.min(((float) width) / imgWidth, ((float) height) / imgHeight);Matrix scale = new Matrix();scale.postScale(scaleFactor, scaleFactor);final Bitmap scaledImage = Bitmap.createBitmap(image, 0, 0, imgWidth, imgHeight, scale, false);image.recycle();</code></pre><p>It looks like the OOM happens during the <code>createBitmap</code>. Is there a more memory efficient way to do this? Perhaps something that doesn't require me to load the entire original into memory?</p>","111644","","","","","2010-07-10 23:27:43","Memory efficient image resize in Android","<android><bitmap><image-manipulation>","2","0","12","",""
"3219692","1","3481701","","2010-07-10 15:05:17","4","848","<p>I have set up a ""Debug Configuration"" to debug my Android project. However to get it to debug on a device (HTC Desire) I have to set the Configuration's ""Target"" to ""Manual"", there seems to be no way to set in the Debug Configuration that it should go to a selected Device.</p><p>It does work, but each debug session I have to ""Manually"" choose the HTC device from the dialog.</p><p>Can I set it to always to go the Device?</p>","172861","","","","","2010-08-14 01:57:45","Eclipse/Android - Debug Configuration - Device?","<android><eclipse>","1","0","1","",""
"3219696","1","3220038","","2010-07-10 15:05:50","0","96","<p>Well, I might as well post the fist question.</p><p>Does AndParcel allow Android Library project functionality? Meaning, I should be able to include an Android Library project as a parcel correct or no?</p>","237740","","","","","2010-07-10 16:51:58","does AndParcel allow android Library projects?","<android>","1","0","","",""
"3219726","1","3220375","","2010-07-10 15:12:00","42","34764","<p>I have an app that has a list as its main activity and then you can click items which opens a detailed view of that item. I also have a search activity that is similar to the main activity and works as intended.</p><p>However I want this search activity to only have once instance on the stack so that users can search multiple times and clicking back would return them to the previouse view that they were on before they started searching (rather than go back to the previouse search results)</p><p>both the singleTask and singelInstance launch mode seems to do what I want so Im not sure which one I should be using for this purpose and why?</p>","362476","","149841","","2012-01-05 11:02:35","2014-04-08 10:22:12","Android singleTask or singleInstance launch mode?","<android><design><activity><multitasking><launch>","2","0","27","",""
"3219774","1","","","2010-07-10 15:25:24","1","540","<p>Using the following code fails with a <code>NullPointerException</code> and the attached stacktrace. At this step I have successfully authenticated with google and try to access <a href=""https://spreadsheets.google.com/feeds/spreadsheets/private/full"" rel=""nofollow"">the following URL</a>: </p><p>The call to <code>getResponseCode</code> fails (also the <code>getInputStream</code> call would fail)</p><pre><code>HttpURLConnection conn = (HttpURLConnection) url.openConnection();conn.setRequestMethod(""GET"");conn.setRequestProperty(""Authorization"", ""GoogleLogin auth="" + auth);conn.connect();BufferedReader reader = null;int rc = conn.getResponseCode();if (rc != 200) {  throw new IOException(""code "" + rc + "" '"" + conn.getResponseMessage() + ""'"");}reader = new BufferedReader(new InputStreamReader(conn.getInputStream()), 512);</code></pre><p>The error : </p><pre><code>java.lang.NullPointerExceptionat org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.readln(HttpURLConnection.java:1178)at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection$ChunkedInputStream.readChunkSize(HttpURLConnection.java:389)at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection$ChunkedInputStream.&lt;init&gt;(HttpURLConnection.java:341)at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getContentStream(HttpURLConnection.java:1074)at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.doRequestInternal(HttpURLConnection.java:1661)at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.doRequest(HttpURLConnection.java:1556)at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1052)at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnection.getInputStream(HttpsURLConnection.java:252)</code></pre>","388482","","1606729","","2013-02-23 19:01:01","2013-02-23 19:01:01","connecting to Google Apps Spreadsheet with android","<android><httpurlconnection><spreadsheet>","0","0","1","",""
"3219779","1","3219829","","2010-07-10 15:27:03","17","9164","<p>What does the method adapter.notifyDataSetInvalidated() accomplish?There is no documentation on it.</p><p>I am trying to reload a ListView and notifyDataSetChanged or notifyDataSetInvalidated don't seem to accomplish anything.</p>","61525","","","","","2014-03-23 12:03:24","Android - What does adapter.notifyDataSetInvalidated do?","<android><dataadapter>","4","0","4","",""
"3219902","1","3220393","","2010-07-10 16:03:51","1","6565","<p>I 've Set up wowza streaming server in my ubuntu box for RTSP streaming video files. The video gets stream perfectly when I 've Totem video player at client side. The same url or video is failing to work on android device and the application that tries to access that rtsp url breaks with Mediaplayer error (1,-1).   </p>","218665","","","","","2010-07-10 18:32:56","Android RTSP streaming failing","<android><video-streaming>","1","0","4","",""
"3219950","1","3219978","","2010-07-10 16:19:49","1","5860","<p>Is it possible to lock the screen from an app?</p><p>ie, just like pressing the power button?</p>","310455","","","","","2010-07-10 16:26:13","Can you lock screen from your app?","<android>","1","0","","",""
"3219982","1","3220422","","2010-07-10 16:27:17","2","404","<p>Say I have a list of Strings with the elements:""One"",""Two"",""Three"",""Four""</p><p>I want to center them in the middle of the screen but I want to do it in a way that the start of each word is next to each other.</p><p>Like this:</p><pre><code>                                      One                                      Two                                      Three                                      Four</code></pre><p>Considering that the font probably has different length per character, how do I do this best in Android?</p>","25282","","","","","2010-07-12 16:24:35","Android centering text in lists","<android><android-ui>","4","0","","",""
"3220042","1","3220123","","2010-07-10 16:53:20","1","781","<p>I usually play a game called <a href=""http://www.google.com.ar/images?q=burako&amp;um=1&amp;ie=UTF-8&amp;source=og&amp;sa=N&amp;hl=es&amp;tab=wi"" rel=""nofollow"">Burako</a>.It has some color playing pieces with numbers from 1-13.</p><p>After a match finishes you have to count your points.For example:</p><pre><code> 1 == 15 points 2 == 20 points</code></pre><p>I want to create an app that takes a picture and count the pieces for me.So I need something that recognizes an image inside an image.</p><p>I was about to read about <code>OpenCV</code> since there is an <a href=""http://github.com/billmccord/OpenCV-Android"" rel=""nofollow"">Android port</a> but it feels there should be something simpler to do this.</p><p>What do you think?</p>","119895","","","","","2010-07-10 17:18:53","Image detection inside an image","<android><opencv>","1","0","","",""
"3220160","1","3220801","","2010-07-10 17:28:13","0","276","<p>I'm making a drawing app. In the centre of the screen, I want the app to contain the user's drawing. At the top of the screen I want buttons for different drawing tools. When a drawing tool is selected, I want buttons specific to that tool to appear at the bottom of the app (e.g. the brush tool might show a ""increase brush size"" button at the bottom of the screen), replacing what buttons might be there from before. What's a good way to do this?</p><p>At the moment, I'm using a relative layout for the whole GUI, then adding a separate linear layout for each tool panel at the bottom of the screen (i.e. the panels overlap when shown together). When a tool button is clicked, I hide all the settings panels except for the one related to the selected tool. This seems a bit messy but I'm not sure how else to do it. It would be nice if I could do it in a way that keeps the code modular for each tool.</p>","369917","","","","","2010-07-10 20:53:28","Android GUI where different panels are shown/hidden based on context?","<java><android><gui><mobile>","1","0","","",""
"3220259","1","","","2010-07-10 17:51:43","2","629","<p>everybody!I have such a demand, need to call in the program Google Maps software, if I use the following method call to map:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(""geo:"" + restaurant.getLatitude() + "","" + restaurant.getLongitude() + ""?q="" + s));startActivity(intent);</code></pre><p>So that I can successfully call the Google Maps software, but if there are multiple maps when the system software, using the above approach will pop up for users to choose to display the map software, I now need to do is have more than one map even if the system software, But every time I call the Google Maps software to display. I ask how you can do, thanks! bythe way, Google Maps software is open source? In the android source code is not found maps related to the source code, where you can come?</p><p>I can successful invoke google map,but if android system have mutil map apps,system will propmt user to select which map app </p>","388528","","297408","","2012-12-24 08:24:45","2012-12-24 08:24:45","In the program called Google Maps","<android><google-maps>","1","1","","",""
"3220406","1","3221018","","2010-07-10 18:37:05","3","224","<p>I need to display a configuration screen when a user installs my application. Is this possible to implement? That screen should not appear again.</p>","377438","","23897","","2010-07-10 18:40:52","2010-07-10 23:17:38","Android configuration screen when installing","<android>","2","0","1","",""
"3220443","1","","","2010-07-10 18:53:39","3","5798","<p>I have a class that extends FrameLayout called NoteView.It is a top level public class.</p><p>It works just fine when I'm creating the UI from java code, but I can't figure out how to use it in XML.  I tried inserting the fully qualified class name just like I would for a custom view, but I get and exception <code>ClassCastException: android.view.View cannot be cast to android.view.ViewGroup</code> when activity tries to inflate the XML.</p><p>I have only been able to find tutorials on Custom Views, not custom viewgroups.  What do I need to do to use a NoteView just like I would a FrameLayout in an XML Layout?</p><p>For example: This works</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt; &lt;test.cjb.sandbox.NoteView android:id=""@+id/noteview"" android:layout_width=""fill_parent"" android:layout_height=""100dp"" android:background=""#FF0000"" android:layout_gravity=""right""&gt; &lt;/test.cjb.sandbox.NoteView&gt;  &lt;Button    android:id=""@+id/button""    android:layout_width=""100dp""    android:layout_height=""fill_parent""    android:text=""Sibling Button""/&gt;&lt;/LinearLayout&gt;</code></pre><p>But this throws the above exception:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt; &lt;test.cjb.sandbox.NoteView android:id=""@+id/noteview"" android:layout_width=""fill_parent"" android:layout_height=""100dp"" android:background=""#FF0000"" android:layout_gravity=""right""&gt;    &lt;Button    android:id=""@+id/button""    android:layout_width=""100dp""    android:layout_height=""fill_parent""    android:text=""Child Button""/&gt; &lt;/test.cjb.sandbox.NoteView&gt;&lt;/LinearLayout&gt;</code></pre>","131871","","131871","","2010-07-10 21:41:07","2011-05-04 05:43:42","How to use custom Android ViewGroup in XML?","<android><user-interface>","1","1","","",""
"3220450","1","","","2010-07-10 18:55:45","1","164","<p>When I try to query using my db in the femulator it works perfectly, but given the same appliction and same varibales into the device (milestone) it seems like the DB is not recognized.</p><p>I think the key to solving it is to understand where on the device we store the db.On the emulator it's on <code>/data/data/com.countryCityGame/databases/test1.db</code></p><p>But when I am using the device itself it must be in another place, does someone know where?</p><p>This is the java code where I build the DB:</p><pre><code>public static void main(String[] args) throws Exception {    String CITIES[] = city.split("","");    String ANIMEL[] = animel.split("","");    String CELEB[] = UK_CELEB.split("","");     String Nature[] = vegtablesAndFruiets.split("","");     String V[][] = {COUNTRIES,CITIES,ANIMEL,Nature,occupations,CELEB};     String []TypeNames = {""Country"",""City"",""Animels"",""Nature"",""Occupation"",""Celeb""};    Class.forName(""org.sqlite.JDBC"");    Connection conn = DriverManager.getConnection(""jdbc:sqlite:test1.db"");    Statement stat = conn.createStatement();    //stat.executeUpdate(""drop table if exists ""+""android_metadata""+"";"");    stat.executeUpdate(""create table android_metadata (\""locale\"" TEXT DEFAULT 'en_US');"");    //PreparedStatement prep1 = conn.prepareStatement(           //   ""insert into ""+""android_metadata""+"" values (?);"");    //prep1.setString(1, ""en_US"") ;    //prep1.addBatch();     stat.executeUpdate(""drop table if exists ""+TABLE_NAME+"";"");    //stat.executeUpdate(""create table ""+TABLE_NAME+"" (name, occupation);"");    stat.executeUpdate(""create table ""+TABLE_NAME+"" (""+VALUE+"" TEXT NOT NULL,""+TYPE+"" TEXT NOT NULL,""+LETTER+"" TEXT NOT NULL,""+counter+"" INTEGER);"");    PreparedStatement prep = conn.prepareStatement(      ""insert into ""+TABLE_NAME+"" values (?,?,?,?);"");    //private void insertToTalble();    int j=0,i=0;    try{        for(j = 0 ;j &lt; V.length; j++)            for (i = 0 ;i &lt; V[j].length ; i++)            {            if  (V[j][i] != null)            {                V[j][i] = asUpperCaseFirstChar(V[j][i]);                Character c = V[j][i].charAt(0);                prep.setString(3, c.toString());            }            prep.setString(1, V[j][i]);            prep.setString(2, TypeNames[j]);            prep.setInt(4,0);            prep.addBatch();            }    }catch(Exception e) {    System.out.println(""***********""+i+""***************"");              }    conn.setAutoCommit(false);    prep.executeBatch();   // prep1.executeBatch();    conn.setAutoCommit(true);    ResultSet rs = stat.executeQuery(""select * from ""+TABLE_NAME+"";"");    while (rs.next()) {      System.out.println(""country name = "" + rs.getString(VALUE));      System.out.println(""type = "" + rs.getString(TYPE));      System.out.println(""letter = "" + rs.getString(LETTER));      System.out.println(""********************************"");    }    rs.close();    conn.close();  }</code></pre><p><strong>and this is the code from where i first get the bug:</strong></p><pre><code>private static final String DB_PATH = ""/data/data/com.countryCityGame/databases/test1.db"";    private static final String DATABASE_NAME = ""test1.db"";    private static final int DATABASE_VERSION = 1;    private static final String TABLE_NAME = ""GameTable"";    private static final String VALUE = ""value"";    private static final String TYPE = ""type"";    private static final String LETTER = ""letter"";    public countryCityGameLogic(EditText[] myEditTextArr , Context context) {        points = 0;//init values        Cursor cursor = null ;        this.context = context;        openHelper = new OpenHelper(context);        gameList = new CharSequence [myEditTextArr.length];        for (int i = 0 ; i &lt; myEditTextArr.length; i++){            gameList[i] = myEditTextArr[i].getText();        }        //this.db = openHelper.getWritableDatabase();        try{            db = SQLiteDatabase.openDatabase(DB_PATH , null,  SQLiteDatabase.NO_LOCALIZED_COLLATORS/*SQLiteDatabase.CREATE_IF_NECESSARY*/);            //this question             cursor = db.query(TABLE_NAME, new String[] {LETTER}            ,LETTER+ "" like "" + ""'%"" + ""A"" +""%'"", null, null, null, null);              if ( !cursor.moveToFirst()){                //*****if data base doesnot exist HERE I GOT PROBLEMES****                this.db = openHelper.getWritableDatabase();//make new data base                }        }catch(SQLiteException e){            this.db = openHelper.getWritableDatabase();//make new data base        //  for (int i = 0 ; i &lt; ALLVALUES.length ; i++)         //          insertValus(ALLVALUES[i],i);        }</code></pre><p><strong>NOTICE:</strong> In the device I am using <code>/data/data/com.countryCityGame/databases/test1.db</code>, it might not be the path where the appliction is located onto the device I am using.</p>","368440","","3800","","2011-09-01 15:42:11","2011-09-01 15:42:11","My device doesnt recognize my DB where my emulator does","<android>","0","4","1","",""
"3220482","1","4229842","","2010-07-10 19:08:29","7","8194","<p>We are getting a large number of <code>SQLiteDiskIOException</code> errors in our Android app, with stack traces similar to the following:</p><pre><code>E/AndroidRuntime( 2252): Caused by: android.database.sqlite.SQLiteDiskIOException: disk I/O errorE/AndroidRuntime( 2252): at android.database.sqlite.SQLiteQuery.native_fill_window(Native Method)E/AndroidRuntime( 2252): at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:75)E/AndroidRuntime( 2252): at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:288)E/AndroidRuntime( 2252): at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:269)E/AndroidRuntime( 2252): at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:171)E/AndroidRuntime( 2252): at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:248)E/AndroidRuntime( 2252): at com.company.android.CActivity$QueryTask.doInBackground(CActivity.java:1660)</code></pre><p>This recently starting happening a few weeks ago, but no significant database changes took place in the exact release in which reporting of this issue started.  Despite having (I believe) appropriate indices, this exception has been reported more than we are comfortable with on <code>cursor.moveToFirst()</code> calls after the query completes, as you can see from the stack trace.  So far, we have been completely unable to reproduce.</p><p>The query is somewhat complicated, with three left joins.  Below is a representative query, with some identifying columns changed to protect the innocent. </p><pre><code>select distinct c._id as _id,c.type as type,c.name as name,c.slug as slug,c.description as description,c.extra1 as extra1,c.extra2 as extra2,c.extra3 as extra3,c.extra4 as extra4,c.extra5,c.extra6 as extra6,c.extra7 as extra7,c.extra8 as extra8, c.extra9 as extra9,c.sslug as sslug,  c2.name as sname,  p.type as prel,  em.dS as dS,em.eS as eS from cse as c left join cse as c2 on c.sslug=c2.slug left join emed as em on c.slug=em.slug left join pre as p on c.sslug=p.slug where c.pslug='slug' AND c.user='user' AND c.csource='csource' order by c.type asc, c.extra6 desc, c.sortorder asc</code></pre><p>Other sources have suggested that we are trying to pull out too much data, but this is simply not the case. The three user cases where we have been able to get full database rowcounts show:cse with &lt; 2000 entries,emed with &lt;150 entries, andpre with either 0 or 7 entries.Furthermore 'explain query plan' on the query indicates all joins are done against indexed columns.</p><p>In every case we have seen this, the user was running Android 2.1 on a variety of devices (DROID, Hero, EVO, possibly others).  Notably, we have not seen this on a couple G1 devices we have, even when they are loaded down with other apps.</p><p>Finally, uninstalling and reinstalling has proven successful in cleaning up the issue, though possibly only temporarily.</p><p>I fear this problem is a result of data corruption in Android 2.1.Does anyone have possible suggestions of what to look into?Could this be related to <a href=""http://code.google.com/p/android/issues/detail?id=8427"">this Android bug on SQLiteDatabaseCorruptException</a></p><p>Guidance and solutions are much appreciated.</p>","449670","","119895","","2010-07-11 01:48:48","2013-05-24 05:03:11","SQLiteDiskIOException in Android","<android>","3","3","6","",""
"3220556","1","3220576","","2010-07-10 19:27:24","5","6552","<p>I want to take overinput over the Volume Up and Down. At the moment my code is:</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    Log.v(TAG, event.toString());    if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN){        mLamp.moveBackward();        return false;    }    else if(keyCode == KeyEvent.KEYCODE_VOLUME_UP){        mLamp.moveForward();        return false;    }    return true;}public boolean onKeyUp(int keyCode, KeyEvent event) {    Log.v(TAG, event.toString());    if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN){        return false;    }    else if(keyCode == KeyEvent.KEYCODE_VOLUME_UP){        return false;    }    return true;}</code></pre><p>This triggers the <code>mLamp.moveBackward()</code> and <code>mLamp.moveForward()</code> function but it still changes the volume of the ringer.What do I have to do that the ringer loudness doesn't change?</p>","25282","","","","","2013-10-26 10:09:02","Taking over the volume key on Android","<android>","3","0","2","",""
"3220626","1","","","2010-07-10 19:52:25","2","11265","<p>I have an android project that uses the xmlrpc library. I downloaded the xmlrpc library and imported into my eclipse workspace. I then added it to the build path in my android project and use it. When I go to run in the emulator, I get this error: ""Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY"". Are the xmlrpc classes not being packaged into my android project? Help...</p>","388571","","388571","","2010-07-10 20:51:44","2011-06-03 07:53:30","Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY when using XMLRPC for android","<android><xml-rpc>","1","1","","",""
"3220743","1","","","2010-07-10 20:32:31","6","1890","<p>How do I use androids default window title style to make my own similar <code>TextView</code>?</p><p>I have done a lot of guessing and made a TextView that has everything thatthe default title bar has, except for the text shadow (and some padding/margins etc. I think).</p><p>Here's essentially what I've tried:</p><p>MainUI.xml</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);    setContentView(R.layout.main);    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_bar);}</code></pre><p>title_bar.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView   xmlns:android=""http://schemas.android.com/apk/res/android""   android:id=""@+id/myTitle""  android:layout_height=""fill_parent""  android:layout_width=""fill_parent""  android:textAppearance=""@android:style/TextAppearance.WindowTitle""  android:background=""@android:drawable/title_bar""  android:text=""This is my new title"" /&gt;</code></pre><p><strong>Edit:</strong></p><p>I found some interesting related articles at <a href=""http://labs.makemachine.net/2010/03/custom-android-window-title/"" rel=""nofollow"">makemachine</a> and <a href=""http://www.anddev.org/my_own_titlebar_backbutton_like_on_the_iphone-t4591.html"" rel=""nofollow"">anddev</a>.</p><p>Although I don't like it, I copied some attributes from the implementation <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/styles.xml;h=d7b654e49809cb97a35682754b1394af5c8bc88b;hb=HEAD"" rel=""nofollow"">style.xml</a>.</p><p>Is there any way to avoid copying the attributes in this static way?</p><p>The following rendered almost perfect, the difference is in fact that the original did ""cut"" the first 2-3 pixels of the title shadow, while my <code>TextView</code> doesn't.</p><pre><code>&lt;TextView   xmlns:android=""http://schemas.android.com/apk/res/android""   android:id=""@+id/myTitle""  android:layout_height=""fill_parent""  android:layout_width=""fill_parent""  android:gravity=""center_vertical""  android:shadowColor=""#BB000000""  android:shadowRadius=""2.75""  android:singleLine=""true""  android:textAppearance=""@android:style/TextAppearance.WindowTitle""  android:background=""@android:drawable/title_bar""  android:text=""This is my new title"" /&gt;</code></pre><p>It's also important to override the default android:windowTitleBackgroundStyle with a transparent color, because the default includes some padding etc. that you don't want to be wrapping your custom title bar.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;  &lt;style name=""CustomTheme"" parent=""android:Theme""&gt;    &lt;item name=""android:windowTitleBackgroundStyle""&gt;@android:color/transparent&lt;/item&gt;  &lt;/style&gt;&lt;/resources&gt;</code></pre><p>Remember to enable the theme in your <code>AndroidManifest.xml</code></p>","215904","","215904","","2010-07-11 11:37:17","2011-12-10 08:58:59","Make custom title view from defaults on Android","<android>","1","3","","",""
"3220862","1","3221099","","2010-07-10 21:16:14","8","7751","<p>I want to present some choices in my application.Right now I'm doing it with buttons one under another.</p><p>What I really want to do is to present them as a list like in ""Settings"" application.This boils down to creating a list with predefined values/choices.My problem is that I can't figure out how to do it with xml.I can add ListView to xml like this:</p><p><code>&lt;ListView android:id=""@+id/ListView01"" android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;&lt;/ListView&gt;</code></p><p>But how do I add entries to that?All examples I've found do it programatically - through cursor adapters or array adapters.</p><p>How do I create a list of textViews using XML only n Android?Does anyone know how it's done in ""Settings"" application and alike?</p><p>Thanks!</p>","219449","","759019","","2012-12-30 18:51:56","2012-12-30 18:51:56","Android - creating listview entirely from xml","<android>","1","0","2","",""
"3220944","1","","","2010-07-10 21:42:45","0","1181","<p>In my application, RTSP streams play only sound without video, but if i specify the video path as a local file, it plays the video and audio.</p><p>How would i get the RTSP streams to show video?</p><pre><code>public void onClick(View arg0) {    Player.setVideoPath(""rtsp://rtspvideohere.sdp"");    Player.start();}</code></pre>","388608","","29407","","2010-07-11 13:13:59","2010-07-11 16:28:16","RTSP streams play only sound, while local does video and sound","<java><android>","1","0","","",""
"3220956","1","3222298","","2010-07-10 21:47:27","0","2581","<p>Hey there I have got an edit text where I want that when someone insert her values it will narrow his option's  .the options are stored in a DB (up to 1200 values to one editbox ).</p><p>i cant get the concept of how to do it can someone help me.</p>","368440","","368440","","2010-07-11 07:51:00","2012-03-05 17:55:27","Auto-complete spinner in android","<android><android-widget>","1","0","2","",""
"3220964","1","","","2010-07-10 21:49:58","1","185","<p>I'm new to android programming.</p><p>Does anyone know how to listen for actions that other applications do?</p>","388609","","119895","","2010-07-11 01:36:42","2010-07-11 02:14:33","Plugin to another android application","<android>","1","2","1","",""
"3220987","1","3225276","","2010-07-10 22:00:04","1","4211","<p>Doing Android 2.1 development. Can anybody explain to me why the following code generates a IOException and doesn't load the file? This exact code used to work, and as far as I can tell, it should still work. For reference, the Log.d() command correctly lists all files that I expect, and the files are correctly zipped into my .APK file. </p><pre><code>        AssetManager assetManager = mContext.getAssets();        String[] files = null;        try            {            files = assetManager.list(""meshes"");            for (int i = 0; i &lt; files.length; i++)                Log.d(TAG, files[i]);            InputStream is = assetManager.open(files[0]);            }        catch (IOException e)             {            Log.e(TAG, ""Could not load '"" + e.getMessage()+ ""'!"");            }</code></pre><p>Any ideas on why this breaks now? The files I'm trying to read are tiny (couple of bytes) binaries.</p>","388611","","","","","2012-10-26 04:40:49","Android AssetManager/InputStream Exception","<android><inputstream><manager><asset>","2","0","0","",""
"3221119","1","3221236","","2010-07-10 22:46:46","14","7771","<p>How can i get rid of the shadow when I scroll <code>ListView</code>.</p><p>I have shadows appearing on top and bottom of the list.</p>","282882","","119895","","2010-07-11 01:37:27","2012-11-08 18:23:59","android listview shadow","<android><android-widget>","2","0","4","",""
"3221135","1","3221235","","2010-07-10 22:52:18","4","4341","<p>is there a way to get every view that is inside my activity?I have over 200 views including buttons, and images, so i want to be able to access them by using a loop</p><p>for example something like</p><pre><code>for (View v : this){     //do something with the views      //depending on the types (button, image , etc)}</code></pre>","242769","","119895","","2010-07-11 01:38:37","2010-12-23 15:51:40","How to get every Views in an Activity?","<android><view><activity>","2","0","","",""
"3221378","1","","","2010-07-11 00:27:05","1","1025","<p>I try work with NETWORK and GPS location provider simultaneously. In main activity I register location update request for each available provider:</p><pre><code>        for (String provider : m_lm.getProviders(false)) {            Intent intent = new Intent(GpsMain.this, GpsTestReceiver.class);            PendingIntent pi = PendingIntent.getBroadcast(GpsMain.this,0, intent, 0);            m_lm.requestLocationUpdates(provider, 60000, 10, pi);        }</code></pre><p>In my BroadcastReceiver (GpsTestReceiver) do incoming Intent handling:</p><pre><code>@Overridepublic void onReceive(Context context, Intent intent) {    // TODO Auto-generated method stub    Bundle ex = intent.getExtras();    if (ex.containsKey(LocationManager.KEY_STATUS_CHANGED)) {        int status = (Integer)ex.get(LocationManager.KEY_STATUS_CHANGED);        String str_status;        switch (status) {        case 1:            str_status = ""TEMPORARILY_UNAVAILABLE"";            break;        case 2:            str_status = ""AVAILABLE"";            break;        default:            str_status = ""OUT_OF_SERVICE"";            break;        }        String provider_name = ???;        s = provider_name+"": change status into ""+str_status+""\n"";    }}</code></pre><p>Question is: how to determine from which provider arrived this intent? (String provider_name = ???;)</p><p>I try at registration moment include in the intent provider name as a payload like this:</p><pre><code>                intent.putExtra(""local.home.gpstest.PROVIDER"", provider);</code></pre><p>but unsuccessfully: incoming intent from provider erase my data...</p>","388654","","","","","2010-07-11 05:35:40","Android: How to find out location provider name from KEY_STATUS_CHANGED broadcast intent sent by LocationManager?","<android><geolocation>","1","0","","",""
"3221418","1","","","2010-07-11 00:48:46","1","4299","<p>I'm trying to open a bluetooth server socket on an Android <em>(2.1-update1 on a GT-I5700)</em> phone and it fails. I have run out of ideas. Some pointers on what I am missing would be welcome.Bluetooth is on, so that shouldn't be a problem.</p><p>I'm also pretty sure permissions are ok:</p><pre><code>&lt;uses-permission android:name=""android.permission.BLUETOOTH""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.BLUETOOTH_ADMIN""&gt;&lt;/uses-permission&gt;</code></pre><p>The code which fails is pretty simple:</p><pre><code>String TAG = ""MYAPP"";UUID UUID_RFCOMM_GENERIC = UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB"");BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();BluetoothSocket s;BluetoothServerSocket bss;try {    Log.i(TAG, ""We do reach this point"");    bss = adapter.listenUsingRfcommWithServiceRecord(""PrettyService"", UUID_RFCOMM_GENERIC);     Log.i(TAG, ""We never reach this"");    s = bss.accept();} catch (IOException e) {    Log.i(TAG, ""Blutooth failed"");}</code></pre><p>And the log:</p><pre><code>INFO/MYAPP(9087): We do reach this pointDEBUG/BluetoothSocket(9087): BluetoothSocket created fd: -1uuidnullport 1DEBUG/BluetoothSocket.cpp(9087): initSocketNativeINFO/BLZ20_WRAPPER(9087): blz20_wrp_socket: fam 31, type 1, prot BTPROTO_RFCOMMDEBUG/BLZ20_WRAPPER(9087): blz20_init: initializing...DEBUG/BTL_IFC_WRP(9087): wsactive_init: init active listINFO/BTL_IFC(9087): main_client_thread: Client main thread startingDEBUG/BLZ20_WRAPPER(9087): blz20_init: successINFO/BTL_IFC(9087): BTL_IFC_RegisterSubSystem: Register subsystem [(null)]INFO/BTL_IFC(9087): btl_ifc_ctrl_connect: Connect control channel for subsystem [(null)]DEBUG/BTL_IFC_WRP(9087): wrp_sock_create: CTRLDEBUG/BTL_IFC_WRP(9087): wrp_alloc_new_sock: wrp_alloc_new_sock sub 1ERROR/BTL_IFC_WRP(9087): ##### ERROR : wrp_sock_create: socket create failed (Permission denied)#####DEBUG/BTL_IFC_WRP(9087): wrp_sock_create: -1DEBUG/BluetoothSocket.cpp(9087): socket() failed, throwingINFO/MYAPP(9087): Blutooth failed</code></pre><p>That error is pretty ugly and googling turns up nothing. I am also quite new to the whole Android world.</p>","55267","","","","","2010-08-17 07:31:18","listenUsingRfcommWithServiceRecord fails on Android 2.1: wrp_sock_create: socket create failed (Permission denied)","<android><bluetooth><rfcomm>","0","1","","",""
"3221488","1","","","2010-07-11 01:25:47","19","17240","<p>I would like to be able to either blur or dim the background when I show my popup window using <code>popup.showAtLocation</code>, and unblur/dim the background when <code>popup.dismiss</code> is called.</p><p>I have tried applying layout params <code>FLAG_BLUR_BEHIND</code> and <code>FLAG_DIM_BEHIND</code> to my activity, but this appears to just blur and dim the background as soon my app is started.</p><p>How can I do blurring/dimming just with popups?</p>","208501","","122607","","2011-12-21 14:12:59","2014-02-20 10:36:37","Blur or dim background when Android PopupWindow active","<android><popupwindow>","5","4","11","",""
"3221603","1","3224478","","2010-07-11 02:17:56","10","7191","<p>In my Android project, I want to loop through the entire collection of <code>Drawable</code> resources.  Normally, you can only retrieve a specific resource via its ID using something like:</p><pre><code>InputStream is = Resources.getSystem().openRawResource(resourceId)</code></pre><p>However, I want to get all <code>Drawable</code> resources where I <strong>won't</strong> know their ID's beforehand.  Is there a collection I can loop through or perhaps a way to get the list of resource ID's given the resources in my project?</p><p>Or, is there a way for me in Java to extract all property values from the <code>R.drawable</code> static class?</p>","107277","","","","","2013-10-02 07:18:04","Android: retrieving all Drawable resources from Resources object","<android><collections><resources><drawable>","6","0","5","",""
"3221661","1","3222935","","2010-07-11 02:48:39","0","1164","<p>I 've set Wowza streaming server to stream mp4 videos to Android phones. Android phone can play the RTSP stream successfully but here It only plays audio of the file not the video. </p>","218665","","","","","2010-07-11 11:47:14","Audio only while streaming a mp4 file to Android Device","<android><video>","1","4","","",""
"3221744","1","","","2010-07-11 03:25:15","1","1168","<p>For starters, I'm a C++/Qt Developer jumping into Android/Java development, so please don't assume I know anything. :)  So, I have an application with a TextView contained with in a ScrollView.  The text contained in the TextView is the results of a web query from my web server application.  Depending on the query, the text can be pretty long.  I want to implement a search feature on the text where the user enters some text string to search for, and if the text string is found, the ScrollView will scroll the TextView to ensure the entered substring is visible, and I want the text highlighted.  I think I know how to highlight the text substring, I know how to tell the ScrollView to scroll to a specific line number in the TextView, but for the life of me, I can't figure out how to find out what line number to scroll to to guarantee my substring is visible.  Ie, I want to query the text view to give me the line number that the substring first occurs at.  Eventually, I want to also implement a find next that goes to the next occurrence of the substring.  Kind of like the Find feature in Firebox.  Any assistance is greatly appreciated.  Thanks in advance.</p>","388695","","","","","2011-03-01 13:59:43","Scrolling TextView in a ScrollView to a specific substring of text","<java><android><textview><scrollview>","1","0","","",""
"3222051","1","","","2010-07-11 06:03:57","3","4615","<p>I am looking into writing some apps for Android phones that work with audio. These phones do not have a line in jack but do have headphone jacks that work with some headsets that include a microphone. Is it possible to work with audio coming in through the headphone jack if I plugged in something like a portable computer mic?</p>","49887","","","","","2010-07-19 11:17:19","Possible to work with audio coming through the headphone jack?","<android><audio><hardware><smartphone>","3","0","4","",""
"3222114","1","","","2010-07-11 06:34:38","0","743","<p>I have one activity in one application, which suppose to run another activity in another application, while passing to it an arguemnts|(Through putExtra)</p><p>the problem is"" that i know that I must add something like:</p><pre><code>Intent i = new Intent(target);i.setAction(""actionstring"" + System.currentTimeMillis());</code></pre><p>to the target intent(activity) so the system wont override the Extra's and ill get diffrent extra's each time i run the target activity. </p><p>But when i add the setAction i get an error:</p><p>couldnt find activity: No Activity found to handle Intent {       action=actionstring1278829343752 flags=0x10000000 (has extras) }</p><p>Any idea how could i solve it with setAction? mybe something i have to add also to the manifest?</p><p>thanks,</p><p>ray.</p>","260511","","","","","2010-07-11 06:51:04","Intent filter and diffrent extra's","<android>","1","2","","",""
"3222206","1","3222259","","2010-07-11 07:17:19","3","3592","<p>I want to setImageResource for an ImageButton programatically, based on a variable.</p><p>For eg: if size=5, I want to setImageResource to R.drawable.five</p><pre><code>    if size=6, I want to setImageResource to R.drawable.six</code></pre><p>Unfortunately, I have too many of these, so an if-else or switch gets tiring. </p><p>Is there a way to achieve something like: R.drawable.size?</p><p>ThanksChris</p>","321927","","","","","2010-07-11 07:50:32","Android ImageButton setImageResource from variable","<android><image><set><resources><imagebutton>","2","0","","",""
"3222279","1","","","2010-07-11 07:49:22","1","879","<p>One of the activities in my app has an <code>intent-filter</code> with:</p><ul><li>Action - VIEW</li><li>Categories - DEFAULT</li><li>BROWSABLE</li></ul><p>Data - scheme is 'myapp123'. I want to start this activity from another application using the Intent but I get <code>NoActivityFoundException</code>. Even if I type myapp123:// from the browser, it doesn't get called. Any help on resolving this issue will be appreciated.</p><h2>AndroidManifest.xml</h2><pre><code>&lt;activity android:name=""TwitterStatus"" android:label=""TwitterStatus""&gt;&lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.VIEW"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;    &lt;DATA android:scheme=""myapp123"" /&gt;&lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>actually I have this callback address for OAuth authentication to Twitter</p><pre><code>mTwitterCallBack = ""myapp123://twittercallback"" ;</code></pre><p>after authenticating by twitter the browser itself tries to search for this URI</p><p>for the purpose of testing, I have put a test option in one of the activities as follows</p><h2>Activity</h2><pre><code>Intent tstIntent = new Intent (Intent.ACTION_VIEW, Uri.parse(mTstURI)) ;  // value of mTstURI entered at runtime - myapp123://twittercallbacktry { startActivity(tstIntent) ;} catch (ActivityNotFoundException e) {    e.printStackTrace();}   // always catches the exception.</code></pre>","388758","","388758","","2010-07-12 03:48:36","2011-05-25 21:19:37","intent-filter not working","<android>","2","2","","",""
"3222309","1","","","2010-07-11 08:01:11","2","839","<p>I have purchased an Samsung Galaxy I9000 Phone, knowing that it does not have either a trackball nor a touchpad/cursorkeys. I thought: simply write an application that reads gestures and sends/generates the appropriate cursor events. Checking the SDK documantation and found that this is possible after granting my application the permission 'INJECT_EVENTS': ""Allows an application to inject user events (keys, touch, trackball) into the event stream and deliver them to ANY window. Without this permission, you can only deliver events to windows in your own process."". </p><p>This clearly states that this permission is available at application level, not only at system/firmware level.</p><p>After several hours of experimentation I did not find any way to get my program to inject cursor events to any other program than my own. How can this be achieved without having the permission 'INJECT_EVENTS'?</p>","388759","","82118","","2011-02-02 00:06:58","2011-08-03 14:56:12","HowTo simulate Trackball/Cursor movement on android device?","<android><android-manifest>","1","2","1","",""
"3222484","1","","","2010-07-11 09:08:02","2","839","<p>The API I need to work with does not support xpath, which is a bit of a headache! :-( lol</p><p>The xml I want to parse is as a String.  My questions:</p><ol><li>Is there a Java equivalent of ""simplexml_load_string"", where it makes the string into an xml document for parsing?</li><li>Which is better for parsing, SAX or DOM?  I need to get a couple of values out of the XML and the structure isn't that deep. [3 levels]</li></ol><p>Thanks!</p>","388791","","36305","","2010-07-12 13:16:59","2010-08-18 02:46:17","XML Parsing in Android [Java]","<java><android><xml>","2","0","0","",""
"3222545","1","3223257","","2010-07-11 09:32:20","1","659","<p>All of a sudden I couldn't upload my apk on my device while debugging/running it from eclipse, this is the error:</p><pre><code>[2010-07-11 12:30:04 - myapp] Failed to upload myapp.apk on device '181D09BAD5D96180'[2010-07-11 12:30:04 - myapp] java.io.IOException: Unable to open sync connection![2010-07-11 12:30:04 - myapp] Launch canceled!</code></pre><p>i tried in the adb kill-server and start-server also tried to reboot/shut down my comp and/or my phone but nothing helps.</p><p>I'm using adk 1.5.</p><p>any idea?</p>","273550","","119895","","2010-07-11 13:24:08","2010-07-11 13:43:40","Failed to upload myapp.apk","<android>","3","4","","",""
"3222608","1","3222764","","2010-07-11 09:57:48","3","12452","<p>I made an app which is just working fine. It displays the number of times app has been started. Here's the code:</p><pre><code>import android.app.Activity;import android.content.SharedPreferences;import android.os.Bundle;import android.preference.PreferenceManager;import android.widget.TextView;public class PreferencesDemo extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // Get the app's shared preferences        SharedPreferences app_preferences =             PreferenceManager.getDefaultSharedPreferences(this);        // Get the value for the run counter        int counter = app_preferences.getInt(""counter"", 0);        // Update the TextView        TextView text = (TextView) findViewById(R.id.text);        text.setText(""This app has been started "" + counter + "" times."");        // Increment the counter        SharedPreferences.Editor editor = app_preferences.edit();        editor.putInt(""counter"", ++counter);        editor.commit(); // Very important    }}</code></pre><p>If I change the int variable to string it throws an error saying: ""app has stopped unexpectedly.. please try again later"". Here's the code that throws error:</p><pre><code>import android.app.Activity;import android.content.SharedPreferences;import android.os.Bundle;import android.preference.PreferenceManager;import android.widget.TextView;public class pref extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);        String c = prefs.getString(""c"", ""hello"");        TextView t = (TextView)findViewById(R.id.te);        t.append(c);        SharedPreferences.Editor edit = prefs.edit();        edit.putString(""c"", ""There"");        edit.commit();    }</code></pre><p>}</p><p>can anyone tell me where m I going wrong? Provided: I have correctly mentioned the textview in main.xml file.</p><p>Here are the LogCat details:</p><pre><code>07-11 15:49:12.908: DEBUG/AndroidRuntime(521): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;07-11 15:49:12.918: DEBUG/AndroidRuntime(521): CheckJNI is ON07-11 15:49:15.459: DEBUG/AndroidRuntime(521): --- registering native functions ---07-11 15:49:19.049: DEBUG/AndroidRuntime(521): Shutting down VM07-11 15:49:19.049: DEBUG/dalvikvm(521): Debugger has detached; object registry had 1 entries07-11 15:49:19.079: INFO/AndroidRuntime(521): NOTE: attach of thread 'Binder Thread #4' failed07-11 15:49:20.349: DEBUG/AndroidRuntime(530): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;07-11 15:49:20.359: DEBUG/AndroidRuntime(530): CheckJNI is ON07-11 15:49:20.739: DEBUG/AndroidRuntime(530): --- registering native functions ---07-11 15:49:22.492: INFO/ActivityManager(68): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.webkul.pref/.pref }07-11 15:49:26.996: WARN/ActivityManager(68): Activity pause timeout for HistoryRecord{43f1d590 com.android.launcher/com.android.launcher2.Launcher}07-11 15:49:27.484: DEBUG/AndroidRuntime(530): Shutting down VM07-11 15:49:27.619: DEBUG/dalvikvm(530): Debugger has detached; object registry had 1 entries07-11 15:49:28.649: INFO/ActivityManager(68): Start proc com.webkul.pref for activity com.webkul.pref/.pref: pid=537 uid=10038 gids={}07-11 15:49:31.339: DEBUG/AndroidRuntime(537): Shutting down VM07-11 15:49:31.339: WARN/dalvikvm(537): threadid=1: thread exiting with uncaught exception (group=0x4001d800)07-11 15:49:31.438: ERROR/AndroidRuntime(537): FATAL EXCEPTION: main07-11 15:49:31.438: ERROR/AndroidRuntime(537): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.webkul.pref/com.webkul.pref.pref}: java.lang.ClassCastException: java.lang.Integer07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at android.os.Handler.dispatchMessage(Handler.java:99)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at android.os.Looper.loop(Looper.java:123)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at java.lang.reflect.Method.invokeNative(Native Method)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at java.lang.reflect.Method.invoke(Method.java:521)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at dalvik.system.NativeStart.main(Native Method)07-11 15:49:31.438: ERROR/AndroidRuntime(537): Caused by: java.lang.ClassCastException: java.lang.Integer07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at android.app.ContextImpl$SharedPreferencesImpl.getString(ContextImpl.java:2699)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at com.webkul.pref.pref.onCreate(pref.java:17)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)07-11 15:49:31.438: ERROR/AndroidRuntime(537):     ... 11 more07-11 15:49:31.646: WARN/ActivityManager(68):   Force finishing activity com.webkul.pref/.pref07-11 15:49:34.053: DEBUG/dalvikvm(68): GC_FOR_MALLOC freed 13421 objects / 615120 bytes in 1300ms07-11 15:49:34.129: WARN/ActivityManager(68): Activity pause timeout for HistoryRecord{43fd3ee8 com.webkul.pref/.pref}07-11 15:49:34.739: WARN/ActivityManager(68): Launch timeout has expired, giving up wake lock!07-11 15:49:37.479: INFO/Process(537): Sending signal. PID: 537 SIG: 907-11 15:49:37.559: WARN/InputManagerService(68): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43ebfa2007-11 15:49:37.779: INFO/ActivityManager(68): Process com.webkul.pref (pid 537) has died.07-11 15:49:37.889: DEBUG/SntpClient(68): request time failed: java.net.SocketException: Address family not supported by protocol07-11 15:49:46.680: WARN/ActivityManager(68): Activity destroy timeout for HistoryRecord{43fd3ee8 com.webkul.pref/.pref}</code></pre>","172543","","172543","","2010-07-11 10:27:44","2013-03-01 23:24:38","Android error: The application has stopped unexpectedly please try again","<java><android>","3","1","1","",""
"3222690","1","3222732","","2010-07-11 10:26:43","5","558","<p>I have a custom <code>ListView</code> that uses a custom <code>ArrayAdapter</code> (which basically just overrides <code>getView()</code>). This custom adapter uses as its backend a <code>List&lt;CustomObject&gt;</code>. The elements in this <code>List</code> are retrieved from the network, so I would like to save it in <code>onSaveInstanceState()</code>. However, I can't find a way to put a <code>List&lt;E&gt;</code> in a <code>Bundle</code>. I'm thinking this is a common task, saving a custom array in the instance state. How do other people do it?</p>","180784","","243782","","2010-07-11 10:30:50","2010-07-11 10:55:40","Save a custom ListView's instance state?","<java><android><serialization>","1","0","","",""
"3222806","1","3222848","","2010-07-11 11:04:13","0","435","<p>Suppose an app gets a content stream by being called with the android.intent.action.SEND filter. Also suppose the Uri and the stream is received like this:</p><pre><code>Uri contentUri = (Uri) extras.get(Intent.EXTRA_STREAM);InputStream in = getContentResolver().openInputStream(contentUri);</code></pre><p>Now, how can I determine the total length of the content without reading the whole stream? Is it even possible? in.available() isn't necessarily accurate, so I guess I do have to read the stream until the end, first?</p><p>The content might be very large, like about 50MB or more. So, I'd rather only read it once.</p>","388826","","","","","2010-07-11 11:20:57","Determine the content length of an Intent.STREAM_EXTRA (Android)","<android><stream><android-intent>","1","0","","",""
"3222863","1","3222903","","2010-07-11 11:24:30","1","504","<p>I know how to make <code>AlertDialog</code>'s of various types. But, how can I make an <code>AlertDialog</code> with the background <em>fuzzy</em> as if it is out of focus (i.e. like using a telephoto lens)?</p><p>Whenever I search for 'focus' the result relaits to something like the <code>onFocus</code> commands, etc. which isn't what I mean.</p><p>An example would be if you press the power button on your phone, a list pops up and the background goes <em>fuzzy</em>.</p>","330770","","119895","","2010-07-11 13:46:43","2010-07-11 13:46:43","How to get an Alertdialog with the background out of focus (fuzzy)","<android><list><background><focus><alertdialog>","1","1","1","",""
"3222968","1","4824805","","2010-07-11 12:01:07","5","832","<p>I would like to make audio records (via <code>MediaRecorder</code>/<code>AudioRecorder</code>) and then play recorded file with some changes (special effects) (e.g. increasing/decreasing speed, adding echo, mix with other predefined audio file, etc)).</p><p>Do you have any suggestions how can I do that? </p><p>Do you have any interesting examples concerned this?</p>","332311","","119895","","2010-07-11 13:47:34","2011-01-28 04:23:23","android, audio filters","<android><audio-recording><microphone>","1","0","2","",""
"3223029","1","3223147","","2010-07-11 12:25:37","6","7547","<p>I have a <code>List&lt;CustomObject&gt;</code> (where <code>CustomObject</code> comes from an external library -- I can't make changes to it). I want to save this in <code>onSaveInstanceState(Bundle)</code>, but I can't seem to do it. Here are the options that I've tried:</p><pre><code>outState.putSerializable(KEY, (ArrayList&lt;CustomObject&gt;) myList); // because myList is instantiated as an ArrayListoutState.putSerializable(KEY, myList.toArray());</code></pre><p>Both options <strong>work</strong> when switching orientation on the phone (yes, <code>onSaveInstanceState</code> is called when switching orientation -- I checked in logcat). However, when the current activity tries to start another one (with <code>startActivity(Intent)</code>), Android pauses the current activity and calls <code>onSaveInstanceState()</code> again. This time, it fails, for some reason unknown to me. The fishy thing is that <code>onSaveInstanceState()</code> executes successfully. The stack trace printed doesn't point to any of my code:</p><pre><code>E/AndroidRuntime(23898): java.lang.RuntimeException: Parcel: unable to marshal value my.custom.Object@5e07e43bE/AndroidRuntime(23898):    at android.os.Parcel.writeValue(Parcel.java:1087)E/AndroidRuntime(23898):    at android.os.Parcel.writeArray(Parcel.java:519)E/AndroidRuntime(23898):    at android.os.Parcel.writeValue(Parcel.java:1072)E/AndroidRuntime(23898):    at android.os.Parcel.writeMapInternal(Parcel.java:469)E/AndroidRuntime(23898):    at android.os.Bundle.writeToParcel(Bundle.java:1445)E/AndroidRuntime(23898):    at android.os.Parcel.writeBundle(Parcel.java:483)E/AndroidRuntime(23898):    at android.app.ActivityManagerProxy.activityPaused(ActivityManagerNative.java:1427)E/AndroidRuntime(23898):    at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3106)E/AndroidRuntime(23898):    at android.app.ActivityThread.access$2400(ActivityThread.java:119)E/AndroidRuntime(23898):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870)E/AndroidRuntime(23898):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(23898):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(23898):    at android.app.ActivityThread.main(ActivityThread.java:4363)E/AndroidRuntime(23898):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(23898):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(23898):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime(23898):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime(23898):    at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Is there any way to store custom objects in the instance state?</p>","180784","","","","","2012-11-26 09:29:18","Save custom object array in instance state","<java><android><serialization>","5","0","4","",""
"3223083","1","4067539","","2010-07-11 12:49:28","2","3100","<p>How do you create a pull out menu as a new <code>Activity</code>.</p><p>Is it possible to have a button that you can pull out as in the Google's built in camcorder app and have that start a new activity?</p><p>Does a button support pull out? If not, what does?</p>","381699","","114066","","2010-11-01 09:40:47","2012-09-15 07:59:25","How to create a pull out menu as a new Activity","<android><layout><slidingdrawer>","2","4","2","",""
"3223211","1","3223245","","2010-07-11 13:31:31","2","709","<p>I am new to Android.</p><p>I wish to know how to design a screen by using java in Android.</p><p>Design via xml and design via java which one is the best?</p>","388870","","119895","","2010-07-11 14:01:00","2012-10-24 19:45:00","How to design a screen in android?","<android>","1","0","","",""
"3223212","1","3223307","","2010-07-11 13:31:36","1","448","<p>How can I find my PreferenceActivity instance, which was created by a framework?</p><p>***</p><p>My first class.</p><pre><code>/** This is MyAppSettings class, The instance of this class will be created by a framework **/public class MyAppSettings extends PreferenceActivity {    protected MySeekBarPreference mSeekBarPref;    @Override    protected void onCreate(Bundle icicle) {        super.onCreate(icicle);        addPreferencesFromResource(R.xml.prefs);        mSeekBarPref = (MySeekBarPreference)super.findPreference(""my_key"");    }}</code></pre><p>***</p><p>My second class.</p><pre><code>public class MySeekBarPreference extends DialogPreference implements SeekBar.OnSeekBarChangeListener {      // in whis code I need to get the instance of the MyAppSettings, which was      // created by Android framework. (I paste a hypothetical func getTheInstanceOfMyAppSettings() :))  private MyAppSettings mAppSettings = getTheInstanceOfMyAppSettings(); </code></pre><p>Can I find it by ID or something else?</p>","384328","","384328","","2010-07-11 14:21:12","2010-07-11 14:21:12","Android PreferenceActivity instance","<android><frameworks><preferenceactivity>","1","1","1","",""
"3223248","1","3223296","","2010-07-11 13:40:06","1","1439","<p>I have a SAXParser with with an XMLReader.</p><pre><code>SAXParserFactory saxPF = SAXParserFactory.newInstance();SAXParser sp = saxPF .newSAXParser();XMLReader xmlR = sp.getXMLReader();MyHandler myHandler = new MyHandler();xmlR .setContentHandler(myHandler );</code></pre><p>My handler code uses startElement and endElement to detect with it's inside a tag. It does this by setting a boolean and using characters() to grab the value</p><pre><code>public void startElement(String namespaceURI,     String localName, String qName, Attributes atts) throws SAXException {    if (localName.equals(""myTag"")) this.in_myTag = true;}public void characters(char ch[], int start, int length) {            if(in_myTag )  { c.setMyTag(new String(ch, start, length));}</code></pre><p>The problem is that I have a tag that is ""A &amp; B Value"" and it's notifying characters() for ""A"" and ""&amp;"" and ""B"" and ""Value"". So the final value of setMyTag is ""Value""</p><pre><code>&lt;myTag&gt;A &amp; B value&lt;/myTag&gt;</code></pre><p><a href=""http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html"" rel=""nofollow"">http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html</a></p>","239774","","","","","2010-07-11 13:56:18","SAXParser problem grabbing tag value with & character","<android><xmlreader><saxparser>","2","0","","",""
"3223306","1","3729339","","2010-07-11 13:59:36","1","463","<p>I work for a cell company, our phones are based Android(SDK 1.5) we have the ability to sign our applications in our phones and give it firmware permissions, like: </p><p>installing an extern application while using PackageManager.(SDK 1.5)</p><p>this is what i did:</p><pre><code> File src = context.getFileStreamPath(fileName); Uri mPackageURI = Uri.parse(src.getAbsolutePath());    PackageManager pm = context.getPackageManager();int installFlags = 0;try {  PackageInfo pi = pm.getPackageInfo(packageName,    PackageManager.GET_UNINSTALLED_PACKAGES);  if (pi != null) {    Log.debug(TAG, TAG + "":replacing  "" + fileName);    installFlags |= PackageManager.REPLACE_EXISTING_PACKAGE;  }} catch (NameNotFoundException e) { }try {    PackageInstallObserver observer = new PackageInstallObserver();    pm.installPackage(mPackageURI, observer, installFlags);} catch (SecurityException e) {  //if the app is not signed by the manufacture it will get here a security exception}class PackageInstallObserver extends IPackageInstallObserver.Stub {  public void packageInstalled(String packageName, int returnCode) {  }}</code></pre><p>Now this is the wierd thing i get:</p><p>Since we are the manfucatures we dont get any exception while execute       pm.installPackage(mPackageURI, observer, installFlags);</p><p>since we have signed our app with admin permissions.</p><p>but what we do get is this crazy result and the phone being RESTARTED.</p><pre><code>threadid=21: thread exiting with uncaught exception (group=0x4000fe70)07-11 16:29:38.493: ERROR/AndroidRuntime(2561): Uncaught handler: thread PackageManager exiting due to uncaught exception07-11 16:29:38.493: ERROR/AndroidRuntime(2561): *** EXCEPTION IN SYSTEM PROCESS.  System will crash.07-11 16:29:38.493: ERROR/AndroidRuntime(2561): java.lang.NullPointerException07-11 16:29:38.493: ERROR/AndroidRuntime(2561):     at com.android.server.PackageManagerService.installPackageLI(PackageManagerService.java:3634)07-11 16:29:38.493: ERROR/AndroidRuntime(2561):     at com.android.server.PackageManagerService.access$1500(PackageManagerService.java:120)07-11 16:29:38.493: ERROR/AndroidRuntime(2561):     at com.android.server.PackageManagerService$5.run(PackageManagerService.java:3253)07-11 16:29:38.493: ERROR/AndroidRuntime(2561):     at android.os.Handler.handleCallback(Handler.java:587)07-11 16:29:38.493: ERROR/AndroidRuntime(2561):     at android.os.Handler.dispatchMessage(Handler.java:92)07-11 16:29:38.493: ERROR/AndroidRuntime(2561):     at android.os.Looper.loop(Looper.java:123)07-11 16:29:38.493: ERROR/AndroidRuntime(2561):     at android.os.HandlerThread.run(HandlerThread.java:60)</code></pre><p><strong>Second way:</strong>Ive also tried this way and I got diffrent exception:</p><p>*very similar to the first way, just the major difference is in this line:</p><pre><code> String src = String.format(""file:///data/data/com.mirs.agentcore/files/%s"", fileName); Uri mPackageURI = Uri.parse(src); PackageManager pm = context.getPackageManager(); String src = String.format(""file:///data/data/com.mirs.agentcore/files/%s"", fileName); Uri mPackageURI = Uri.parse(src); PackageManager pm = context.getPackageManager(); int installFlags = 0;  .... //the rest of the code is the same as the First way(mention above)</code></pre><hr><p>After this code being executed(Second way), the phone continue normally, but I get this exception:</p><p>09-12 12:10:16.484: ERROR/PackageManager(6601): Couldn't copy package file to temp file.</p>","260511","","260511","","2010-09-19 10:06:54","2011-07-15 17:21:21","Error Installing with Admin Permissions","<android>","1","2","","",""
"3223362","1","","","2010-07-11 14:21:07","2","588","<p>I'm using a ViewFlipper with two ListViews. When setting a background drawable on the ViewFlipper, the animation performed when ""flipping"" only renders the foreground, and background is black! When animation is done, the background appears.Is there a known problem with animating the background ""layer"" of a view?</p><p>Also, the animation performance/frame rate on my HTC Hero decreases significantly when adding the background.</p><p>Any ideas or solutions? Thanks!</p><p>/Morten</p>","388895","","","","","2010-08-25 14:38:17","Android ViewFlipper animation does not render background?","<android><animation><viewflipper>","1","0","0","",""
"3223376","1","3223410","","2010-07-11 14:26:28","1","1616","<p>I have a custom class called <code>NoteView</code> that extends <code>FrameLayout</code>.  Previously, I had just been using the stock <code>LinearLayout</code> and have an XML layout built already that I want to reuse by adding that entire hierarchy (with some other overlay views which is why I needed framelayout) to the <code>NoteView</code>.</p><p>The problem is I can't figure out how to inflate the XML and add it to the <code>NoteView</code> from within the <code>NoteView</code> Class.  I can add it after initialization is complete, but I want to be able to be able to inflate that hierarchy and add it automatically when my <code>NoteView</code> is either instantiated or inflated from XML.</p><p>How can I populate my extended <code>FrameLayout</code> with a layout from XML by adding it from within the <code>NoteView</code> class itself?</p>","131871","","119895","","2010-07-11 14:50:02","2013-07-05 15:05:31","How to add layout from xml to Extended FrameLayout Android?","<android><layout><user-interface><views>","1","0","","",""
"3223431","1","","","2010-07-11 14:45:51","2","731","<p>I'm currently involved in an android application whose basic purpose is to upload large media files. What is difference of using HttpClient for uploading large files over using plain sockets in Android ? From what I had researched I found out that in order to send large files to server I need to use 'multipart POST' but it seems it is possible without it as well using plain socket ?</p>","388903","","","","","2010-07-11 15:03:18","Android HttpClient versus plain Socket?","<android><sockets><httpclient>","2","0","","",""
"3223575","1","","","2010-07-11 15:32:01","1","1396","<p>I've encountered a problem with mobile internet connection after phone wake up from sleep mode. There is an application which updates some data periodically. <code>AlarmManager</code> triggers my <code>BroadcastReceiver</code> which starts <code>service</code>. <code>service</code> acquires <code>PARTIAL_WAKE_LOCK</code> and some http requests are sent. Unfortunately when update interval is quite big (5h) <code>service</code> could not send/download anything. Problem doesn't appear when I'm using WIFI connection instead of mobile and <code>WIFI sleep policy</code> is set to <code>never</code>. Everything is OK on mobile connection when update interval is short (less than half an hour). I'm also sure 5h event is received by my <code>BroadcastReceiver</code> because I've checked it. </p><p>How such events should be handled. I've tried to check whether connection is established by <code>ConnectivityManager</code> and retry 5 times if not but still same problem appears.</p><p>Thanks for any answer in advance   </p>","374590","","","","","2010-11-08 15:55:39","android dev: problem with mobile internet connection after phone wake up","<android>","1","0","","",""
"3223607","1","3223739","","2010-07-11 15:42:39","1","421","<p>I'm having a hard time figuring out how to <code>getText()</code> as a readable String from a inflated <code>EditText</code>.</p><p>I have a boolean method that checks something, so, in the onCreate method i call it like this</p><pre><code>if(method) {    if(booleanVariable) {         LayoutInflater factory = LayoutInflater.from(MyActivity.this);         View child = factory.inflate(R.layout.password, null);         mPassword = (EditText)child.findViewById(R.id.password);           }}</code></pre><p>Then thats the part where i try to retrieve the text:</p><pre><code>private View.OnClickListener btnLoginListener = new View.OnClickListener() {        @Overridepublic void onClick(View v) {     if(mPassword!=null) {          if(mPassword.getText().toString()==password) {                    // LOGIN OK            } else {// NOT OK            }     }}</code></pre><p>Result:</p><pre><code>07-11 15:39:53.098: VERBOSE/Project(1239): mPassword: &lt;b&gt;android.widget.EditText@43d3ba98&lt;/b&gt; password: 329349</code></pre>","2443607","","119895","","2010-07-11 17:31:58","2010-07-11 17:31:58","Content of a inflated EditText","<android><context><edittext><inflate>","1","0","","",""
"3223640","1","","","2010-07-11 15:51:12","2","645","<p>I wrote a small application that downloads an mp4 video from the net and after sometime plays it.The video is seen for about 1.5 minutes but after that it freezes surprisingly.Logcat shows:</p><pre><code>07-11 18:35:22.132: ERROR/PlayerDriver(53): Content is truncated.07-11 18:35:22.132: ERROR/MediaPlayer(867): error (1, 31)07-11 18:35:22.132: ERROR/MediaPlayer(867): Error (1,31)</code></pre><p>and that's it.This phenomenon is consistent with any content I play, so I guess the problem is not with the content itself.Does anyone know the nature of this problem?</p><p>Thanks,Eyal</p>","340081","","29407","","2010-07-11 15:51:57","2010-07-11 15:56:07","Problem with playing mp4 video on Android","<android>","0","0","","",""
"3223867","1","3223888","","2010-07-11 16:51:39","2","3467","<p>I have a simple <code>LinearLayout</code> with two Buttons side by side.  They are supposed to slide into and out of view from the right side of the screen when needed.  I have the animation working and the rest of the work is done, but I have one last problem to solve.</p><p>How can I set the <code>LinearLayout</code>'s visibility to <code>View.GONE</code> after the slide out animation is complete?  I need it to disappear once it's of screen.</p>","131871","","","","","2013-05-27 16:46:20","How to hide view when animation done in android?","<android><animation>","2","0","","",""
"3223974","1","","","2010-07-11 17:23:19","7","457","<p>I am based in Germany and publish the ""Last Call Widget"" on the Android Market.  I have been steady improving it over time, but one group of users still complain about it not working on their devices.</p><p>My widget listens for the ""android.intent.action.PHONE_STATE"" intent, and then sets an alarm to update the last call UI in 20 seconds, then 60 seconds, then 5 minutes, 1 hour, etc.  This works reliably on all my test devices, even with aggressive task killers (try it yourself).  Unfortunately I have a cluster of users with Motorola Droids on the Verizon network who complain that the UI does not automatically update.</p><p>I believe Verizon is a CDMA network (we have GSM here in Europe), though the Android API docs don't specify any implementation differences.  This could also be a driver issue on the Motorola Droid (we have GSM Motorola Milestones in Europe).</p><p>I am wondering if anyone reading is in a position to offer any ideas, or test the widget on a Droid and/or CDMA network to see if they can reproduce an issue (with logs)?</p><p>RegardsMark</p>","388967","","","","","2010-07-14 23:42:13","Android: A Verizon Droid puzzle","<android>","1","1","","",""
"3224193","1","","","2010-07-11 18:30:06","79","72669","<p>I'm trying to dynamically create <code>TableRow</code> objects and add them to a <code>TableLayout</code>.The <code>TableRow</code> objects has 2 items, a <code>TextView</code> and a <code>CheckBox</code>. The <code>TextView</code> items need to have their layout weight set to 1 to push the <code>CheckBox</code> items to the far right.</p><p>I can't find documentation on how to programmatically set the layout weight of a <code>TextView</code> item.</p>","388986","","119895","","2012-07-25 23:41:13","2014-02-08 10:33:30","Set the layout weight of a TextView programmatically","<android><layout><textview><weight>","7","0","19","",""
"3224225","1","3224236","","2010-07-11 18:39:46","4","923","<p>Is there a built-in Android icon for ""open"" or ""load""?  I'm making menu items, and I see <code>ic_menu_save</code>, but there's no <code>ic_menu_open</code> nor <code>ic_menu_load</code>.  I guess I could just use <code>ic_menu_add</code>, but that's not quite right.  I;m looking for a little folder or something.  Surely others have needed an open icon?  </p>","85348","","","","","2010-07-11 18:43:52","Android Icon for ""open"" or ""load""","<android><icons>","1","0","","",""
"3224261","1","","","2010-07-11 18:56:44","1","290","<p>How can I extract the following parameters for the field test:</p><p>GPRS attach status, GPRS attach type, PTMSI, MAC mode, andRAU Timer</p><p>From where can I extract these details? I did a lot of search in Framework component and i couldn't find any matching functions.</p>","308131","","308131","","2010-07-12 04:23:55","2010-07-12 04:23:55","Field Test Mode","<android>","0","0","","",""
"3224383","1","3226289","","2010-07-11 19:39:52","1","1072","<p>I'm using opengl es 2.0 on android 2.2. My problem here isn't with the canvas, or creating a fullscreen android view, that I already have figured out.</p><p>I'm wondering how you would set the coordinates of a GL_QUAD, or 2 GL_TRIANGLES to perfectly cover the entire screen, for use as a texturing surface for a 2D game, for example.</p><p>I currently have the gluPerspective set to:</p><pre><code>float ratio = (float) width / height;GLU.gluPerspective( gl, 45.0f, ratio, 1.0f, 100.0f );</code></pre><p>inside onSurfaceChanged, so the width and height variables are the width and height of the screen, respectively.</p><p>next I have the coordinates of the quad as:</p><pre><code>public static final float screenVerts[] = {  -1f, -1f,   1f, -1f,   1f,  1f,  -1f,  1f};</code></pre><p>however the displayed quadrilateral isn't in proportion to the screen, it's simply displayed as a square, with the coordinates apparently being relative to opengl's own geometry, not the screen's height / width.</p><p>how do I make the screenVerts variable, (2D points for the rect that I draw on) to be relative to the screen itself? I.e. 1.0f being 100% of the screen's height in the Y-coordinate of one of the points in the quad.</p><p>And I really do apologize for not phrasing this well, no offense will be taken if I need to explain myself again.</p>","389002","","44729","","2010-07-12 01:57:32","2010-07-12 06:20:54","How to draw fullscreen in android?","<java><android><opengl-es><coordinates><fullscreen>","1","0","","",""
"3224434","1","3224886","","2010-07-11 19:56:12","0","1287","<p>Im posting from my phone so please excuse stupid typos and formatting issues. </p><p>I have an activity which lists saved games that the player can load.  </p><p>I created a simple layout xml file which defines a ScrollView. On load, I grab all the saved games and programatically add a view for each saved game to a vertically oriented LinearLayout child of the ScrollView. </p><p>The view for each game consists of a Horizontally oriented LinearLayout which in turn contains a Button and a vertically oriented LinearLayout.   That LinearLayout in turn contains some TextViews and ImageViews (and one more LinearLayout which I'm ommitting here for the sake of clarity).</p><p>The hierarchy looks something like this (some details omitted).  </p><pre><code> ScrollView      LinearLayout - vertical            Each saved game:           LinearLayout - horizontal                 Button - load game                LinearLayout - vertical                      TextView - game name                     TextView - date string</code></pre><p><strong>My problem:</strong></p><p>I would like the top of the button and the ""game name"" texview to be vertically aligned but the TextView (or maybe it's LinearLayout parent) has some rogue padding on top that I can't get rid of. See screenshot for details. </p><p><img src=""http://i.imgur.com/sTUgE.png"" alt=""alt""></p><p>LoadSaved class:Note: mScrollView is badly named. It refers to the ScrollView's child LinearLayout. </p><pre><code>   public class LoadSaved extends Activity {     public LinearLayout mScrollView;     private MinerDb mDb;      public void onCreate(Bundle b) {              super.onCreate(b);             setContentView(R.layout.loadsaved);             mDb = new MinerDb(this);            mScrollView = (LinearLayout) findViewById(R.id.load_scroll_view);            Bundle[] savedGames = mDb.getSavedGames();            for (int i = 0; i &lt; savedGames.length; i++) {                 Bundle game = savedGames[i];                 final int gameId = game.getInt(""gameId"");                 String name = game.getString(""name"");                 String date = game.getString(""date"");                 Bundle player = game.getBundle(""player"");                 int playerMoney = player.getInt(""money"");                 int playerHealth = player.getInt(""health"");                 LinearLayout gameContainer = new LinearLayout(getApplicationContext());                 gameContainer.setPadding(5, 5, 5, 5);                 gameContainer.setGravity(Gravity.TOP);                 gameContainer.setOrientation(LinearLayout.HORIZONTAL);                 gameContainer.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));                 Button loadButton = new Button(getApplicationContext());                 loadButton.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));                 loadButton.setText(""Load"");                 LinearLayout gameInfo = new LinearLayout(getApplicationContext());                 gameInfo.setOrientation(LinearLayout.VERTICAL);                 gameInfo.setPadding(10,0,10,10);                 gameInfo.setGravity(Gravity.TOP);                 gameInfo.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));                 TextView nameView = new TextView(getApplicationContext());                 nameView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));                 nameView.setGravity(Gravity.TOP);                 nameView.setText(name);                 TextView dateView = new TextView(getApplicationContext());                 dateView.setPadding(5,0,0,0);                 dateView.setGravity(Gravity.TOP);                 dateView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));                 dateView.setText(date);                 LinearLayout playerView = new LinearLayout(getApplicationContext());                 playerView.setOrientation(LinearLayout.HORIZONTAL);                 playerView.setPadding(5,0,0,0);                 playerView.setGravity(Gravity.TOP);                 playerView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));                 TextView playerMoneyView = new TextView(getApplicationContext());                 playerMoneyView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));                 playerMoneyView.setPadding(0,0,10,0);                 playerMoneyView.setTextColor(Color.GREEN);                 playerMoneyView.setText(""$"" + playerMoney);                TextView playerHealthView = new TextView(getApplicationContext());                playerHealthView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));                playerHealthView.setPadding(0,0,10,0);                playerHealthView.setTextColor(Color.RED);                playerHealthView.setText(playerHealth + ""%"");                playerView.addView(playerMoneyView);                playerView.addView(playerHealthView);                gameInfo.addView(nameView);                gameInfo.addView(dateView);                gameInfo.addView(playerView);                gameContainer.addView(loadButton);                gameContainer.addView(gameInfo);                mScrollView.addView(gameContainer);                loadButton.setOnClickListener(new OnClickListener() {                      public void onClick(View v) {                           Log.e(""LoadSaved"", ""LoadSaved::onCreate: Clicking: "" + gameId);                           Intent loadGameIntent = new Intent(LoadSaved.this, Miner.class);                           loadGameIntent.putExtra(""load_game"", gameId);                           startActivity(loadGameIntent);                           finish();                      }                 });            }       }  }</code></pre><p>loadsaved.xml                                  </p><pre><code>           &lt;LinearLayout                android:orientation=""vertical""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:id=""@+id/load_scroll_view"" /&gt;       &lt;/ScrollView&gt;  &lt;/LinearLayout&gt;</code></pre>","1742702","","1742702","","2010-07-11 20:20:03","2010-07-11 22:33:18","Problems vertically aligning a Button and horizontally oriented LinearLayout within a vertcally oriented LinearLayout","<android><user-interface><vertical-alignment>","3","0","","",""
"3224449","1","3234720","","2010-07-11 20:03:24","3","5333","<p>I am trying to build the bitmap-plasma sample that is included with the ndk, but getting an error.  I run ndk-build from the samples/bitmap-plasma directory, and the error it displays is that it cannnot locate android/bitmap.h file.</p><p>How do i direct the ndk-build script to the file it needs?</p><p>Using android-ndk-r4 on Ubuntu Lucid 10.04</p>","251068","","251068","","2010-07-12 16:46:30","2011-03-02 20:09:24","How to build Android NDK sample: ""bitmap-plasma""","<android><bitmap><android-ndk><sample>","2","0","1","",""
"3224507","1","","","2010-07-11 20:23:58","6","4845","<p>AppBrain has a fantastic new app that lets you automatically install applications on your phone using your web browser. Similar to the Chrome push. In their case, they are using it to let you install apps without a prompt directly on the phone. Engadget has a good video demonstrating their system.</p><p><a href=""http://lifehacker.com/5582169/appbrain-upgrade-installs-android-apps-instantly-from-the-web"">http://lifehacker.com/5582169/appbrain-upgrade-installs-android-apps-instantly-from-the-web</a></p><p>My question is: What mechanism are they using to avoid asking for a prompt on the phone and to do the installation directly?</p><p>The reason I'm asking is that have a couple hundred android phones that run some custom software, the users have to manually update the software by clicking through the install process. And ideally I'd prefer to be able to do push updates without having to prompt people (in exchange for a free phone+service you have to run the software, so 'you shouldn't do that' doesn't invalidate the question of how do you do that). The biggest problems are that if you're doing rapid development/testing it's a pain to get everyone up to the right versions and it's hassle for people.</p><p>What AppBrian does sounds like a perfect fix to this problem, but how does it work? The only permission the AppBrain fast installer asks for is access to your accounts and network access. Now, there was the interesting development about Jon Oberheide's REMOVE_ASSET and INSTALL_ASSET which he says uses the GTalk service to imitate prompt-less installs. The interesting this is that AppBrian's FastWeb installer works on a 2.01 Droid but does not work on a 2.2 Nexus One (maybe one of the last round of Froyo updates disables AppBrain's access to the INSTALL_ASSET intent).<a href=""http://jon.oberheide.org/blog/2010/06/25/remote-kill-and-install-on-google-android/"">http://jon.oberheide.org/blog/2010/06/25/remote-kill-and-install-on-google-android/</a></p><p>Can anyone shed any light on this? I know auto update is coming for the Market but I'm not sure if this would be a usable workaround. I'm fine with saying 'you need to click to install this once', but having hundreds of people waste their time clicking 'ok' is a waste.</p><p>I personally think that this is something Google should support for Enterprise users in the future with the Device Administrator features. If I went with Android and could easily stage and keep people up to date with apps it wold be pretty useful.</p>","306093","","306093","","2010-07-13 17:33:23","2012-06-29 17:34:53","How does AppBrain's installation app work?","<android><security><installer><google-talk>","1","2","9","",""
"3224541","1","3224660","","2010-07-11 20:34:23","0","613","<p>I'm working on an Android widget that will show the current network state (i.e 1xRTT, EvDo Rev. A, WiMax, etc.). It may seem like a pointless idea, but for whatever the reason, the Evo doesn't differentiate between 1x &amp; EvDo, it just says 3G for both, which is annoying if you're in a fringe 3G area.</p><p>Anyways, to the point: I have the widget complete and it updates with the current network just fine, but how can I make it update whenever the connection changes? I know I can use a BroadcastReceiver to catch the ConnectivityManager.CONNECTIVITY_ACTION intent the system sends on a connection change. How can I update the widget from there?</p><p>Or can I use the AppWidgetProvider to catch the intent and then update?</p><p>I know how to catch the intent, I just don't know how to update the widget once I do.</p>","389032","","23897","","2012-06-24 23:18:32","2012-06-24 23:18:32","Update Widget on System Broadcast Intent","<android><android-widget><android-intent>","1","0","","",""
"3224570","1","","","2010-07-11 20:46:56","0","316","<p>So every time I run this code my Android app stops unexpectdly, and i dont get why...</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;import android.widget.Button;import android.widget.TextView;public class TheStupidTest extends Activity {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final TextView text1 = (TextView) findViewById(R.id.TextView01);    text1.setText(""well this works at least"");    Button yButton = (Button) findViewById(R.id.button_yellow);    yButton.setOnTouchListener(new OnTouchListener() {        @Override        public boolean onTouch(View v, MotionEvent event) {            if ( event.equals(MotionEvent.ACTION_UP) ) {                 text1.setText(""You pressed the yellow button"");                 return true;             }             return false;        }    });    } }</code></pre>","389037","","","","","2010-12-02 12:45:33","Android app always stops unexpectedly, trying to do event handler?","<java><android><events><handler>","2","3","","",""
"3224857","1","","","2010-07-11 22:25:35","15","3442","<p>I was wondering if its possible to save master and detail records to a content provider using the android.content.ContentResolver.applyBatch() method in the same operation where subsequent ContentProviderOperation items in the providers parameter depend on the result of previous items.</p><p>The problem I'm having is that the actual Uri isn't known at the time that the ContentProviderOperation.newInsert(Uri) method is called and the Uri is immutable.</p><p>What I have come up with is shown below:</p><p><P>Master Uri: content://com.foobar.masterdetail/master<br/>Detail Uri: content://com.foobar.masterdetail/master/#/detail<br/></p></p><pre><code>ArrayList&lt;ContentProviderOperation&gt; operations = new ArrayList&lt;ContentProviderOperation&gt;();operations.add(ContentProviderOperation.newInsert(intent.getData())    .withValue(Master.NAME, """")    .withValue(Master.VALUE, """")    .build());operations.add(ContentProviderOperation.newInsert(intent.getData()        .buildUpon()        .appendPath(""#"") /* ACTUAL VALUE NOT KNOWN UNTIL MASTER ROW IS SAVED */        .appendPath(""detail"")        .build())    .withValue(Detail.MASTER_ID, /* WHAT GOES HERE? */)    .withValue(Detail.NAME, """")    .withValue(Detail.VALUE, """")    .build());ContentProviderResult[] results = this.getContentResolver().applyBatch(MasterDetail.AUTHORITY, operations);for (ContentProviderResult result : results) {    Uri test = result.uri;}</code></pre><p>In my content provider, I am overriding the applyBatch() method in order to wrap the operation in a transaction.</p><p>Is this possible or is there a better way to do this?</p><p>Thanks.</p>","376859","","180740","","2011-08-29 00:01:13","2011-08-29 00:01:13","Master-detail Using ContentResolver.applyBatch()?","<android><android-contentprovider>","1","0","7","",""
"3224936","1","3225077","","2010-07-11 22:48:31","0","457","<p>Im trying to send a List to next activity the list </p><p>List mGF = new ArrayList();</p><p>i cant figur it out...  i have read and try for days...</p><p>Intent i = new Intent(mContext, ViewImages.class);i.put....? (mGF);</p><p>How do i send and how do i get it as mGF in the next activity</p><p>hope you understand</p>","389080","","","","","2010-07-11 23:40:27","Send List to new activity","<android><activity><android-intent>","1","0","","",""
"3224986","1","","","2010-07-11 23:08:10","2","1166","<p>I need to create an app that takes a MS word document and lets the user of the app interact with the pages meaning viewing each page separately, zooming, going forward and backward.  </p>","389076","","","","","2010-07-11 23:38:00","Upload and display a MS word Document in Android","<java><android><ms-word>","1","2","","",""
"3225047","1","","","2010-07-11 23:30:39","1","773","<p>I'm trying to write a painting app for a mobile device (Android) that will have a bit more functionality than MS Paint (e.g. various brushes and brush settings, selections, layers)  but won't be as complex as Photoshop. I need my app to have a decent undo/redo feature. Unlimited undo/redo is probably not possible. I'd be happy with being able to undo about the last minute worth of user actions (maybe about 20 actions).</p><p>The main approaches I know of for undo/redo is:</p><ol><li><p>save the whole state or just the bits that changed after each operation. Undoing involves updating the state by restoring snapshots. Pros: simple to implement Cons: memory intensive.</p></li><li><p>use the command pattern where each command has a ""do action"" and ""undo action"" method. To undo, you just call the undo action of the previous commands. Pros: memory efficient, Cons: much more complex to implement.</p></li></ol><p>My pathological undo/redo scenarios I have to consider is:</p><ul><li><p>the user paints over the whole canvas in one go, where you would want this whole operation to be undone when the user clicks undo. With option 1, we'd need to store a bitmap the size of the whole canvas.</p></li><li><p>the user draws something, imports image 1.jpg onto the canvas, does some more drawing, 1.jpg is then deleted/modified at some point by another application and then the user wants to undo then redo all their actions in the paint application. I'm really not sure how to undo correctly here without saving a copy of any imported image while it's on the undo stack.</p></li></ul><p>Can anyone give any recommendations about how best to implement undo/redo on a mobile device where memory and processor speed are low? I like the simplicity of 1 and 3 but it seems like the only realistic option is 2. I'm not sure how to cope with my second pathological example with this option though.</p>","369917","","369917","","2010-07-11 23:42:10","2010-07-12 15:42:59","Efficient undo/redo for Photoshop-like mobile app","<java><iphone><android><gui>","2","3","1","",""
"3225092","1","5474667","","2010-07-11 23:44:14","20","11380","<p>I have a list of events which are seperated by month and year (Jun 2010, Jul 2010 etc.). I have enabled fast scrolling because the list is really long. I've also implemented SectionIndexer so that people can see what month and year they are currently viewing when scrolling down the list of events at speed.</p><p>I don't have any problem with the implementation, just how the information is shown. Fast scrolling with SectionIndexer seems to only really be able to support a label with a single letter. If the list was alphabetised this would be perfect, however I want it to display a bit more text.</p><p>If you look at the screenshot bellow you'll see the problem I'm having.</p><p><img src=""http://blog.matto1990.com/wp-content/uploads/2010/07/dispay_problem.png"" alt=""A screenshot of the problem described""></p><p>What I want to know is: is it possible to change how the text in the centre of the screen is displayed. Can I change it somehow to make it look right (with the background covering all of the text).</p><p>Thanks in advance. If you need any clarification, or code just ask.</p>","99582","","","","","2012-03-16 10:22:23","Fast Scroll display problem with ListAdapter and SectionIndexer","<android><listview>","2","1","22","",""
"3225317","1","3225322","","2010-07-12 01:11:23","1","166","<p>I've been assigned to create an RESTful Android application for an existing web service which is built using Django.</p><p>My current design idea is to have the Android application receive a JSON version of the data that would normally be sent to the Django template on each url. So my view would look like:</p><pre><code>#The site stores and organizes user's medical experiences by allowing search of # what treatments have been effective for a particular conditiontreatment_for_condition = {'treatment' : treatment, 'condition' : condition}if send_as_json :     return HttpResponse(json.dumps(treatment_for_condition),mimetype='application/json')else:     t = loader.get_template('results.html')     return HttpResponse(t.render(treatment_for_condition))</code></pre><p>Is there an elegant way to set the ""send_as_json"" variable? I'm considering the two following strategies:</p><p>1) Adding a qualifier to the end of all URLs so that    /condition/treatment/ will return a webpage    and    /condition/treatment/?json=true will return a JSON object</p><p>2) Creating a subdomain json.treatmentreport.com that will set the ""send_as_json"" variable to true, then dispatch to the same view as if it were in the www domain.</p><p>Can either of these solutions be implemented elegantly? Or am I going about this completely the wrong way?</p>","377142","","","","","2010-07-12 01:13:54","What is an elegant way to create application access URLs for an existing web application?","<android><django><json>","1","0","","",""
"3225318","1","3225360","","2010-07-12 01:11:42","4","2907","<p><strong>What I'm trying to accomplish:</strong> When the user clicks a specific RadioButton, a TextView should appear immediately below the selected RadioButton.</p><p><strong>My solution so far:</strong> Code-wise, put a TextView inside of the RadioGroup and set it's initial visibility to ""invisible"". Then, when a specific RadioButton is clicked, set the hidden TextView's visibility to ""visible"". When the RadioButton is unselected, hide the TextView. Setting the TextView's visiblity is done within an Activity class I've defined.</p><p>So, in my example XML code below, when ""radio_button_one"" is selected, ""my_sometimes_hidden_textview"" should appear. Conversely, when ""radio_button_one"" is deselected (or not selected), ""my_sometimes_hidden_textview"" should have it's visibility set to ""invisible"".</p><p><strong>Question:</strong> Is putting the TextView inside of the RadioGroup valid (or, good practice)?  If not, is there a better way to do what I'm trying to accomplish? I'm relatively new to Android development, so if there is something in the official Android documentation that I missed please point me to it. Thanks for the insight in advance.</p><h2>main.xml</h2><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:background=""#FFFFFF""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TextView        android:id=""@+id/my_always_visible_textview""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:text=""This textview is always visible"" /&gt;    &lt;RadioGroup        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""vertical""        android:padding=""10px""&gt;        &lt;RadioButton            android:id=""@+id/radio_button_one""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Radio Button 1"" /&gt;        &lt;TextView            android:id=""@+id/my_sometimes_hidden_textview""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""This should only appear when radio_button_one is selected"" /&gt;        &lt;RadioButton            android:id=""@+id/radio_button_two""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Radio Button 2"" /&gt;    &lt;/RadioGroup&gt;&lt;/LinearLayout&gt;</code></pre><hr><p>Thank you for the replies, CommonsWare and Macarse.</p><p>CommonsWare: Thanks for clarifying that a RadioGroup is a type of LinearLayout. My instincts fought against adding the TextView because most RadioGroup examples I've come across to date don't show elements other than RadioButtons present. Hence, I thought that only RadioButtons should go in RadioGroups.</p><p>Macarse:</p><ol><li><p>I tried placing the TextView outside of the RadioGroup, just as you described. Your solution does work, so long as a programmer doesn't need the TextArea to appear immediately below a specific RadioButton. I haven't been able to figure out how to position the TextArea immediately below the specific RadioButton without explicitly placing the TextView inside of the RadioGroup.</p></li><li><p>Thanks for the ViewStub link. In fact, this may be the best way to accomplish what I'm trying to do overall. Along with the TextView I talked about in my question, I also wanted to add a button to appear next to the TextView only when a specific RadioButton was selected.</p></li></ol>","391931","","1288","","2011-09-30 03:41:41","2011-09-30 03:41:41","It's possible to put a TextView inside of a RadioGroup. But, is it good practice?","<android><radio-button>","2","0","1","",""
"3225380","1","3225577","","2010-07-12 01:39:24","0","152","<p>I have a listview in alphabetic order and as the user scrolls i want a way to see the first letter.Like a phone catalog.</p>","348058","","","","","2010-07-12 03:15:17","is there a default way to make the first letter of the contents appear (eg as a hover) android","<android>","2","0","","",""
"3225622","1","3228004","","2010-07-12 03:03:38","1","1329","<p>An app I'm working on can't meaningfully launch until it has a Location from somewhere -- coarse, fine, it doesn't matter. It just needs one that isn't null. So, my Activity class is doing something along the lines of the following:</p><p>onCreate(): </p><ul><li>instantiate LocationManager</li><li>create Map so I can keep track of all the LocationListener objects for which I've requested updates.</li></ul><p>onResume():</p><ul><li>Grab List of enabled LocationProviders from LocationManager</li><li>Iterate through list. For each one, check whether there's already a LocationListener in the Map. If not, create a new one, register it for updates, and stick it in the Map.</li><li>Render the View</li><li>implicitly return from onResume(). I'm ashamed to admit it, but I have absolutely no idea what happens to the Thread at this point.</li></ul><p>(in the meantime)</p><p>... LocationManager.onLocationChanged(Location) gets called. The original plan was to use my LocationManager's reference to the Activity object to call a method whose purpose was to update the view to reflect the new status. Apparently, that's not allowed by Android.</p><p>... the user clicks a button associated with one of the LocationProvider updates, and the program proceeds to finish launching, or the user gets tired of waiting, clicks cancel, and the program quits since there's nothing meaningful it can do without a location.</p><p>So... </p><ol><li><p>What IS the proper way to have the main UI Thread(?) wait until another thread calls onLocationChanged() with the updated values, update the UI, then proceed to launch the next Activity's intent or call finish() depending on whether the user clicks a button associated with a Location or clicks cancel?</p></li><li><p>What happens if you request updates from a LocationProvider and pass it a LocationListener that's already registered to receive updates? Does it just replace the previous time and distance args with the new ones, or will it create TWO entries in the subscriber list, and call the LocationListener TWICE the next time the location updates?</p></li><li><p>What happens if a the app nullifies all of its references to a LocationListener while it's still registered for updates? Does it live on, Zombie-like, thanks to a reference by the LocationProvider? Or does the LocationProvider use WeakReferences for everything, so old, forgotten-about LocationListeners will just fall out of scope and be garbage-collected?</p></li><li><p>If the LocationListener-implementing class has a reference to the LocationManager, is the Thread that calls its onLocationChanged() method allowed to use it to change the current LocationListener's subscription terms? Or will that blow up with an angry warning, just like the attempt to update the View from a Thread of the wrong type?</p></li></ol>","388603","","","","","2010-07-12 11:21:20","How to update View in response to LocationListener.onLocationChanged()?","<android>","1","7","","",""
"3225642","1","3226392","","2010-07-12 03:09:23","0","622","<p>I'm doing what seems like simple math in an android app, however I keep getting massive rounding errors. For example.</p><p>Float.toString(0.4*0.4*12.5);</p><p>I would expect to get 2 as the result of the above equation. However I get 2.0000002</p>","389152","","","","","2010-07-12 06:48:48","How to avoid rounding errors in Android app devlopment?","<android>","3","0","","",""
"3225673","1","3225702","","2010-07-12 03:25:52","1","4398","<p>All the examples that I have read have only went over how to create one Activity based apps that allow for listing items and none of them have talked about how to drill down into a selected list item to perform various CRUD operations.</p><p>So my question is what is the best practice for this?  Is it to set an id value in the intent (I haven't seen any examples do this) or should a ContentProvider be created and used?</p><p>If anyone knows of any good tutorials that would answer this question please let me know.</p>","26849","","","","","2010-07-12 03:33:46","How do you do simple CRUD in Android?","<android>","1","0","","",""
"3225696","1","3227935","","2010-07-12 03:31:50","5","5190","<p>I've an app where I wish to update the Activity (List activity to be precise) only when the activity from Service is in foreground (Active)</p><p>I can use ListActivity Intent but the problem is this brings up activity even when its in background. </p><p>I also considered using registerDataSetObserver on ListAdapter but that mandates that cursor should be updated. Updating the Cursor from external service may not be feasible.</p><p>Do we have a generic solution to this ?</p>","389161","","389161","","2010-07-12 03:49:19","2013-11-02 08:21:29","Refreshing an Activity from service when Active","<android>","2","0","3","",""
"3225714","1","","","2010-07-12 03:37:53","0","190","<p>I've extended the LinearLayout class into a subclass that inflates the resource xml and holds some custom button logic.  According to <a href=""http://developer.android.com/guide/topics/ui/custom-components.html"" rel=""nofollow"">Building Custom Components</a> I now can use it in place of Linear Layout. </p><p>Question is:  How do I use this class to set my view in my activity?  I've tried using  in the main.xml but that didn't work.</p>","389162","","72882","","2012-12-18 12:48:52","2012-12-18 12:48:52","How to use a custom control once it has been extended","<android>","0","2","1","",""
"3225763","1","3230103","","2010-07-12 03:50:46","1","2429","<p>I am trying to record video to an external SD card. However, everytime I try and acutally record the data -- I always get a java.io.FileNotFound exception. I was wondering if anyone knew of any tutorials or could help correct my code.</p><p>Here is the class in which tries to record video </p><pre><code>public class VideoActivity extends Activity {private SurfaceView preview;private SurfaceHolder previewHolder;private String locationName;private String filepath;private File video;public void onCreate(Bundle videocawk) {    super.onCreate(videocawk);    setContentView(R.layout.video_layout);    setSurface();    locationName = getIntent().getStringExtra(""locationName"");    filepath = getFilePath(locationName);    try {        MediaRecorder r = getMediaRecorder(filepath, previewHolder                .getSurface());        setSurfaceCallback(preview,r);        setButtonListeners(r);    } catch (IllegalStateException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }}private String getFilePath(String locName) {    String dir = Environment.getExternalStorageDirectory().getAbsolutePath();    String add = ""/test/data/video/"";    String name = locName + ""--1"";    String total = dir + add + name;    video = new File(total);    return total;}private void setSurface() {    preview = (SurfaceView) findViewById(R.id.preview);    previewHolder = preview.getHolder();    previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);}private void setButtonListeners(final MediaRecorder r) {    Button start = (Button) findViewById(R.id.start_video);    Button end = (Button) findViewById(R.id.stop_video);    start.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            startRecording(r);        }    });    end.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            stopRecording(r);            setPassPrefs();            startActivity(setPassPrefs());            finish();        }    });}private void setSurfaceCallback(SurfaceView s, final MediaRecorder r){SurfaceHolder.Callback surfaceCallback = new SurfaceHolder.Callback() {    public void surfaceCreated(SurfaceHolder holder) {        try {            r.setPreviewDisplay(previewHolder.getSurface());        } catch (Throwable t) {            Log.e(""PictureDemo-surfaceCallback"",                    ""Exception in setPreviewDisplay()"", t);            Toast.makeText(VideoActivity.this, t.getMessage(),                    Toast.LENGTH_LONG).show();        }    }    public void surfaceChanged(SurfaceHolder holder, int format, int width,            int height) {    }    public void surfaceDestroyed(SurfaceHolder holder) {        r.stop();        r.release();    }};previewHolder.addCallback(surfaceCallback); }private Intent setPassPrefs() {    AttachedImageAdapter adapter = new AttachedImageAdapter(locationName,            VideoActivity.this);    adapter.setVideoPath(filepath);    Intent i = new Intent(VideoActivity.this, EnterTag.class);    i.putExtras(getIntent());    return i;}private void startRecording(MediaRecorder r) {    r.start();}private void stopRecording(MediaRecorder r) {    r.stop();}private MediaRecorder getMediaRecorder(String filepath, Surface s)        throws IllegalStateException, IOException {    MediaRecorder m_recorder = new MediaRecorder();    m_recorder.setPreviewDisplay(s);    m_recorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);    m_recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);    m_recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);    m_recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);    m_recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);    m_recorder.setMaxDuration(20000); // length of video in MS    m_recorder.setVideoSize(320, 240);    m_recorder.setVideoFrameRate(15);    m_recorder.setOutputFile(video.getPath());    m_recorder.prepare();    return m_recorder;}</code></pre><p>}</p><p>Any help would be appreciated -- and thanks again in advance. Also, here is a <a href=""http://pastebin.com/CR01YrCu"" rel=""nofollow"">pastebin</a> that has the layout that the video activity references. </p><p><a href=""http://pastebin.com/mKqkjvJA"" rel=""nofollow"">Here</a> is the PasteBin of my error log -- if it helps. </p>","354247","","354247","","2010-07-12 05:11:14","2010-08-24 14:43:38","Record Video to External SD Card on Android","<android><video-capture>","1","3","1","",""
"3225889","1","3226233","","2010-07-12 04:33:04","37","34690","<p>When calling <code>progressDialog = ProgressDialog.show(this, null, null, true);</code> usually the developers wants to only show the progress indication image, and usually would it expect to be centered within the window (at least from regular UI design point of view).But the image is too far left, it seems that some padding/margin on the right hand side is still being calculated in for (optional) text on the right, although we're not passing any text as parameter.It would just make life little easier for a developer :) So we don't need to create a custom dialog only in order to have the progress indicator being centered by default.</p><p>(I filed this as a feature request at <a href=""http://code.google.com/p/android/issues/detail?id=9697"">http://code.google.com/p/android/issues/detail?id=9697</a>; please star it if you would also like to see this improved).</p><p><img src=""http://img340.imageshack.us/img340/2218/progressindicator.png"" alt=""alt text""></p><p>Now my questions:</p><ol><li><p>How can I easily center the progress image without having to entirely create my own custom alert dialog class? Any parameter I might have overlooked?</p></li><li><p>Furthermore, how to set the background to transparent? In a way like the NewsRob app is doing it (see screenshot):</p></li></ol><p><img src=""http://img59.imageshack.us/img59/517/newsrobprogress.png"" alt=""alt text""></p><p>I'm also wondering about this: <a href=""http://stackoverflow.com/questions/2866141/how-to-put-custom-animation-into-a-progressdialog"">http://stackoverflow.com/questions/2866141/how-to-put-custom-animation-into-a-progressdialog</a>I haven't actually tried it myself yet but if you cannot create custom animations, it means if you want a kind of animated progress indicator, you always need to extend the ProgressDialog class?Looking at the ProgressDialog class though, I don't find anything other than regular drawables though (<a href=""http://www.netmite.com/android/mydroid/frameworks/base/core/java/android/app/ProgressDialog.java"">ProgressDialog.java</a>), they're not using AnimatedDrawable there.</p>","241475","","3265095","","2014-03-06 07:24:43","2014-03-06 07:24:43","How to center progress indicator in ProgressDialog easily (when no title/text passed along)","<android><progressdialog>","6","0","55","",""
"3226023","1","3226102","","2010-07-12 05:15:58","0","2391","<p>What algorithm or technique should I use to make an object follow the path that the user's drawing on the screen? </p>","377717","","21234","","2010-12-08 11:01:36","2011-07-17 20:04:40","move an object follow a user-defined path on Android","<android><algorithm><graphics><path>","2","0","","",""
"3226055","1","","","2010-07-12 05:25:13","4","1464","<p>I am a new fish in Android development. While reading books and Android source code I found out that there so many inner classes in the Android application. Why does Android need so many inner classes?</p><p>I am confused by these inner classes.</p>","389204","","63550","","2010-08-06 11:13:28","2012-12-03 12:42:11","Why so many inner classes in Android?","<java><android>","5","2","","",""
"3226135","1","3226281","","2010-07-12 05:50:04","7","22904","<p>Does Android have a UDID like IPhone? If yes, is there a way I can get it programatically?</p><p>ThanksChris</p>","321927","","","","","2012-08-23 18:56:42","Android UDID like IPhone?","<iphone><android><udid>","4","1","4","",""
"3226179","1","3226219","","2010-07-12 05:58:48","0","335","<p>Does the Android Application Development comes under the J2ME programming or is it totally/partially different?</p><p>Please do let me know if anybody has a clear idea.</p>","384176","","708312","","2012-05-24 08:28:54","2012-11-06 18:54:25","Android development","<android>","2","0","","",""
"3226185","1","","","2010-07-12 06:00:38","0","1162","<p>Whenever I need to connected to wifi accesspoint.It will take time and some times gives unsuccessfull 0r disconnected state.But i need to connect Wifi immediatly within seconds.Every time I disconnect or disable wifi using WifiManager.disconnect() or wifiManager.setWifiEnabled(false) then all Accesspoints are dissappear from wifiSettings screen.Again whenever enable the network it scans all accesspoints,configured networks and wifiManager shows to me while connecting the network 'obtaining the IP adress of network and after obtaining the ip address it tries to connect.So here getting late to connect the Wifi.Is there any alternative to remedy this problem please give me response ASAP?</p>","362544","","","","","2012-07-21 16:35:00","how to overcome delay in Wifi Connection android programmatically?","<android><wifi>","1","2","","",""
"3226206","1","3234490","","2010-07-12 06:04:03","3","11924","<p>I want to have a button that has an image on top and some text on bottom. Both the image and text are decided during runtime, so I want to be able to combine ImageButton's setImageBitmap and Button's setText for each button. </p><p>Any ideas?</p><p>ThanksChris</p>","321927","","","","","2013-11-11 11:26:55","Android ImageButton with Image and Text","<android><image><text><button><imagebutton>","4","3","1","",""
"3226357","1","3226387","","2010-07-12 06:36:44","3","7233","<p>I have a series of ImageButtons horizontally laid out in a LinearLayout. When I do a setBackgroundColor to GREEN, these ImageButtons all become GREEN rectangles, all connected that look like one single bar. Is there a way I can specify a border between these buttons, so I know where one button starts and where it ends?</p>","321927","","114066","","2010-07-30 07:12:20","2010-07-30 07:20:45","Android ImageButton border?","<android><background><border><imagebutton>","2","4","","",""
"3226439","1","3227166","","2010-07-12 06:58:15","0","113","<p>I can load a list with the following code</p><pre><code>String[] projection = new String[] {    Audio.Media._ID,    Audio.Media.DATA,    Audio.Media.DISPLAY_NAME};        audioCursor = this.managedQuery(Audio.Media.EXTERNAL_CONTENT_URI,             projection, null, null, Audio.Media.DISPLAY_NAME + "" ASC"");        startManagingCursor(audioCursor);        String[] columnsToMap = new String[] {Audio.Media.DISPLAY_NAME};        int[] mapTo = new int[] {R.id.text1};        ListAdapter mAdapter = new SimpleCursorAdapter(this,             R.layout.song_item , audioCursor, columnsToMap, mapTo);        this.setListAdapter(mAdapter);</code></pre><p>and in the onListItemClick I can get the file name like this</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {    String DisplayName;    DisplayName =(String) ((TextView) v).getText(); // get name to compare    Toast.makeText(this,DisplayName, Toast.LENGTH_SHORT).show();</code></pre><p>but what I need is the original Audio.Media._ID number from the top.  How can retrieve this number from the onListItemClick?</p>","293565","","","","","2010-07-12 09:19:43","Need to get the ID of audiofile in android","<android><listadapter>","1","0","","",""
"3226467","1","","","2010-07-12 07:07:27","5","584","<p>I tried posting this on the Android Developers list and didn't hear anything - maybe some of you have insight into this!</p><p>I'm working on an app that should have the ability to disable incoming calls for a user-specified period of time.  It should work much the way a ""DND"" (do not disturb) button works on an office phone.</p><p>I've looked over the SDK, and I can't find any way to send phone calls to voicemail or disable the big incoming call screen without putting the phone in airplane mode.  That would be OK if I could keep Bluetooth enabled.  (I'd like the user to be able to listen to music via a Bluetooth headset while phone calls are blocked.)</p><p>In summary, any of the following would work if I could do them from my app:</p><ol><li>Programmatically send all calls to voicemail (like a ""DND"" button) this would be ideal since it would still be in the call log at the end of the ""do not disturb"" time.</li><li>Intercept the incoming call in my app and bounce it.</li><li>Disable all radios but Bluetooth and Wi-Fi - This has the disadvantage of losing the call log.</li><li>Prevent the built-in phone call app from displaying its incoming call screen (I can disable the ringer and vibration) even though the call is received</li></ol><p>Is any of these possible?  Or maybe another approach I haven't thought of?</p><p>Just a side note: For Android phones to be the best possible productivity tool, it should be possible to use a device for email/Internet/apps without receiving constant interruptions from calls. Humans have a significant context-switch time.</p>","389243","","1606729","","2013-02-23 19:26:25","2013-02-23 19:26:25","Can I block incoming calls without disabling Bluetooth - i.e., DND (do not disturb) mode - on Android","<android>","1","2","","",""
"3226495","1","3226743","","2010-07-12 07:13:31","73","115358","<p>I have an application where on the home page I have buttons for navigation through the application.</p><p>On that page I have a button ""EXIT"" which when clicked should take the user to the home screen on the phone where the application icon is.</p><p>How can I do that?</p>","379749","","703019","","2012-03-11 06:26:26","2014-04-10 09:10:24","android - exit application code","<android><exit><back-button>","14","0","36","",""
"3226617","1","3226844","","2010-07-12 07:37:46","1","557","<p>how could I change my custom webview font size ? </p><pre><code>    String summary = ""&lt;html&gt;&lt;body&gt;You scored &lt;b&gt;192&lt;/b&gt; points.&lt;/body&gt;&lt;/html&gt;"";    webView.loadData(summary, ""text/html"", ""utf-8"");</code></pre><p>I want to control the font(text) size of that string summary at webview. </p><p>Can I control with <code>addJavascriptInterface  (Object  obj, String  interfaceName)</code> ?</p>","2438460","","","","","2010-07-12 08:21:54","android webkit change font size?","<android><android-webview>","1","0","0","",""
"3226618","1","","","2010-07-12 07:37:57","0","350","<p>i want to check if my application ""ABC"" is currently running in my phone memory or not</p><p>any one guide me how to achieve this?</p><p>any help would be appreciated.</p>","249991","","","","","2010-07-12 07:42:12","how to check my application running in memory or not?","<android>","1","0","1","",""
"3226710","1","3231402","","2010-07-12 07:57:01","3","1591","<p>So I have a submenu that I have for an options menu item. I want a list of checkable entries that the user can select/deselect as many as they want. The only problem I can't solve is how to prevent the option menu from closing when one of the checkboxes is clicked. I saw the performShortcut has a FLAG_PERFORM_NO_CLOSE flag, but I'm not sure how to use that method. I've tried many things, but I'm confused on where the keyevent is supposed to come from or if this is even the right method I should be looking at.</p><p>So tl;dr: How do I prevent options menus/submenus from closing when an option is selected?</p>","375874","","","","","2010-07-12 19:05:43","Android checkable submenu options","<android><options>","1","6","1","",""
"3226945","1","","","2010-07-12 08:41:36","2","817","<p>In two webviews we both have dom element like textarea. If we click on one textarea at this webview, and then click on the other textarea in the other webview, the focus problem comes out : they both focus and input method has problem</p><pre><code>WebView mWebView = new WebView(this);mWebView.setLayoutParams(webviewParams);mWebView.loadUrl(""file:///android_asset/header.html"");mWebView.FOCUS_AFTER_DESCENDANTS;WebView mToolbar= new WebView(this);mToolbar.setLayoutParams(toolbarParams);mToolbar.loadUrl(""file:///android_asset/footer.html"");mMainLayout.addView(mWebView);mMainLayout.addView(mToolbar);</code></pre>","389300","","","","","2012-04-05 14:21:02","focus problem of two webviews in android development","<android><webview>","1","0","","",""
"3226984","1","3227171","","2010-07-12 08:48:27","1","304","<p>As far as I understand, all the built-in standard apps like (email, music, calendar etc) are built using the same API. So I should be able to import a  project like mail / music etc without checking out the full source repository of android. I'v been trying that but I am getting compilation problems like class resolve failure. </p><p>Am I doing it wrong? Do I have to get the full android source project to import a project like Mail ? </p>","321098","","648313","","2011-07-13 21:00:18","2012-10-03 09:19:09","How to import individual projects from Android Source Code","<android><android-source>","2","1","","",""
"3226996","1","","","2010-07-12 08:50:54","3","1929","<p>I'm trying to write a new contact to the contact database in Android 2.1. But I am getting the following error:</p><pre><code>java.lang.UnsupportedOperationException: Aggregate contacts are created automatically.</code></pre><p>I have added the following fields in the manifest:</p><pre><code>&lt;uses-permission android:name=""android.permission.READ_CONTACTS"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_CONTACTS"" /&gt;</code></pre><p>This is my code:</p><pre><code>ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();String accountType = null;String accountName = null;Builder builder = ContentProviderOperation.newInsert(ContactsContract.Contacts.CONTENT_URI);builder.withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, accountType);builder.withValue(ContactsContract.RawContacts.ACCOUNT_NAME, accountName);ContentProviderOperation op = builder.build();Log.i(""contacts"", ""op.getUri(): "" + op.getUri());ops.add(op);ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)    .withValueBackReference(        ContactsContract.Data.RAW_CONTACT_ID,        ops.size()    )    .withValue(        ContactsContract.Data.MIMETYPE,        StructuredName.CONTENT_ITEM_TYPE    )    .withValue(StructuredName.DISPLAY_NAME, contact.getFullName())    .build());ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)    .withValueBackReference(        ContactsContract.Data.RAW_CONTACT_ID,        ops.size()    )    .withValue(        ContactsContract.Data.MIMETYPE,        ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE    )    .withValue(        ContactsContract.CommonDataKinds.Phone.NUMBER,        contact.getPhoneNumber()    )    .build());try {    this.cr.applyBatch(ContactsContract.AUTHORITY, ops);}</code></pre>","389309","","496830","","2011-11-14 13:02:13","2011-11-14 13:02:13","Writing contact to contact database - Android 2.1","<java><android><android-2.1-eclair>","1","0","","",""
"3227013","1","","","2010-07-12 08:54:15","0","127","<p>Very new to eclipse but doing some Android development so I'm using it now :)</p><p>Is there anyway to put the bin and gen folders outside of the project directory?  I want to have all the source controlled stuff in one place and all build products in another.</p><p>(Yes, I know I could get source control to ignore those folders, but I'd still like to keep the source folders ""clean"")</p>","199816","","","","","2010-07-12 08:54:15","In Eclipse can I put the bin (and gen) folders elsewhere in an Android project","<android><eclipse><adt>","0","2","","",""
"3227015","1","3499679","","2010-07-12 08:54:57","5","1246","<p>I need to run a periodic task in an Android application. I currently use a timer like this:</p><pre><code>final Handler guiHandler = new Handler();// the task to runfinal Runnable myRunnable = new Runnable() {    @Override    public void run() {        doMyStuff();    }};Timer timer = new Timer();timer.schedule(new TimerTask() {    @Override    public void run() {        guiHandler.post(myRunnable);    }}, 0, 30000); // run every 30 seconds</code></pre><p>This does exactly what I need, but there is a problem: if I change the time on the emulator or phone, the timer stops running. This is what appears in the log when I change the time:</p><pre><code>D/SystemClock(  331): Setting time of day to sec=1278920137W/SystemClock(  331): Unable to set rtc to 1278920137: Invalid argument</code></pre><p>Nothing about the timer being interrupted, but it clearly doesn't run anymore after the system clock has changed. I need the task to keep running all the time as long as the application is running.</p><p>How can I restart the timer if it gets stopped like this? There's no method on the Timer or TimerTask to check whether it's currently running, so I can't know when to reschedule it. Any ideas?</p>","249893","","","","","2010-08-17 05:57:20","Changing Android system clock stops timers. How can I restart them?","<android><timer><systemtime>","1","0","1","",""
"3227122","1","","","2010-07-12 09:11:42","4","3262","<p>According to the documentation, <a href=""http://developer.android.com/reference/android/media/MediaRecorder.html#setMaxDuration(int"" rel=""nofollow"">http://developer.android.com/reference/android/media/MediaRecorder.html#setMaxDuration(int</a>)</p><p>the recording stops when the timer expires. </p><p>By stop, do they mean it calls internally recorder.stop() and then restores the state the app was in before calling recorder.start()?</p>","381699","","","","","2011-06-07 20:14:22","MediaRecorder.setMaxDuration(int timer) what happens when timer expires","<android>","2","1","2","",""
"3227182","1","3236103","","2010-07-12 09:21:53","5","20585","<p>I have a ListView activity that needs a footer to the list of items so that you can click it and it would load more items into the list. The list is backed my an SimpleAdapter backed by a map of strings and before the adapter is set i do this inorder to add the footer:</p><pre><code>mInflater.inflate(R.layout.list_load_more_row, null);TextView footer = (TextView) findViewById(R.id.loadMore);getListView().addFooterView(footer);setListAdapter(ListViewHelper.getAdapterForContentList(mContent, this));</code></pre><p>But Im getting this exception in the debugger</p><p>java.lang.NullPointerExceptionandroid.widget.ListView.clearRecycledState(ListView.java:489)android.widget.ListView.resetList(ListView.java:476)android.widget.ListView.setAdapter(ListView.java:417)</p><p>Whats wrong and how would i go about adding my footer to the list?</p><p>[EDIT]the activity is using list_load_more_row.xml:</p><pre><code>  &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/loadMore""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:textSize=""17sp""        android:textStyle=""bold""        android:textColor=""#000000""          android:ellipsize=""marquee""          android:marqueeRepeatLimit=""marquee_forever""        android:gravity=""center_horizontal|center_vertical""        android:text=""@string/hello"" /&gt;</code></pre>","362476","","362476","","2010-07-12 14:03:06","2013-07-20 08:43:14","Android adding footer to ListView addFooterView()?","<java><android><xml><listview><user-interface>","3","4","2","",""
"3227335","1","3227359","","2010-07-12 09:38:16","1","2538","<p>i want to call a function ""ABC"" after 10 seconds in android again and again untilli use return statement to quit.</p><p>any one guide me how to achieve this?</p>","249991","","","","","2014-02-07 17:10:07","calling a function in android after intervals?","<android>","1","0","2","",""
"3227507","1","3227777","","2010-07-12 10:05:03","0","97","<p>The function below is part of the code for Google's Camera app.It is supposed to update a text view that displays dynamically the time elapsed since start of recording. But this function does not have a loop so how does it do it? Please help.</p><p>private static final int UPDATE_RECORD_TIME = 5;</p><pre><code>private final Handler mHandler = new MainHandler(); private class MainHandler extends Handler {        @Override        public void handleMessage(Message msg) {            switch (msg.what) {                case UPDATE_RECORD_TIME: {                    updateRecordingTime();                    break;                }                default:                    Log.v(TAG, ""Unhandled message: "" + msg.what);                    break;            }        }    }  </code></pre><p>int seconds = intent.getIntExtra(MediaStore.EXTRA_DURATION_LIMIT, 0); mMaxVideoDurationInMs = 1000 * seconds;</p><pre><code>mMediaRecorder.setMaxDuration(mMaxVideoDurationInMs);//this function is to update the recording timeprivate void updateRecordingTime() {if (!mMediaRecorderRecording) { return; } long now = SystemClock.uptimeMillis(); long delta = now - mRecordingStartTime;// Starting a minute before reaching the max duration // limit, we'll countdown the remaining time instead. boolean countdownRemainingTime = (mMaxVideoDurationInMs != 0         &amp;&amp; delta &gt;= mMaxVideoDurationInMs - 60000); long next_update_delay = 1000 - (delta % 1000); long seconds; if (countdownRemainingTime) {     delta = Math.max(0, mMaxVideoDurationInMs - delta);     seconds = (delta + 999) / 1000;} else {     seconds = delta / 1000; // round to nearest} long minutes = seconds / 60; long hours = minutes / 60; long remainderMinutes = minutes - (hours * 60); long remainderSeconds = seconds - (minutes * 60); String secondsString = Long.toString(remainderSeconds); if (secondsString.length() &lt; 2) {     secondsString = ""0"" + secondsString; } String minutesString = Long.toString(remainderMinutes); if (minutesString.length() &lt; 2) {     minutesString = ""0"" + minutesString; } String text = minutesString + "":"" + secondsString; if (hours &gt; 0) {     String hoursString = Long.toString(hours);     if (hoursString.length() &lt; 2) {         hoursString = ""0"" + hoursString;     }     text = hoursString + "":"" + text; } mRecordingTimeView.setText(text); if (mRecordingTimeCountsDown != countdownRemainingTime) {     // Avoid setting the color on every update, do it only     // when it needs changing.     mRecordingTimeCountsDown = countdownRemainingTime;     int color = getResources().getColor(countdownRemainingTime             ? R.color.recording_time_remaining_text             : R.color.recording_time_elapsed_text);     mRecordingTimeView.setTextColor(color); } // Work around a limitation of the T-Mobile G1: The T-Mobile // hardware blitter can't pixel-accurately scale and clip at the // same time, and the SurfaceFlinger doesn't attempt to work around // this limitation. In order to avoid visual corruption we must // manually refresh the entire surface view when changing any // overlapping view's contents. mVideoPreview.invalidate(); mHandler.sendEmptyMessageDelayed(         UPDATE_RECORD_TIME, next_update_delay); } </code></pre>","381699","","381699","","2010-07-13 04:05:18","2010-07-13 04:05:18","need help to interpret Google's camcorder app-update timer","<android>","1","0","","",""
"3227509","1","","","2010-07-12 10:05:36","1","1174","<p>I want to make an app that will use data from an xml database and there are two points where I need help cause I find Java with xml too complicated.</p><p>e.g.</p><pre><code>&lt;items&gt;&lt;1&gt;&lt;name&gt;box&lt;/name&gt;&lt;price&gt;2.00&lt;/price&gt;&lt;/1&gt;&lt;2&gt;&lt;name&gt;pencil&lt;/name&gt;&lt;price&gt;1.00&lt;/price&gt;&lt;/1&gt;&lt;/items&gt;</code></pre><ol><li>get a single xml value from a child node(eg.name of 1st item - ""box"")    </li><li>get an xml database from child nodes (to use it as data source for a listbox) - this one is not necessary. </li></ol>","389372","","650492","","2011-11-10 07:16:03","2011-11-10 07:16:03","getting a single xml node - android dev","<java><android><xml>","1","0","","",""
"3227670","1","3228055","","2010-07-12 10:31:41","11","11528","<p>AccountAuthenticator.java:</p><pre><code>Intent intent = new Intent(context, AccountActivity.class);</code></pre><p>AccountActivity.java:<br>In onCreate(Bundle aBundle) I want to say:</p><pre><code>getIntent().getContext();</code></pre><p>But getContext() does not exist.</p><p><strong>How do I get the Context from the Intent ?</strong><br>Since it's passed in the Intent constructor, I was expecting it to be available on arrival in the AccountActivity.</p>","77115","","","","","2013-10-14 23:37:59","How do I get the Context from the Intent?","<android>","2","3","2","",""
"3227681","1","3228001","","2010-07-12 10:33:11","0","105","<p>i download AlarmClock in the sound code  of android,i have modified it,but i want to run it</p><p>can  i  rebuild AlarmClock in Windows, if i can ,how? thanks.</p>","233618","","32502","","2010-07-12 11:42:29","2010-07-12 11:48:23","can i rebuild sound code in Windows","<android><source-code>","2","0","","",""
"3227710","1","","","2010-07-12 10:37:18","4","1079","<p>I want to implement a Web Service on Android.. I want to use my device as <strong><em>server</em></strong>. After doing some research on the internet, I found several options:</p><ul><li><p><strong>SerDroid</strong> (small web server for the Android platform)</p></li><li><p><strong>i-Jetty</strong> (open-source web container to run on the Android mobile device platform)</p></li><li><p><strong>KWS</strong> (lightweight and fast web server especially designed for android mobile devices)</p></li></ul><p><em><strong>What is the best?</em></strong></p><p>Alternatively, I could use <strong>REST + JSON</strong> to implement Web Service on Android? I don't undestand so much what is REST + JSON...</p>","385561","","1748142","","2012-10-26 06:26:57","2013-06-04 19:14:23","Best way to create a Web Service ON Android","<android><web-services><web-applications><android-emulator>","1","4","3","2013-06-05 10:40:03",""
"3227785","1","3227934","","2010-07-12 10:49:23","1","565","<p>I am new to android. I just create one application it download the file from the mail attachment. When we try to open a file my application will give an alert dialog. But it gives the alert, behind that it shows a black background with my application title bar. I don’t want to display that background and title. I wish to display the alert only. Is there any possibility to do like this? </p><p>note:Alert with no background means i wish to show like a mobile alert.In the download folder there will be a list of downloaded files if i select any one of the file it show the alert with the file list background </p>","389404","","32502","","2010-07-12 11:18:05","2010-07-13 13:17:47","How to display alert without background and application title?","<android><dialog><themes>","1","1","","",""
"3227807","1","3228005","","2010-07-12 10:52:14","0","1009","<p>UID - is unique for every device.But is it possible to determine to wich device it belongs(iPhone or Android i mean) ?</p><p>iPhone devices are quite standartised - they come with almoust same hardware but Android is almoust on every device(including iPhone in some cases :) )</p>","87383","","","","","2010-07-12 11:21:35","Android UID vs iPhone UID","<iphone><android>","2","1","","",""
"3227915","1","3227949","","2010-07-12 11:10:29","0","627","<p>I would like to access the word lists used on android phones for spell checking (not including the user-defined-dictionary).</p><p>I am writing an app which i would like to be able to check if a word exists in the current phone users language. I imagine their is some API call or service i can use to access the build in word lists?</p><p>Any help would be great, thanks!</p>","236743","","","","","2010-07-12 11:15:52","Access Android spell check lists","<android>","1","0","","",""
"3227992","1","3330026","","2010-07-12 11:20:01","2","3325","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2729438/how-to-create-database-in-android"">how to create database in android</a>  </p></blockquote><p>I am new to mobile application development.I wish to know how to create and use the database in android. Is there any requirements needed to create the database(like sql)? now i use the eclipse ide.</p>","389404","","114066","","2010-07-12 11:52:15","2010-07-25 16:32:41","how to use database in android?","<android><database><sqlite>","4","0","1","2011-10-04 12:37:32",""
"3228006","1","3228132","","2010-07-12 11:21:50","1","2078","<p>My <code>Android app</code> requires to get the current <code>date and time from Internet</code>. I can't rely on the date from the phone. How is it possible to get the time from Internet? What are the available <code>time servers</code>?</p>","347783","","1726308","","2012-12-03 13:36:40","2012-12-03 13:36:40","How to connect to time server for getting the current time settings? Also is there any time server at all?","<java><android><ntp>","3","1","","",""
"3228105","1","3228216","","2010-07-12 11:35:41","1","158","<p>I've been through the Android tutorials - these do a good job of introducing how we can hand-roll an Android user-interface. Actually, I do not need that level of control right now... I'm looking for something simpler...</p><p>I'd like to make an Android app which will mainly contain a number of standard UI widgets, nothing particularly fancy. Having done some VB development a long time ago (yes, I know it's crap!) - I particularly like the ability to paint user-interfaces with an interface designer and then add in the relevant callbacks via the IDE. I'm using Eclipse, so for now solutions requiring net-beans or other IDEs are not particularly helpful.</p><p>I'm well aware that this practice often produces sub-optimal code, and less than beautiful interfaces. That's not really a concern here. I just need to produce a certain effect quickly in order to prove a concept. There will be plenty of time later on for optimization if my idea is good enough. </p>","46411","","114066","","2010-07-12 11:50:17","2010-07-12 12:36:52","Is there a good quality interface ""painter"" for Android on Eclipse","<android><eclipse><layout>","2","2","1","",""
"3228245","1","","","2010-07-12 11:54:41","7","7642","<p>I am developing in Android, I am using instrumentation to test Phone application. Instrumentation is Android env to test applications. </p><p>For that I use am command with name of test case. I run adb, then I enter adb shell, then write in shell the am command. </p><p>I wish to deliver a parameter together with this am command. I mean that I wish to deliver parameters to the test launched by the am command. </p><p>Is it possible ???Please help ?</p>","268121","","14343","","2010-07-14 23:45:23","2014-01-20 21:31:54","How can I deliver parameters to a test function, that launched using adb shell am Instrumentation command","<android><instrumentation>","2","0","6","",""
"3228248","1","3229226","","2010-07-12 11:55:08","5","25043","<p>I have a button in my application. I want to change its position programmatically. I have created a button in XML as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;Button android:text=""@+id/Button01""         android:id=""@+id/Button01""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:layout_marginLeft=""50px""        android:layout_marginTop=""10px""        &gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>Suppose I want to set the position of the button as 100px from left (as layout_marginLeft=""100px""). How can I do it programmatically? Please help me to solve the problem.</p>","379693","","1128737","","2012-01-11 19:40:38","2012-08-16 18:39:38","Android Button Position Programmatically","<android><android-widget>","4","2","1","",""
"3228291","1","3228689","","2010-07-12 12:01:27","0","84","<p>i don't know it is right place to ask question in stackoverflow .but i fell its best place to get quick answer for my query.for getting more downloads i developed my application in android 1.5 version,minSDK 3. if i place application into android market.it will visible 1.5 and higher version mobile android market.it is good way for develop application in 1.5.how to make application good ui for all screen resolution</p><p>Thanks in Advance</p><p>Aswan </p>","1746300","","","","","2010-07-12 12:56:01","android device compatibility","<android>","1","0","","",""
"3228312","1","","","2010-07-12 12:04:23","3","1234","<p>I was wondering if it is possible to abbreviate only a portion of a string in a TextView. What I would like to do is something like this:</p><pre><code>Element with short title (X)Element with a very lo...(X)</code></pre><p>The title should be ellipsized, but the X must be always visible. In my case, is not possible to use more than one TextView. Do you think there is a simple way of doing this?</p><p>Thanks!</p>","316477","","","","","2012-09-03 17:44:57","Ellipsize only a section in a TextView","<android><string><textview><abbreviation>","2","0","","",""
"3228364","1","3228783","","2010-07-12 12:10:19","1","130","<p>how do i display videos retrieved from resources in my android application ?</p><pre><code>MediaPlayer mp = new MediaPlayer();mp = MediaPlayer.create(context, R.raw.vid);mp.start();</code></pre><p>i have placed a vid.3gp file in my res/raw folder..</p><p>i am getting NullPointerException.. what changes do i need to make</p><p>why so??</p><p>do we need something called as Surface Holder or something similar ?</p>","379749","","996493","","2012-08-16 15:04:25","2012-08-16 15:04:25","android - application displaying videos","<android><resources><video>","1","0","","",""
"3228377","1","","","2010-07-12 12:12:44","0","1307","<p>I want to use the concept of array in my Android Application, I don't know how to do that actually.</p><p>So could anybody please help me how to do that on demand.</p>","384176","","119895","","2010-07-12 13:40:45","2010-07-12 13:47:55","Array defining in Android Application","<android>","3","0","","",""
"3228379","1","","","2010-07-12 12:13:21","0","209","<p>I want to set the autotext programmatically, I have set the edittext proprty like</p><p><code>EditTxt.setInputType(InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);</code> but no effect.</p><p>Please give some inputs</p>","389469","","213464","","2010-07-12 12:21:06","2010-07-12 13:21:26","problem in setting autotext progrmmatically","<android>","1","0","","",""
"3228446","1","3228472","","2010-07-12 12:22:43","-4","1561","<p>I wish to use database for my application.How to use the database in android.I use eclipse ide.Is there any <strong>requirements</strong> need for create database.Give some basic ideas about it.I am android beginner.Help me to know about it.</p>","370334","","","","","2010-07-12 12:26:55","work with database in android?","<android>","2","3","","",""
"3228518","1","","","2010-07-12 12:33:04","0","1464","<p>i want to send files via Bluetooth to a another device. I want to send files to a device programmatically. Has anyone a idea how i can send files via Bluetooth OPP? </p>","164460","","","","","2012-08-16 14:50:43","Android bluetooth push files","<android><bluetooth>","1","0","","",""
"3228546","1","3228620","","2010-07-12 12:37:01","0","555","<p>How can I change the font size of a ListView dynamically?</p>","164850","","1267661","","2012-10-25 17:10:10","2012-10-25 17:10:10","How to change the font size of a ListView dynamically?","<android><android-listview>","1","0","","",""
"3228687","1","","","2010-07-12 12:55:49","0","129","<p>I want to create an intent on an android phone that sets (or increases/decreases) the loudness of music that gets played on a PC running Windows.Is there some API that helps me?</p>","25282","","","","","2010-07-12 13:06:31","Controlling PC loudness via Android","<android>","2","0","","",""
"3228744","1","","","2010-07-12 13:01:57","0","328","<p>I have been working on this little music player for a while and I have been stuck for quite a couple of days in creating a now-playing list. I was thinking about storing it inside the database back end. Well, I have a remote interface and what I would like to do is that I would like to query and retrieve data from the database, from that remote interface. Any one would care to shed some lights?</p>","372107","","","","","2010-07-12 13:29:15","Querying a database from a remote service","<android>","1","0","","",""
"3228926","1","3228994","","2010-07-12 13:23:12","2","1244","<p>In my project I have to make a text file and read particulars from that file. I need to know where I should place the file in directory so that I can successfully read it in my java code?</p>","172543","","","","","2010-07-12 13:30:58","where is internal file stored in an android project?","<java><android>","2","0","","",""
"3229010","1","","","2010-07-12 13:33:11","1","845","<p>Is there any way by which i can transfer calls to voice mail programmatically?? I am making an application for android in which i will use this feature. </p>","389525","","","","","2011-10-17 23:44:56","How to Transfer calls to voice mail in android?","<java><android><eclipse>","2","1","1","",""
"3229091","1","3229132","","2010-07-12 13:43:17","3","7711","<p>Any ideas why at times Eclipse frizzles and doesn't recognize code it did seconds ago?  The ""R"" in the code below has the red squiggle under it when it didn't 5 minutes ago and I've change no code.  This happens frequently with Eclipse and usually I shut it down and start it again and it's good to go...no go this time.</p><pre><code>// Initialize view elements    mSearchBox      = (EditText) this.findViewById(R.id.edittext_search);    mSearchButton   = (Button) this.findViewById(R.id.button_search);</code></pre>","2186261","","","","","2014-03-18 15:40:29","Eclipse not Recognizing ""R.id..."" with Android","<android><eclipse-plugin>","6","0","1","",""
"3229123","1","3229243","","2010-07-12 13:47:54","2","1000","<p>HI,</p><p>I'm building an Android application requiring internet connection, and I'm using ConnectivityManager to check whether the device is connected to internet or not. Now, what's the best strategy if it's not connected? Should I quit the application and tell the user to first connect to internet? or is there any way to ask the user if he wants to get connected and connect programatically?</p><p>Thanks</p><p>Jul</p>","326849","","","","","2010-07-12 14:20:21","How to connect to internet programatically?","<android><connection><internet>","3","0","1","",""
"3229137","1","3231621","","2010-07-12 13:48:59","0","1976","<p>I somewhat manage to get the data &amp; stored in Database &amp; also I displayed in Listview. Now I need to delete the selected listview i.e, corresponding row in a database. Can anyone help me pls.</p>","367407","","314166","","2012-04-09 17:14:03","2012-04-09 17:14:03","How to delete a selected row in database android","<android>","1","1","","",""
"3229269","1","3229306","","2010-07-12 14:03:25","0","361","<p>Why doesn't it work? ""First"" overlapped ""Second"". What's wrong?</p><pre><code>   protected View onCreateDialogView() {              RelativeLayout layout = new RelativeLayout(mContext);              RelativeLayout.LayoutParams mParams = new  RelativeLayout.LayoutParams (LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);              mFirstText = new TextView(mContext);              mSecondText.setId(1);              mSecondText = new TextView(mContext);              mSecondText.setId(2);              mParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT, mFirstText.getId());              mParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, mSecondText.getId());              setText(mFirstText, ""First"");              setText(mSecondText, ""Second"");              layout.addView(mFirstText, mParams);              layout.addView(mSecondText, mParams);              return layout;      }</code></pre>","384328","","","","","2010-07-12 14:07:24","Android RelativeLayout","<android><relativelayout>","1","0","","",""
"3229275","1","","","2010-07-12 14:03:55","0","238","<p>There is a mapview in my application and it works well. I added a menu item, when click it,  a new activity that also has a mapview will start. Then finish the new activity and go back to the first one, part of the mapview become blank and never refresh when pan the map, and it can be recovered only after zooming in or zooming out several times. Did anybody know how to solve this problem? </p>","472358","","472358","","2010-07-12 14:11:30","2011-07-12 05:20:10","android mapview partly blank","<android>","1","0","","",""
"3229424","1","3229440","","2010-07-12 14:33:44","2","603","<p>I saw it used in textview and webview</p><pre><code>android:id=""@+id/textview""android:id=""@+id/webview""</code></pre><p>but looks like there is none for DigitalClock widget.</p><p>So, when do I have to use it? Just for text and web views?</p>","287316","","","","","2010-07-12 14:39:22","When do I need to use ""android:id""?","<android><android-widget>","2","0","","",""
"3229447","1","3229508","","2010-07-12 14:40:25","2","2076","<p>I am trying to search for best provider with this case below:</p><pre><code>// GPS    case R.id.main_menu_gps:        // Set up location services        mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);        mBestProvider = mLocationManager.getBestProvider(new Criteria(), true);        Log.d(DEB_TAG, ""@@@@Value of mBestProvider is "" + mBestProvider);        if(mBestProvider != null){            showGpsSearchingDialog();            mLocationManager.requestLocationUpdates(mBestProvider, 150000, 1, this);        } else {            Log.d(DEB_TAG, ""Provider is null"");            showGpsAlertDialog();        }    break;</code></pre><p>My device is returning ""GPS"" as the best provider but is not able to find a location and my progress dialogue is displayed forever searching.  If I go into the phone settings of ""Location/Security"" and check the ""Use wireless networks"" the best provider is Network and it works to return a location.  </p><p>Am I doing something wrong when the best provider is GPS and no data is returned?</p>","2186261","","","","","2010-07-12 16:43:25","Search for Best Provider in Android Application","<android><gps>","3","0","","",""
"3229480","1","3229858","","2010-07-12 14:47:22","2","2175","<p>Is it possible to get an android cursor from an array (either <code>ArrayList</code> or <code>StringaArray</code>)?</p>","364727","","244296","","2010-07-12 15:16:56","2010-07-12 15:42:26","get cursor from array","<android><string><arrays><cursor>","1","2","1","",""
"3229487","1","3229775","","2010-07-12 14:47:47","2","1367","<p>Is there any way to setup a logcat filter by name?  I realize they have the filter by log tag, but my app may have various different tags.  I can use the filter by pid, but of course everytime i recompile and redeploy this pid changes.  I'd like to be able to fitler it by com.mycompany.appname or something along those lines.  is this even possible?</p>","372405","","","","","2010-07-12 15:31:09","android DDMS logcat filter by name","<android><filter><logcat><ddms>","1","0","","",""
"3229597","1","","","2010-07-12 15:10:30","2","997","<p>If I have a Binder object representing a Remote Interface (to an Android service or a callback interface to a remote client), would I need explicit synchronization when sending IPC via this object from multiple threads, or is that taken care of by the underlying Android component?</p>","440093","","","","","2012-09-18 10:53:36","Are Android AIDL/Binder Interface Objects thread-safe?","<android>","2","0","2","",""
"3229608","1","3229694","","2010-07-12 15:13:42","2","504","<p>How should i get started with Android? From where do i get help and sample source code? Can a JSF application run on Android phones? I saw primefaces site and it has TouchFaces which are meant for Android phones. But i really don't know how should i get started with Android. Is it too tough? Does it take too much time creating even a simple application?</p><p>Thanks in advance :)</p>","260594","","","","","2011-05-15 17:49:05","How do i get started with Android?","<android>","8","1","4","2011-11-22 16:37:58",""
"3229619","1","","","2010-07-12 15:15:01","2","406","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3226710/android-checkable-submenu-options"">Android checkable submenu options</a>  </p></blockquote><p>So I posted this last night but I guess the server ate it. I have an options menu, and then a submenu with checboxes. All this works fine, except I need to let the user select multiple checkboxes without the menu closing. How is this implemented? I've looked at performShortcut() but I can't figure out where the KeyEvent is supposed to come from.</p>","375874","","","","","2010-07-12 15:15:01","Prevent android menu/submenu from closing on selecting","<android><options>","0","2","","2010-07-13 18:39:32",""
"3229622","1","3229852","","2010-07-12 15:15:18","2","670","<p>I've hit a brick wall on a UI item with regard to applications on sense phones. I have been unable to craft search queries on google or SO to find any reference to what I'm after.</p><p>Is there a way that I can have my application theme its UI styles to match the phone's currently applied style? I'm basically after the styles for different UI widgets (check boxes, spinner, button, etc).</p><p>I have a myTouch 3G Slide which is running the Espresso variant of HTC Sense.</p><p>Update: (Thanks @Macarse for the tip)</p><p>As a clarification I'm attempting to get my spinner drop down, check boxes, buttons, etc) to follow the Sense theme that is currently applied on the phone. Currently, I have done the following with no success:</p><p>I have created a res/values/styles.xml file with the following content:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;style name=""Theme"" parent=""@android:style/Theme""&gt;&lt;/style&gt;&lt;/resources&gt;</code></pre><p>That unfortunately had no success doing either of the following with the AndroidManifest.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.division6.pwgenapp""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:theme=""@style/Theme""&gt;    ...    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt;</code></pre><p>Or</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.division6.pwgenapp""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:theme=""@android:style/Theme""&gt;    ...    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt;</code></pre><p>Now if I use something like @android:style/Theme.Light, the application as a whole takes on the light theme.  What I'm trying to figure out is if there is some form of reference that would allow me to just ref the system applied theme.</p><p>Thanks again for the comments.</p><p>UPDATE:I did some digging around in one of the themes available for the Slide and noticed that the theming they did was exclusively for the HTC Sense/Rosie widgets.  As a result I am more or less unable to reference those settings without tying myself to the Rosie widget set (which is an HTC exclusive).</p><p>Thank you all for viewing and your comments.</p>","289625","","289625","","2010-07-12 23:02:03","2010-07-12 23:02:03","Android application theming on Sense phones","<android><styles><themes>","2","0","1","",""
"3229831","1","4959751","","2010-07-12 15:39:04","6","1576","<p>I am using Google Analytics for Android to track events, page views on an Android app. When calling the tracker's dispatch method, I receive a RuntimeException:</p><pre><code>07-12 18:02:05.594: WARN/MessageQueue(12823): Handler{44a08620} sending message to a Handler on a dead thread07-12 18:02:05.594: WARN/MessageQueue(12823): java.lang.RuntimeException: Handler{44a08620} sending message to a Handler on a dead thread07-12 18:02:05.594: WARN/MessageQueue(12823):     at android.os.MessageQueue.enqueueMessage(MessageQueue.java:179)07-12 18:02:05.594: WARN/MessageQueue(12823):     at android.os.Handler.sendMessageAtTime(Handler.java:457)07-12 18:02:05.594: WARN/MessageQueue(12823):     at android.os.Handler.sendMessageDelayed(Handler.java:430)07-12 18:02:05.594: WARN/MessageQueue(12823):     at android.os.Handler.post(Handler.java:248)07-12 18:02:05.594: WARN/MessageQueue(12823):     at com.google.android.apps.analytics.NetworkDispatcher$DispatcherThread.dispatchEvents(Unknown Source)07-12 18:02:05.594: WARN/MessageQueue(12823):     at com.google.android.apps.analytics.NetworkDispatcher.dispatchEvents(Unknown Source)07-12 18:02:05.594: WARN/MessageQueue(12823):     at com.google.android.apps.analytics.GoogleAnalyticsTracker.dispatch(Unknown Source)07-12 18:02:05.594: WARN/MessageQueue(12823):     at com.company.activity.set(MyActivity.java:177)07-12 18:02:05.594: WARN/MessageQueue(12823):     at com.company.activity.access$34(MyActivity.java:175)07-12 18:02:05.594: WARN/MessageQueue(12823):     at com.company.activity.$45.onClick(MyActivity.java:1982)07-12 18:02:05.594: WARN/MessageQueue(12823):     at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)07-12 18:02:05.594: WARN/MessageQueue(12823):     at android.os.Handler.dispatchMessage(Handler.java:99)07-12 18:02:05.594: WARN/MessageQueue(12823):     at android.os.Looper.loop(Looper.java:123)07-12 18:02:05.594: WARN/MessageQueue(12823):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-12 18:02:05.594: WARN/MessageQueue(12823):     at java.lang.reflect.Method.invokeNative(Native Method)07-12 18:02:05.594: WARN/MessageQueue(12823):     at java.lang.reflect.Method.invoke(Method.java:521)07-12 18:02:05.594: WARN/MessageQueue(12823):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-12 18:02:05.594: WARN/MessageQueue(12823):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-12 18:02:05.594: WARN/MessageQueue(12823):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>--EDIT--At first I was convinced it had to do with my placement of tracker, putting it in onResume, Threads, etc. magically made it throw exceptions. Turns out, <a href=""http://code.google.com/intl/iw-IL/mobile/analytics/docs/android/index.html"" rel=""nofollow"">Google's own example code</a> (also available in their SDK download) also throws this Exception:</p><pre><code>&gt;07-12 23:47:09.343: WARN/MessageQueue(18468): null sending message to a Handler on a dead thread07-12 23:47:09.343: WARN/MessageQueue(18468): java.lang.RuntimeException: null sending message to a Handler on a dead thread07-12 23:47:09.343: WARN/MessageQueue(18468):     at android.os.MessageQueue.enqueueMessage(MessageQueue.java:179)07-12 23:47:09.343: WARN/MessageQueue(18468):     at android.os.Looper.quit(Looper.java:173)07-12 23:47:09.343: WARN/MessageQueue(18468):     at com.google.android.apps.analytics.NetworkDispatcher.stop(Unknown Source)07-12 23:47:09.343: WARN/MessageQueue(18468):     at com.google.android.apps.analytics.NetworkDispatcher.init(Unknown Source)07-12 23:47:09.343: WARN/MessageQueue(18468):     at com.google.android.apps.analytics.GoogleAnalyticsTracker.start(Unknown Source)07-12 23:47:09.343: WARN/MessageQueue(18468):     at com.google.android.apps.analytics.GoogleAnalyticsTracker.start(Unknown Source)07-12 23:47:09.343: WARN/MessageQueue(18468):     at com.google.android.apps.analytics.GoogleAnalyticsTracker.start(Unknown Source)07-12 23:47:09.343: WARN/MessageQueue(18468):     at com.google.android.apps.analytics.sample.AnalyticsSample.onCreate(AnalyticsSample.java:23)07-12 23:47:09.343: WARN/MessageQueue(18468):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)07-12 23:47:09.343: WARN/MessageQueue(18468):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)07-12 23:47:09.343: WARN/MessageQueue(18468):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)07-12 23:47:09.343: WARN/MessageQueue(18468):     at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3815)07-12 23:47:09.343: WARN/MessageQueue(18468):     at android.app.ActivityThread.access$2400(ActivityThread.java:125)07-12 23:47:09.343: WARN/MessageQueue(18468):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2037)07-12 23:47:09.343: WARN/MessageQueue(18468):     at android.os.Handler.dispatchMessage(Handler.java:99)07-12 23:47:09.343: WARN/MessageQueue(18468):     at android.os.Looper.loop(Looper.java:123)07-12 23:47:09.343: WARN/MessageQueue(18468):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-12 23:47:09.343: WARN/MessageQueue(18468):     at java.lang.reflect.Method.invokeNative(Native Method)07-12 23:47:09.343: WARN/MessageQueue(18468):     at java.lang.reflect.Method.invoke(Method.java:521)07-12 23:47:09.343: WARN/MessageQueue(18468):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-12 23:47:09.343: WARN/MessageQueue(18468):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-12 23:47:09.343: WARN/MessageQueue(18468):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>This happens when you force the original activity to be destroyed (i.e. changing orientation, going to Home screen, etc.) . I can't store the original tracker object via onSavedInstance, since tracker isn't a Parcelable. Any other ideas, clues how to get rid of this error?</p><p>--EDIT--Even stranger, it seems that this is also causing the following problem: </p><pre><code>&gt;07-13 00:50:02.581: WARN/googleanalytics(27605): Dispatcher thinks it finished, but there were -4 failed events</code></pre><p>While most mentions of this online point their fingers back to whitespaces in the Events or PageViews which corrupt the db, I have confirmed this not to be the case. Also, I'm not sure what it means to have a negative event (-4)!</p>","299080","","68805","","2011-01-28 07:30:55","2011-02-10 16:21:31","RuntimeException from Google Analytics for Android ""sending message to a handler on a dead thread""","<android><google-analytics><analytics><handler><dispatch>","1","1","1","",""
"3229865","1","5393263","","2010-07-12 15:43:17","3","1965","<p>Is there a way to have a <code>Linkify</code>'d link call a method in my <code>Activity</code> or am I only allowed to use <code>Linkify</code> to create links to other activities / apps etc.?</p>","372405","","119895","","2010-07-12 15:47:55","2011-03-23 14:28:33","Linkify to call java code","<android><linkify>","4","0","2","",""
"3229929","1","3230496","","2010-07-12 15:51:59","4","3981","<p>I want to be able to capture key events inside a service I am writing. I can do this inside an activity without problems, but all my attemps to get this working in a service have failed. The key I wanted to capture (globally) is the BACK button, but if this is not possible any (hardware) button a HTC Desire offers would be OK.</p>","388759","","","","","2011-10-12 05:45:06","How to capture key events inside a service?","<android>","3","2","2","",""
"3230169","1","","","2010-07-12 16:18:25","2","843","<p>I am wondering if a piece of hardware can be developed (probably over bluetooth for example) that could launch an existing android application on your device.</p><p>I can't seem to find any documentation on this kind of functionality.</p><p>Has anybody come across this?</p>","389654","","119895","","2010-07-12 17:25:33","2010-07-12 17:41:48","Can android bluetooth accessories force the device to launch an application?","<android><bluetooth><accessory>","2","0","","",""
"3230489","1","3230539","","2010-07-12 17:00:05","0","935","<p>when the device is not connected to the internet, I send the user to the settings</p><pre><code>startActivity(new Intent(android.provider.Settings.ACTION_SETTINGS)</code></pre><p>but then I'm stuck in the settings page. How can I go back to my main activity? </p><p>thanks</p><p>Jul</p>","326849","","","","","2010-07-12 17:07:58","How can I go back to my main activity after starting the Settings activity?","<android><activity>","1","1","1","",""
"3230520","1","3230601","","2010-07-12 17:04:24","3","532","<p>android emulator does not recognize hebrew font where my phone does how do I install the Hebrew font on my emulator .</p>","368440","","243782","","2010-07-12 17:05:05","2010-07-12 17:17:22","android emulator does not recognize Hebrew font","<android>","1","3","","",""
"3230643","1","","","2010-07-12 17:26:23","3","5997","<p>Hey, this might be simple but I dunno how to go about it.  I have an app that I'm working on, and I'd like my friend to take a look at it.  How can I go about sending them the apk package so they can play with the app?</p>","362857","","","","","2013-04-18 18:54:06","Sending Android app to friend","<android>","2","2","","2013-04-18 20:02:21",""
"3230656","1","3231417","","2010-07-12 17:28:32","1","6622","<p>I am using a dialog as a form for the user to input data. When they click the ""OK"" button, the dialog is closed, and I need to use the data that was entered. How can I reference this data in the activity once the dialog has closed?</p>","382252","","","","","2010-07-12 19:13:32","Return data from dialog","<android><dialog>","2","0","1","",""
"3230690","1","3230751","","2010-07-12 17:32:45","1","1801","<p>I have trouble understanding the following thing: in my localized application I have an <code>Enum</code> in an activity that stores some localized strings (<code>R.string.aString</code>) which are compared against another localized string.</p><p>If while in application I change the locale and I came back and start the Activity that contains the Enum  I observe that it's members have are the same as before localization change. </p><p>What is the reason for this?</p><p>Edit :</p><pre><code>class Settings extends Activity {    public enum SettingPreferenceScreen    {        Connection (R.string.Connection , xml_resource_1)        Legend (R,string.Legend ,xml_resource_2)        .......    String key;    int res;    SettingPreferenceScreen(String key, int res)    {....}    public int getResource (String key)    {      for(SettingPreferenceScreen p : SettingPreferenceScreen.values())        if(key.equals(p.key))           return p.res;      return -1;    }    }}</code></pre>","284609","","844882","","2012-03-22 20:17:58","2012-03-22 20:18:54","Enum in Activity","<android>","3","2","","",""
"3230813","1","","","2010-07-12 17:50:27","3","1056","<p>Wondering how to get the <code>EC/IO</code> value on the Android Nexus One phone.</p><p>Actual methods given by Android class <code>android.telephony.SignalStrength</code> are:</p><pre><code>/* Get the CDMA Ec/Io value in dB*10  */int  getCdmaEcio() /* Get the EVDO Ec/Io value in dB*10  */int  getEvdoEcio() </code></pre><p>The problem is: I am on an UMTS / WCDMA Network, so, there is no way for me to actual get the value.</p><p>Any updates from Android? Or workaround?</p>","389719","","119895","","2010-07-12 17:54:55","2011-09-04 15:42:52","Android Dev : NO EC/IO?","<java><android>","2","0","","",""
"3230860","1","5821575","","2010-07-12 17:55:56","2","1021","<p>Is there a way to find out if a user has the PIN lock or password lock screen security set?</p><p>I know that you can check <code>Settings.Secure.PATTERN_LOCK_ENABLED</code> to read if the pattern is set. Even a value to read that shows if ANY security is set would be helpful.</p>","201939","","995926","","2012-05-05 13:38:09","2012-05-05 13:38:09","Android 2.2 Screen Lock Security","<android><security><settings><lockscreen><android-2.2-froyo>","2","0","","",""
"3230893","1","3230923","","2010-07-12 18:00:06","5","7457","<p>The internet is not available when I access it from the Android Virtual Device, any idea how can I configure it to do so?</p>","287316","","","","","2011-12-27 18:47:39","How to make Android Virtual Device access the internet?","<android><networking>","3","0","1","",""
"3231077","1","3231120","","2010-07-12 18:23:56","2","93","<p>Is there any way with the Android SDK to emulate a specific device ROM?  For example, could I launch an emulator that replicated the Verizon Droid Incredible, or the Sprint HTC Hero?</p>","349138","","","","","2010-07-12 18:28:58","Developing to all devices","<android>","1","0","","",""
"3231139","1","3415607","","2010-07-12 18:31:28","0","627","<p>I have an Activity communicating with and directly accessing a background Service's data members through get functions. The problem is that I can't seem to be able to access the actual data members. For instance, I try and get an ArrayList with a few items in it but I just receive an empty ArrayList.</p><p>This code is almost directly from the local service tutorial in the Android Service class doc. </p><p>Here's my service: CommunicationService</p><pre><code>public static final String BROADCAST_ALARM = ""Alarm"";private Intent mAlarmBroadcast = new Intent(BROADCAST_ALARM);private AlarmList mAlarms;class TempTask extends AsyncTask&lt;String, Void, Void&gt; {    private int id = 0;    @Override    protected Void doInBackground(String... params) {        while (true) {            mAlarms.addAlarm(++id, ""Description"", ""Label"");            sendBroadcast(mAlarmBroadcast);            try {                Thread.sleep(1000);            } catch (InterruptedException e) {            }        }    }}@Overridepublic void onCreate() {    super.onCreate();    mAlarms = new AlarmList();    new TempTask().execute(""test"");}public AlarmList getAlarmList() {    return mAlarms;}</code></pre><p>And here's my bound activity:</p><pre><code>private CommunicationService mComService = null;private IconicAdapter mListAdapter;@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.alarm_list);    mListAdapter = new IconicAdapter(this, R.layout.row, R.id.label);    setListAdapter(mListAdapter);    // Attempt to bind with the service.    bindService(new Intent(this, CommunicationService.class), mOnService, BIND_AUTO_CREATE);}/* * Receives broadcasts from the bound service. */private BroadcastReceiver receiver = new BroadcastReceiver() {    @Override    public void onReceive(Context context, Intent intent) {        String action = intent.getAction();        if (action != null) {            if (action.equals(CommunicationService.BROADCAST_ALARM)) {                AlarmList alarmList = mComService.getAlarmList();                ArrayList&lt;Alarm&gt; alarms = alarmList.getAllAlarms();                /* THIS IS WHERE THE PROBLEM EXISTS.                 * alarms is an ArrayList of size 0, where as if you break                 * over the actual data member in the service class, it is                 * full of elements.                 */                mListAdapter.addAll(alarms);            }        }    }};private ServiceConnection mOnService = new ServiceConnection() {    @Override    public void onServiceConnected(ComponentName name, IBinder binder) {        mComService = ((CommunicationService.LocalBinder) binder).getService();        appendAlarms();    }    @Override    public void onServiceDisconnected(ComponentName name) {        // This is called when the connection with the service has been        // unexpectedly disconnected -- that is, its process crashed.        mComService = null;    }};</code></pre><p>Thank you for your time.</p>","368333","","","","","2010-08-05 14:20:02","Access data members of background service","<android>","1","0","","",""
"3231224","1","3231319","","2010-07-12 18:42:21","3","1545","<p>I'm using my Dropbox folder to store my Eclipse workspace in (instant back ups) but want to develop on both Linux and Windows. (I think) the workspace file stores the location of the Android SDK which is different on both machines /home/android... and c:\android.</p><p>Is there any way of developing on Windows one minute and Linux the next? (the issue is the directory of the Android SDk.</p><p>thanks</p>","381258","","","","","2010-07-12 21:24:08","Android Eclipse, Dropbox, Windows and Linux","<android><windows><linux><eclipse>","2","1","0","",""
"3231278","1","","","2010-07-12 18:48:18","0","210","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2869338/where-to-start-to-learn-android"">Where to start to learn Android?</a>  </p></blockquote><p>Where do i need to look and what do i need to know before starting Developing Android apps.</p>","389763","","918414","","2012-06-30 04:56:56","2012-06-30 04:56:56","New Devolper where do i start? Android","<android>","4","0","","2011-09-26 07:25:00",""
"3231475","1","","","2010-07-12 19:13:57","1","411","<p>I have a very simple layout with two side by side textviews.  Both have the same parent layout that fills the screen horizontally.</p><p>I need them to have a visible space between them so that they are visually seperated when both have text.  I also need the left textview to take up about 2/3 the screen width and let the other have the rest.</p><p>This is fairly easy to do with LinearLayout and a few margin settings, but if either one of the views has no text, I need the other one to fill the entire width.</p><p>I'm not quite sure how to have the layout do that without setting the empty view's visibility to GONE in code.  Is there any good, efficient way to do all of these things at once?  Feel free to use any layout you wish to make it work.</p>","131871","","","","","2010-07-12 19:16:54","How to layout TextViews side-by-side with spacing in android?","<android><xml><layout>","1","0","","",""
"3231627","1","3231705","","2010-07-12 19:33:21","2","758","<p>Is it possible to make the webview stay as a small window, instead of get the full screen?</p>","287316","","","","","2010-07-12 19:43:45","Webview in a small window","<android><gui>","2","0","2","",""
"3231893","1","3263938","","2010-07-12 20:13:33","3","1919","<p>There are some posts about this, but so far, i haven't seen any good answer. Is there a way i can stream audio from mms:// uris with Android?. MediaPlayer seems not to like these streams. Also changing mms:// with http or rtsp doesn't work either. Did someone find a workaround to this?. Thanks! </p>","367029","","367029","","2010-07-13 08:57:30","2014-02-03 17:08:23","how to stream through mms://","<android><streaming><media-player><mms>","2","1","4","",""
"3231918","1","","","2010-07-12 20:18:54","0","540","<p>How to design the BroadcastReceiver class that will block outgoing SMS.</p><p>abortBroadcast();  does not work. Any help will be appreciated. </p><pre><code>if ((actionType.equals(Intent.ACTION_SEND))){    setResultData(null); // I tried this and abortBroadcast(); as well}</code></pre>","357349","","29407","","2010-07-12 20:46:29","2014-02-20 19:45:22","Block outgoing text","<android>","1","3","","",""
"3232002","1","3232028","","2010-07-12 20:28:26","4","1879","<p>Can someone explain to me this <code>StaleDataException</code></p><pre><code>07-11 19:58:23.298 E/AndroidRuntime( 1044): Uncaught handler: thread main exiting due to uncaught exception07-11 19:58:23.368 E/AndroidRuntime( 1044): android.database.StaleDataException: Access closed cursor07-11 19:58:23.368 E/AndroidRuntime( 1044): at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:217)07-11 19:58:23.368 E/AndroidRuntime( 1044): at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java:84)07-11 19:58:23.368 E/AndroidRuntime( 1044): at android.database.CursorWrapper.getInt(CursorWrapper.java:128)</code></pre><p>When and how do we need to assure a requiry on the cursor, and why fails with this Exception?</p>","243782","","","","","2010-07-12 20:31:08","Can someone explain to me this `StaleDataException`","<android><exception><staledataexception>","1","0","","",""
"3232073","1","3232129","","2010-07-12 20:35:37","1","439","<p>A website hosts only android 1.6 platform developed applications.. What changes should I make to my project so that it runs as android 1.6 one? Would any change of minSDK from 8 to 4 suffice?</p>","172543","","","","","2011-02-05 05:36:29","how can I change android application developed on android 2.2 platform to android 1.6?","<android>","3","0","","",""
"3232173","1","3232230","","2010-07-12 20:50:43","0","457","<p>Using a layoutanimation on one of  my views.</p><pre><code>android:layoutAnimation=""@anim/animate_layout""</code></pre><p>The animation is done each time one enters that view. It will however not run if that view was already active and the user changed to another application and then returned to it. In order to do that, I need to overwrite the <code>onresume()</code> method and call it from there.</p><p>How can I call the layoutAnimation from within the code in order to run it again for the whole layout?</p>","62570","","","","","2010-08-03 13:51:08","Reanimating a view when using layoutanimation","<android><animation>","3","0","","",""
"3232195","1","","","2010-07-12 20:54:52","0","645","<p>The sample code of hello-gridview implements an image adapter to populate the gridview with a series of customized imageviews. the getview method in image adapter is implemented to customize image views. I am wondering how this method is utilized to populate the gridview. It looks like that the population is based on the integer array in the image adapter. If there are two integer arrays what will happen? Could you pleas talk about the detail steps for the gridview population process?</p><p>One more question is about the getitem(position) method in the image adapter.  this method  is supposed to return the corresponding data item of the imageadapter. It returns null in the sample code.How could we implement the getitem(position) method to return a specific customized child imageview of the gridview?</p><p>Many thanks,</p><p>Song</p>","389864","","","","","2011-02-19 12:36:15","how gridview is populated with customized imageviews from the image adapter","<android>","1","0","","",""
"3232274","1","","","2010-07-12 21:06:50","9","11938","<p>I downloaded the source for SpriteMethodTest, and I want to build it in Eclipse. So I Went:</p><p>File >> New >> Android Project >> Create Project From Existing Source >> SpriteMethodTest</p><p>It created the project alright, but the R class is not generated. Any file that references a resource in R says <code>R cannot be resolved</code>.</p><p>Importing android.R just results in <code>R.drawable.background cannot be resolved</code>. How do I generate R again?</p>","63887","","","","","2012-11-13 22:54:10","R class missing after creating android project from existing source","<android><eclipse>","10","4","","2013-02-19 05:25:07",""
"3232330","1","","","2010-07-12 21:14:43","2","127","<p>I'm new in Android programming and want to know if it's possible to search in other apps.</p><p>I mean, I want to find all notes which have #yellow inside the text.</p><p>Something like when I use the <code>QuickSearchBox</code>, but I don't want to open the notepad app. Instead I want to read this note inside my own app.Or the same with the calendar, I want to find the next calendar entry which has #yellow in the description, and want to read the description in my app not in the calendar.</p><p>Is it possible to say global search, search for #yellow in calendar and give me the description of this entry?</p><p>The reason why I want to do it like this is I want to use an app which is already installed as an editor and store for my information.</p>","389859","","26428","","2010-07-17 01:55:12","2010-07-17 01:55:12","How can I search in other apps using global search","<android>","1","1","1","",""
"3232395","1","3232955","","2010-07-12 21:26:00","3","3017","<p>I am doing a login <code>Activity</code> which basically has an <code>EditText</code> and two <code>Buttons</code>.It looks like this:</p><p><img src=""http://img249.imageshack.us/img249/9108/loginm.png"" alt=""http://img249.imageshack.us/img249/9108/loginm.png""></p><p>The <code>EditText</code> has a <code>TextWatcher</code> that validates the user with an <code>AsyncTask</code> that hits a webservice.</p><p>The code:</p><pre><code>public class Login extends Activity {    private EditText mUserNameET;    private Drawable mCorrect;    private Drawable mIncorrect;    private ProgressBar mProgressBar;    private MyApp mApp;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.login);        mApp = (MyApp) getApplication();        mUserNameET = (EditText) findViewById(R.id.user_name_et);        mUserNameET.addTextChangedListener(new LoginValidator());        mCorrect = getResources().getDrawable(R.drawable.correct);        mIncorrect = getResources().getDrawable(R.drawable.incorrect);        mProgressBar = new ProgressBar(this);    }    private class LoginValidator implements TextWatcher {        private ValidateUserAsyncTask validator = new ValidateUserAsyncTask();        @Override        public void afterTextChanged(Editable s) {            String value = s.toString();            if ( value.length() == 0 )                return;            /* If it's running, cancel it. */            /* Issue #2 */            if ( AsyncTask.Status.RUNNING == validator.getStatus() ) {                validator.cancel(true);                validator = new ValidateUserAsyncTask();            } else if ( AsyncTask.Status.FINISHED == validator.getStatus() ) {                validator = new ValidateUserAsyncTask();            }            validator.execute(value);            /* Issue #1 */            mUserNameET.setCompoundDrawables(null, null, mProgressBar.getProgressDrawable(), null);        }        @Override        public void beforeTextChanged(CharSequence s, int start, int count,                int after) {        }        @Override        public void onTextChanged(CharSequence s, int start, int before,                int count) {        }    }    class ValidateUserAsyncTask extends AsyncTask&lt;String, Void, Boolean&gt; {        @Override        protected void onPostExecute(Boolean result) {            super.onPostExecute(result);            if ( result ) {                mUserNameET.setCompoundDrawablesWithIntrinsicBounds(null, null, mCorrect, null);            } else {                mUserNameET.setCompoundDrawablesWithIntrinsicBounds(null, null, mIncorrect, null);            }        }        @Override        protected Boolean doInBackground(String... params) {            return mApp.validateUser(params[0]);        }    }}</code></pre><p>My issues:</p><p>While the <code>AsyncTask</code> is working I want to show a ProgressBar inside the <code>EditText</code>.I tried to do it using:</p><pre><code>mUserNameET.setCompoundDrawables(null, null, mProgressBar.getProgressDrawable(), null);</code></pre><p>but it doesn't work.</p><p>And I am also a bit worried about creating new instances of the <code>AsyncTask</code>. Am I leaking memory?</p>","119895","","","","","2011-05-16 08:39:41","EditText's TextWatcher validator","<android>","2","1","1","",""
"3232462","1","","","2010-07-12 21:36:41","0","2325","<p>I want to embed youtube videos in my android app and want to use the youtube api. Is there any way I can do this ?</p>","389887","","","","","2010-11-11 22:00:14","Embedding youtube videos in your android app","<android><youtube>","1","0","","",""
"3232718","1","7434249","","2010-07-12 22:17:24","8","9591","<p>I want to add my own framework code that runs in the Android ""system_server"" (handles all the system level services). My service loads a JNI library that talks to a driver I have added to the kernel. The service is designed to allow an app to register a listener with it to get updates from the driver. I found a pretty good blog post (<a href=""http://www.androidenea.com/2009/12/adding-system-server-to-android.html"">http://www.androidenea.com/2009/12/adding-system-server-to-android.html</a>) that explains how to add a system service, but I cannot get it completely working.</p><p>First of all, the post mentions that an ""appropriate"" Android.mk file should be used to write the client/test application, but does not give an example of this. When I try to build it, I get build errors saying it can't find the service I have added. Could someone give an example of what this might look like?</p><p>Also, I'd like to implement this in the vendor directory (or device directory in froyo) rather than in the Android open source code. The blog post mentions that the proper place for this is the vendor directory, but does not give an example of what this should look like. Anyone know?</p><p>ANY additional information on implementing your own system service in Android would be helpful. Again my specific workflow is:</p><p>Android App -> System Service -> JNI (native) library -> Device Driver</p>","287575","","346309","","2011-09-15 16:49:34","2013-10-17 17:04:22","How to add a system service to the Android Framework","<android><jni><android-service>","3","0","6","",""
"3232844","1","3250489","","2010-07-12 22:40:03","0","1065","<p>I've a very simple / minimal code Android application. I'm drawing some lines on screen with my finger. </p><p>At some point, app closes itself / exists automatically. No exception is thrown.</p><p>I'm really stuck. Any help / idea is highly appreciated!</p><p>Thanks in advance/</p><pre><code>07-12 23:13:54.264: DEBUG/dalvikvm(3638): GC_EXPLICIT freed 3102 objects / 163096 bytes in 48ms07-12 23:14:08.394: DEBUG/dalvikvm(3638): GC_EXPLICIT freed 438 objects / 22696 bytes in 99ms07-12 23:14:09.324: DEBUG/dalvikvm(3638): GC_EXPLICIT freed 2697 objects / 142112 bytes in 73ms07-12 23:14:15.434: INFO/DEBUG(11269): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***07-12 23:14:15.434: INFO/DEBUG(11269): Build fingerprint: 'google/passion/passion/mahimahi:2.2/FRF91/43546:user/release-keys'07-12 23:14:15.434: INFO/DEBUG(11269): pid: 11450, tid: 11450  &gt;&gt;&gt; com.mypackage.name &lt;&lt;&lt;07-12 23:14:15.434: INFO/DEBUG(11269): signal 11 (SIGSEGV), fault addr a001fac507-12 23:14:15.434: INFO/DEBUG(11269):  r0 44992640  r1 0000004b  r2 41a278e8  r3 0003ae5007-12 23:14:15.434: INFO/DEBUG(11269):  r4 44992640  r5 a001fac5  r6 0000015b  r7 0000207207-12 23:14:15.434: INFO/DEBUG(11269):  r8 80816fc0  r9 00000004  10 00000000  fp bebf286807-12 23:14:15.434: INFO/DEBUG(11269):  ip 112648cb  sp bebf2564  lr 80818c6c  pc 80844380  cpsr 2000003007-12 23:14:15.434: INFO/DEBUG(11269):  d0  643a64696f72646e  d1  647265676775626507-12 23:14:15.434: INFO/DEBUG(11269):  d2  0064006e0069000f  d3  006500530077004607-12 23:14:15.434: INFO/DEBUG(11269):  d4  0001310600012f24  d5  000068870000673107-12 23:14:15.434: INFO/DEBUG(11269):  d6  4398835b4398835b  d7  4100000042d52ee007-12 23:14:15.434: INFO/DEBUG(11269):  d8  44994138439a088a  d9  0002405342d3c24707-12 23:14:15.434: INFO/DEBUG(11269):  d10 4499413842d3c247  d11 00000000439a088a07-12 23:14:15.434: INFO/DEBUG(11269):  d12 0000000000000000  d13 000000000000000007-12 23:14:15.434: INFO/DEBUG(11269):  d14 0000000000000000  d15 000000000000000007-12 23:14:15.434: INFO/DEBUG(11269):  d16 00000000449993e0  d17 4027a0540000000007-12 23:14:15.434: INFO/DEBUG(11269):  d18 0707070703030303  d19 f0f0f0f0f0f0f0f007-12 23:14:15.434: INFO/DEBUG(11269):  d20 0100010001000100  d21 010001000100010007-12 23:14:15.434: INFO/DEBUG(11269):  d22 f0f0f0f0f0f0f0f0  d23 f000f000f000f00007-12 23:14:15.434: INFO/DEBUG(11269):  d24 f000f000f000f000  d25 f000f000f000f00007-12 23:14:15.434: INFO/DEBUG(11269):  d26 0100010001000100  d27 010001000100010007-12 23:14:15.434: INFO/DEBUG(11269):  d28 0100010001000100  d29 010001000100010007-12 23:14:15.434: INFO/DEBUG(11269):  d30 0000000000000000  d31 3fe555555555555507-12 23:14:15.434: INFO/DEBUG(11269):  scr 2000001207-12 23:14:15.514: INFO/DEBUG(11269):          #00  pc 00044380  /system/lib/libdvm.so07-12 23:14:15.514: INFO/DEBUG(11269):          #01  lr 80818c6c  /system/lib/libdvm.so07-12 23:14:15.514: INFO/DEBUG(11269): code around pc:07-12 23:14:15.514: INFO/DEBUG(11269): 80844360 c064f8d0 f8dcb510 47983028 bf00bd10 07-12 23:14:15.514: INFO/DEBUG(11269): 80844370 699db5f0 0c90ea81 f00c460e 4604017f 07-12 23:14:15.514: INFO/DEBUG(11269): 80844380 b0856828 19c5010f f8d559c1 42a1c00c 07-12 23:14:15.514: INFO/DEBUG(11269): 80844390 6869d10e d10b42b1 0f01f01c d10268af 07-12 23:14:15.514: INFO/DEBUG(11269): 808443a0 458468e8 4620d013 eb54f7dd e00e4607 07-12 23:14:15.514: INFO/DEBUG(11269): code around lr:07-12 23:14:15.514: INFO/DEBUG(11269): 80818c4c e5054008 e7950102 e5963014 e3500000 07-12 23:14:15.514: INFO/DEBUG(11269): 80818c5c e5962010 0a000cc1 e5900000 fa00adc0 07-12 23:14:15.514: INFO/DEBUG(11269): 80818c6c e3500000 0a000c64 ea000bef e320f000 07-12 23:14:15.514: INFO/DEBUG(11269): 80818c7c e320f000 eb000cbe e320f000 e320f000 07-12 23:14:15.514: INFO/DEBUG(11269): 80818c8c e320f000 e320f000 e320f000 e320f000 07-12 23:14:15.514: INFO/DEBUG(11269): stack:07-12 23:14:15.514: INFO/DEBUG(11269):     bebf2524  00000001  07-12 23:14:15.514: INFO/DEBUG(11269):     bebf2528  00000007  07-12 23:14:15.514: INFO/DEBUG(11269):     bebf252c  4186be10  07-12 23:14:15.514: INFO/DEBUG(11269):     bebf2530  80816fc0  /system/lib/libdvm.so07-12 23:14:15.514: INFO/DEBUG(11269):     bebf2534  8084e5cb  /system/lib/libdvm.so07-12 23:14:15.514: INFO/DEBUG(11269):     bebf2538  0000ccc8  [heap]07-12 23:14:15.514: INFO/DEBUG(11269):     bebf253c  418a76ec  /dev/ashmem/dalvik-LinearAlloc (deleted)07-12 23:14:15.514: INFO/DEBUG(11269):     bebf2540  00000000  07-12 23:14:15.514: INFO/DEBUG(11269):     bebf2544  afd10280  /system/lib/libc.so07-12 23:14:15.514: INFO/DEBUG(11269):     bebf2548  00000001  07-12 23:14:15.514: INFO/DEBUG(11269):     bebf254c  4186be24  07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2550  bebf25c0  [stack]07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2554  0000131e  07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2558  df002777  07-12 23:14:15.524: INFO/DEBUG(11269):     bebf255c  e3a070ad  07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2560  00000000  07-12 23:14:15.524: INFO/DEBUG(11269): #00 bebf2564  42af93dc  /system/framework/android.policy.odex07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2568  4186bdb8  07-12 23:14:15.524: INFO/DEBUG(11269):     bebf256c  bebf25c0  [stack]07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2570  00002072  07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2574  80818c6c  /system/lib/libdvm.so07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2578  44994138  /dev/ashmem/mspace/dalvik-heap/2 (deleted)07-12 23:14:15.524: INFO/DEBUG(11269):     bebf257c  bebf25c0  [stack]07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2580  00230030  [heap]07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2584  0000ccd0  [heap]07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2588  00035fa8  [heap]07-12 23:14:15.524: INFO/DEBUG(11269):     bebf258c  0000039c  07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2590  808a12e0  /system/lib/libdvm.so07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2594  808a5ed8  /system/lib/libdvm.so07-12 23:14:15.524: INFO/DEBUG(11269):     bebf2598  bebf2868  [stack]07-12 23:14:15.524: INFO/DEBUG(11269):     bebf259c  80822758  /system/lib/libdvm.so07-12 23:14:15.524: INFO/DEBUG(11269):     bebf25a0  0000ccc8  [heap]07-12 23:14:15.524: INFO/DEBUG(11269):     bebf25a4  bebf25c0  [stack]07-12 23:14:15.524: INFO/DEBUG(11269):     bebf25a8  808226dc  /system/lib/libdvm.so07-12 23:14:15.894: INFO/ActivityManager(87): Process  com.mypackage.name (pid 11450) has died.07-12 23:14:15.904: INFO/WindowManager(87): WIN DEATH: Window{44c2c2b8 com.mypackage.name/com.mypackage.name.Game paused=false}07-12 23:14:15.904: INFO/WindowManager(87): WIN DEATH: Window{44c95808 SurfaceView paused=false}07-12 23:14:15.924: INFO/UsageStats(87): Unexpected resume of android while already resumed in com.mypackage.name07-12 23:14:15.954: DEBUG/Zygote(58): Process 11450 terminated by signal (11)</code></pre>","389935","","236136","","2010-07-12 22:52:44","2012-02-29 08:12:34","Android App closes automatically - Native code crash?","<android>","2","3","","",""
"3232887","1","","","2010-07-12 22:48:21","3","263","<p>Is there a way to use the Google Maps API for Android in a Live Wallpaper? From looking at the API, mapViews seem to require a MapActivity, so I'm not sure if there an easy way to make this work in a WallpaperService out of the box.</p>","389940","","19750","","2011-08-31 14:26:10","2011-08-31 14:26:10","Google Maps API for Android in a WallpaperService (live wallpaper)","<android><maps><live-wallpaper>","0","1","1","",""
"3232895","1","3232944","","2010-07-12 22:50:31","1","1050","<p>I'd like to know how to draw two PNG pictures onto the screen.</p><p>My XML layout:  (named paperxml.xml)</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/layoutid""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""  &gt;    &lt;ImageView xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/paperid""        android:src=""@drawable/paperrepresentation""    /&gt;    &lt;ImageView xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/rockid""        android:src=""@drawable/rockrepresentation""        android:layout_alignTop=""@id/paperid""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>What would be the java code to instantiate the XML layout and display both ImageViews on the screen at the same time?Simply calling <code>setContentView(R.drawable.paperxml);</code> crashes my application on startup.</p>","389943","","119895","","2010-07-12 22:57:43","2010-11-21 03:36:19","How to draw 2 PNG Images to the screen at the same time","<android><image><png><draw><imageview>","3","0","","",""
"3232914","1","","","2010-07-12 22:55:01","2","240","<p>Android resources and their automatically generated references simplify the development of <strong>one</strong> app a great deal. But they also complicate the reuse of Android activities in multiple projects, and in general of any component that uses resources.</p><p><a href=""http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject"" rel=""nofollow"">Library projects</a> are a limited alternative. A project can depend on many library projects, but a library project can't depend on another, and adding additional JAR dependencies is not straightforward.</p><p>How do you reuse Android components (not plain old Java code)? Any tips and tricks?</p>","143378","","","","","2010-07-12 23:33:04","Reuse tips for Android","<android><resources><activity><code-reuse>","1","0","","",""
"3233331","1","3233475","","2010-07-13 00:25:58","1","3066","<p>I have an android application using an SQLite database. I open the database when the application starts, but never close it as it is in constant use.</p><p>What is the best way to tell the database to flush all its changes to permanent storage? Do I need to just close it and re-open or is there a more efficient way?</p><p>My problem is that when testing on a phone, turning the phone off after a number of writes sometimes causes the database to loose the most recent updates when the application is restarted, which is obviously unacceptable for a database system. </p><p>Since I cannot find out how to capture the application close event I cannot know when to manually close the database.</p>","40175","","","","","2011-07-23 17:21:53","Flushing and SQLite database on android","<android><sqlite3>","3","0","1","",""
"3233429","1","3234944","","2010-07-13 00:51:58","0","547","<p>I'm looking for a good way to manage multiple SharedPreference files. Basically the user should be able to create, edit, and delete the preference files and then select the one they want from a spinner.</p><p>What I'm trying to figure out is how do I find all of the preference files that the app has? Is there a way to scan the directory and return the names of all of the preference files?</p><p>I'm thinking that once I get a lits of all of the names I could create a string array with all of the names and feed it to the spinner.</p><p>Thanks for the help!</p>","368845","","","","","2010-07-13 07:22:19","Managing multiple SharedPreference files","<android><preferences>","1","0","","",""
"3233477","1","3234368","","2010-07-13 01:06:14","0","2194","<p>I have two parts of a program (the actual app and a BroadcastReceiver) that could possibly try to connect to and modify a SQLite database and a SharedPreferences file.</p><p>1) I know you can make multiple connections to a single SQLite database. I also read that SQLite can ""lock"" the database when it attempts to modify or read from a database (UPDATE, INSERT, etc), so how do I properly handle the case where 2 threads try to modify/read a single SQLite database at the same time?</p><p>Right now, I have have this code snippet in my database connection code/class:</p><pre><code>private SQLiteDatabase myDatabase;public boolean insert(ContentValues columnValueMap) throws Exception    {        long result = 0;        int attempt =0;        do        {            if(!myDatabase.isDbLockedByOtherThreads() &amp;&amp; !myDatabase.isDbLockedByCurrentThread())            {                synchronized (myDatabase)                {                    result=myDatabase.insertOrThrow(TABLE_NAME, TEXT, columnValueMap);                    if(result ==0 || result == -1)                    {                        return false;                    }                    return true;                }            }            else            {                Thread.sleep(50);            }            attempt++;        }while(attempt&lt;=5);        throw new Exception(""Database Locked!"");    }</code></pre><p>2) Do I also have to worry about simultaneous access for a SharedPreferences file (It doesn't matter which thread gets access first, I'm just worried about errors being thrown)?</p><p>Thanks. </p><p><strong>[EDIT]</strong> Proposed change</p><pre><code>public boolean insert(ContentValues columnValueMap) throws Exception    {        long result = 0;        synchronized (myDatabase)        {            result=myDatabase.insertOrThrow(TABLE_NAME, SMS_TEXT, columnValueMap);            if(result ==0 || result == -1)            {                return false;            }            return true;        }    }</code></pre>","272302","","272302","","2010-07-13 07:36:53","2010-07-13 07:36:53","Android -- SQLite + SharedPreferences, 2 Threads Simultaneous Read/Write?","<java><android><multithreading><sqlite><sharedpreferences>","1","0","2","",""
"3233542","1","","","2010-07-13 01:23:07","0","1025","<p>I'm having an issue with inheritance between 2 classes and a single normal class.  Here is an example of what I have:</p><p>Abstract ClassA      function get_name();</p><p>Abstract ClassB extends ClassA</p><p>ClassC extends ClassB</p><p>Now, when I create an object of ClassC, I can't access the get_name() function.  I'm not sure what I'm doing wrong here.  Any help would be very much appreciated!</p>","390015","","","","","2010-07-13 01:27:39","Android/Java Abstract Class Inheritance Issue","<java><android><inheritance><abstract-class>","1","1","","",""
"3233657","1","3233680","","2010-07-13 01:53:26","1","1619","<p>I have a TextView that will hold a styled, multiline string.  This text is generated line by line as the data is drawn from different sources bit by bit.  As I grab each field, I add a Bold header to the TextView on a new line, then I add the data for that field in italics on a new line.</p><p>Example formatting:     </p><p><strong>Due Date</strong><br><em>July 22, 2010</em><br><strong>Course</strong><br><em>CSC 350</em></p><p>I could set the styling like this:</p><pre><code>Spannable str = (Spannable) textview.getText();str.setSpan(new StyleSpan(android.graphics.Typeface.Bold), 0, 8, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);str.setSpan(new StyleSpan(android.graphics.Typeface.Italic), 8, 21, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);str.setSpan(new StyleSpan(android.graphics.Typeface.Bold), 21, 27, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);str.setSpan(new StyleSpan(android.graphics.Typeface.Italic), 27, 33, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);</code></pre><p>But that requires knowing the length of each section of text at runtime which is simply unmanageable since there is a variable number of data fields that could be added to the textview.</p><p>How can I add the styling as I'm adding each piece of text instead of after all the text has been added?</p>","131871","","","","","2012-01-24 18:48:52","How to generate Styled text for TextView while assembling string?","<android><coding-style><textview>","4","0","","",""
"3233764","1","3233863","","2010-07-13 02:24:33","4","2192","<p>I'm sorry in advance for not having any code to post up, mainly because I can't for the life of me figure out how I need to do what I need to do.</p><p>Basically, at specified intervals during the day (ex. 5 P.M), I want my app to download some data from my server and store it on the device. This is to both reduce the load on my server from having data being downloaded every time the app is run, and to reduce the loading times for the user so that when they go to use the app, the latest data is already sitting on their device.</p><p>I have absolutely no clue how to do this. I know how to download data just fine, but now how to download in the background like I'm planning. Is it even possible?</p><p>I'm not asking for anyone to do it for me, but could someone please point me in the right direction. </p>","205910","","157882","","2010-07-13 02:33:37","2013-08-15 11:59:11","Android - How to download data in the background at specified times","<java><android><background><sync>","4","0","2","",""
"3233923","1","3233935","","2010-07-13 03:08:08","0","433","<p>I have a working dynamic <code>TableLayout</code> that holds user data. Clicking an ""Add Event"" button brings up a <code>Dialog</code> that allows the user to enter data. When the <code>Dialog</code> is dismissed, the entered data appears as a new row in the table. </p><p>Now, however, I am having trouble allowing the user to EDIT a given row in the table. It seems I need dynamic ID's to give each <code>TableRow</code> in order to allow edits. Is this possible?</p>","382252","","","","","2011-06-13 20:24:07","Dynamic TableLayout with ID's?","<android>","1","0","1","",""
"3233967","1","3234018","","2010-07-13 03:22:09","0","605","<p>i have a lisyView,every item(every row ) have a imageView and a textView,when i scroll the listView,the whole item gets the focus,but for every item , frist i want to  imageView  gets focus,then textViews get focus,so thati can handle the click events of imageView,so my questtion is how to get the focus of imageView .</p>","233618","","233618","","2010-07-13 08:46:33","2010-07-13 08:46:33","item of listView obtain focus and click events","<android><listview>","1","0","","",""
"3234276","1","3234330","","2010-07-13 04:51:15","0","1252","<blockquote>  <p><strong>Possible Duplicates:</strong><br>  <a href=""http://stackoverflow.com/questions/307934/learning-java"">Learning Java?</a><br>  <a href=""http://stackoverflow.com/questions/75102/best-java-book-you-have-read-so-far"">Best Java book you have read so far</a>  </p></blockquote><p>I wanna learn to program in Java so i can program for Android and iPhone. so is there a book or something where i can learn the basic very fast.</p><p>I have a programming background in PHP, MySQL etc</p>","155196","","379693","","2010-10-30 08:48:39","2010-10-30 08:48:39","Java crashcourse","<java><android><android-emulator>","2","3","","2010-07-13 16:59:44",""
"3234386","1","3384789","","2010-07-13 05:20:51","2","1736","<p>I want to insert a contact photo with other information in a batch insert. ""is"" is the input stream using the uri of the photo:</p><pre><code>is = Data.clientContext.getContentResolver().openInputStream(/data/data/com.project.xxxxxxxxxxxxx/files/photo);             op_list.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)                .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)                .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE)                .withValue(ContactsContract.CommonDataKinds.Photo.PHOTO, is)                .build());</code></pre><p>I cannot seem to get the photo to insert with the batch. Any pointers?</p>","371532","","","","","2010-08-02 03:21:54","Android: Batch insert contact photo","<android><batch-file><insert>","1","0","","",""
"3234485","1","3234865","","2010-07-13 05:44:55","0","380","<p>Is there a way to encode a string as a bitmap? Or a drawable?</p><p>ThanksChris</p>","321927","","","","","2010-07-13 07:29:49","Android encode string as bitmap?","<android><string><bitmap><encode><drawable>","1","1","","",""
"3234562","1","3236931","","2010-07-13 06:01:57","1","187","<p>I need to have a video preview(on a Surface) and a TextView and a few buttons(at the bottom of the screen)</p><p>Currently, my preview's height is large but it's narrow and at the far left at the screen and the TextView is not visible.</p><p>The buttons are placed at the bottom as I require.</p><p>How do I make the preview's width large as well and the TextView visible?</p><p>Here is my layout:</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;TextView  android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Android Recorder""/&gt;&lt;SurfaceView android:id=""@+id/camsurface""        android:layout_width=""fill_parent""  android:layout_height=""0px"" android:layout_weight=""1"" /&gt; &lt;TextView   android:id=""@+id/recording_time""android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text="" 00:00""/&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""horizontal""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;Button android:id=""@+id/btn_settings"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Settings""/&gt; &lt;Button android:id=""@+id/btn_record"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Record"" /&gt; </code></pre><p>    </p><p></p>","381699","","381699","","2010-07-14 09:16:05","2010-07-14 09:27:16","GUI-preview and buttons together","<android>","2","0","","",""
"3234572","1","3234653","","2010-07-13 06:04:01","14","6997","<p>Can we simulate calls and SMS in android programmtically? Like in Windows mobile we can simulate calls and SMS.</p>","389525","","389525","","2010-07-13 06:37:40","2010-07-13 07:44:48","How can we simulate calls and SMS in Android?","<java><android>","2","8","1","",""
"3234582","1","3234631","","2010-07-13 06:06:08","0","876","<p>As I have referred some articles and sites, I found that we can also create HTML file and then we can display HTML file using Android WebView..</p><p>I have referred at:</p><ol><li><a href=""http://developerlife.com/tutorials/?p=369"" rel=""nofollow"">Android WebView (WebKit) Tutorial</a></li><li><a href=""http://mobiforge.com/designing/story/understanding-user-interface-android-part-4-even-more-views"" rel=""nofollow"">Understanding User Interface in Android - Part 4: Even More Views</a></li></ol><p>So my question is that:</p><blockquote>  <p>Is Android provides STYLE/CSS tag to define styles, if yes then there is any way to write STYLE/CSS tag in Android?</p></blockquote><p>Thanx - Paresh</p>","379693","","128662","","2011-08-08 12:43:08","2011-08-08 12:43:08","HTML Style Tag in Android","<html><android><android-widget><android-webview>","1","0","1","",""
"3234607","1","3234884","","2010-07-13 06:12:20","30","40328","<p>Is it possible to set a focus to a button widget which lies somewhere down in my layout. <code>onCreate</code> of the activity my control/focus should be on that button programmatically.</p>","28557","","57191","","2012-01-16 14:11:22","2013-08-07 12:57:36","Android - Set focus to a button widget programmatically onCreate of the activity","<android><android-widget>","1","0","6","",""
"3234704","1","3235116","","2010-07-13 06:35:44","7","4068","<p>I have noticed that applications like GPS Status get a fix pretty quickly. When I try to get a fix within my own application it takes more time. Does anybody know why is this happening? Do they use a hidden part of the API to force the GPS to connect faster?</p><p>Here's what I use</p><pre><code>LocationManager loc = (LocationManager) context            .getSystemService(Context.LOCATION_SERVICE);loc.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,            listener);</code></pre><p>I want the GPS to give results as frequent as possible because I need it for an AR app :)Although I putting settings like 1000 ms and 1 m for the update frequency with no perceivable difference in speed of fix. </p>","369531","","","","","2012-06-07 11:45:51","Faster GPS fix in Android","<android><gps>","2","0","5","",""
"3234712","1","3234855","","2010-07-13 06:37:13","1","384","<p>How do you prevent the screen from going off when recording is in process. If recording is in process, and there's no other activity like using arrow keys, or the keypad, the screen goes off and when it's brought back to life, the preview is corrupted.</p>","381699","","","","","2012-11-28 10:40:33","screen goes off while recording and preview gets corrupted","<android>","1","0","1","",""
"3234823","1","","","2010-07-13 07:02:06","3","1232","<p>I have a ListView that shows the closest word matches to a search.</p><p>For example if I search ""hi"" I get the following results in the ListView<br/></p><p><br/>...<br/><strong>hi</strong><br/>hi five<br/>hi-five<br/>high<br/>highlight<br/>....</p><p>I am using </p><pre><code>ListView.setSelection(wordList.indexOf(searchWord));ListView.setSelected(true);</code></pre><p>The above code puts the selected word ""hi"" at the top and doesnt highlight the selection.</p><p>I want the ""hi"" to be centrally positioned , selected and highlighted automatically.See below</p><p>...<br/>hello<br/>hello there<br/><strong>hi</strong><br/>hi-five<br/>hi five<br/>...</p><p>What code can I use to achieve the above?</p><p>Many thanks.</p>","390164","","","","","2014-04-03 09:26:01","Android ListView center selection","<java><android>","4","2","","",""
"3234830","1","","","2010-07-13 07:02:40","3","572","<p>I have a block of text that includes name, maybe company name, and address, and maybe email address. I want to extract the street address out of that, and preferably name and address.</p><p>This data is siphoned from multiple sources, so I have no idea about the actual formatting. It could be something like this</p><pre><code>Company name, owner@domain.comATTN John Doecare of Company Name123 Street StNew York, NY 12345US123-456-7890</code></pre><p>But any of those lines could be rearranged or missing (phone number could come first, no ATTN or c/o, etc). Also, this could be from any country.</p><p>The goal is to a) plug the address into the Google Maps API, and b) create a contact with as much information as possible.</p><p>Here is a random idea I had:</p><ol><li>Take any line with an email address (can be found with a regex easily), store the email address and remove the line from further consideration.</li><li>Take any line with a phone number (digits only, and [-+()]), store that number, and remove the line from further consideration.</li><li>Take the last three lines and consider those the street address - plug them into Google Maps and hope for the best.</li></ol><p>Obviously, that's a lot of juju magic. Is there a smarter approach? Are there are any libraries that have good regexes to look for street addresses of different countries?</p>","345717","","","","","2012-02-08 13:03:05","Extract address/contact details from a text block with name and address?","<java><android><street-address>","1","2","","",""
"3234873","1","3234915","","2010-07-13 07:09:11","1","1314","<p>I know this has been covered elsewhere, but I'm new to the Android platform and am having a hard time figuring out how to add basic menu options to my first app.</p><p>I have an options menu setup using</p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu){  MenuInflater inflater = getMenuInflater();  inflater.inflate(R.menu.menu, menu);  return true;}</code></pre><p>and</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:id=""@+id/menuPrefs"" android:icon=""@android:drawable/ic_menu_preferences"" android:title=""Settings""&gt;&lt;/item&gt;&lt;/menu&gt;</code></pre><p>Then within my main java class I have</p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item){ if(item.getItemId()==R.id.menuPrefs) {  showPrefs(); }private void showPrefs() { Intent i = new Intent(this, Prefs.class); startActivity(i);}</code></pre><p>And then in Prefs.java I have</p><pre><code>public class Prefs extends Activity {     @Override     protected void onCreate(Bundle savedInstanceState) {      Toast.makeText(getBaseContext(), ""FNORD"", Toast.LENGTH_LONG).show();     }    }</code></pre><p>Now from this I would expect to see the Toast message ""FNORD"" when the menu option is pressed, however the application stops unexpectedly.</p><p>If I move the toast statement into the showPrefs() function in place of the startActivity call it works.</p>","389152","","","","","2012-07-05 16:25:28","startActivity crashes when trying to respond to menu click","<android>","3","0","","",""
"3235131","1","6159538","","2010-07-13 07:51:10","71","49048","<p>I have some fixed strings inside my <code>strings.xml</code>, something like:</p><pre><code>&lt;resources&gt;    &lt;string name=""somestring""&gt;        &lt;B&gt;Title&lt;/B&gt;&lt;BR/&gt;        Content    &lt;/string&gt;&lt;/resources&gt;</code></pre><p>and in my layout I've got a <code>TextView</code> which I'd like to fill with the html-formatted string.</p><pre><code>&lt;TextView android:id=""@+id/formattedtext""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:text=""@string/htmlstring""/&gt;</code></pre><p>if I do this, the content of <code>formattedtext</code> is just the content of <code>somestring</code> stripped of any html tags and thus unformatted.</p><p>I know that it is possible to set the formatted text programmatically with </p><p><code>.setText(Html.fromHtml(somestring));</code> </p><p>because I use this in other parts of my program where it is working as expected.</p><p>To call this function I need an <code>Activity</code>, but at the moment my layout is just a simple more or less static view in plain XML and I'd prefer to leave it that way, to save me from the overhead of creating an <code>Activity</code> just to set some text.</p><p>Am I overlooking something obvious? Is it not possible at all? Any help or workarounds welcome!</p><p>Edit: Just tried some things and it seems that HTML formatting in xml has some restraints: </p><ul><li><p>tags must be written lowercase </p></li><li><p>some tags which are mentioned <a href=""http://stackoverflow.com/questions/3207769/android-textview-with-html-seperator"">here</a>  do not work, e.g. <code>&lt;br/&gt;</code> (it's possible to use <code>\n</code> instead)</p></li></ul>","323715","","323715","","2010-07-13 13:32:21","2014-03-11 03:01:42","Set TextView text from html-formatted string resource in XML","<html><android><formatting><textview>","4","1","51","",""
"3235314","1","3237413","","2010-07-13 08:20:21","1","72","<p>I am looking to write an Android app for a device that has not been released to the market yet, and so I will not have the hardware to test upon.  I have created an AVD (Android Virtual Device) with as much information as is currently available on the web, so assume that this is as like the device as is possible to get.</p><p>However, does anyone have any tips or ideas to make the process of developing for this platform as easy as possible?  My current apps have been for personal use on my own phone, so can test performance on the hardware etc. which is obviously not possible in this case.  Any gotchas to watch out for (apart from the possibility of the device never being released..!!)</p>","201618","","","","","2010-07-13 13:04:05","Android - writing apps for not-yet-released devices","<android><android-emulator>","1","6","","",""
"3235380","1","4329537","","2010-07-13 08:28:05","25","9112","<p>I was a JaveEE developer. Recently I joined an Android development team. The structure of Android confused me. The MVC design pattern seems not suit for Android development. So what's is the design pattern principle for Android development? I means is there any hint about how to write a clean, easy reading and effective Android code. </p>","389204","","","","","2013-01-10 21:56:35","what's design pattern principle in the Android development?","<android><design><design-patterns>","6","0","22","",""
"3235513","1","3237106","","2010-07-13 08:48:44","1","526","<p>How can I disable swipeLeft()/swipeRight() methods, because it <strong>intercepts onRelease() method</strong> then I quickly moves the finger?</p>","384328","","","","","2010-07-13 12:46:40","KeyboardView.OnKeyboardActionListener","<android><keyboard-events>","1","0","","",""
"3235622","1","3236169","","2010-07-13 09:06:27","4","301","<p>Im trying to find an idea for my third year project related to mobile programming with Android or J2ME. anybody has any new idea of mobile application? or at least something that is worth to work on it for the third year project?</p>","261002","","114066","","2010-07-13 11:33:17","2010-07-13 14:48:25","mobile programming","<android><java-me>","10","2","1","2010-07-14 02:26:35",""
"3235630","1","3235695","","2010-07-13 09:07:38","1","1953","<p>Is there any better way to draw a black horizontal line than defining layout with fixed height and black background?</p>","296427","","114066","","2012-01-27 08:45:12","2012-01-27 08:45:12","How to draw horizontal line in ListView?","<android><android-listview><listviewitem>","2","0","","",""
"3235640","1","3235663","","2010-07-13 09:08:43","1","2403","<p>I am porting a linux application onto android, which runs on beagle board.</p><p>My application has to access serial port(send/recv). Is it possible to read/write serialport using an application, unless the android is 'root'ed? </p>","180908","","49246","","2010-12-27 22:59:11","2011-12-14 15:14:18","Serial port programming on Android-Beagleboard","<android><serial-port><beagleboard>","1","0","","",""
"3235746","1","3240478","","2010-07-13 09:23:02","10","7304","<p>I have some code which executes two queries against a database and returns two cursor objects.  Is there any way that I can combine these two cursors so that all the <code>ListView</code> gets the data from both?</p>","264276","","493939","","2012-05-03 17:28:01","2012-05-03 17:28:01","ListView using two cursoradapters?","<android><android-listview><android-cursoradapter>","4","0","5","",""
"3236070","1","3236661","","2010-07-13 10:04:09","1","199","<p>I defined the following Sound Class to play Sound in my Pacman Game:</p><pre><code>public class Sound {    private static boolean sound = true;    private static MediaPlayer eatSound;    private static MediaPlayer shortEatSound;    private static MediaPlayer eatCherry;    private static MediaPlayer eatGhost;    private static MediaPlayer extraLive;    private static MediaPlayer intermission;    private static MediaPlayer openingSound;    private static MediaPlayer pacmanDiesSound;    private static MediaPlayer sirenSound;    public static void initializeOpenSound(Context context) {        openingSound = MediaPlayer.create(context, R.raw.opening_song);    }    public static void initializeSounds(Context context) {        eatSound = MediaPlayer.create(context, R.raw.eating);        shortEatSound = MediaPlayer.create(context, R.raw.eating_short);        eatCherry = MediaPlayer.create(context, R.raw.eating_cherry);        eatGhost = MediaPlayer.create(context, R.raw.eating_ghoasts);        extraLive = MediaPlayer.create(context, R.raw.extra_lives);        intermission = MediaPlayer.create(context, R.raw.intermission);        pacmanDiesSound = MediaPlayer.create(context, R.raw.pac_man_dies);        sirenSound = MediaPlayer.create(context, R.raw.siren);    }    public static int getOpeningSoundDuration() throws SoundInitializationError {        if (openingSound != null) {            return openingSound.getDuration();        } else {            throw new SoundInitializationError(""Opening Sound not initialized!"");        }    }    public static void playSirenSound() throws SoundInitializationError {        if (isSoundOn()) {            if (sirenSound != null) {                sirenSound.start();            } else {                throw new SoundInitializationError(""Siren Sound not initialized!"");            }        }    }    public static void playPacmanDiesSound() throws SoundInitializationError {        if (isSoundOn()) {            if (pacmanDiesSound != null) {                pacmanDiesSound.start();            } else {                throw new SoundInitializationError(""Pacman Dies Sound not initialized!"");            }        }    }    public static void playOpeningSound() throws SoundInitializationError {        if (isSoundOn()) {            if (openingSound != null) {                openingSound.setLooping(true);                openingSound.start();            } else {                throw new SoundInitializationError(""Opening Sound not initialized!"");            }        }    }    public static void playIntermissionSound() throws SoundInitializationError {        if (isSoundOn()) {            if (intermission != null) {                intermission.start();            } else {                throw new SoundInitializationError(""Intermission Sound not initialized!"");            }        }    }    public static void playExtraLiveSound() throws SoundInitializationError {        if (isSoundOn()) {            if (extraLive != null) {                extraLive.start();            } else {                throw new SoundInitializationError(""Extra Live Sound not initialized!"");            }        }    }    public static void playEatSound() throws SoundInitializationError {        if (isSoundOn()) {            if (eatSound != null) {                eatSound.start();            } else {                throw new SoundInitializationError(""Eat Sound not initialized!"");            }        }    }    public static void playShortEatSound() throws SoundInitializationError {        if (isSoundOn()) {            if (shortEatSound != null) {                shortEatSound.start();            } else {                throw new SoundInitializationError(""Short Eat Sound not initialized!"");            }        }    }    public static void playEatCherrySound() throws SoundInitializationError {        if (isSoundOn()) {            if (eatCherry != null) {                eatCherry.start();            } else {                throw new SoundInitializationError(""Eat Cherry Sound not initialized!"");            }        }    }    public static void playEatGhostSound() throws SoundInitializationError {        if (isSoundOn()) {            if (eatGhost != null) {                eatGhost.start();            } else {                throw new SoundInitializationError(""Eat Ghost Sound not initialized!"");            }        }    }    public static void stopOpeningSound() throws SoundInitializationError {        if (openingSound != null) {            openingSound.stop();        } else {            throw new SoundInitializationError(""Opening Sound not initialized!"");        }    }    public static boolean isSoundOn() {        return sound;    }    public static void setSoundOn(boolean b) {        sound = b;    }}</code></pre><p>This works perfectly well on my HTC Desire, but on my T-Mobile G1, only the OpeningSound can be played. The other sound files aren't played, but there is also no exception. Both devices use 2.1.</p><p>Any hints?</p>","","anon","","anon","2010-07-13 10:20:48","2010-07-13 11:26:43","Sound works on HTC Desire but not on T-Mobile G1","<java><android><audio>","1","0","","",""
"3236125","1","","","2010-07-13 10:14:41","1","296","<p>i want to save received mms in my pc through data cable or bluetooth automatically.</p><p>any one guide me which phone supports functionality like this or is there any specific software available to achieve this?</p><p>any help would be appreciated.</p>","249991","","","","","2010-07-13 10:14:41","what is easiest way to save mms in pc?","<iphone><android><windows-mobile><blackberry><symbian>","0","2","","2010-07-13 12:31:17",""
"3236175","1","3237345","","2010-07-13 10:23:36","1","94","<p>How to set <code>targetsdkversion</code> for 1.5. I developing projects based on eclipse id when I try to set <code>targetSdkVersion</code> in manifest it showing error.</p>","1746300","","119895","","2010-07-13 12:53:13","2010-07-13 12:54:28","Use sdk problem","<android>","2","2","","",""
"3236195","1","","","2010-07-13 10:26:42","5","5597","<p>I'm making a game on Android and I need to do certain actions when the users attempts a long press on the screen. Unfortunately I haven't found any methods that works directly with a custom SurfaceView, feel free to tell me if such a method exists :)</p><p>So I decided to try and implement a long touch detection from the onTouch event listener.</p><p>here is my code:</p><pre><code>@Override    public boolean onTouch(View v, MotionEvent event)    {        long touchDuration = 0;            if ( event.getAction() == MotionEvent.ACTION_DOWN )            {                //Start timer                touchTime = System.currentTimeMillis();            }else if ( event.getAction() == MotionEvent.ACTION_UP )            {                //stop timer                touchDuration = System.currentTimeMillis() - touchTime;                if ( touchDuration &lt; 800 )                {                    onShortTouch(event,touchDuration);                }else                {                    onLongTouch(event,touchDuration);                }            }        }        return true;</code></pre><p>This works, but I can detect if the press was a long press or not only when the user stops touching the phone. So it's not exactly what I want.  I would prefer if a timer would start when the user first touches the screen then once 800 ms is elapsed the LongTouch() method is called. In other words, I don't want to have to check how long has elapsed when ACTION_UP since ACTION_DOWN. I believe I should use a thread for the said timer but I can't make it work. When using the following code, the debug message is displayed as soon as I touch the screen:</p><pre><code>        @Override    public boolean onTouch(View v, MotionEvent event)    {        long touchDuration = 0;            TouchThread touchThread = new TouchThread();            if ( event.getAction() == MotionEvent.ACTION_DOWN )            {                //Start timer                touchTime = System.currentTimeMillis();                touchThread.setEvent(event);                touchThread.run();              }        return true;    }    private class TouchThread extends Thread    {            public MotionEvent event = null;            public void setEvent(MotionEvent e)            {                event = e;            }            @Override            public void run()            {                long startTime = System.currentTimeMillis();                long time = 0;                while(event.getAction() == MotionEvent.ACTION_DOWN)                {                    time = System.currentTimeMillis() - startTime;                    if( time &gt; 800 )                    {                        System.out.println(""LOOONG CLICK!!"");                        return;                    }                }            }    }</code></pre><p>Has anyone got any idea ? An other solution would also be welcome.</p><p>Thanks.</p>","376373","","1016716","","2012-04-30 08:31:43","2012-04-30 08:31:43","Long Touch on a surfaceView ( android )","<android><multithreading><touch><long-press>","3","0","1","",""
"3236203","1","3252924","","2010-07-13 10:27:54","3","3923","<p>I have a table named ""master"" with columns <code>id</code>, <code>name</code>, <code>surname</code>, <code>gender</code>, and  <code>designation</code></p><p>When I fire off a query to get a <a href=""http://developer.android.com/reference/android/database/Cursor.html"" rel=""nofollow"">Cursor</a> object for a <a href=""http://developer.android.com/reference/android/widget/CursorAdapter.html"" rel=""nofollow"">CursorAdapter</a> I get:</p><pre><code>IllegalArgumentException: column '_id' does not exist when call to CursorAdaptor </code></pre><p>But I don't have a columen named ""_id"".</p><p>Can anybody tell me why I am getting this error?</p><p>Here is the stack trace:</p><pre><code>07-13 15:45:40.582: WARN/System.err(295): java.lang.IllegalArgumentException: column '_id' does not exist07-13 15:45:40.592: WARN/System.err(295):     at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:314)07-13 15:45:40.592: WARN/System.err(295):     at android.widget.CursorAdapter.changeCursor(CursorAdapter.java:257)07-13 15:45:40.602: WARN/System.err(295):     at com.praumtech.names4baby.ui.NamesListAdapter.setCursor(NamesListAdapter.java:63)07-13 15:45:40.602: WARN/System.err(295):     at com.praumtech.names4baby.ui.BoysNamesListActivity.initNameList(BoysNamesListActivity.java:79)07-13 15:45:40.602: WARN/System.err(295):     at com.praumtech.names4baby.ui.BoysNamesListActivity.onCreate(BoysNamesListActivity.java:49)07-13 15:45:40.602: WARN/System.err(295):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)07-13 15:45:40.602: WARN/System.err(295):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)07-13 15:45:40.612: WARN/System.err(295):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)07-13 15:45:40.612: WARN/System.err(295):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)07-13 15:45:40.612: WARN/System.err(295):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)07-13 15:45:40.612: WARN/System.err(295):     at android.os.Handler.dispatchMessage(Handler.java:99)07-13 15:45:40.621: WARN/System.err(295):     at android.os.Looper.loop(Looper.java:123)07-13 15:45:40.621: WARN/System.err(295):     at android.app.ActivityThread.main(ActivityThread.java:4203)07-13 15:45:40.621: WARN/System.err(295):     at java.lang.reflect.Method.invokeNative(Native Method)07-13 15:45:40.621: WARN/System.err(295):     at java.lang.reflect.Method.invoke(Method.java:521)07-13 15:45:40.621: WARN/System.err(295):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)07-13 15:45:40.621: WARN/System.err(295):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)07-13 15:45:40.631: WARN/System.err(295):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","289597","","20712","","2013-08-22 00:04:30","2013-08-22 00:04:30","IllegalArgumentException: column '_id' does not exist when call to SimpleCursorAdaptor","<android><database>","4","0","2","",""
"3236304","1","","","2010-07-13 10:41:30","1","1346","<p>i am gettin 1 problem in d android application that i have made.</p><p>-> i have a 3 RadioButton's on 1 activity screen</p><p>-> after a Button is pressed(on same activity) the text associated with all of them should change and all RadioButton's must be unchecked and should be clickable</p><p>the text is changing properly and the RadioButton's are becoming unchecked but the problem am facing is that:</p><ol><li>if suppose RadioButton 1 is selected and then after pressing the Button am unable to click that same RadioButton until i click some other RadioButton.</li></ol><p>Why so??</p>","379749","","","","","2014-03-06 06:11:05","android - controlling state of RadioButton","<android><activity><radio-button>","3","1","1","",""
"3236746","1","3565167","","2010-07-13 11:39:17","3","1784","<p>How can I tell that my application has been put in the background (i.e. none of my app's activities are visible anymore)? I need to determine this so that I can release resources shared among several of my activities (graphics, sound clips and a socket connection).</p><p>I've thought about keeping a global counter that's incremented in the activities' onStart() method, and decremented in onStop(). If the counter reaches zero, then all activities have been stopped and my app is running in the background. However I'm not sure if this is going to be 100% reliable. Also, I can't help but think that there must be a better way of doing this.</p>","135522","","135522","","2010-07-13 12:00:43","2011-06-09 10:33:45","Determining if app is running in background","<android><activity>","5","1","1","",""
"3236907","1","","","2010-07-13 12:00:19","1","140","<p>I'm using a CountDownTimer's <code>onTick(long l)</code> function to check some conditions and if they are satisfied then I call an activity's function to perform some UI related tasks. However I'm wondering if it is possible that while the activity is destroyed and recreated due to an orientation change, the <code>onTick()</code> to be run, and possible to call for the function in my activity, activity that might not yet be created?</p><p>If so any ideas on how this could be corrected ?</p>","304866","","119895","","2010-07-13 12:50:56","2010-07-13 16:38:34","Activity lifecycle related issue","<android>","3","0","","",""
"3237060","1","3238180","","2010-07-13 12:21:30","2","765","<p>What is the maximum size of the SD Card on an Android Emulator running Android 2.1 ? What is the maximum size one can specify?</p>","373049","","","","","2010-08-02 21:50:07","Maximum Size of the SD Card on an Android 2.1 Emulator","<android><android-emulator>","2","4","","",""
"3237129","1","3237180","","2010-07-13 12:29:53","1","220","<p>I have downloaded the appinventor_extras_setup.exe from net and installed the complete package. But whenever I type the URL <a href=""http://appinventor.googlelabs.com"" rel=""nofollow"">http://appinventor.googlelabs.com</a> it starts asking a survey.. Is that because I haven't connected my phone with the PC.. What if I m a developer with an android phone.. can't I use appInventor?</p>","172543","","31899","","2010-07-16 15:45:39","2010-11-06 13:05:20","In the latest launched AppInventor is it necessary to connect a phone to PC for building the app?","<android><app-inventor>","5","0","","",""
"3237400","1","3238134","","2010-07-13 13:01:51","0","285","<p>Using:</p><pre><code>private void play() {    VideoView v = (VideoView) findViewById(R.id.videoView);    MediaPlayer mp = MediaPlayer.create(this, R.raw.video);    mp.setDisplay(v.getHolder());    mp.start();}</code></pre><p>My video plays just about 5 first seconds, and stay like paused.. why does it happen? Is it something related to buffer? (I'm playing a local resource)</p><p>--</p><p>I've tried another 3gp video, and the same problem happens.</p>","287316","","287316","","2010-07-13 13:15:11","2010-07-13 14:23:39","Video plays just the first 5 seconds","<android><video><multimedia>","2","0","1","",""
"3237403","1","","","2010-07-13 13:02:07","3","908","<p>I'm creating a gallery view where I'm loading images from the web. While the images are loading, I want to display an animation as a placeholder for each image. I figured this could be done using an AnimationDrawable, however, the animation won't start. The first frame of the animation loads as expected, and if I use the same in for example onWindowFoucsChanged in an activity, everything works fine.</p><p>Inside the getView method of my GalleryItemCursorAdapter (which extends SimpleCursorAdapter) I'have the following snippet:</p><pre><code>AnimationDrawable frameAnimation = (AnimationDrawable) mContext.getResources().getDrawable(R.drawable.loading);    holder.picture.setImageDrawable(frameAnimation);    frameAnimation.setCallback(holder.picture);    frameAnimation.setVisible(true, true);    frameAnimation.start();     </code></pre><p>holder.picture is an ImageView. I get no errors, and (very) similar code seems to work fine other places, leading me to believe this may be related to similar to the onCreate issues for animations reported elsewhere. I've tried some variations of the above code, too.</p><p>My questions:</p><ol><li>Is there an easier/better way to display a loading animation?</li><li>What can I do to make the above example work (if at all possible)?</li></ol>","184844","","","","","2011-05-22 11:18:08","How to use AnimationDrawable in getView with Gallery","<android><animation><drawable>","1","0","","",""
"3237521","1","3237738","","2010-07-13 13:17:32","2","1918","<p>Is there a way to show a <code>TextView</code> in front of a <code>VideoView</code>?</p>","287316","","119895","","2010-07-13 13:24:22","2010-07-13 13:40:52","Show a TextView in front of a VideoView?","<android><gui><widget>","2","0","","",""
"3237542","1","4606055","","2010-07-13 13:21:17","4","175","<p>I have an app that reads and writes files during <code>onCreate</code>.  The problem is that when the app is installed via the Market and run the first time the files it needs to get have no access to them.  I get FileNotFound exceptions even though the file is there. If I back out of the app and reopen it then the files can be read.</p><p>This is not the same behavior when pushing the apk from eclipse or adb.  In fact I was able to reproduce the problem using eclipse and thought I fixed it doing adb uninstalls and eclipse installs but the problem persists for users pulling the update from the market.</p>","258676","","","","","2011-01-05 15:52:30","How can you reproduce the procedure that occurs when a Android market app is updated?","<android>","3","0","3","",""
"3237566","1","3245963","","2010-07-13 13:24:15","8","5702","<p>I have a gallery with the <code>TextView</code> to achieve the segment controller on the image below. I can achieve it by the ApiDemo's Gallery Example but I am lagging on the look and feel of the gallery.</p><p>I want to do the backgrounds, Selected/deselected and selected item won't be cone to the center of the screen.</p><p>Any Idea or Articles are most Thankful.</p><p><img src=""http://www.freeimagehosting.net/uploads/cce47da969.png"" alt=""image""></p><p>I have tried to get using 2 ways. that are:</p><ol><li><code>Gallery View</code></li><li><code>horizontal ScrollView</code></li></ol><p>The ouput getting is in the below image:</p><p><img src=""http://www.freeimagehosting.net/uploads/b4c1be5924.png"" alt=""image""></p><p>I have Problem on Both to get the proper output. </p><p>In Gallery View,</p><ul><li>can not Change Background of SelectedItem.and make it us rounded corner.</li><li>Selected Item comes to the center horizontal of the Screen Automatically.</li></ul><p>In horizontal View,</p><ul><li>More Complicated when the <code>textView</code>'s number is large.</li><li>Can not find a way similar to On Click Item. if i have use switch case. the previous problem comes again.</li></ul>","267269","","267269","","2010-07-14 09:34:43","2011-07-13 14:08:02","Text Gallery on Android?","<android><gallery>","1","3","12","",""
"3237647","1","","","2010-07-13 13:32:04","0","157","<p>I have a Live Wallpaper which uses the Camera. However, when running the LW I am unable to use any camera apps. The app starts, pauses then returns to the desktop. Logcat suggests that the problem is that the Camera App (and video camera app. and Qik etc.) are trying to open the camera and failing to do so. The LW is releasing the camera when visibility is false, but it seems that it is not quick enough. </p><p>Is there any way of speeding this up so that the standard camera apps are still usable?</p>","390483","","","","","2011-08-08 22:05:17","Quickly stopping camera on Android","<android>","1","0","","",""
"3237747","1","6351077","","2010-07-13 13:41:43","1","3051","<p>Hey guys, I was wondering if it were possible to translate audio without having to call a recognizer intent (ie a dialog that says you are recording audio). I want to be able to recover the results of the voice recognition every 2 to 3 seconds or so and plan to use this with a bunch of listviews. Is this possible? If so any ideas? Thanks!</p><p>Edit: I forgot to mention that I am playing around with android.speech.SpeechRecognizer but so far, in my implementation of the RecognitionListener interface all I have been able to get from ddms is that there is a client side error. Nothing else seems to be called. Also, is it essential that I implement a RecognitionService? I know that the example in the API is just that. If so, how would I create and use this service? Thanks again.</p>","390492","","390492","","2010-07-13 15:06:59","2012-09-16 02:53:23","Voice recognition with android","<android><speech-recognition><voice>","3","0","2","",""
"3237752","1","","","2010-07-13 13:42:34","10","16618","<p>is any body know how to set style fore textView at run time:</p><p>something like this </p><pre><code>myTextView.setStyle(R.style.mystyle);</code></pre>","390495","","241475","","2011-02-14 07:09:23","2012-05-16 12:54:04","android : set textView style at runtime","<android>","5","0","4","",""
"3237892","1","","","2010-07-13 13:59:32","0","583","<p>I have a customized <code>ImageView</code> that works fine in one application. I've transplanted it to another application and am getting a null pointer exception prior to either my activity's <code>onCreate()</code> method or my customized <code>ImageView</code>'s constructor being invoked. So far, I am unable to determine why it works in one app and not in another. Eclipse is happy with my layout file in the broken app, and since it appears to die before reaching any of my Java code, I don't know how to chase this down.</p><p>Anyone know what my problem might be? Any debugging tips for this kind of problem? </p><p>Here's the stack trace.</p><pre><code>ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2417  ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2512   ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 119 ActivityThread$H.handleMessage(Message) line: 1863  ActivityThread$H(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 123 ActivityThread.main(String[]) line: 4363    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  Method.invoke(Object, Object...) line: 521  ZygoteInit$MethodAndArgsCaller.run() line: 860  ZygoteInit.main(String[]) line: 618 NativeStart.main(String[]) line: not available [native method]  </code></pre>","267257","","1606729","","2013-02-23 20:20:05","2013-02-23 20:20:05","Null pointer exception before Activity.onCreate() when using custom Android ImageView","<android><nullpointerexception><imageview><oncreate>","0","2","","",""
"3237956","1","","","2010-07-13 14:06:18","0","927","<p>I have a layout that I have defined in an xml file which contains a number of ImageView's, RelativeLayout's, etc.</p><p>In OnCreate() I have the following code</p><pre><code>public void onCreate(Bundle savedInstanceState){    super.onCreate( savedInstanceState );    setContentView( R.layout.main );</code></pre><p>In my override for the view, I have the following code</p><pre><code> class MainView extends View {  .  @Override  protected void onDraw(android.graphics.Canvas canvas)   {      .      .     canvas.drawBitmap( Bitmap, x, y, null );  }</code></pre><p>The x and y are calculated to coincide with one of my ImageViews ( I have verified that they are correct and the bitmap is valid ), my problem is that the bitmap is always drawn behind the ImageView. That is it is obscured by it. Is there any way to force the bitmap to draw in front of the ImageView?</p>","330844","","21234","","2010-12-08 11:01:43","2010-12-08 11:01:43","How to draw a bitmap in FRONT of a layout in OnDraw","<android><graphics>","2","0","","",""
"3238034","1","3238365","","2010-07-13 14:14:29","1","6199","<p>I downloaded Android SDK components from <a href=""http://dl-ssl.google.com/android/repository/repository.xml"" rel=""nofollow"">http://dl-ssl.google.com/android/repository/repository.xml</a>.</p><p>Now my question is how to install these components? I am using Eclipse and the AVD plugin for Eclipse is installed.</p>","389525","","389525","","2010-07-13 14:34:51","2012-01-06 12:12:17","How to install Android platform components offline?","<android><eclipse>","3","1","2","",""
"3238146","1","3246149","","2010-07-13 14:24:49","1","1032","<p>i need to add a radar chart to my app. Now i'm using the AChartEngine Library but it doesn't support the radar chart type. Do someone know some alternative?</p>","314554","","56338","","2010-11-14 09:17:14","2013-10-09 11:28:53","Adding a Radar Chart, programming on Android","<java><android><charts><achartengine>","1","0","1","",""
"3238324","1","","","2010-07-13 14:46:15","0","5504","<p>I googled a lot to find various hints what could cause this problem. Many of them on this forum, but nothing works.</p><p>I installed the sdk from scratch on 3 different machines (xp, macos snow leopard, leopard) and always the same problem, that even the sample code in the android sdk doesn't compile.After hours of looking through the xml files I recognized, that when I remove ' from strings the sample code of the sdk will compile.So does a new project, as long there is no change needed in the R.java file.As soon as I try to add a button with findViewByID, I get the error that the field R.id cannot be resolved. No other changes were done to the project.</p><p>As mentioned before I tried various things, including:clean project, rebuildrestart eclipseupdate sdk (even tough I installed the new sdk)no uppercase letters...Install sdk, latest eclipse classic on a clean machine</p><p>I don't think it's an issue of the code itself, because even the sample code provided by the sdk doesn't compile without removing ' from the xml.</p><p>Please somebody has some hints and ideas where to look next please?</p>","2494666","","213269","","2011-09-23 14:59:04","2012-10-03 20:18:10","android r.java will not update","<android><r.java-file>","3","0","","",""
"3238361","1","3240288","","2010-07-13 14:49:59","1","403","<p>We are supposed to cache textual and audio data in our applicationuntil device is booted or maximum of two days, whichever happensearlier. To get a perspective on data to be cached, note that we areto store about 200 text headers containing around 10 fields, each oflength 30 bytes and about 20 sound files each about a minute long.</p><p>We are getting the textual data by parsing XMLs and then we keep themin ArrayLists. The sound files are directly written inside the appstorage using File I/O (and not on SDcard or Apps Cache directory).</p><p>This application is to be run on devices running Android 1.5 or later.</p><p>I understand, and please correct me if I am wrong, that we can cachethe files either on SDcard or inside the application or insideapplications Cache directory.</p><p>I have the following questions regarding how do we approach Caching?</p><ol><li>Should we persist the textual data in applications SQLite databaseor should we use Java Serialization mechanism and persist the Listobjects(which constitute Serializable components) inside theapplication?</li><li>Where should we write the text data /sound files - insideapplication, cache or SD card?</li><li>Can all of these be saved to applications cache directory? How bigcan the cache directory grow?</li><li>Can we specify a time span to Android Runtime for which a cache ismaintained? Or would we have to do this manually?</li></ol><p>Please help and advise.</p><p>Thanks. Note: have also asked this question <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/d74fa72971d618d5#"" rel=""nofollow"">here</a>.</p>","236128","","","","","2010-07-13 18:51:03","Approach to cache large amount of Textual and audio data in Android application","<android><caching>","1","0","","",""
"3238388","1","3238945","","2010-07-13 14:52:33","17","23307","<p>My app shows a list of 9 categories and each category displays a Gallery-based coverflow (graciously offered by Neil Davies <a href=""http://www.inter-fuser.com/2010/02/android-coverflow-widget-v2.html"">here</a>) with images of the selected category.<br>The images are fetched from the Web, each ranging from 300K to 500K in size, and stored in an arrayList of Drawables. This data is bound to the coverflow using a BaseAdapter (code below).<br>Every time I exit the coverflow and go back to the list of categories, I clear the arrayList (again, code below).<br>In scenario 1, my arrayList contains 5 Drawables. In this scenario, I can freely browse all the categories and show their images. During my test I cycled through all the categories for 5 times, which seems enough to determine that there is no problem.<br>In scenario 2, my arrayList contains 10 drawables. In this scenario, I get an OutOfMemoryError exception while going through images inside the 5th or 6th categeory:  </p><pre>07-13 08:38:21.266: ERROR/dalvikvm-heap(2133): 819840-byte external allocation too large for this process.07-13 08:38:21.266: ERROR/(2133): VM won't let us allocate 819840 bytes07-13 08:38:21.277: DEBUG/skia(2133): --- decoder->decode returned false07-13 08:38:21.287: WARN/dalvikvm(2133): threadid=25: thread exiting with uncaught exception (group=0x4001b188)07-13 08:38:21.296: ERROR/AndroidRuntime(2133): Uncaught handler: thread Thread-64 exiting due to uncaught exception07-13 08:38:21.308: ERROR/AndroidRuntime(2133): java.lang.OutOfMemoryError: bitmap size exceeds VM budget07-13 08:38:21.308: ERROR/AndroidRuntime(2133):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)07-13 08:38:21.308: ERROR/AndroidRuntime(2133):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:459)07-13 08:38:21.308: ERROR/AndroidRuntime(2133):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)07-13 08:38:21.308: ERROR/AndroidRuntime(2133):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)07-13 08:38:21.308: ERROR/AndroidRuntime(2133):     at android.graphics.drawable.Drawable.createFromStream(Drawable.java:657)</pre>  <p>This doesn't make sense to me. If I am leaking memory I would have expected to crash at some point in scenario 1, but I went through all the categories a substantial number of times and didn't crash. I also used the Memory Analyzer plugin for Eclipse which didn't present any potential culprits.<br>If the system couldn't handle 10 images, like in scenarion 2, I would have expected to crash in the first category, but I crash only after 5 or 6 categories.<br>Some code:</p><p>The coverflow's adapter functions:    </p><pre><code>public int getCount() {     return DataManager.getInstance().getImageBufferInstance().getImageArraySize(); }public Object getItem(int position) {         return DataManager.getInstance().getImagesBuffer().get(position);}public long getItemId(int position) {     return position;}public View getView(int position, View convertView, ViewGroup parent) {               ImageView i;         if (convertView == null)             i = new ImageView(mContext);         else             i = (ImageView)convertView;         Drawable bufferedImage = (Drawable)getItem(position);         Log.v(""getView"", ""position: "" + position);         i.setImageDrawable(bufferedImage);         i.setLayoutParams(new CoverFlow.LayoutParams(Utils.getInstance().getScreenWidth() / 2,                 Utils.getInstance().getScreenHeight() / 2));         i.setScaleType(ImageView.ScaleType.CENTER_INSIDE);          try{         //Make sure we set anti-aliasing otherwise we get jaggies         BitmapDrawable drawable = (BitmapDrawable) i.getDrawable();         drawable.setAntiAlias(true);         }         catch (Exception e)         {             Log.v(""getView"", ""Exception: "" + e.toString());         }         return i;           }</code></pre><p>populating the data source upon entry to the category:  </p><pre><code>for (int i = 0; i &lt; ImageBuffer.getInstance().getImageArraySize(); i++)  {    String imageUrl = ImageBuffer.getInstance().getImageUrl(i);    Log.v(""Initial"", imageUrl);    Drawable fullImage = AsyncImageLoader.getInstance().loadImageByUrl(imageUrl);    ImageBuffer.getInstance().getImages().add(i, fullImage);  }</code></pre><p>clearing the data source when exiting the category (in finish()):  </p><pre><code>for (int i = 0; i &lt; ImageBuffer.getInstance().getImageArraySize(); i++)  {    if (ImageBuffer.getInstance().images.get(i) != null)              {                  ImageBuffer.getInstance().images.get(i).setCallback(null);                  ImageBuffer.getInstance().images.set(i, null);              }    }</code></pre><p>EDIT:</p><p>OK, I applied Mathias' LogHeap function on my coverflow and here are some outputs.Prior to loading the first gallery:</p><pre>DEBUG/Application(5221): debug. =================================DEBUG/Application(5221): debug.heap native: allocated 6.20MB of 6.28MB (0.07MB free) in [com.example.Coverflow]DEBUG/Application(5221): debug.memory: allocated: 4.00MB of 24.00MB (0.00MB free)DEBUG/dalvikvm(5221): GC freed 4558 objects / 638152 bytes in 84msDEBUG/dalvikvm(5221): GC freed 17 objects / 808 bytes in 67ms</pre>  <p>After entering the first gallery:  </p><pre>DEBUG/Application(5221): debug. =================================DEBUG/Application(5221): debug.heap native: allocated 14.90MB of 16.89MB (0.07MB free) in [com.example.Coverflow]DEBUG/Application(5221): debug.memory: allocated: 4.00MB of 24.00MB (1.00MB free)DEBUG/dalvikvm(5221): GC freed 357 objects / 50080 bytes in 68msDEBUG/dalvikvm(5221): GC freed 353 objects / 27312 bytes in 67ms</pre><p>After existing the first gallery:</p><pre>DEBUG/Application(5221): debug. =================================DEBUG/Application(5221): debug.heap native: allocated 14.83MB of 16.89MB (0.11MB free) in [com.example.Coverflow]DEBUG/Application(5221): debug.memory: allocated: 4.00MB of 24.00MB (1.00MB free)DEBUG/dalvikvm(5221): GC freed 330 objects / 17920 bytes in 77msDEBUG/dalvikvm(5221): GC freed 13 objects / 760 bytes in 67ms</pre><p>After entering the fifth gallery:</p><pre>DEBUG/Application(5221): debug. =================================DEBUG/Application(5221): debug.heap native: allocated 16.80MB of 23.32MB (0.08MB free) in [com.example.Coverflow]DEBUG/Application(5221): debug.memory: allocated: 4.00MB of 24.00MB (1.00MB free)DEBUG/dalvikvm(5221): GC freed 842 objects / 99256 bytes in 73msDEBUG/dalvikvm(5221): GC freed 306 objects / 24896 bytes in 69ms</pre><p>After exiting the fifth gallery:</p><pre>DEBUG/Application(5221): debug. =================================DEBUG/Application(5221): debug.heap native: allocated 16.74MB of 23.32MB (0.11MB free) in [com.example.Coverlow]DEBUG/Application(5221): debug.memory: allocated: 4.00MB of 24.00MB (1.00MB free)DEBUG/dalvikvm(5221): GC freed 331 objects / 18184 bytes in 68msDEBUG/dalvikvm(5221): GC freed 60 objects / 3128 bytes in 68ms</pre>  <p>It seems that more and more memory is allocated when entering a gallery, but very little is released after exiting. Am I not clearing my drawables properly? For each element in my arrayList of drawables I call setCallBack(null) and set the element to null. Is that not enough?<br>Desperate for any insight.<br>Thanks</p>","283630","","283630","","2010-07-14 08:58:10","2013-02-06 08:53:29","Android: out of memory exception in Gallery","<android><memory-leaks><gallery>","4","2","27","",""
"3238408","1","","","2010-07-13 14:54:04","6","8050","<p>I am porting a complex C application to Android, as an SO library, wrapped with thin java layer.After few hours of hassle, i have the code compiling under Android, but of course, the application crashes :(</p><p>After looking around, i understand the only way to debug C application under Android is by gdb. Since I don't have a lot of experience with gdb, any one out there can share some insights?</p><p>Anyone has a tutorial for gdb under windows :) ?</p><p>thx</p>","20719","","251349","","2011-12-08 11:28:00","2012-04-25 00:00:05","Debugging Android NDK, under windows","<android><android-ndk>","1","2","2","",""
"3238416","1","","","2010-07-13 14:54:56","4","341","<p>Is there any way on Android to dynamically change position of VideoView or SurfaceView while playing video?<br>I've tried to use view animators, Surface.setPosition(), View.layout(), push Surface view with ralated LinearLayout with bigger weight( this approach helps sometimes and i see that video jumps to new position while playing but i need smooth moving.) and nothing happens until video ends.</p><p>(Checked on Emulator (2.2) and Nexus One  - results are the same)</p>","390574","","","","","2011-12-09 05:32:47","Change Video position while playback","<android>","1","0","1","",""
"3238502","1","4689001","","2010-07-13 15:03:16","4","2007","<p>I am writing my own SyncAdapter for android devices that should synchronize TV broadcast information to the device but ran into problem of not getting the Synchronize ""mydata"" checkbox visible under Data &amp; Synchronization part of the account preferences.</p><p>I have implemented my own SyncAdapter and defined it properly in the xml:</p><p>Here is my sync.xml:</p><pre><code>&lt;sync-adapter xmlns:android=""http://schemas.android.com/apk/res/android""    android:contentAuthority=""com.example.tv.programs""    android:accountType=""com.example.tv.sync""    android:supportsUploading=""false""    android:userVisible=""true""/&gt;</code></pre><p>Corresponding part of android manifest, where I define my sync service and provider:</p><pre><code>&lt;service android:name="".sync.ProgramSynchronizationService"" android:exported=""true"" android:process="":programs""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.content.SyncAdapter"" /&gt;    &lt;/intent-filter&gt;    &lt;meta-data        android:name=""android.content.SyncAdapter""        android:resource=""@xml/sync"" /&gt;&lt;/service&gt;&lt;provider android:name=""com.example.tv.providers.ProgramContentProvider""     android:authorities=""com.example.tv.programs"" /&gt;</code></pre><p>Am I doing something wrong as I don't get anything visible under the Data &amp; Synchronization part?</p>","258196","","","","","2012-01-31 22:11:51","How to enable synchronization of custom account in android?","<android><synchronization><account>","2","0","2","",""
"3238522","1","3241027","","2010-07-13 15:06:29","2","753","<p>Google Labs will be rolling out something called <a href=""http://appinventor.googlelabs.com/about/"" rel=""nofollow"">Google App Inventor</a> (for Android). CNet says: </p><blockquote>  <p>""To use App Inventor, you do not need  to be a developer. App Inventor  requires NO programming knowledge.  This is because instead of writing  code, you visually design the way the  app looks and use blocks to specify  the app's behavior,"" the Google  project description states.</p></blockquote><p>I sense a big, big development here. This is big. The Android platform is really gaining ground on a big range of devices: phones/pda's, netbooks, tablet pc's and embedded systems.</p><p>The underlying Android SDK is a well-written framework, but only a reasonable java-programmer has the knowledge to use the components to build a proposed piece of software.</p><p>I spoke a lot of people about the android platform. A phone with Android is not a phone. It's a device with wireless and 3G internet capabilities, bluetooth capabilities, a camera, a speaker, a microphone, a touchscreen, a motion sensor and a GPS receiver. These components can be combined in endless ways, the sky is the limit.</p><p>Until now, you would need to hire a Java programmer to build that 'genius app' for you.</p><p>But now, everyone and his sister will be building them, publishing them, and improving them.</p><p>Don't you think this is going to be big?</p>","380865","","31899","","2010-07-13 19:37:53","2010-07-13 20:13:36","What will Google App Inventor mean for mobile software development?","<android><mobile><app-inventor>","8","6","1","2010-07-13 23:02:05","2010-07-13 18:21:48"
"3238565","1","","","2010-07-13 15:11:42","2","1618","<p>I want to be able to display a certain youtube channel's videos and allow the user to select one of their videos to watch. Do I have to do this manually (parse the source code of the webpage to get each individual video link and then display them) or can I use the youtube api?</p><p>If anyone has done this, example code or tutorials would be greatly appreciated. Thanks!</p>","389887","","","","","2010-07-13 16:00:12","Embedding youtube channels in android application","<java><android><youtube><youtube-api>","1","1","0","",""
"3238593","1","3240494","","2010-07-13 15:14:51","3","316","<p>I'm developing an HTML / Javascript application meant to run on an Android device running Froyo (2.2). Assuming I don't need multitouch functionality, will the emulator's browser be a reliable means of debugging HTML, CSS and Javascript? Or is it possible that I would work out all the bugs in the emulator but find the actual device handles things differently?</p>","208361","","","","","2010-07-13 19:02:25","Is the Android Emulator browser suitable and reliable for testing an HTML/Javascript Application?","<javascript><html><android><testing><emulator>","1","0","","",""
"3238654","1","3240583","","2010-07-13 15:22:20","0","2277","<p>I am trying to put a background image and draw on top of that screen. I assumed activity will have a on draw method, but it does not have. it seems i need to use surfaceview. Can I put a surfaceview on top of the image view and make it transparent ? any example/tutorial i can refer to ?</p>","384185","","","","","2010-07-13 19:13:58","drawing on an android activity","<android>","1","0","","",""
"3238760","1","","","2010-07-13 15:34:38","0","69","<p>One particular activity uses a gallery view and many images that are displayed when one item in the gallery view is clicked. When you scroll through the gallery, the scrolling is very smooth ONLY if one certain image is commented out (even if 40+ images/textviews are displayed). We've tried changing the resolution of that image, changing the scaletype, but it still lags the gallery view. This image takes up a large portion of the background. Have you ever encountered any problems similar to this? We would really appreciate any advice you have to offer.</p>","390608","","","","","2010-07-13 19:56:48","One particular ImageView causing severe lag","<java><android><imageview>","1","0","","",""
"3238898","1","3344379","","2010-07-13 15:49:53","4","1201","<p>I have an application that uses the <a href=""http://code.google.com/p/mapview-overlay-manager/"" rel=""nofollow"">mapview-overlay-manager</a> code to draw map markers on a MapView using the LazyLoadManager from a web api. As I drag the map, the markers load/unload as expected. </p><p>On the tap of a marker I inflate a <em>balloon.xml</em> file and use it to show a balloon above the marker. This is where the problem is. It works, but then suddenly (which I cannot repeat on a consistently) the balloon overlay will stop showing up on the screen. </p><p>Its odd though, because the marker still shows that its been tapped, but then the balloon stops showing up. I've checked that the balloon is not null (which it is not),  and that the itemInfo is not null. Its just not getting added to the MapView after the call to .addView(...), yet all the params are valid. </p><p>Side note: Anytime this happens, all of the overlays turn real dark and the overlay shadows go from semi-transparent to black. I have no idea what is causing that, but it happens at the same time, which makes me believe its a drawing problem. </p><p>Code for the above problem is below. Any tips/ideas/etc would be appreciated. </p><pre><code>@Override        public boolean onSingleTap(MotionEvent e, ManagedOverlay overlay, GeoPoint point, ManagedOverlayItem item) {            if(mBalloon != null)             {                mMapView.removeView(mBalloon);                mBalloon = null;             }             if(item != null) {                //Toast.makeText(getApplicationContext(), item.getTitle(), Toast.LENGTH_SHORT).show();                MapView.LayoutParams balloonLayoutParams = new MapView.LayoutParams(350, MapView.LayoutParams.WRAP_CONTENT, item.getItemInfo().getMarkerPoint(mMapView.getProjection()), MapView.LayoutParams.BOTTOM_CENTER);                if(mBalloon == null) {                    if(mLayoutInflater == null) {                        mLayoutInflater = getLayoutInflater();                    }                    ViewGroup parent = (ViewGroup)mMapView.getParent();                     mBalloon = (BalloonLayout) mLayoutInflater.inflate(R.layout.balloon_layout, parent, false);                 }                 TextView title = (TextView)mBalloon.findViewById(R.id.title);                 title.setText(item.getItemInfo().getTitle());                 TextView subTitle = (TextView)mBalloon.findViewById(R.id.subTitle);                 subTitle.setText(item.getItemInfo().getBalloonSubTitle());                 if(DEBUG) Log.d(TAG, ""Setting on click listener."");                ((ImageButton)mBalloon.findViewById(R.id.go_button)).setOnClickListener(new ViewItemInfoListener(item.getItemInfo()));                mMapView.addView(mBalloon, balloonLayoutParams);            }            return false;        }    });    // Fires off the background event to get the     overlayManager.populate();}</code></pre>","5210","","","","","2010-07-27 13:58:14","Popup Balloons Disappear Randomly after tap of OverlayItem on MapView","<android>","2","0","","",""
"3238904","1","3239007","","2010-07-13 15:50:16","2","304","<p>I am nearly done with my first android app and there's still a bit more work to do but I want to get feedback from users about what they like/hate/bugs to fix, etc. I plan on making the app free with ads. Now I have been testing my app on my phone (HTC Magic) and plan on doing some simple testing on the emulator using different configurations. Would it be a good idea to release the app as being beta as it is now? And then fix up any issues and implement the full features I want in it later on and re-release it? I don't want the beta ratings to hurt the final version  so would I'm guessing I simply release it as a new app instead of an update to the beta?</p><p>Also If I was to release the beta should I be releasing it with or without ads? </p><p>I would love to hear your experience with your apps!</p><p>Thanks</p>","362476","","244296","","2011-08-22 14:35:59","2012-01-16 22:57:10","Android releasing and app into the market","<android><release><beta><google-play>","2","0","0","",""
"3238928","1","3238976","","2010-07-13 15:53:33","0","744","<p>I would like to add one video to the main screen of my application but I want to user to be able to do other things in the app meanwhile. Think about some video animation or flash movie for some website that you can watch the video and look on other things in the website.</p><p>lets say I have buttons and more things in the same screen and I want a small video to be playing there too in a loop.</p><p>is this possible? </p><p>I thought that Flash movie could be good for that, but its only for latest versions of android then I don't want to use it.</p><p>Thanks.</p>","178016","","","","","2010-07-13 15:59:13","Video inside android app","<android>","1","2","","",""
"3238932","1","3240471","","2010-07-13 15:53:58","0","101","<p>In my tablet whenever i select the checkbox option for cell phone tethering iam observing below line in my Eclipse logcat</p><pre><code>07-09 07:28:18.279: INFO/ActivityManager(940): Starting activity: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.tether.Tether }</code></pre><p>I want to use this one in my application.Is it possible to use this component or can i see inbuilt application methods in my Application like API methods after including that component?Please give me sample code on this</p>","362544","","","","","2010-07-13 18:59:16","how to use inbuit application from Android?","<android>","1","0","","",""
"3238950","1","","","2010-07-13 15:55:46","0","331","<p>I am trying to make an application that can simulate a fight of two characters and I need to update some TextViews of their hp as it goes down. This is currently happening while two threads are running. Their hp is a global variable and since views can only be modified in the main thread, I have a while loop running while the threads are going that keeps updating the textviews. In Logcat, you can see the while loop running and the hp going down. However, the textviews are not updated until after the threads are finished. </p><p>I've tried using runnables and asynch task to update the textviews. None of these methods work. Why is this happening?</p>","389887","","","","","2010-10-03 23:01:31","Updating TextViews in a separate thread","<android><multithreading>","1","2","","",""
"3238966","1","3239052","","2010-07-13 15:57:47","1","664","<p>Naming Android mime-types/Uris:</p><p>The sample notepad application uses:""vnd.android.cursor.dir/vnd.google.note""""vnd.android.cursor.item/vnd.google.note""</p><p>Let's say I want create my own application with three datatypes that should be stored in the database, how should I name my uris?</p><p>Should all content uris start with vnd.android.cursor.dir and vnd.android.cursor.item before the slash?</p>","25282","","135152","","2011-05-25 03:13:20","2011-09-03 16:46:00","Naming Android mime types","<android><sqlite>","2","0","1","",""
"3239258","1","","","2010-07-13 16:30:51","1","564","<p>The Android git tree provides a set of XML files describing the public API, e.g. <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=api;h=4b81e932f2e6a83bf022a9918b143e732b15fd2c;hb=HEAD"" rel=""nofollow"">base.git/api</a>, e.g. <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=api/7.xml;h=83d2bc74d18656bc99bb133a27d0cf6859193d57;hb=HEAD"" rel=""nofollow"">base.git/api/7.xml</a> (which contains the public API for Android 2.1).</p><p>Does anybody know how this file is generated?  I would imagine that it uses some tool to process the android.jar file into an XML file (likely using <code>java.lang.reflect</code>).</p><p>I ask principally because I need to process this file, and the file contains many deficiencies, e.g. there are types which implement the <code>java.util.List</code> interface, but <code>java.util.List</code> isn't defined in the file, and generic information is missing from the file (e.g. <code>java.util.Vector</code> is generic, but there isn't any way to tell that from the XML file).</p>","83444","","","","","2011-07-30 00:59:41","What tool is used to generate Android's API XML files?","<android>","2","0","1","",""
"3239263","1","","","2010-07-13 16:31:06","4","1261","<p>I have question about the Java threads. Here is my scenario:</p><p>I have a thread calling a method that could take while.  The thread keeps itself on that method until I get the result. If I send another request to that method in the same way, now there are two threads running (provided the first did not return the result yet).  But I want to give the priority to the last thread and don't want to get the results from the previously started threads.  So how could I get rid of earlier threads when I do not have a stop method?</p>","330072","","74815","","2010-07-13 17:06:15","2010-07-13 18:43:21","How does one stop a thread without a stop() method?","<java><android><multithreading><delay>","6","2","","",""
"3239321","1","","","2010-07-13 16:37:49","10","7139","<p>Apparently, I can specify source folders using the source.dir property in build.properties - but what if I want to specify multiple source folders ?</p><p>The comments below are from the build.xml file generated by the Android SDK tools:</p><pre><code>&lt;!-- The build.properties file can be created by you and is never touched     by the 'android' tool. This is the place to change some of the default property values     used by the Ant rules.     Here are some properties you may want to change/update:     application.package         the name of your application package as defined in the manifest. Used by the         'uninstall' rule.     source.dir         the name of the source directory. Default is 'src'.     out.dir         the name of the output directory. Default is 'bin'.     Properties related to the SDK location or the project target should be updated      using the 'android' tool with the 'update' action.     This file is an integral part of the build system for your application and     should be checked in in Version Control Systems.     --&gt;</code></pre><p>Note: I dont care about building in Eclipse - Im setting up automated builds using ant.</p>","246793","","246793","","2010-07-15 14:14:22","2011-08-11 15:53:50","How to specify multiple source folders in build.properties when using ant to build Android projects?","<android><ant><build><source><folders>","2","2","1","",""
"3239372","1","","","2010-07-13 16:43:37","0","202","<p>How to send and receive the values to the webservices in Android? .I am very new to android.Give some ideas to me...</p>","388870","","244296","","2010-07-13 16:46:26","2011-06-14 15:41:51","How to send and receive values in android?","<android>","3","0","","",""
"3239418","1","","","2010-07-13 16:49:02","3","608","<p>I am new to android development, and not very good at programming in general but, I am working on a tab layout that has a listview per tab.  Each tab has it's own java file. I am currently trying to add a context menu that when clicked (not long clicked) on an item in my listview, will bring up a menu so I can choose an option.  Right now it just shows a toast displaying the name of the item I clicked.  The listview options are currently added to the list via local string declaration, here is an example of on of my tabs:</p><pre><code>public class AlbumTab extends ListActivity{    @Override    public void onCreate(Bundle savedInstanceState)     {      final String[] CDExplorer_tabs = new String[] {""Client Heirarchy"", ""Territory"", ""Sales Credit"", ""Admin"", ""General Search""};      super.onCreate(savedInstanceState);      setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, CDExplorer_tabs));      ListView lv = getListView();      lv.setTextFilterEnabled(true);      lv.setOnItemClickListener(new OnItemClickListener()       {        public void onItemClick(AdapterView&lt;?&gt; parent, View view,            int position, long id)         {          Toast.makeText(getApplicationContext(), ((TextView) view).getText(),              Toast.LENGTH_SHORT).show();        }      });    }</code></pre><p>would I have to make another string array for each menu I want to popup and somehow connect it to the other string?  Or do if statements that decide on which menu to popup based on which listview item is clicked?</p>","390579","","244296","","2010-07-13 16:55:12","2010-08-23 09:13:58","Android Context menu from listsview","<android><listview><menu>","1","6","1","",""
"3239478","1","4880069","","2010-07-13 16:56:53","16","41087","<p>What's the best way to link to an Android Market app without knowing who will get the link (Android user/non-Android user) and from where (desktop/mobile)?</p><p>For <strong>iPhone</strong> I use the itunes.apple.com app links. They show a complete description of the app, and if you have iTunes installed, either on the desktop or on your mobile, it allows you to download the app directly. Example: <a href=""http://itunes.apple.com/us/app/ibooks/id364709193?mt=8"">http://itunes.apple.com/us/app/ibooks/id364709193?mt=8</a></p><p>For <strong>Android</strong> I currently use a third-party Android Market web browser (see answer below), but I was wondering if there was a better alternative, and hoping to learn from others who have dealt with this issue.</p>","143378","","143378","","2010-07-13 22:31:06","2013-10-01 07:34:13","How to link to Android Market app","<android><hyperlink><itunes><google-play>","5","1","13","",""
"3239486","1","","","2010-07-13 16:57:43","6","2417","<p>Can you please tell me how can I use android's icon expander_ic_maximized?I find that in frameworks/base/core/res/res/drawable-hdpi/expanderic_minimized.9.png</p><p>Here is my layout xml file:</p><pre><code>&lt;ImageView android:id=""@+id/icon""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:src=""@drawable/expander_ic_minimized""&gt;</code></pre><p>But I get this error:</p><pre><code>res/layout/test.xml:70: error: Error: Resource is not public. (at 'src' with value '@android:drawable/expander_ic_maximized').</code></pre>","286802","","116938","","2014-03-13 21:59:41","2014-03-13 21:59:41","How can I use a system provided icon in Android (e.g. expander_ic_maximized)","<android>","3","0","1","",""
"3239528","1","","","2010-07-13 17:02:39","0","1284","<p>I want to create a circle layout. All of my views should be in the circle. Which layout do I have to prefer and how? The focus of the layout should be a clockwise circle.</p><p>Edit:</p><p>I can do this view and it is an update of my question, prompted by the comments to this question. Is there any example for doing that?</p><p>The screenshot is attached below.</p><p><img src=""http://www.freeimagehosting.net/uploads/e11f35e522.png"" alt=""image""></p>","267269","","63550","","2011-09-15 17:05:56","2013-01-22 08:54:27","Circle/daisy layout (pinwheel) in Android?","<android><graphics><layout><canvas><views>","1","11","1","",""
"3239929","1","","","2010-07-13 17:49:01","7","2383","<p>Just curious.  I am already a Java android guy but am interested in the new app inventor beta for android.I was wondering what ""real"" developers are thinking.  A lot of people want to develop an android app but don't really have programming skills.  Seems like a lot of apps could be written with app inventor - not sure since I haven't tried it yet.</p>","390769","","31899","","2010-07-13 19:36:58","2010-12-06 14:11:08","Should I learn Google App Inventor as a supplement to Java for Android","<android><app-inventor>","6","0","3","",""
"3240010","1","3240040","","2010-07-13 17:57:56","3","669","<p>I've more than one activity (inside the same Application) that needs to have access to the database. What's the best pattern to implement this ? Do I need a content provider even if all activities belong to the same application? </p><p>Which activity should have the responsibility for opening and closing the database ? </p>","306346","","306346","","2010-08-02 15:34:23","2010-08-02 15:41:55","Android Content Provider inside the same application","<android><database><design-patterns><android-contentprovider>","2","0","","",""
"3240095","1","3240666","","2010-07-13 18:09:54","1","348","<p>My app changes orientation when I move from vertical to the left. But does not when I move from vertical to right?</p>","334802","","","","","2010-08-30 03:16:21","android orientation change vertical to right","<android><orientation>","2","4","","",""
"3240131","1","3240409","","2010-07-13 18:16:03","0","69","<p>I have heard that the ARCHOS 5 Internet Tablet doesn't have the Google APIs SDK, but rather the plain vanilla Android 1.6 OS build.  Is this true?  And does anyone know of any other devices like this currently on the market or in the works?</p><p>I'm particularly interested in phones, but would like to know about any such devices.  My company adds maps to our apps but they are often optional, so I'd like to know if I need to be worried that these apps won't be available to non-maps devices.</p>","213525","","213525","","2010-07-13 18:23:26","2010-07-13 18:52:08","Are there any Android devices in the US market or elsewhere that do NOT ship with the Google Maps Add-On library?","<android><google-maps>","1","6","","",""
"3240133","1","3240376","","2010-07-13 18:16:15","2","3705","<h2>PROBLEM SOLVED!!</h2><p><strong>I just found my mistakes, after looking through the debugger over and over again, but anyway, thanks everyone!!</strong></p><p>Hi there, I am very new to Android and was working through some tutorials. Now I got stuck at the Tab tutorial. The code seems to be fine at first glance as I am not getting any errors, but when I try to run the app on the emulator it always crashes  and I get an ""application stopped unexpectedly"" error message. </p><p>I already tried what was said in the discussion about the <a href=""http://www.anddev.org/problem_with_android_tab_layout_tutorial-t10722.html"" rel=""nofollow"">tab layout problem</a>, but the changes I made didn't help with the error. If someone can help me with that, that would absolutely great. If you would like to see the code, just tell me if I should post or send it. </p><p>Thank u in advance.</p><p>This is my code for the <strong>Manifest.xml</strong> file because I am not sure, if I have done something wrong there:</p><pre><code>   &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.mobilevideoeditor.moved""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;           &lt;activity android:name="".GalleryView"" android:label=""@string/app_name""                  android:theme=""@android:style/Theme.NoTitleBar""&gt;               &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;            &lt;activity android:name="".ShareGalleryView"" android:label=""@string/app_name""                      android:theme=""@android:style/Theme.NoTitleBar""&gt; &lt;/activity&gt;                       &lt;activity android:name="".EditGalleryView"" android:label=""@string/app_name""                  android:theme=""@android:style/Theme.NoTitleBar""&gt; &lt;/activity&gt;          &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p>This is the <strong>GalleryView.java</strong> file: </p><pre><code>package com.mobilevideoeditor.moved;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;public class GalleryView extends TabActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Resources res = getResources(); // Resource object to get Drawables        TabHost tabHost = getTabHost();  // The activity TabHost        TabHost.TabSpec spec;  // Reusable TabSpec for each tab        Intent intent;  // Reusable Intent for each tab        // Create an Intent to launch an Activity for the tab (to be reused)        intent = new Intent().setClass(this, EditGalleryView.class);        // Initialize a TabSpec for each tab and add it to the TabHost        spec = tabHost.newTabSpec(""edit"").setIndicator(""Edit"",                          res.getDrawable(R.drawable.ic_tab_edit))                      .setContent(intent);        tabHost.addTab(spec);        // Do the same for the other tabs        intent = new Intent().setClass(this, ShareGalleryView.class);        spec = tabHost.newTabSpec(""share"").setIndicator(""Share"",                          res.getDrawable(R.drawable.ic_tab_share))                          .setContent(intent);        tabHost.addTab(spec);        tabHost.setCurrentTab(0);    }}</code></pre><p>Here is the code for the <strong>main.xml</strong>: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@android:id/tabhost""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""5dp""&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:padding=""5dp"" /&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>The code for the <strong>EditGalleryView.java</strong> and the <strong>ShareGalleryView.java</strong>: </p><pre><code>package com.mobilevideoeditor.moved;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class ShareGalleryView extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        TextView textview = new TextView(this);        textview.setText(""This is the Share tab!"");        setContentView(textview);    }}</code></pre><p>And finally the code for the <strong>ic_tab_share.xml</strong> and the <strong>ic_tab_edit.xml</strong>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;!-- When selected, use ic_tab_share (grey icon) --&gt;    &lt;item android:drawable=""@drawable/ic_tab_share""          android:state_selected=""true"" /&gt;    &lt;!-- When not selected, use ic_tab_share_unselected (white icon)--&gt;    &lt;item android:drawable=""@drawable/ic_tab_share_unselected"" /&gt;&lt;/selector&gt;</code></pre><p>Thanks again :) </p>","390782","","1228","","2013-08-15 12:34:02","2013-08-15 12:34:02","Android Tab Tutorial Trouble","<android><tabs>","1","2","","",""
"3240165","1","3240387","","2010-07-13 18:21:08","0","47","<p>I'm recieving a Float Array from a Bundle like so...</p><pre><code>         Bundle b = this.getIntent().getExtras();          float camObjCoord[] = b.getFloatArray(""tweets"");</code></pre><p>Sadly I'm not being allowed make the data public. It will only allow final.. what would be the best way around this?</p>","358438","","","","","2010-07-13 18:49:18","Making data received from a bundle public","<android>","2","0","","",""
"3240331","1","5227302","","2010-07-13 18:43:09","84","72958","<p>Is there any Possible to make the <code>ListView</code> horizontally? I done this Using Gallery view. But the Selected item comes to the center of the Screen Automatically. I want to avoid it. the selected item at the same spot i have clicked. How to Rectify this Problem? My Idea is to set the <code>ListView</code> with Horizontal Scroll. Share Your Idea?</p>","267269","","267269","","2010-07-23 13:10:41","2014-03-21 10:25:29","Horizontal ListView in Android?","<android><listview><gallery><horizontal-scrolling>","15","1","41","",""
"3240490","1","3240514","","2010-07-13 19:02:19","3","454","<p>Does the android simulator use the same amount of memory as the real device?For example if my app doesn't run out of memory on a simulator, does it mean that it doesn't run out of memory on an actual device?</p>","242769","","881229","","2014-01-28 09:04:07","2014-01-28 09:04:07","Android ==> Simulator VS Device memory size?","<android><memory><android-emulator>","2","2","2","",""
"3241149","1","","","2010-07-13 20:18:48","0","797","<p>how come I don't see detailed Israel map when I integrate with the MapView in my MapActivity?I can see just about any other country except Israel.</p><p>thanks, Ori</p>","258429","","","","","2011-05-16 16:26:19","Android and Google Maps API in Israel","<android><google-maps>","1","4","","",""
"3241189","1","","","2010-07-13 20:22:18","0","302","<p>Basically every time I try to exit my application using the home button and then reenter it, it makes me force close the game before I can open the game up. I haven't been able to find out how to have it save the state when I leave the app, I need it to save an arraylist and some variables and booleans, but I don't know how to do it. Here is my activity and my surfaceCreated, Destroyed and stuff, the surfaceCreated is where the error is thrown, saying the thread is already open.</p><p>Here is the logcat</p><p>E/AndroidRuntime(  183): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(  183): java.lang.IllegalThreadStateException: Thread already started.E/AndroidRuntime(  183):        at java.lang.Thread.start(Thread.java:1286)E/AndroidRuntime(  183):        at com.Waldev.cannon.CannonBlast$panel.surfaceCreated(CannonBlast.java:515)E/AndroidRuntime(  183):        at android.view.SurfaceView.updateWindow(SurfaceView.java:392)E/AndroidRuntime(  183):        at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:182)E/AndroidRuntime(  183):        at android.view.View.dispatchWindowVisibilityChanged(View.java:3745)E/AndroidRuntime(  183):        at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:690)E/AndroidRuntime(  183):        at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:690)E/AndroidRuntime(  183):        at android.view.ViewRoot.performTraversals(ViewRoot.java:694)E/AndroidRuntime(  183):        at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)E/AndroidRuntime(  183):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  183):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  183):        at android.app.ActivityThread.main(ActivityThread.java:4203)E/AndroidRuntime(  183):        at java.lang.reflect.Method.invokeNative(NativeMethod)E/AndroidRuntime(  183):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  183):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)E/AndroidRuntime(  183):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)E/AndroidRuntime(  183):        at dalvik.system.NativeStart.main(Native Method)</p><pre><code>    @Override    public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) {        // TODO Auto-generated method stub    }    public void surfaceCreated(SurfaceHolder holder) {        thread.setRunning(true);        thread.start();    }    @Override    public void surfaceDestroyed(SurfaceHolder holder) {        // simply copied from sample application LunarLander:        // we have to tell thread to shut down &amp; wait for it to finish, or else        // it might touch the Surface after we return and explode        boolean retry = true;        thread.setRunning(false);        while (retry) {            try {                thread.join();                retry = false;            } catch (InterruptedException e) {                // we will try it again and again...            }        }    }public void onCreate(Bundle savedInstanceState) {    final Window win = getWindow();    super.onCreate(savedInstanceState);    panelStuffz = new panel(this);    requestWindowFeature(Window.FEATURE_NO_TITLE);    win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);     setContentView(panelStuffz);}@Overridepublic void onSaveInstanceState(Bundle savedInstanceState){    super.onSaveInstanceState(savedInstanceState);}@Overridepublic void onRestoreInstanceState(Bundle savedInstanceState) {     super.onRestoreInstanceState(savedInstanceState);}</code></pre>","390927","","390927","","2010-07-13 21:49:27","2010-11-23 07:14:00","Can't reenter android application with force close","<java><android>","1","4","","",""
"3241322","1","3241535","","2010-07-13 20:37:34","8","24260","<p>So I have my Activity, and on pressing a ""Quit"" button I call Activity.finish(). This effectively closes my application.</p><p>The problem: The Dalvik-process of my application is still hanging around as a zombie in background. It seems like this is normal as other applications do the same. Even The hello-world example hangs around in memory..</p><p>I could live with this, but unfortunatley this behaviour makes the development of my application a pain. I have a remote service connected to my Activity, and this service won't unload until my Activity unloads (which as said it never does). </p><p>Everything is somehow kept alive for no good reason.</p><p>How can I <em>really</em> remove my Activity from memory? </p><p>I'm looking for something like Activity.finish_and_kill_my_process_please() call or something similar.</p>","15955","","102937","","2013-01-29 23:09:23","2014-01-09 10:25:18","How to kill my own Activity - the hard way","<android><process><activity><kill>","8","0","10","",""
"3241458","1","3344663","","2010-07-13 20:56:20","2","5662","<p>Is there a way to outline android's TextView text?</p>","287316","","","","","2012-04-24 09:23:27","How to outline android's TextView text?","<android><gui><widget>","2","0","1","",""
"3241533","1","","","2010-07-13 21:07:31","1","3206","<p>I'm currently making an app where it would communicate with a simple database that will be hosted on a server. The database will only have three columns, a _id, title, and url link. I've successfully done this using the phone's local database using SQLiteDatabase but I want it so that any other phone can also access the same database. I will be updating the server's database (adding new rows) on the computer so the phones should reflect these changes.</p><p>I believe I will be using sqlite on the server too to create the database. Basically I want all changes to be handle on the server side instead of doing it from the phone like how I am with the local database. The phone should be able to access the data and use it accordingly. Can anyone explain me a way to do this?</p><p>Thank you in advance!</p>","386074","","","","","2013-10-16 05:36:33","How to communicate with server's database from android phone?","<android><database><sqlite>","1","0","2","",""
"3241586","1","3241660","","2010-07-13 21:15:18","1","2129","<p>I created a simple login screen that stacks a login button, the username and password edit boxes vertically from the bottom. </p><p>When someone clicks the username/password fields, the virtual keyboard comes up and hids the editbox or button below it. I have seen this in another application that the login button always stays in the visible area.... how can I achieve this?</p>","320938","","244296","","2011-02-25 13:55:47","2011-02-25 13:55:47","Keep android view in visible area if keyboard comes up","<android>","2","0","","",""
"3241729","1","5134920","","2010-07-13 21:34:23","9","22223","<p>I'd like to make my font sizes configurable but i'd also like to make use of the style tag in my layouts.  Is it possible to change the definition of a style at runtime? or is the only option to manually change the individual style elements on each textview etc.?</p>","372405","","","","","2013-09-04 14:18:45","android dynamically change style at runtime","<android><coding-style>","3","1","18","",""
"3241739","1","3249602","","2010-07-13 21:35:46","1","316","<p>I would like to detect if the navigation keys of the front of the phone (Home,Menu,Back,Search) are hard-keys (ex. G1) or soft-keys (ex. Nexus One).</p><p>This api /android/content/res/Configuration.html#keyboard gets close but is related to the keyboard and not the front facing keys.</p><p>KeyEvent (http://d.android.com/reference/android/view/KeyEvent.html) has a FLAG_VIRTUAL_HARD_KEY flag, I can only detect that after the key is pressed. I'd like to find out what type of buttons the user has without asking the user to press a key first.</p><p>I would have expected such an api to be under /android/hardware/package-summary.html but android.hardware has very little info about the actual hardware of the device.</p><p>sorry for incomplete links...</p>","341390","","","","","2010-07-14 19:12:32","Detecting button type of front nav keys","<android>","1","0","","",""
"3242034","1","3242097","","2010-07-13 22:21:41","17","6348","<p>After doing the whole ""enterprise"" programming for a while, I'm seriously disillusioned by the language itself and always feel quite hampered if I have to go back to it. The project size of your average Android app isn't too intimidating and the libraries are actually quite nice regarding their coding style, but if I could avoid Java, I'd certainly do.</p><p>So that's the question: Can I avoid it? While there are lots of JVM language that would be an option on desktops and servers, the Dalvik VM and the devices themselves pose some limits. This seems to be a bit better in 2.2 with the JIT, but limiting myself to the cutting edge would be a rather harsh decision.</p><p>The only alternative I know that's used somewhat seems to be Scala. Is there some possibility I'm missing? Clojure seems to run in exactly the problems I've illustrated above with Dalvik, but as the AppInventor is built on Kawa there might be hope for a Lisp on the mobile platform?</p><p>What other languages are already usable or make strides towards that?</p>","39639","","181412","","2011-03-28 13:30:15","2014-03-05 04:46:47","Android without Java","<java><android><scala><clojure><lisp>","6","3","7","",""
"3242081","1","3242367","","2010-07-13 22:31:57","0","817","<p>I have a View that inherits from LinearLayout that inflates itself.  After it has been created and inflated I wanted the ability to inflate a different layout.  However, calling inflate() a second time seems to have no effect.  Only if I close the activity and open it again is the state reflected in the UI.</p><p>Is it possible to call inflate multiple times to dynamically change the layout?</p><p>My inflate code is pretty simple:</p><pre><code>layoutInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);layoutInflater.inflate(R.layout.my_layout, this, true);</code></pre>","135199","","","","","2012-05-26 05:46:11","Calling inflate() multiple times in an Android view","<android>","1","0","","",""
"3242251","1","","","2010-07-13 23:10:11","19","11454","<p>I have to show copyright symbol, ©, in the message of an AlertDialog. I set a sting value with the copyright symbol in res/string. But the symbol is shown as a question mark when the dialog opens. How can I correctly show the copyright symbol in the dialog. Thanks.</p>","256239","","","","","2013-10-23 07:10:53","How to show copyright symbol in dialog?","<android>","3","5","","",""
"3242439","1","","","2010-07-13 23:56:31","2","284","<p>I'm developing a library, not an application, for Android and I would like to know how should I test it? I know that if you are developing an application you can instrument the test+application and make it work, but this is not my case. I'm using Maven. Is it possible integrate the test results to the Maven lifecycle? The worst case would be create an application to test my library.</p><p>Thoughts?</p>","141639","","70604","","2010-08-20 07:09:01","2011-11-02 17:12:13","How can I test a library on Android?","<android><maven-2><testing>","1","0","","2013-06-22 14:35:05",""
"3242801","1","","","2010-07-14 01:41:02","0","381","<p>I am trying to find the correct xml to define a layout of three items on a single 'line' as follows :</p><ul><li>Button (left aligned on the screen) with the text 'Prev' - wrap-context</li><li>TextView (center aligned) with the title of the screen - fixed 200px size</li><li>Button (right aligned on the screen) with the text 'Next' - wrap_content</li></ul><p>Just cannot seem to get it working unless I use absolute layout which I'd rather not.I have experimented (seems like every option) with gravity/layout_gravity and embedded LinearLayouts...</p><p>I guess the question is - can I right align one item, left align another and center align another all on the same LinearLayout 'line'</p><p>Thanks .. KJ</p>","116103","","","","","2012-09-10 15:11:19","Android Layout Alignment Issue","<android><layout>","2","0","","",""
"3242822","1","","","2010-07-14 01:46:41","0","608","<p>I created an android app and there is a function that will periodically delete old records</p><pre><code>delete from tablea where col1 = 'value1' and col2 = 'value2' and postdate &lt; '2010-06-14'</code></pre><p>It has performance problem when total number of row in tablea has more then 50,000. It take around 45 seconds to delete 500 records.</p><p>I already have index for this where clause:</p><pre><code>CREATE INDEX indexa on tablea (col1, col2, postdate)</code></pre><p>adding PRAGMA synchronous=OFF and PRAGMA count_changes=OFF didn't help.</p><p>Please advise</p>","391105","","244296","","2010-07-14 01:49:52","2010-07-14 04:59:31","How to optimize delete with date range where clause?","<android><sqlite><indexing><delete><date-range>","2","1","","",""
"3242911","1","","","2010-07-14 02:08:56","0","557","<p>I have a ListView that is filled from my adapter with my custom views.  Each view has two buttons, one that starts another activity to edit the contents of that list item and one to delete that item.</p><p>My question is where should my ClickEvent handlers for those buttons be?  Should I put them right in my custom view code since I have all the information I need? Should I start an ASyncTask that deletes the item and updates the adapter data and calls onDataSetChanged() etc?</p><p>Should all of this be bubbled up through events to my ListActivity?</p><p>I could probably make it work at any level, but at what level along this hierarchy (Activity->ListView->Adapter->ListItemView) is the proper place to edit/delete backing data for the ListView?</p>","131871","","","","","2010-07-14 03:47:28","Where should data changing event in listview be handled?","<android><listview><adapter>","1","0","","",""
"3242980","1","3243095","","2010-07-14 02:25:35","1","377","<p>How do I remove a queued message of a given type from a handler's message queue?</p>","440093","","","","","2010-07-14 02:55:39","Pull a message from an Android handler","<android>","1","1","","",""
"3243066","1","3243078","","2010-07-14 02:47:54","1","391","<p>If my app goes haywire in the field, what are some diagnostic resources that the app can collect at runtime? Is there a way to access all the Logger message our app generated (i.e. via Log.e())?</p>","440093","","","","","2010-08-28 18:36:11","How to extract an Android app's log messages at runtime?","<android>","1","0","","",""
"3243215","1","","","2010-07-14 03:26:57","33","18696","<p>I have been a java developer 2 years. But I have never wrote a WeakReference in my code. How to use WeakReference to make my application more efficiency especially in Android application.  </p>","389204","","181412","","2013-06-17 13:45:17","2014-04-06 18:50:52","How to use WeakReference in Java and Android development?","<java><android><weak-references>","1","2","4","",""
"3243237","1","3244480","","2010-07-14 03:35:45","2","656","<p>I'm implementing a custom adapter that iterates over some database entries which in turn link back to the Android contacts database. The adapter will make the query to the content resolver and bind the data from the returned cursor into the view. However, suppose I add a contact to my private database, then remove it from the Android contacts list. The query will fail, and ideally in that case I want to delete that entry from the database and try the next one, and invalidate the view that I'm supposed to be binding so it doesn't show up on the screen.</p><p>I don't see an obvious way to do that from the SDK docs, so I thought I'd ask lazyweb!</p><p>The other solution is to iterate through the whole private contact database on instantiation and prune all the bad entries, but I consider that very expensive.</p>","92631","","","","","2010-07-14 09:06:55","When implementing bindView() for an adapter, can I 'skip' a view?","<android>","2","2","","",""
"3243365","1","4370751","","2010-07-14 04:20:41","6","1730","<p>Is there any control in Android which is similar to UISegmentedControl Bar style in iPhone?</p><p>The Bar style is the button from following view (the background is a separate control, the two buttons stick together)</p><p><img src=""http://c0848462.cdn.cloudfiles.rackspacecloud.com/8b7e0e7d1b318f40a6fcc0caeb9d0f92.png"" alt=""alt text""></p><p>view in action here<a href=""http://www.youtube.com/watch?v=8DdPnOjOCgM#t=5m25"" rel=""nofollow"">http://www.youtube.com/watch?v=8DdPnOjOCgM#t=5m25</a></p>","154206","","243782","","2010-07-14 09:41:33","2010-12-06 20:42:36","UISegmentedControl Bar style equivalaent in Android","<android>","1","1","3","",""
"3243445","1","","","2010-07-14 04:49:31","6","2797","<p>I'm working with the emulator using the debugger and I've noticed that onUpdate is not getting called.  When I add the widget to the emulator homescreen I see my breakpoint being hit in the onReceive method.  The onReceive method does get the android.appwidget.action.APPWIDGET_UPDATE intent.  However, the onUpdate function never gets called.  I believe it's defined correctly.</p><pre><code>    @Override        public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds)        {    // code that sets up remove view and updates appWidgetManager    }</code></pre>","48784","","","","","2012-08-02 19:42:59","onUpdate not being called in widget, even though I see the android.appwidget.action.APPWIDGET_UPDATE intent in onreceive","<android><android-widget>","3","0","","",""
"3243471","1","3247015","","2010-07-14 04:58:03","3","1018","<p>I am having social networking application made by me, in which you can post comments, i want to facilitate user to one click share posted commented on user's Facebook as well.</p><p>I tried <a href=""http://code.google.com/p/fbconnect-android/"" rel=""nofollow"">fbconnect-android</a> is there any other way sharing comments on FB?</p>","216431","","119895","","2010-07-14 14:12:22","2010-07-14 14:16:10","Android share comment on facebook","<android><facebook>","1","0","0","",""
"3243488","1","3243948","","2010-07-14 05:01:57","1","2587","<p>Android: I have a social networking application made by me, in which you can post comments, i want to facilitate user to one click share posted commented on user's twitter.</p>","216431","","55093","","2011-06-06 16:06:47","2011-06-06 16:06:47","Android share comment on twitter","<android><twitter>","1","0","1","",""
"3243497","1","3243536","","2010-07-14 05:04:05","4","659","<p>Can anyone please clear my doubt regarding the query that does Android Programming has anything to do with the J2ME?</p><p>Does Android Development comes under J2ME Platform as J2ME is used basically for the Mobile Applications and Android is also the same one.</p><p>Please let me know if anybody is knowing it.</p>","384176","","114066","","2010-07-14 10:08:40","2012-04-18 05:41:08","Android and J2ME","<android><java-me>","3","0","2","",""
"3243527","1","3249681","","2010-07-14 05:13:27","5","437","<p>Could someone explain how to start Appinventor after installing?</p><p>I downloaded the file and placed in folder as indicated in the provided instructions but am unable to find the launching icon for the Appinventor editor.</p><p><a href=""http://appinventor.googlelabs.com/about/"" rel=""nofollow"">http://appinventor.googlelabs.com/about/</a></p>","379749","","243587","","2012-11-17 22:53:29","2013-07-01 17:12:25","Appinventor - finding the launch icon / starting appinventor","<android><app-inventor>","4","2","2","",""
"3243634","1","","","2010-07-14 05:41:43","0","571","<p>When I am trying to make a call from one emulator to other, I am experiencing the following message ""Not registered on Network"".</p><p>Can anyone please let me know the solution to isolate this message. I tried adding the uses-permissions in the Android Manifest file and I also tried stopping and starting adb server but no luck.Thanks in advance.</p><p>Regards,Serenity.</p>","391225","","","","","2011-06-09 10:54:42","""Not registered on Network""","<android>","0","2","","",""
"3243635","1","6415599","","2010-07-14 05:41:59","7","1021","<p>At the moment I am developing an application which catches the action <code>NEW_OUTGOING_CALL</code> with the help of a <code>BroadcastReceiver</code>. I am aborting the call by calling <code>setResultData(null)</code>. After that I am showing the user a dialog which allows him to decide if he wants to use my application to rewrite its number. When the users decision has happened I am placing the new call depending on the decision. Now my broadcast receiver gets called up once again. </p><p>What is the correct way of getting to know that I have already processed the number? I got a working solution that uses a timestamp to guess if it could be already processed. Another solution would be to add a <code>""+""</code> at the end of the processed number.These methods are working fine for my application being the only one catching the <code>NEW_OUTGOING_CALL</code> event. But what should I do when other applications (like Sipdroid or Google Voice) are also sitting there catching the <code>NEW_OUTGOING_CALL</code> broadcast aborting it and restarting it again? I don't see a possibility to get to know if we are still in the same ""call flow"" and if I already processed the number. </p><p>I would love to hear your ideas about this problem!</p>","391216","","244296","","2010-07-17 14:22:55","2013-08-13 08:29:12","What is the correct way of handling the action NEW_OUTGOING_CALL while looping?","<android>","3","1","4","",""
"3243654","1","","","2010-07-14 05:45:03","13","14434","<p>HiI've started android emulator app and trying to open from embeded browser locally started web-site, but local dns name (from /etc/hosts) is not resolved. Is there any option to enable local resolving?</p>","143511","","","","","2013-07-31 11:02:29","android emulator and local site","<android><android-emulator>","4","0","2","",""
"3243672","1","3243688","","2010-07-14 05:51:36","1","1297","<p>I have inherited EditText class an made my custom class, MyEditText.</p><p>and want to detect key pressed(say 'a', 'b', 'c'... '0', '1', '2'... etc.) event in Android. How?</p><p>It seems overridden method onKeyDown(int keyCode, KeyEvent event) is called when 'back', '\', '/', 'DEL', '@' keys are pressed, but not for any numeric or alphabets.</p>","108663","","","","","2010-07-14 05:55:58","How can I detect any key pressed (numeric, alphabet) event in Android for EditText","<android><events><keypress><numeric><alphabet>","1","0","","",""
"3243784","1","3243845","","2010-07-14 06:14:27","3","2597","<p>Is there any android API to extract contacts in vcard 3.0 format ?I have come across an open-source vcard project <a href=""http://code.google.com/p/android-vcard/"" rel=""nofollow"">android-vcard</a> </p><p>but in the <strong>usage Example</strong> the following comments are mentioned.</p><p><strong>Important:</strong> If you are developing application for Android device, you don't have to use this library, because it is already included in the underlying Android framework. This library is useful only if you are developing application to be run outside of Android environment. Android developers: read this text twice. </p><p>Can you please let me know which library is mentioned in the above description? Is it made available to the application developers? </p>","366053","","","","","2011-09-28 19:29:29","Android contatcs vcard API","<android>","1","0","2","",""
"3243827","1","","","2010-07-14 06:23:40","5","167","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/7980298/how-can-i-change-the-status-of-my-gtalk-or-gmail-in-android"">How can i change the status of my Gtalk or Gmail in Android?</a>  </p></blockquote><p>I have an android application working right now. I would like to add a new feature in that -chat status.I expect it to be working like this: when I set status to available or invisible, it should set my gtalk status to the same.Is that possible in any way?</p>","391238","","998692","","2011-12-20 14:47:27","2011-12-20 14:47:27","setting status of gtalk through android application","<android>","0","0","","2012-04-11 13:47:43",""
"3244022","1","","","2010-07-14 07:08:40","3","5191","<p>How can I set the Background for a button to a transparent Color, like transparent Blue for eg, instead of a solid blue? </p><p>When I use <code>button.setBackgroundColor(Color.BLUE)</code> it sets it to a solid blue.</p>","334802","","68805","","2011-12-19 13:14:32","2011-12-19 13:14:32","Button set Background to Transparent Color","<android><button><transparent>","2","0","1","",""
"3244058","1","3244577","","2010-07-14 07:13:53","3","419","<p>I'm just getting into my first android application and just wondering what the convention is here?</p><p>Is it more organised to separate my code into various packages? For example.</p><pre><code>com.myfirstapp.activity;com.myfirstapp.database;</code></pre><p>I was thinking of doing this as a way of organising my code with database helper files for example kept it .database package.</p><p>I have just noticed that data is stored in /data/data/YOUR_PACKAGE/ does this mean that when on a device I would end up having data stored all over the place if I use different packages?</p><p>If this is not right what is a better way of organising code in Eclipse much like you do in Xcode?</p>","387317","","114066","","2010-07-14 08:54:13","2010-07-14 09:01:45","Android separate code into packages","<android><eclipse><setup>","2","0","","",""
"3244128","1","","","2010-07-14 07:28:44","0","267","<p>Has anyone any idea on how to solve the generic problems related to starting a task in background from an activity and when the task is finished posting the result to the activity that created ? (the activity might get destroyed in the meantime due to a orientation change ,or receiving a call , or might be in the process of destroying and recreation)  </p>","304866","","304866","","2010-07-14 07:56:18","2010-10-09 06:35:57","Background tasks and activity","<android>","1","0","","",""
"3244308","1","3514934","","2010-07-14 08:01:24","1","2769","<p>I have a ViewGroup (LinearLayout) which contains a couple of TextViews and one ImageView.I want to make this entire group clickable.</p><p>I tried something like this:</p><pre><code>    viewGroup.setOnClickListener( new OnClickListener(){        @Override        public void onClick() {            //do stuff        }    });</code></pre><p>However, clicks on the TextViews or ImageViews or on the area enclosed by the ViewGroup above doesn't result in the handler being called.</p><p>Any suggestions on how I can make a whole ViewGroup clickable?</p>","106095","","","","","2010-08-18 17:40:39","Make a ViewGroup clickable on Android","<android>","2","0","1","",""
"3244410","1","","","2010-07-14 08:17:48","0","1266","<p>I know there is already a question like this, but I have found this page on the Android Developemt site: <a href=""http://developer.android.com/reference/java/sql/package-summary.html"" rel=""nofollow"">http://developer.android.com/reference/java/sql/package-summary.html</a>which seems to suggest that it is possible to interface to a SQL database.If this is possible then could someone please show me how it can be done.</p>","391340","","","","","2010-11-18 15:47:36","Access SQL Server 2008 from Android?","<java><sql><android>","3","0","","",""
"3244472","1","3256556","","2010-07-14 08:30:16","2","4432","<p>I created a sql lite database with the following columns:</p><pre><code>static final String dbName=""demoDB"";    static final String tableName=""Employees"";    static final String colID=""EmployeeID"";</code></pre><p>then</p><pre><code>public void onCreate(SQLiteDatabase db) {        // TODO Auto-generated method stub        db.execSQL(""CREATE TABLE ""+tableName+"" (""+colID+"" INTEGER PRIMARY KEY AUTOINCREMENT, ""+                colName+"" TEXT, ""+colAge+"" Integer);"");    }</code></pre><p>I want to select all the records in the database like this and display them in a gridview:</p><pre><code>SQLiteDatabase db=this.getWritableDatabase();         Cursor cur= db.rawQuery(""Select ""+colName+"", ""+colAge+"" from ""+tableName, new String [] {});String [] from=new String []{DatabaseHelper.colName,DatabaseHelper.colAge};            int [] to=new int [] {R.id.colName,R.id.colAge};            SimpleCursorAdapter sca=new SimpleCursorAdapter(this,R.layout.gridrow,c,from,to);        GridView grid=(GridView)findViewById(R.id.grid);        grid.setAdapter(sca);</code></pre><p>but i receive the following exception:</p><pre><code>java.lang.IllegalArgumentException: column '_id' does not exist.</code></pre><p>the db table does not have a column with name '_id'</p><p>so what is wrong with this code</p><p>Thanks</p>","235123","","","","","2013-06-24 02:44:26","android sqlite exception:java.lang.IllegalArgumentException: column '_id' does not exist","<android><sqlite>","6","3","","",""
"3244524","1","3244602","","2010-07-14 08:38:04","1","393","<p>I have very little knowledge of generics other than how to 'use them'. In my app I have  various ListView Activity that seem to share similar methods and variables and have the exact 'algorithm' in the sense that the steps performed are all very much the same.</p><p>For example in my onCreate method I call a method to add a footer, start a progress dialog, call a method to get content based on a xml url and there is a Handler and Runnable fields that is used to call the method to fill the data for the list when the xml parsing is done.</p><p>I was thinking maybe I can create a BaseListActivity that does all these things/has methods to all these things and each specific ListActivity can be extended from that. The problem is they use a List object to hold the items that the xml parsed and which the ListAdapter is backed by.</p><p>So here is code of the fields used:</p><pre><code>// list of games from xmlprivate List&lt;Game&gt; mGames = new ArrayList&lt;Game&gt;();private List&lt;Game&gt; mNewGames = null;// Need handler for callbacks to the UI threadprivate final Handler mHandler = new Handler();// Create runnable for postingfinal Runnable mUpdateResults = new Runnable() {    public void run() {        mGames.addAll(mNewGames);        fillData();    }};LayoutInflater mInflater = null;private ProgressDialog mProgressDialog = null;private int currentPage = 0;</code></pre><p>so really the main difference is that each different activity would use a different object type for the List (ie. Game, Media, Article, etc.). How would I go about doing this?</p>","362476","","","","","2010-07-14 08:55:07","Java code reuse through Inheritance when generics are involved (List in particular)?","<java><android><generics><inheritance><oop>","3","0","0","",""
"3244690","1","","","2010-07-14 09:02:53","-1","757","<p>Specify me the steps to compile fastboot under cygwin to generate fastboot.exe for windows</p>","391153","","","","","2010-07-14 09:07:14","Compile Fastboot on windows","<android>","1","3","","2010-07-16 05:22:32",""
"3244708","1","","","2010-07-14 09:05:00","0","154","<p>I have have an Activity where I would like to hide some elements based on user selection of certain options on same screen. I'm using View.GONE to complete take view off the screen layout if particular option is selected. So this results in some of the UI components move upward.And this seems working fine till Android 1.6. When UI components are moved upward remaining area at bottom is cleared properly. But on 2.1/2.2 device/emulator this bottom area is not getting cleared and components are visible at their old location and new location with some overlap. </p><p>Calls to requestLayout()/ refreshDrawableState() also does not have any effect.</p><p>My xml layout component nesting is something like below:</p><p>ScrollView</p><pre><code> RaidoGroup LinearLayout    View1    View2    View3    View4    View5</code></pre><p>Any clues ?</p>","255507","","","","","2010-07-14 09:05:00","View refresh issue on Android 2.0+","<android>","0","2","","",""
"3244739","1","5628855","","2010-07-14 09:09:54","1","1108","<p>Last year I made an Android application that scrapped the informations on my train company in Belgium ( application is BETrains: <a href=""http://www.cyrket.com/p/android/tof.cv.mpp/"" rel=""nofollow"">http://www.cyrket.com/p/android/tof.cv.mpp/</a>)</p><p>This application was really cool and allowed users to talk with other people in the train ( a messagery server is runned by me) and the conversations wre also on Twitter: <a href=""http://twitter.com/betrains"" rel=""nofollow"">http://twitter.com/betrains</a></p><p>Everybody in Belgium loved it. The company tried to avoid us to use their data, make some users websites closed, but their was some lawyers that attack the company and finally we have no more problems and the websites are open: <a href=""http://blog.tuinslak.org/2010/07/irail-is-back"" rel=""nofollow"">http://blog.tuinslak.org/2010/07/irail-is-back</a></p><p>So, legally my application is ( for now) totally correct and legal, but I get no help from the train company.</p><p>So my question is a little help to get the datas. I am now an android/java beginner and spend some weeks to try to find a solution, but maybe people like will fint it in a few minuts.</p><p>So the problem is the next one. You may have a look at the following URL, and you will find 2 cities names within URL: Mons and Tournai, and also informations on the date and time. That was the old method that worked one year:</p><p>http://hari.b-holding.be/Hafas/bin/query.exe/en?&amp;REQ0JourneyStopsS0A=1&amp;REQ0JourneyStopsS0G=MONS%20[b]&amp;REQ0JourneyStopsZ0A=1&amp;REQ0JourneyStopsZ0G=TOURNAI%20[b]&amp;REQ0JourneyDate=27.010.10&amp;REQ0JourneyTime=19:030&amp;Timesel=depart&amp;ViaName=&amp;ViaMode=NEE&amp;DateMode=ANDERS&amp;PLANNER=TRUE&amp;start=1&amp;queryPageDisplayed=yes</p><p>But now, the URL bring me on a confirmation page and I have to click on the confirm button to get to the next page.</p><p>So my code won't work anymore, I need to click on this button programmatically to arrive on the correct webpage.</p><p>Have you any idea on how to simulate a click on this button? For now my code is the classic scrapping code with the URL given a few line on the top. I assumed that the Url give me the result page. That was the case till last week.</p><pre><code>DefaultHttpClient httpclient = new DefaultHttpClient();        HttpGet get = new HttpGet(mon_url);        HttpResponse response;            try {                  response = httpclient.execute(get);                  HttpEntity entity = response.getEntity();                          BufferedReader buf = new BufferedReader(new InputStreamReader(entity.getContent()));                 etc...</code></pre><p>Have you any idea on how to improve the code?</p><p>As the software is free, I cannot send paypal money, but a whole country would be really thankfull to the man that might help!</p><p>Thank a lot.</p>","327402","","327402","","2010-07-19 22:55:34","2011-04-11 23:47:26","Android/Java: Simulate a click on this webpage","<java><android><web-services><screen-scraping><web-scraping>","1","0","2","",""
"3244800","1","3286605","","2010-07-14 09:18:46","6","5881","<p>Hi allIs there a way to change ImageView drawable with its corresponding drawable for landscape mode without destroying the whole activity. I tried to set the drawable again in onConfigurationChanged callback but it doesn't work. Something like this </p><pre><code>@Overridepublic void onConfigurationChanged(Configuration conf) {    super.onConfigurationChanged(conf);    mImageView.setImageDrawable(getResources().getDrawable(R.drawable.iv));}</code></pre><p>When i star the activity in landscape mode to correct drawable is displayed so resources are located correctly.</p>","184601","","","","","2011-12-07 21:24:00","change image onConfigurationChanged","<android><gui>","3","0","3","",""
"3244916","1","3244974","","2010-07-14 09:37:10","1","227","<p>Can anybody please tell me that how closely Android Application Development is associated with Java. That is, is it possible for a person working in Android Development to work on Core Java or J2EE or J2SE ever?</p><p>Let me make my question a bit more clear: "" As Android is based on Java, but does it depends on Java so well that a person from the Android development side can work in Core Java or J2EE or in J2SE.?</p><p>Seeking really to know this now.</p>","384176","","114066","","2010-07-14 10:08:06","2013-04-26 20:14:54","Android and java Association","<java><android>","3","2","","",""
"3244950","1","","","2010-07-14 09:43:32","0","543","<p>I am communicating with PHP web services in Android application. All the requests send from android are encoded with UTF-8 and the php scripts decodes it with utf-8. </p><p>But when any request is send with apostrophe ' the decode function of php doesn't seem to work the way it should. </p><p>For example, if I send the request as ""Today's Horoscope"" then its utf-8 encode will be ""Today%27s+Horoscope"". I tried to decode this with Android and it was successful. But in php it gives the same text after decoding.</p><p>The database is MySql. Is this a problem with database or php? I am not sure about it but is there any workaround to this problem?</p><p>Regards</p><p>Sunil</p>","261566","","","","","2010-08-03 10:42:17","Strange problem of apostrophe in communicating with PHP script from Android","<php><android><apostrophe>","3","0","","",""
"3244956","1","","","2010-07-14 09:44:37","1","798","<p>I am very new to android development. I have a activity with a GridView. I need to change GridView's text color and change each row's background color. How can I do this ?</p><p>Thank You in advance.</p><p>DineshNS</p>","391406","","391406","","2010-07-14 11:41:56","2013-09-21 13:11:21","Android - Changing GridView text color and styling","<android><gridview>","1","0","","",""
"3244965","1","3247198","","2010-07-14 09:45:19","0","1159","<p>By Default in the <code>Listview</code>,focus will come on the list item.Instead of that, can I get only the border to the list item?</p><p>I can achieve this by using a transparent image as a list selector.Is there any other simplest way to achieve this requirement?</p>","391409","","119895","","2010-07-14 14:31:50","2010-12-04 10:24:52","How can we set the border to a list item in list view","<android>","1","0","","",""
"3245165","1","3245249","","2010-07-14 10:16:57","4","5871","<p>So is there a way for a webview control to detect a swipe while capable of doing multitouch zoom and having build-in zoom controls?</p>","348058","","348058","","2010-07-14 10:54:44","2010-07-14 10:54:44","How to webview swipe gesture detect with multitouch zooming enabled withing a flipper","<android><multi-touch><swipe>","1","2","4","",""
"3245234","1","3262206","","2010-07-14 10:27:00","14","8173","<p>I need to completely remove dividers from ExpandableListView. As for parent items it's a setDividerHeight method where I can pass a zero value. But there's no similar method for child divider. Is there any way to hide it? </p>","218783","","218783","","2010-07-14 10:41:43","2013-02-01 15:30:28","Android: Hide child dividers in ExpandableListView","<android><android-widget>","2","0","4","",""
"3245264","1","3245577","","2010-07-14 10:31:46","2","448","<p>I am having some trouble with implementing my own observer in Java on the Android platform.</p><p>I have created a class call NetworkPathJni that uses an Observer interface class called NetworkPathJniObserver to notify other objects of changes.</p><p>Here is the code for NetworkPathJni.java</p><hr><pre><code>public class NetworkPathJni {NetworkPathJniObserver networkPathJniObserver;  public NetworkPathJni(NetworkPathJniObserver aObserver){    networkPathJniObserver = aObserver;    Log.d(""Phone"", ""NetworkPathJni Created"" );  }  public void NetworkPathStateChanged(int aAvailabilityState){      Log.d(""Phone"", ""NetworkPathStateChanged new state = "" + aAvailabilityState );      TAvailabilityState availabilityState = intToAvailability(aAvailabilityState);      Log.d(""Phone"", ""Is SipNetworkPath alive?"" +  networkPathJniObserver.isAlive());      networkPathJniObserver.NetworkPathStateChanged(availabilityState);      Log.d(""Phone"", ""NetworkPathStateChanged end"" );      Log.d(""Phone"", ""Is SipNetworkPath alive? (2)"" +  networkPathJniObserver.isAlive());  }</code></pre><hr><p>And here is the code for the observer</p><hr><pre><code>public interface NetworkPathJniObserver {void NetworkPathStateChanged(TAvailabilityState aAvailabilityState);boolean isAlive();}</code></pre><hr><p>The observer is implemented as follows in a class called SipNetworkPath</p><hr><pre><code>public class SipNetworkPath implements NetworkPathInterface, NetworkPathJniObserver{NetworkPathObserverInterface observer;NetworkPathJni networkPathJni;public SipNetworkPath(NetworkPathObserverInterface aObserver){    domainType = aDomainType;    observer = aObserver;    networkPathJni = new NetworkPathJni(this);    Log.d(""Phone"", ""SipNetworkPath created"" );}//NetworkPathJniObserver@Overridepublic void NetworkPathStateChanged(TAvailabilityState availabilityState) {    Log.d(""SipNetworkPath"", ""SipNetworkPath - Do networkpathstate changed!"");}@Overridepublic boolean isAlive() {    return true;}</code></pre><hr><p>And SipNetworkPath is instanciated as follows</p><hr><pre><code>public class WifiNetworkPath extends SipNetworkPath{public WifiNetworkPath(NetworkPathObserverInterface aObserver) {    super(aObserver);}</code></pre><hr><p>The logging shows that both NetworkPathJni and SipNetworkPath get created and that NetworkPathStateChanged(int aAvailabilityState) is called.</p><p>Within that method all the logging comes back but the method does not get called in the observer and I get false when I ask ""Is SipNetworkPath alive?"" in the logging.</p><p>Is the observer class losing reference or something or is there a mistake in my way of doing this?</p>","243999","","","","","2010-07-14 11:49:51","Java Observer Problem","<java><android><observer-pattern>","1","3","","",""
"3245302","1","","","2010-07-14 10:36:51","2","252","<p>At the moment I am trying to evaluate if it is possible to reuse the android contact search in a 3rd party application. </p><p>I got the problem that I have to implement a contact list/picker including a filtering possibility for the contacts list. That means that the standard android picker opened by an intent does not help me. So I decided to implement the list/picker on my own which is not that difficult. But I need to be able to offer the android search dialog in my own implementation as well.</p><p>So is it possible to reuse the standard contact search mechanism in an own application? (the contact search available e.g. in the default contact list) Or do I have to implement this one on my own? </p><p>Thank you very much for helping me out!</p>","391216","","","","","2010-07-21 11:25:30","Reuse default android contact search in 3rd party application - Possible?","<android>","1","0","1","",""
"3245331","1","3245401","","2010-07-14 10:40:43","1","3556","<p>I've got a float array <code>camObjCoord</code> declared as..</p><p><code>public static float camObjCoord[] = new float[8000];</code></p><p>I'm then filling it's indexes in a class that does something like the following..</p><p><code>camObjCoord[1] = 2.5;</code></p><p>I'm then calling <code>makeview()</code></p><pre><code>       public void makeview() {    Intent myIntent = new Intent(this, GLCamTest.class);    this.startActivity(myIntent);    Bundle b = new Bundle();    b.putFloatArray(""tweets"", camObjCoord);}</code></pre><p>and then in the new class it's doing...</p><pre><code>               public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Bundle b = this.getIntent().getExtras();    float original[] = b.getFloatArray(""tweets"");    camObjCoord = original;    counter++;}   </code></pre><p>But... I'm getting a Null pointer Exception at <code>float original[] = b.getFloatArray(""tweets"");</code> and I don't know why. I've tried bundling before calling the intent etc. but I've had no luck at a fix. Anyone know why?</p><p>I've also included some of the error incase any of you are interested.</p><pre><code>            07-14 11:14:35.592: ERROR/AndroidRuntime(7886): Caused by:  java.lang.NullPointerException            07-14 11:14:35.592: ERROR/AndroidRuntime(7886):     at  org.digital.com.GLCamTest.onCreate(GLCamTest.java:41)            07-14 11:14:35.592: ERROR/AndroidRuntime(7886):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)            07-14 11:14:35.592: ERROR/AndroidRuntime(7886):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)            07-14 11:14:35.592: ERROR/AndroidRuntime(7886):     ... 11 more</code></pre><p>Thanks!</p>","358438","","","","","2013-06-14 20:49:05","Null pointer exception when using Bundle to pass data","<java><android><nullpointerexception>","5","3","","",""
"3245382","1","3259029","","2010-07-14 10:49:54","3","4586","<p>I want to get rid of horizontal scroll bar in TabHost. It's there even if TabWidget is on top.</p><p><img src=""http://img341.imageshack.us/img341/1879/brokentabs.png"" alt=""alt text""></p><p>Below is my xml layout.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@android:id/tabhost""android:layout_width=""fill_parent""android:layout_height=""fill_parent"" &gt;     &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""             android:layout_height=""fill_parent""/&gt;                     &lt;TabWidget        android:id=""@android:id/tabs""                             android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:gravity=""bottom"" /&gt;&lt;/TabHost&gt;</code></pre>","296427","","296427","","2010-07-14 10:57:02","2011-12-09 10:07:49","How to get rid of horizontal scroll bar in tabhost?","<android><layout><android-tabhost><tabwidget>","2","0","3","",""
"3245538","1","","","2010-07-14 11:17:18","1","1407","<p>I am trying to follow </p><p><a href=""http://developer.android.com/guide/topics/graphics/2d-graphics.html"" rel=""nofollow"">http://developer.android.com/guide/topics/graphics/2d-graphics.html</a></p><p>and draw a shape on top of the imageview</p><p>my class is </p><pre><code>package com.bayer.glucofacts;import android.content.Context;import android.graphics.Canvas;import android.graphics.drawable.ShapeDrawable;import android.graphics.drawable.shapes.OvalShape;import android.widget.ImageView;public class CustomDrawableImageView extends ImageView { private ShapeDrawable mDrawable; public CustomDrawableImageView(Context context) {  super(context);  int x = 10;  int y = 100;  int width = 300;  int height = 50;  mDrawable = new ShapeDrawable(new OvalShape());  mDrawable.getPaint().setColor(0xff74AC23);  mDrawable.setBounds(x, y, x + width, y + height); } protected void onDraw(Canvas canvas) {  mDrawable.draw(canvas); }}</code></pre><p>and did xl like</p><pre><code>&lt;com.cmp.app.CustomDrawableImageView  android:id=""@+id/bg_image"" android:src=""@drawable/book""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" /&gt;</code></pre><p>but this crashes my app when i doo setContnetLayout in onCreate of the activity</p><p>when i was doing only ImageView without extending it for canvas drawing, it was working fine.</p><p>whats the problem ? </p><p>basically i plan to draw an image and a few lines on top of the image. how to do this ?</p>","384185","","17343","","2010-07-14 11:18:44","2012-10-09 10:44:11","shape draw in imageview","<android>","1","0","","",""
"3245579","1","3271914","","2010-07-14 11:22:56","3","423","<p>I've got a float array <code>camObjCoord</code> declared as..</p><p><code>public static float camObjCoord[] = new float[8000];</code></p><p>I'm then filling its indexes in a class that does something like the following..</p><pre><code>                      public void addcube(float highx, float lowx, float highz, float lowz){    //Constructing new cube...    System.out.println(""f = "" + f);    Global.cubes++;    float y = 1.5f;    System.out.println(""highx = "" + highx + ""lowx = "" + lowx + ""highz = "" + highz + ""lowz = "" + lowz);    //FRONT    camObjCoord[i] = lowx;     i++;    camObjCoord[i] = -y;     i++;    camObjCoord[i] = highz;     i++;    camObjCoord[i] = highx;     i++;    camObjCoord[i] = -y;     i++;    camObjCoord[i] = highz;     i++;    camObjCoord[i] = lowx;     i++;    camObjCoord[i] = y;     i++;    camObjCoord[i] = highz;     i++;    camObjCoord[i] = highx;     i++;    camObjCoord[i] = y;     i++;    camObjCoord[i] = highz;    //BACK     i++;    camObjCoord[i] = lowx;     i++;    camObjCoord[i] = -y;     i++;    camObjCoord[i] = lowz;     i++;    camObjCoord[i] = lowx;     i++;    camObjCoord[i] = y;     i++;    camObjCoord[i] = lowz;     i++;    camObjCoord[i] = highx;     i++;    camObjCoord[i] = -y;     i++;    camObjCoord[i] = lowz;     i++;    camObjCoord[i] = highx;     i++;    camObjCoord[i] = y;     i++;    camObjCoord[i] = lowz;     i++;    //LEFT    camObjCoord[i] = lowx;     i++;    camObjCoord[i] = -y;     i++;    camObjCoord[i] = highz;     i++;    camObjCoord[i] = lowx;     i++;    camObjCoord[i] = y;     i++;    camObjCoord[i] = highz;     i++;    camObjCoord[i] = lowx;     i++;    camObjCoord[i] = -y;     i++;    camObjCoord[i] = lowz;     i++;    camObjCoord[i] = lowx;     i++;    camObjCoord[i] = y;     i++;    camObjCoord[i] = lowz;     i++;    //RIGHT    camObjCoord[i] = highx;     i++;    camObjCoord[i] = -y;     i++;    camObjCoord[i] = lowz;     i++;    camObjCoord[i] = highx;     i++;    camObjCoord[i] = y;     i++;    camObjCoord[i] = lowz;     i++;    camObjCoord[i] = highx;     i++;    camObjCoord[i] = -y;     i++;    camObjCoord[i] = highz;     i++;    camObjCoord[i] = highx;     i++;    camObjCoord[i] = y;     i++;    camObjCoord[i] = highz;     i++;    //TOP    camObjCoord[i] = lowx;     i++;    camObjCoord[i] = y;     i++;    camObjCoord[i] = highz;     i++;    camObjCoord[i] = highx;     i++;    camObjCoord[i] = y;      i++;    camObjCoord[i] = highz;     i++;    camObjCoord[i] = lowx;     i++;    camObjCoord[i] = y;     i++;    camObjCoord[i] = highz;     i++;    camObjCoord[i] = highx;     i++;    camObjCoord[i] = y;     i++;    camObjCoord[i] = lowz;     i++;    //BOTTOM    camObjCoord[i] = lowx;     i++;    camObjCoord[i] = -y;     i++;    camObjCoord[i] = highz;     i++;    camObjCoord[i] = lowx;     i++;    camObjCoord[i] = -y;     i++;    camObjCoord[i] = lowz;     i++;    camObjCoord[i] = highx;     i++;    camObjCoord[i] = -y;     i++;    camObjCoord[i] = highz;     i++;    camObjCoord[i] = highx;     i++;    camObjCoord[i] = -y;     i++;    camObjCoord[i] = lowz;    i++;    int p = 0;    System.out.println(""FULL ARRAY"");    while(p &lt; 72){        System.out.println(camObjCoord[p]);        p++;    }}</code></pre><p>I'm then calling <code>makeview()</code></p><pre><code>    public void makeview() {     Intent myIntent = new Intent(this, GLCamTest.class);        Bundle b = new Bundle();        b.putFloatArray(""tweets"", camObjCoord);        myIntent.putExtras(b);    this.startActivity(myIntent);}</code></pre><p>and then in the new class it's doing...</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Bundle b = this.getIntent().getExtras();    float original[] = b.getFloatArray(""tweets"");    camObjCoord = original;    counter++;}   </code></pre><p>I then have another class <code>class GLLayer</code> and it looks like the following..      <a href=""http://pastebin.org/394884"" rel=""nofollow"">http://pastebin.org/394884</a> inside this class I'm drawing the cube(s) from the float array, I've check and the values for the cube are indeed there and when I'm coding the array in it works but when I'm dynamically building the array then passing it the cube doesn't draw. I'm calling the class like so..</p><pre><code>           glView=new GLLayer(this);           mPreview = new CamLayer(this, glView); </code></pre><p>Anyone have any idea why? How would I fix my problem? Just to add, I am giving the exact same values to the exact same indexes when drawing dynamically</p><pre><code>          final static float camObjCoord[] = new float[] {            // FRONT             -2.0f, -1.5f,  2.0f,              2.0f, -1.5f,  2.0f,             -2.0f,  1.5f,  2.0f,              2.0f,  1.5f,  2.0f,             // BACK             -2.0f, -1.5f, -2.0f,             -2.0f,  1.5f, -2.0f,              2.0f, -1.5f, -2.0f,              2.0f,  1.5f, -2.0f,             // LEFT             -2.0f, -1.5f,  2.0f,             -2.0f,  1.5f,  2.0f,             -2.0f, -1.5f, -2.0f,             -2.0f,  1.5f, -2.0f,             // RIGHT              2.0f, -1.5f, -2.0f,              2.0f,  1.5f, -2.0f,              2.0f, -1.5f,  2.0f,              2.0f,  1.5f,  2.0f,             // TOP             -2.0f,  1.5f,  2.0f,              2.0f,  1.5f,  2.0f,             -2.0f,  1.5f, -2.0f,              2.0f,  1.5f, -2.0f,             // BOTTOM             -2.0f, -1.5f,  2.0f,             -2.0f, -1.5f, -2.0f,              2.0f, -1.5f,  2.0f,              2.0f, -1.5f, -2.0f,        };</code></pre><p>Then it will render this cube. It appears to not like that I'm making the array and then dynamically adding indexes. Why? how do I fix this? For the bounty I would also accept an appropriate workaround which will work in Android.</p><p>Thanks.</p><p>edit1: I've tried various things it's not the passing of the array causing the problems if I was to declare the array like so...</p><p>edit2: I've also tried printing the array as it goes into GLLayer (class which renders cubes) and everything is as you would expect. I've no idea why these cubes wouldn't be appearing :(</p><p>edit3: I've added how I'm constructing the float arrays.</p><p>edit4: I've also tried setting the size of the array equal to the number of values I'm inputting. Doesn't work.</p>","358438","","44390","","2012-06-12 13:32:32","2012-06-12 13:32:32","Problem dynamically drawing a cube","<java><android><arrays><opengl-es><floating-point>","2","1","0","",""
"3245607","1","3246491","","2010-07-14 11:26:17","5","10807","<p>Can anybody tell how to implement double click event in android without using gesturedetector?</p>","386430","","21234","","2010-07-14 11:34:52","2011-09-08 22:55:05","double click event in android","<android><android-2.2-froyo>","3","2","","",""
"3245811","1","3246501","","2010-07-14 12:00:07","5","4281","<p>I want to store some metadata in images. My camera application gives me a bitmap, which I store in the storage (MediaStore) device. In addition to this, I want to add a few tags to the picture in its metadata. I think EXIF is a good way of doing this. But I couldn't find good references on how to do this.</p><p>If there are some tools to achieve this task in Android programming, please let me know.</p><p>Thanks</p>","370764","","","","","2013-04-11 08:09:31","Writing EXIF metadata to images in Android","<android><bitmap><metadata><exif>","1","1","1","",""
"3246017","1","3249748","","2010-07-14 12:25:57","0","3452","<p>HI, When trying to show more than one animation at the same time sometimes one of the animations ""hickups"" and just seems to jump right to the end position.</p><p>What im trying to achive is have a Gallery baseed mebu that changes the current view in a ViewFlipper, the Gallery changes the current view on the setOnItemClickListener.if i don't use the event to chnage the current view then my Gallery animation works as expected.</p><p>if i try to chnage the view then the ViewFlipper animation works but the Gallery animation is choppy.</p><p>Any advice as to the correct way for mutiple animations?</p><p>Thanks,</p>","274180","","","","","2010-07-14 19:30:40","Android Multiple Animations","<android><user-interface><animation>","1","0","2","",""
"3246156","1","","","2010-07-14 12:41:13","2","1118","<p>As described in this <a href=""http://stackoverflow.com/questions/3213899/cant-grab-progress-on-http-post-file-upload-android/3246050#3246050"">answer</a> you cannot grab a progress of a multipart/form POST upload in Android using only the Android SDK, because there is an issue with the stream buffering when using HttpURLConnection which will be fixed post Froyo (see <a href=""http://code.google.com/p/android/issues/detail?id=3164#c6"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=3164#c6</a>).</p><p>Since the Apache HttpClient 3.1 was removed from the SDK quite early and the new HttpClient, which is now part of the SDK, wasn't adopted completely (it misses multipart capabilities) you can add the missing parts (specifically apache-mime4j-0.6.jar and httpmime-4.0.1.jar) to perform a multipart/form-data upload AND grab the progress of the upload (also described in the answer mentioned above).</p><p>Now, the reason why I open a new question is, that doing as described leads to an enormous growth of the installed app size (in my case from 170kb to 732kb).</p><p>So, the question is: <strong>Is there any other way to perform a multipart/form-data upload and grab the upload progress without increasing the app size that much?</strong>Are there any other libraries one can use or is there any other alternative way, not mentioned here?</p>","388826","","","","","2012-03-24 18:37:21","Alternative way to grab progress on multipart/form upload (Android)","<java><android><upload><progress><multipartform-data>","2","0","1","",""
"3246217","1","13700704","","2010-07-14 12:47:40","0","2792","<p>I would like to change the transparency of a whole View in Android. How can I do that? The View has a nontransparent background.</p>","114066","","114066","","2012-12-04 10:22:26","2012-12-04 10:22:26","Is it possible to set the transparency of a view in Android?","<android><android-layout><transparency>","2","2","","",""
"3246422","1","","","2010-07-14 13:12:22","2","1865","<p>I understand that to access a SQL database from Android I need to create a web service that will run on the SQL server and will process requests from the Android application, what I need to know is how to create this web service and how to access it from Android.If anyone can point me in the right direction then this would be greatly appriciated.</p>","391340","","","","","2010-07-14 13:25:17","Access SQL database from Android?","<sql><android><xml><web-services>","1","2","","",""
"3246439","1","3248737","","2010-07-14 13:14:54","0","348","<p>I have a PNG file formatted for the iPhone I used in a TextView drawable.  The image is just two words in black text on a white background, when you view it.  On the iPhone it shows as two words in white text on a black background.  On the Android it shows as two words in black text on a transparent background.</p><p>Can someone tell me how to make the Android image show as white text on a black background by configuring the Android TextView?  I'd like to save time from creating new PNG files.</p><p>Thanks in advance!</p>","291981","","","","","2010-07-14 17:22:05","iPhone PNG image displays differently in Android TextView drawable","<iphone><android><graphics>","2","0","","",""
"3246447","1","3246458","","2010-07-14 13:15:55","5","8659","<p>I have to set the style for a <code>TextView</code> which is created programmatically. </p><p><strong>How do I implement <code>style=""@style/test""</code> programmatically?</strong></p><p>I have looked at the <a href=""http://developer.android.com/guide/topics/resources/style-resource.html"" rel=""nofollow"">Android developer style documentation</a> already, but it did not answer my question. Any ideas?</p>","267269","","1542891","","2014-03-03 12:03:39","2014-03-03 12:03:39","how to set the Style Attribute Programmatically in Android?","<android><coding-style>","2","1","1","",""
"3246530","1","3248562","","2010-07-14 13:24:22","3","874","<p>I want to start a new activity from my <code>UncaughtExceptionHandler</code> when an uncaught exception appears. Is this possible?</p><p>I think the current activity can't start a new child activity in its ""error"" state because I always get this errors:</p><pre><code>07-14 14:34:06.075: INFO/ActivityManager(74): Starting activity: Intent { flg=0x10000000 cmp=de.rwth/system.ErrorHandler (has extras) }07-14 14:34:06.615: WARN/ActivityManager(74): Activity pause timeout for HistoryRecord{4338f8d8 de.rwth/.main}07-14 14:34:16.115: WARN/ActivityManager(74): Launch timeout has expired, giving up wake lock!07-14 14:34:16.628: WARN/ActivityManager(74): Activity idle timeout for HistoryRecord{433a89d8 de.rwth/system.ErrorHandler}</code></pre><p>I tried to start the child activity from a new thread, because i thought the current thread might be in a state where it is not allowed to start a new activity but this didn't work too. </p><p>So does anyone know how this could work? How do i prevent the current activity from blocking everything while in this error state? is the any way to set the exception to handled?</p>","165106","","119895","","2010-07-14 14:03:11","2010-07-16 16:16:36","starting activity on uncaughtException() call","<android><exception><exception-handling><activity><android-intent>","1","3","3","",""
"3246627","1","3247208","","2010-07-14 13:37:13","1","683","<p>I'm slighty puzzled about how android's AppWidget machinery works.</p><p>I reimplemented the AppWidgetProvider's constructor like this:</p><pre><code>public class MyProvider extends AppWidgetProvider {   public MyProvider() {     Log.d(""TEST"", ""Creating..."")   }   public void onUpdate(..., int[] appWidgetIds) {      // updating stuff here   } }</code></pre><p>From what I've read in the docs, I understood that AppWidgetProvider is instantiated once, when widget of that type is added for the first time. If another widget of the <b>same</b> type gets added, it will be managed by exactly that provider.</p><p>But I just discovered that this is not the case!</p><p>For each widget I add, android creates a new MyProvider (I see that from 'adb logcat' - it prints ""Creating..."" for each widget)!I don't understad why :)Maybe I got something wrong? Or documentation isn't clear on something.What's the reason of having appWidgetIds passed to <i>onUpdate</i> and other methods if each provider is managing only ONE widget?</p>","258848","","","","","2010-07-14 14:36:23","Why is AppWidgetProvider created each time I add an app widget?","<android><widget><android-widget>","2","2","","",""
"3246792","1","3250421","","2010-07-14 13:53:35","24","13013","<p>To enable logging for apache commons HttpClient in normal Java application I used:</p><pre><code>System.setProperty(""org.apache.commons.logging.Log"", ""org.apache.commons.logging.impl.SimpleLog"");System.setProperty(""org.apache.commons.logging.simplelog.showdatetime"", ""true"");System.setProperty(""org.apache.commons.logging.simplelog.log.httpclient.wire"", ""debug"");System.setProperty(""org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient"", ""debug"");</code></pre><p>But on android I don't see logs in LogCat.</p><p>Am I missing some thing?</p>","62192","","21234","","2012-05-18 18:23:47","2013-02-09 00:20:44","How to enable logging for apache commons HttpClient on Android","<android><apache-commons-httpclient>","4","0","27","",""
"3246819","1","3247120","","2010-07-14 13:56:43","0","1470","<p>Is it possible to change the text color of a textview if the textview is pressed?I want to achieve a flashing effect with the color change only lasting as long as the button is pressed.</p><p>I know how to change the background of the textview with a selector list and the correct state but how can I change the color of text if the user pushes a button or a simple textview?</p>","114066","","114066","","2010-07-14 14:29:46","2014-04-04 15:21:57","How to change textColor on press Even in Android?","<android><layout>","5","0","","",""
"3246940","1","3253380","","2010-07-14 14:07:43","4","2476","<p>I hear different things from different people on that topic and nobody is really sure. Also a quick google search doesn't reveal anything informative.</p><p>The question is: when using Flurry Analytics (or Google Analytics or whatever analytics tool) in an Android App. Do I need to inform the users in form an EULA or something similar that is shown on first app start and has to be accepted?</p><p>The stats collected are completely anonymous, so most people say you don't have to show an EULA. But what's the truth now?</p>","373138","","1288","","2012-08-04 17:30:38","2012-08-04 17:30:38","Do you need to display an EULA when using Flurry/Google Analytics?","<android><google-analytics><analytics><flurry>","4","1","4","2011-09-04 20:10:21",""
"3246959","1","3284904","","2010-07-14 14:09:18","1","396","<p>Why if I start the MPlayer from the onCreate it doesn't start?I tried also from onStart(), but the only working way was from onTouch or on key press.</p><p>Any idea how to start it without any additional user input needed?</p>","287316","","287316","","2010-07-19 14:30:45","2010-07-20 19:00:40","How to start MPlayer from onCreate?","<android>","1","0","0","",""
"3247171","1","3247702","","2010-07-14 14:32:37","5","8827","<p>I've got a bitmap... and if the bitmap's height is greater than maxHeight, or the width is greater than maxWidth, I'd like to proportionally resize the image so that it fits in maxWidth X maxHeight.  Here's what I'm trying:</p><pre><code>    BitmapDrawable bmp = new BitmapDrawable(getResources(), PHOTO_PATH);    int width = bmp.getIntrinsicWidth();    int height = bmp.getIntrinsicHeight();    float ratio = (float)width/(float)height;    float scaleWidth = width;    float scaleHeight = height;    if((float)mMaxWidth/(float)mMaxHeight &gt; ratio) {        scaleWidth = (float)mMaxHeight * ratio;    }    else {        scaleHeight = (float)mMaxWidth / ratio;    }    Matrix matrix = new Matrix();    matrix.postScale(scaleWidth, scaleHeight);    Bitmap out = Bitmap.createBitmap(bmp.getBitmap(),             0, 0, width, height, matrix, true);    try {        out.compress(Bitmap.CompressFormat.JPEG, 100,                 new FileOutputStream(PHOTO_PATH));    }    catch(FileNotFoundException fnfe) {        fnfe.printStackTrace();    }</code></pre><p>I get the following exception:</p><p><code>java.lang.IllegalArgumentException: bitmap size exceeds 32bits</code></p><p>What am I doing wrong here?</p>","238849","","","","","2013-02-25 08:10:17","Proportionally resize a bitmap","<android>","3","1","2","",""
"3247314","1","3247416","","2010-07-14 14:45:45","3","2868","<p>is there a way to apply a color to an alpha animation in android?  I know how to use  the <code>&lt;alpha&gt;</code> element, but i'd like to have the alpha apply a color as well as an alpha  so i can hightlight a layout.  is this possible?</p>","372405","","","","","2013-07-26 09:52:20","android apply color to alpha animation","<android><animation><colors><alpha>","2","0","1","",""
"3247403","1","3248182","","2010-07-14 14:54:46","1","490","<p>So, I was finally able to build and debug the android platform (the process can be seen <a href=""http://stackoverflow.com/questions/3196634/android-build-failure"">here</a>). Now, the question is: where are the unit tests, how do I launch them and where do I see results?</p><p>And also, is there any guide to android platform architecture?</p>","163423","","","","","2010-07-14 16:10:44","Unit testing the android platform","<android><unit-testing><platform>","1","0","","",""
"3247554","1","3247895","","2010-07-14 15:10:40","1","4332","<p>I tried with threads, but android throws ""CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views."".</p><p>So how can I wait 3 seconds and then hide the view, letting the GUI responsive?</p><p>--</p><p>A Timer uses another thread either, so it will not solve..</p>","287316","","287316","","2010-07-14 15:16:39","2012-11-20 09:19:45","How to show a view for 3 seconds, and then hide it?","<android><gui>","3","1","2","",""
"3247708","1","","","2010-07-14 15:25:43","0","632","<p>I am developing an application which will read the text file from the SD-Card. I am able to store the details into sd-card in a text format. However, I am unable to display the data from the text file due to default buffer size limitation.</p><p>Please let me know the procedure to increase the buffer size.</p><p>Regards,Serenity.</p>","391225","","","","","2010-07-14 15:25:43","How to increase the buffer size for reading text files in android emulator?","<android>","0","3","","",""
"3247847","1","","","2010-07-14 15:38:15","9","1118","<p>I have to use OAuth for my Android client and I have found that the learning resources are pretty rare or inadequate for this technology. </p><p>Does anybody know a good book/tutorial/online resource to learn OAuth?Thank you.</p>","82368","","82368","","2010-07-14 15:57:43","2011-06-18 14:35:11","Best Learning Resource for OAuth","<android><http><authentication><rest><oauth>","5","2","2","",""
"3247874","1","3247961","","2010-07-14 15:40:57","6","497","<p>When creating a new android project, the build target has two choices:</p><p>Android 2.2, Android Open Source ProjectANDGoogle API's, Google Inc.</p><p>Both show Platform as 2.2 and API level 8</p><p>Which to choose (and why)?</p>","386541","","","","","2010-07-14 15:47:36","Android build target, duplicates, which to choose?","<android>","1","0","","",""
"3248069","1","3248111","","2010-07-14 15:56:39","2","3600","<p>I'm working on an android application, and test it on an emulator, because I don't have physical android device.</p><p>So, I have a button, and I set a click listener on it. Does it mean that it will work only when the user pushes the click button on his device, or it will work also when he taps the button (the tap is touch event right?)?Also when I set a touch listener to the button, and when I click with the cursor on the button (on the emulator), it fires the two events onClick and onTouch.</p><p>Do I need to have the two listeners, because I want to work on click and touch, but I don't know its behavior on a real device.</p><p>Thank you.</p>","391770","","","","","2010-07-14 16:03:51","Android emulator, onClick and onTouch problem","<android><click><emulator><touch>","2","0","2","",""
"3248132","1","3248449","","2010-07-14 16:04:38","6","7735","<p>Despite <a href=""http://stackoverflow.com/questions/2848775/use-startactivityforresult-from-non-activity"">similar question was asked</a>, I have differnet situation: My app consists mostly of a background <code>Service</code>. I want to start external activities and get results back.</p><p>I see several options:</p><ol><li><p>Create dummy <code>Activity</code> and keep reference to it for using its <code>startActivityForResult</code>. This consumes quite a lot of memory, as we know.</p></li><li><p>Use <code>Broadcast Intents</code> instead of Android's results infrastructure: ask client activities to broadcast their results before closing. This kind of breaks the idea and not so performance-efficient.</p></li><li><p>Use <code>Instrumentation</code> directly - try to copy code from startActivityForResult into my Service. </p></li><li><p>Use Service interfaces - serialize and add <code>AIDL</code> connection to the Intent for starting an Activity. In this case Activity should <a href=""http://stackoverflow.com/questions/3114669/android-and-restful-services"">call Service directly</a> instead of providing result.</p></li></ol><p>The third approach feels closer to Android for me, but I'm not sure if it's possible to do - Service does not have its Instrumentation, and default implementation seems to always return null. </p><p>Maybe you have any other ideas?</p>","33782","","33782","","2010-07-14 16:12:29","2010-07-14 16:43:16","Analog of startActivityForResult for Service","<android>","1","0","5","",""
"3248250","1","3248438","","2010-07-14 16:18:32","2","1628","<p>I am looking to add a (local, not online) high scores table to my Android app and I wanted to get some insight on the best way to approach the problem.</p><p>I have a list of users (right now being saved out to a file and read back in as an array of User objects), and the high scores need to reference this data to populate the table with the user's name and photo, etc.</p><p>For the display, I think a <a href=""http://developer.android.com/reference/android/widget/TableLayout.html"" rel=""nofollow"">TableLayout</a> would probably be my best option. I can make columns for picture, name, score, etc.</p><p>For the information itself, I'm thinking maybe a SQLite table would be the best way to organize my data? If so, then it may be worthwhile to move my user data to a SQLite table as well so I can ensure the data is cross-referenced properly.</p><p>Does anybody here have any helpful information or opinions on this? Thanks.</p><p><strong>UPDATE</strong>: I went with the SQLite database (using two tables) and it works great! Wasn't too hard to learn and get working either. For the layout, it turns out a <a href=""http://developer.android.com/reference/android/widget/ListView.html"" rel=""nofollow"">ListView</a> with a custom adapter was the best way to accomplish what I wanted (more flexible than a TableLayout).</p>","2359478","user370382","2359478","user370382","2010-07-26 18:00:32","2010-07-26 18:00:32","High scores table","<java><sql><android><sqlite>","4","0","","",""
"3248363","1","3278423","","2010-07-14 16:31:38","0","607","<p>I am trying to suppress logging output from BT since it spams my debug session.  The log looks like this:</p><pre><code>07-14 11:27:46.800 I/dun_service( 1105): The value returned from dun_getusbmodemstate_fromsys is 207-14 11:27:48.775 D/BT HS/HF( 1284): cdmaDbm : -81, cdmaEcio : -7007-14 11:27:54.090 D/BT HS/HF( 1284): cdmaDbm : -81, cdmaEcio : -7007-14 11:27:58.460 D/BT HS/HF( 1284): cdmaDbm : -81, cdmaEcio : -7007-14 11:28:03.060 D/BT HS/HF( 1284): cdmaDbm : -81, cdmaEcio : -7007-14 11:28:09.420 D/BT HS/HF( 1284): cdmaDbm : -81, cdmaEcio : -7007-14 11:28:13.770 D/BT HS/HF( 1284): cdmaDbm : -81, cdmaEcio : -70</code></pre><p>and I am using this command line to watch logcat:</p><pre><code>&gt; logcat -v time BT:S</code></pre><p>and yet it still persists to log.  I think the problem is that the component is actually <code>BT HS/HF</code> but I am not able to quote it appropriately.</p><p>I can use this command:</p><pre><code>adb logcat -v time | findstr /v ""BT HS/HF""</code></pre><p>but that feels like a hack - besides, I might miss buffered output through the pipe.</p>","157804","","","","","2010-07-19 04:17:30","How to suppress BT logging in android logcat?","<android><filter><logcat>","1","0","","",""
"3248396","1","3248413","","2010-07-14 16:35:59","1","1802","<p>How do I exclude an application from appearring in the Application Launcher. The code below is used to add on to the launcher but when I exclude it, the launcher still appears.</p><pre><code>&lt;activity android:name="".Application"" android:label=""@string/app_name""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.MAIN"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;   &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre>","369479","","244296","","2010-07-14 16:37:49","2010-07-14 16:38:03","Exclude Application from Launcher","<android><launcher>","1","0","","",""
"3248403","1","","","2010-07-14 16:36:45","0","529","<p>here's a few things i couldn't figure out and could find anyone else posting them in the discussion: </p><p>1.In the new API</p><p>ContactsContract.AggregationExceptions table does not really work for me:</p><p>when I try to insert a row into the table, it gives me this error:</p><blockquote>  <p>07-13 14:20:09.399: ERROR/XXXXX(3074):  java.lang.UnsupportedOperationException:  URI:  content://com.android.contacts/aggregation_exceptions,  calling user: ............</p></blockquote><p>my code here: </p><pre><code>ContentValues values = new ContentValues();values.put(AggregationExceptions.RAW_CONTACT_ID1, String.valueOf(oldRawContactId)); values.put(AggregationExceptions.RAW_CONTACT_ID2, String.valueOf(newRawContactId)); values.put(AggregationExceptions.TYPE, AggregationExceptions.TYPE_KEEP_TOGETHER); mContentResolver.insert(AggregationExceptions.CONTENT_URI, values); </code></pre><p>and I'm sure the two raw contact id exists. </p><p>2.in the old API:</p><p>when I create a group in Contact book, the name of the group is not shown(or not shown correctly)</p><p>here's the code: </p><pre><code>ContentValues values = new ContentValues(); values.put(Contacts.Groups.SHOULD_SYNC, 1); values.put(Contacts.Groups.SYSTEM_ID, mGroupID); values.put(Contacts.Groups.NAME, mGroupTitle); mContentResolver.insert(Contacts.Groups.CONTENT_URI, values); </code></pre><p>3.in the old API: </p><p>when I insert a custom IM contact method for a contact, the data is inserted and shown correctly, but user cannot edit the contact using the default contact app any more. If I remove the contact method, user can edit the contact again. </p><p>here's the code for inserting the contact method: </p><pre><code>ContentValues values = new ContentValues(); values.put(ContactMethods.PERSON_ID, newContactId); values.put(ContactMethods.KIND, Contacts.KIND_IM); values.put(ContactMethods.TYPE, ContactMethods.TYPE_CUSTOM); values.put(ContactMethods.AUX_DATA, ContactMethods.encodeCustomImProtocol(MYIM_PROTOCOL)); values.put(ContactMethods.DATA, buddyId); values.put(ContactMethods.ISPRIMARY, 0); values.put(ContactMethods.LABEL, IM_LABEL); mContentResolver.insert(ContactMethods.CONTENT_URI, values);</code></pre>","341623","","29407","","2010-07-14 16:44:08","2011-01-27 04:19:54","problems with the old and new Contact API","<android>","1","0","0","",""
"3248904","1","3248952","","2010-07-14 17:44:12","0","2742","<p>In my xml i have an edittext element like this</p><pre><code>&lt;EditTextandroid:id=""@+id/hrvalue""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""64""android:textSize=""18sp""&gt;&lt;/EditText&gt;</code></pre><p>in my configuration class i want to read the value of the edittext and save it to a variable.In the edittext box the user will be inputting a number integer.I have wrote the following code</p><pre><code>SharedPreferences prefs = self.getSharedPreferences(""prefs"", 0);SharedPreferences.Editor edit = prefs.edit();EditText hrvalue = (EditText)findViewById(R.id.hrvalue);edit.putString(""hrvalue""+appWidgetId,hrvalue.getText().toString());edit.commit();</code></pre><p>Could i read the value in the edittext box as integer?</p><p>Now I want to read the value as integer in my other class but i don't know how to do it.The sharedpreferences key,value pairs is a bit confusing for me.I wrote </p><pre><code>int hrvalue=prefs.getInt(""hrvalue""+appWidgetId,1);</code></pre><p>Is this correct? Is that the correct way of reading from an edittext and adding it to sharedpreferences?Where is the value of an edittextbox stored?I had success with checkbox but not yet with edittext.</p><p>Thanks.</p>","364418","","35501","","2010-07-14 17:48:59","2010-07-14 17:51:27","Android Saving Edittext content to SharedPreferences and Reading it back","<java><android><edittext><sharedpreferences>","1","0","","",""
"3249018","1","","","2010-07-14 18:00:23","1","725","<p>Is it posible that Android would allow an app to block a phone call, email and or SMS from coming through to the device?</p><p>e.g. User opens app and sets it to block all incoming info for 2 hours. App blocks all email, SMS and calls for 2 hours.</p>","391890","","119895","","2010-07-14 18:45:51","2010-07-14 18:45:51","Can you block incoming traffic with an Android app?","<android><mobile><sms><call>","1","2","","",""
"3249245","1","3249276","","2010-07-14 18:30:00","3","8745","<p>I am planning to drop a call and I find this as one of workaround for that. How do I activate the airplane mode via code? </p><p>This way I will drop the call based on some event.</p>","357349","","63550","","2011-06-05 12:38:59","2013-02-27 07:19:50","How to set the AIRPLANE_MODE_ON to ""True"" or ON?","<android>","3","1","10","",""
"3249266","1","","","2010-07-14 18:34:09","2","1033","<p>By default, Wifi sleep policy is ""Sleep on screen idle"".</p><p>With this policy, is it possible for a Background Service at a later time to wake up Wifi using some API?</p><p>Am trying the following, but does not work:When my Background Service wakes up, it calls ""ConnectivityManager.getActiveNetworkInfo()"" to get active network.Since, the wireless is off on idle, I tried waking it up using ""WifiManager.startScan"" on a previously used Wifi connection.But still dont get Wifi connectivity.</p><p>Any ideas?I preferably do not want to change my sleep policy to ""Never"".</p><p>ThanksHemant</p>","391932","","","","","2010-09-03 14:47:40","Android Froyo and Wifi","<android><wifi><sleep>","1","0","","",""
"3249332","1","3249496","","2010-07-14 18:42:55","2","1873","<p>I have an activity defined as below:</p><pre><code>    &lt;activity android:name=""com.example.ui.HomeActivity""        android:alwaysRetainTaskState=""true""/&gt;</code></pre><p>A strange thing is that, when running on emulator, and the back key is pressed, the activity was destroyed (I saw onDestroy() called in log). But when running on my Nexus One phone, and the back key is pressed, the activity is not destroyed (I didn't see onDestroy() called in log).</p><p>Could someone tell me why?</p><p>Thanks.</p>","256239","","","","","2012-01-27 00:56:36","Did back key destroy an activity?","<android>","2","0","","",""
"3249372","1","3249855","","2010-07-14 18:47:01","0","307","<p>In my application, I have two different activities and both are list activities. I use a SimpleAdapter for each activity and each adapter binds to an arraylist during the onCreate. Both arraylists are present in a different class. Now if there is any change in the arraylists, I have to notify the  corresponding activity. I currently made it to work using a public static handler for the activity and calling the handler.sendMessage from the class where arraylists are stored. But I am not very happy with this solution. Is there a better way to do it? Am I missing some Android feature that can easily do this stuff?</p>","386123","","","","","2010-07-14 19:44:22","Query regarding handlers in Android","<android><handler>","1","0","","",""
"3249414","1","","","2010-07-14 18:50:32","2","704","<p>i want to add a QSB in my activity which will show search result from a list of string variables with in my activity.Can anyone know how can i do this.</p><p>Thanks in advance....  </p>","307585","","317773","","2011-08-10 06:04:53","2011-08-10 06:04:53","android Quick Search Box problem","<android><quick-search>","0","2","0","",""
"3249477","1","3249900","","2010-07-14 18:57:30","1","306","<p>Can an Android process ever host multiple Dalvik VM's? If so, what scenarios can cause this to occur, and what would be the benefit of having multiple VM's in the same process?</p>","440093","","","","","2013-02-22 03:51:45","Can an Android process host multiple Dalvik VM's?","<android>","1","0","","",""
"3249656","1","","","2010-07-14 19:20:01","0","590","<p>I am kicking around the idea of installing a netbook in my car, and I'd like to write an app (C# and WPF based) that would essentially be a gigantic phone interface connected via bluetooth to my Android phone (Nexus 2.2). There was already a similar question asked <a href=""http://stackoverflow.com/questions/550117/dialing-a-phone-number-through-bluetooth"">here</a>, however based on a google search and response <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/bc8e97da9a741c4c"" rel=""nofollow"">here</a> I guess it's not possible to accomplish this. Could anyone confirm this or provide a few more pointers?</p>","272980","","272980","","2010-07-14 20:20:16","2010-07-14 20:20:16","Placing Phone Calls To Android Phone From A Program over Bluetooth","<c#><java><android><bluetooth><phone>","0","2","","",""
"3249670","1","3249754","","2010-07-14 19:21:20","1","1316","<p>hey, im new to android development and trying to make my first application.</p><p>What im trying to implement is a feature i've seen in Handcent SMS: the popup notification.</p><p>So far, my application has a broadcast receiver that uses Toast to display an incoming SMS message.</p><p>However, instead of a Toast notification, I want to make a pop up window that shows the message and offers users a space to type a reply and a button to send. (also a button to simply acknowledge the message without replying)</p><p>how would I accomplish this?can I make my own 'floating' activity and use startActivityForResult?would that have to be fired from inside of a service since broadcast receivers arent supposed to do any heavy lifting?</p><p>or can i use NotificationManager or something.</p>","391979","","","","","2010-07-14 19:31:15","how to to pop up and ask for user input on android after receiving broadcast","<android><popup><activity><notifications><broadcastreceiver>","1","0","","",""
"3249769","1","3249825","","2010-07-14 19:32:51","1","1846","<p>I am trying to query contact information based on a phone number on android 1.6. This is the code I tried. But I get count equals to 0 in my cursor.</p><pre><code>    String selection = ""PHONE_NUMBERS_EQUAL("" + People.Phones.NUMBER + "" , ""   + phoneNumber + "")"";    Cursor cursor = mContext.getContentResolver().query(People.CONTENT_URI,            new String[] {People._ID, People.NAME, People.Phones.NUMBER},            selection, null, null);</code></pre><p>Do you have any idea why it is not working?</p><p>Thank you.</p>","286802","","243782","","2010-07-14 19:37:22","2010-12-18 16:32:58","How can I query contact information based on a phone number","<android><android-1.6-donut>","2","1","1","",""
"3249832","1","3390039","","2010-07-14 19:41:59","6","4669","<p>I implemented a gallery, and inside it I have many listviews from left to right.For some reason Gallery works great with all views but not with listview.With listview, when scrolling on the gallery, sometimes I get little jumps.</p><p>Anyone have an idea on how to solve this?</p><p>some notes:  The gallery uses an adapter to find out what to show, and then the listview is created based on the adapter</p><p>Thanks</p>","237115","","","","","2012-06-15 13:24:07","Android - ListView inside Gallery makes the scrolling not Smooth","<android>","4","2","5","",""
"3249928","1","3300364","","2010-07-14 19:53:51","0","929","<p>I am trying to do a layout similar to the one used in iphone for the weather app:<a href=""http://www.spirituality.org.za/uploaded_images/MTN-South-Africa-iPhone-Weather-app-719447.jpg"" rel=""nofollow"">http://www.spirituality.org.za/uploaded_images/MTN-South-Africa-iPhone-Weather-app-719447.jpg</a></p><p>This layout scrolls left/right very smoothly, and only loads the weather as you scroll.</p><p>HorizontalScrollView cant be used because it loads everything in memory, so not a good idea.Gallery will be similar to the iphone, but it has many problems when you put ListViews inside it, so also not good.</p><p>Is there any other layout like that?  or do I have to build my custom layout? In case it must be custom, do you know any site/app/code where they have done something similar?</p><p>Thanks</p>","237115","","","","","2010-07-21 14:32:36","Android - create Layout like the iphone weather app","<android><listview><layout>","2","0","","",""
"3249996","1","3250099","","2010-07-14 20:03:30","3","3416","<p>I know only primitives can be stored in the android preferences, but do arrays count? Can I store an array of, say, Strings or booleans in an android preference?</p>","375874","","","","","2012-01-22 15:04:27","Android store array in preferences","<android><preferences><android-preferences>","2","0","","",""
"3249997","1","3515083","","2010-07-14 20:03:40","5","1367","<p>ive got an imageview which im displaying a contacts picture using a uri which always looks similar to this:</p><blockquote>  <p>content://com.android.contacts/contacts/34/photo</p></blockquote><p>how would i be able to detect whether this photo exists, as if it doesnt then i want to use a placeholder instead (stored in my drawable folder). at the moment it just shows a blank image.</p>","364727","","243782","","2010-07-14 20:10:43","2012-05-20 04:06:05","detect if contact has photo","<android><file><uri><photo><exists>","2","2","3","",""
"3250034","1","3250101","","2010-07-14 20:08:34","15","8924","<p>I have written a simple helloworld app with a WebView which has a link to Cnn on a simple.html page in my asset folder.</p><pre><code>&lt;a href=""http://cnn.com""&gt;cnn.com&lt;/a&gt;</code></pre><p>How, in my Activity do I capture the click on this, stop the WebView from navigating, and then informing the Activity that ""http://CNN.com"" was clicked?</p>","172861","","","","","2010-07-14 20:39:02","Android WebView - Intercept clicks","<android><webview>","1","0","9","",""
"3250100","1","","","2010-07-14 20:16:11","0","1468","<p>I have a ListView that contains an Image on the left of two vertically-oriented TextViews using a RelativeLayout. When both TextViews have text it looks fine. Sometimes the TextView on the bottom won't have any text, and the problem is that the entire layout is several pixels above where it should be because it still reserves that space for text when there isn't any making the entire list have annoying blank gaps. I remember seeing an example of where someone made the layout not reserve the space, but I can't remember how he did it. Could somebody please enlighten me?</p>","392023","","","","","2010-08-12 12:06:18","android RelativeLayout, trying to vertically center a TextView when the TextView below has no text","<android><textview><relativelayout>","1","2","","",""
"3250104","1","3250662","","2010-07-14 20:16:43","5","2800","<p>I'm writing a painting/graphics Java application for a mobile phone (so memory is limited). The application state is essentially three 1000x500 bitmaps (i.e. layers of a painting). Loading three bitmaps takes about 2 or 3 seconds.</p><p>I'm trying to write an undo engine but I just cannot work out a good way to do it. The typical approaches are:</p><ul><li><p>Use the command pattern: When you undo, you reload the state of the initial file and then playback all the commands processed so far except for the final one. Doing this naively though means waiting 2 or 3 seconds to load the initial state which is too slow. There isn't enough memory to store the initial state in memory either.</p></li><li><p>Use the memento pattern: When you undo, you replace the part of the current state that was changed with the old state. This means every action needs to save bitmaps of the old state to disk because there just isn't enough memory on a mobile device to store this in memory. As saving bitmaps takes time, how do I cope if the user decides to e.g. paint many brush strokes in quick succession? I cannot make them wait.</p></li></ul><p>All my solutions involve complex hybrids of the above patterns. </p><p>Can anyone suggest a solution that would allow me to have reasonably fast undo/redo for my application?</p>","392024","","","","","2011-05-03 17:31:56","Fast undo/redo with memento/command pattern?","<java><android><design-patterns><oop><optimization>","2","1","3","",""
"3250119","1","","","2010-07-14 20:18:47","1","533","<p>Yo guys.</p><p>You know when u do options/more/share page from the browser? Well I'd like an activity of mine to show up in the menu of all the apps capable of responding to that browser's intent. Thing is I dunno how to write the intent filter in the manifest. Also how do I access data like URL and title of the page which are supposedly add as extra in the intent?</p><p>Cheers</p>","87624","","","","","2010-07-14 20:26:19","how to react to an intent of the browser?","<android>","1","1","1","",""
"3250134","1","","","2010-07-14 20:20:52","1","902","<p>I am new to Android and so I may be missing some very basic things here.</p><p>I am trying to host custom KML files on a server behind my firewall and display those KML files on the Android emulator.</p><p>I started by writing a simple app that uses an Intent to display the overlay and pointing the app at geo:0,0?q=http://code.google.com/apis/kml/documentation/KML_Samples.kml. This works in the emulator.</p><p>Next I downloaded that KML file and posted it on my web server (Apache 2.2 on Fedora). I added an AddType directive for the .kml extension and restarted HTTPD.</p><p>When I point my simple app's Intent to my internally hosted KML file I get the error ""The community map could not be displayed because it contains errors.""</p><p>I added some code to try and download the KML file independently of the KML so I could check the status line and the like:</p><pre><code>final HttpClient client = new DefaultHttpClient();final HttpGet get = new HttpGet(""http://mycompany.com/data/KML_Samples.kml"");try {    final HttpResponse resp = client.execute(get);    android.util.Log.e(""MapOverlays"", resp.toString());} catch (Throwable t) {    android.util.Log.e(""MapOverlays"", ""Exception"", t);}</code></pre><p>With a breakpoint on the first Log message line I can inspect the results:</p><p>statusline = ""HTTP/1.1 200 OK""</p><p>Content-Type: application/vnd.google-earth.kml+xml</p><p>Here's the Intent I'm using:</p><pre><code>final Intent intent = new Intent(android.content.Intent.ACTION_VIEW,        Uri.parse(""geo:0,0?q=http://mycompany.com/data/KML_Samples.kml""));startActivity(intent);</code></pre><p>So the two main questions are</p><ol><li>What do I need to do to get KML loaded from a private server?</li><li>What tools are available (if any) to determine what is wrong with what I've done (something more informative than ""The community map..."")?</li></ol><p>Thanks</p>","392027","","392027","","2010-07-14 20:27:30","2011-05-27 20:10:46","What's the secret to hosting custom KML for use in Google Maps Mobile?","<android><google-maps><kml>","1","0","1","",""
"3250159","1","3250556","","2010-07-14 20:23:44","0","790","<p>I created a background .png for my application in GIMP. It's resolution is 640x480, which from googling, seems to be the resolution for a default emulator. My problem is when I apply the background to the <code>RelativeLayout</code> with <code>android:background=@drawable/bg</code> and run it, there are lots of artifacts in the image. As if the emulator could not provide enough colors to display the .png correctly. What is going on here?</p><p>P.S. This image is nothing to fancy, just simple lines and radial gradients.</p>","382252","","","","","2013-07-30 11:11:14","Background Image in RelativeLayout has artifacts","<android>","2","0","","",""
"3250232","1","3250257","","2010-07-14 20:32:33","2","408","<p>I'm not sure what it's called exactly, but I was wondering how you can create a class which you can call multiple methods on in one call. For example, using an android class but it doesn't really matter, you can call all of the class' methods at once:</p><pre><code>AlertDialog.Builder().setItem().setTitle().setPositiveButton().setCancelable() ...etc</code></pre><p>The only way I can think that this could work is if every method returned <code>this</code>, but that seems like it would cause problems. I'm not sure how, but it just seems like it would.</p><p>Also, does this technique have a name?</p>","375874","","90848","","2011-10-09 22:07:50","2011-10-09 22:07:50","Creating java methods that can be called like this: foo.bar().baz().quux()","<java><android><methods><class-design>","8","0","","",""
"3250392","1","","","2010-07-14 20:49:11","0","923","<p>I'm not even concerned with the camera per se.  I want at the closest thing to the display screen.  Meaning:  it could even be the desktop the user is looking at, completw w/ the background and the icons she moves back and forth.  </p><p>Let's say, at time t=1 sec, the app goes to pixel (78, 300) on that display and obtains its value.  What may be at (78, 300) could be a portion of the icon or some speck of tree leaf on the photo being used as desktop background.</p><p>I'm familiar with BitmapFactory.decodeFile() for getting at the pixel contents of a file.  But what about the display?</p><p>Thank you for any assistance.</p>","225626","","","","","2010-07-14 20:53:25","Get pixel value from an Android display?","<android>","1","0","","",""
"3250422","1","3250484","","2010-07-14 20:52:05","3","433","<p>How can I make my simple site, on which the user can choose to play a number of music clips by clicking on little ""play"" buttons on the page (think of Amazon's ""preview"" on their product pages for CDs), work on mobile devices? </p><p>[I originally created the page thinking only of desktop browsers, so currently it works by using Flash. I know that won't work at least on the iphone.]</p><p>Will I have to build a platform-specific app for all major mobile platforms to provide this kind of simple interface? If so, can you recommend a framework that will let me do this in ""write once, run everywhere"" fashion?</p><p>Many thanks for any insight!</p><p>~l</p>","175029","","","","","2010-07-14 20:59:20","music website: how to make it work on android/blackberry/iphone/symbian?","<iphone><android><mobile><audio>","1","0","","",""
"3250506","1","3251331","","2010-07-14 21:02:09","1","905","<p>i used the code below for my listview and textview .</p><p>Code:</p><pre><code>textcontent.setText(Html.fromHtml(item.get_text()));textcontent.setAutoLinkMask(Linkify.WEB_URLS);</code></pre><p>XML:</p><pre><code>&lt;TextView                android:id=""@+id/txtview""                android:autoLink=""web""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:text=""put your link here""/&gt;</code></pre><p>the link looks like url and i can click it but it generate this exception </p><blockquote>  <p>android.util.AndroidRuntimeException:  Calling startActivity() from outside  of an Activity context requires the  FLAG_ACTIVITY_NEW_TASK flag.</p></blockquote><p>any idea how to solve this problem ? </p>","302707","","","","","2010-07-14 23:25:13","Problem when click to HTML links inside a ListView?","<android>","2","1","1","",""
"3250539","1","3250576","","2010-07-14 21:07:02","3","1483","<p>I have a simple helloworld app. I am trying to tell the Activity that a user clicked, ""Cnn.com""</p><pre><code>    WebViewClient wc = new WebViewClient() {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            if (url.equals(""http://cnn.com/"")) {                //TELL ACTIVITY CNN WAS CLICKED                return true;            } else {                return false;            }        }    };    mWebView.setWebViewClient(wc);</code></pre><p>How would I do this.</p><p>(I am coming from a C# .NET background)</p>","172861","","","","","2010-07-14 21:12:07","Android WebView Communicating from a WebViewClient to Activity","<android><webviewclient>","1","1","","",""
"3250646","1","","","2010-07-14 21:22:29","0","1085","<p>I'm just getting into Android development, and I have a question about communicating between a receiver class and an activity class. I'm very new to JAVA and Android so I hope I don't sound too stupid. I'm developing an application where I intercept an SMS message and then based on various elements of that SMS I might delete it once it's been saved to the inbox. I have a receiver class that intercepts the txt message, and I am also able to delete messages from my inbox with code in the activity class using a button at the moment. The problem I have is communicating between the receiver class and the activity class where the code to delete a message resides. I tried putting that code directly into the receiver class but as I'm sure most of you already know the BroadcastReceiver class doesn't seem to support what I need to delete messages. I've been searching for an answer to this for a while, but haven't been able to find anything. Honestly I'm not sure I know enough about JAVA and Android to even recognize a solution if I saw it. Thanks in advance for any help.</p>","392071","","","","","2012-10-04 16:58:39","Android from receiver to activity","<android><sms><activity><receiver>","2","0","","",""
"3250914","1","6246754","","2010-07-14 22:01:49","1","208","<p>I have an Android app that has a Content Provider with an SQLiteDatabase implementation. I have 1 db that has 3 tables. I noticed that my tables don't get any new row inserted after i reach index number 1000. </p><p>This limit is unique for each table. So if i have table_a, table_b, table_c, then if table_a row entries max out at 1000, then table_b and _c can still add more entries, but then table_a does not add any more entries from now on.</p><p>I ran this on 2 different phones and noticed that they both can't add new entries after 1000. Is this a limitation that is documented somewhere or is there something wrong with my code?</p><p>I read something about setMaximumSize() in the SQLiteDatabase class, but I don't think that would solve my problem because it is related to the number of entries rather then the db file size.</p><p>Any thoughts?</p><p>Thanks in advance.</p>","392097","","392097","","2010-07-15 16:10:57","2011-06-05 23:56:42","Is there a max number of entries per table for SQLiteDatabase Content Provider","<sql><android>","1","2","","",""
"3250987","1","3252547","","2010-07-14 22:15:01","0","2125","<p>I have a <code>Gallerywiew</code>.</p><p>I'm using <code>lazyload</code> to download images but when I rotate device it reloads all images and does not use the cache.</p><p>If I do <code>android:configChanges=""keyboardHidden|orientation""</code> the current images are in size of latest orientation.</p><p>To get the images to show full size I do:</p><pre><code>Display display = ((WindowManager)getSystemService(Context.WINDOW_SERVICE))                           .getDefaultDisplay();int width = display.getWidth();int height = display.getHeight();</code></pre>","389080","","2642204","","2013-10-19 10:10:19","2013-10-19 10:10:19","Save cache when rotate device","<android><caching><gallery>","3","0","3","",""
"3251066","1","3251100","","2010-07-14 22:33:47","7","6070","<p>Does there exist an automated GUI testing framework for Android?</p>","440093","","","","","2012-07-22 17:43:09","Automated GUI testing framework for Android","<android>","4","0","3","2012-08-09 20:38:50",""
"3251113","1","","","2010-07-14 22:42:08","0","127","<p>I am actually working on Android Call block App. however my part of code requires Java to generate obstacle/noise in the phone call.</p><p>I want to generate mute and unmute signals in a loop with varying intervals between them. Let me show with Pseudo Code in order to quickly explain logic.</p><pre><code>array Tmute=[1,1,1,3,1,1,1,1,1];  //time in seconds to mute microphone  array TunMute=[3,1,2,4,1,2,1,2,4];   //time in seconds to unmute microphone  int i=0;    runThisLoop for (UserDefinedTime t){    MuteTheMicroPhone();    thread.sleep(Tmute[i]);    UnMuteTheMicroPhone();    thread.sleep(TunMute[i]);    i++;}DropCall();</code></pre><p>I will take care of array out of bounds.</p><p>My Question : Is there a better way to generate the specific Tmute and TunMute which matches my pattern of noise generation, my pattern is shown in Array. Since I am using Android Device memory, I was concerned about efficient programming. Please comment and let me know if this question is not clear.</p>","357349","","1606729","","2013-02-23 21:35:11","2013-02-23 21:35:11","Timer in Java for noise generation","<java><android>","1","0","","",""
"3251478","1","3251527","","2010-07-14 23:54:26","1","73","<p>is there any way to retrieve phone info such as language so that i can use that to auto adjust the program based on the phone language ? </p><p>//Thx in advance</p>","267822","","","","","2010-07-15 00:05:51","Retriving phone prefences","<android>","1","0","","",""
"3251509","1","3251554","","2010-07-15 00:01:45","0","1057","<p>I have a ListView that uses Linkify to create a link to another activity in my app.  the url looks something like <code>content://com.myapp/activitiy/view?param=blah</code></p><p>this works fine every time.</p><p>however, in another view, I'm trying to call some code like this:</p><pre><code>   Intent i = new Intent(""content://com.myapp/activity/view?param=blah"");   i.setAction(Intent.ACTION_VIEW);   startActivity(i); </code></pre><p>but for some reason this doesn't seem to work.  It doesn't trigger my activity (and in fact it blows up if i dont include the setAction() call.  How am I supposed to create the Intent such that it acts the same way that Linkify does...?</p><p>Now i realize i can setup the extras and then handle it in the activity, but that just seems like duplicated effort.  So instead i'll spend the time it would have taken to do that, and post this question.  SO any help much appreciated.  :)</p>","372405","","","","","2010-07-15 00:12:23","android linkify intent","<android><android-intent><linkify>","1","0","","",""
"3251763","1","3252276","","2010-07-15 01:07:56","2","301","<p>I defined a white color in mycolors.xml under res/values as below:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt; &lt;color name=""my_white""&gt;#ffffffff&lt;/color&gt;&lt;/resources&gt;</code></pre><p>In my code, I set the text color of a TextView as the white color I defined:</p><pre><code>TextView myText = (TextView) findViewById(R.id.my_text);myText.setTextColor(R.color.my_white);</code></pre><p>But the text in the TextView turned out to be a black color.</p><p>When I use @color/my_white in layout xml files, it works fine. </p><p>I check the generate R.java, and see:</p><p>public static final int my_white=0x7f070025;</p><p>Did I miss something?</p><p>Thanks.</p>","256239","","256239","","2010-07-15 03:32:16","2010-07-15 03:56:47","Defined color under res not usable in code","<android>","3","0","1","",""
"3251934","1","3252092","","2010-07-15 01:47:42","15","5578","<p>On the iPhone I use a Navigation Controller to push and pop Views from. Very handy.</p><p>Is there an equivalent in Android?</p>","172861","","","","","2013-06-18 00:41:37","Android UINavigationController-like feature","<android><uinavigationcontroller>","2","0","2","",""
"3252139","1","3252260","","2010-07-15 02:46:16","0","340","<p>So basically my app starts out with a TabView, then through the options menu the user selects to add a game to the database. This opens the InputGame class, which accepts a few values, and then it <em>should</em> put them into a database when the user clicks ""Submit"". It will also go  back to the original home view. The app goes back the the home tabs view just fine, bu nothing ever gets added to the database. Am I doing something wrong?</p><p>InputGame:</p><pre><code>public class InputGame extends Activity {    private EditText gameTitle;    private Spinner consoleSelect;    private Spinner genreSelect;    private Spinner ratingSelect;    private Spinner styleSelect;    private EditText gamePub;    private EditText gameDev;    private EditText gameRegion;    private EditText gamePrice;    private EditText gameRelease;     private DatabaseHelper db = null;    private Cursor constantsCursor=null;    private Button addGame;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.inputgame);        db = new DatabaseHelper(this);        constantsCursor = db.getReadableDatabase().rawQuery(                ""SELECT _ID, title, console "" + ""FROM constants ORDER BY title"",                null);        /*Hide the scroll bar*/        ScrollView sView = (ScrollView)findViewById(R.id.ScrollInput);        sView.setVerticalScrollBarEnabled(false);        sView.setHorizontalScrollBarEnabled(false);        /* Accepts game title */        gameTitle = (EditText) findViewById(R.id.gametitle);                /* Console select*/         consoleSelect = (Spinner) findViewById(R.id.console_select);        ArrayAdapter&lt;CharSequence&gt; consoleAdapter = ArrayAdapter.createFromResource(                this, R.array.consoles_array, android.R.layout.simple_spinner_item);        consoleAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        consoleSelect.setAdapter(consoleAdapter);        /* Genre select*/           genreSelect = (Spinner) findViewById(R.id.genre_select);        ArrayAdapter&lt;CharSequence&gt; genreAdapter = ArrayAdapter.createFromResource(                this, R.array.genres_array, android.R.layout.simple_spinner_item);        genreAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        genreSelect.setAdapter(genreAdapter);        /* Style  select*/          styleSelect = (Spinner) findViewById(R.id.style_select);        ArrayAdapter&lt;CharSequence&gt; styleAdapter = ArrayAdapter.createFromResource(                this, R.array.style_array, android.R.layout.simple_spinner_item);        styleAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        styleSelect.setAdapter(styleAdapter);        /* Rating select*/          ratingSelect = (Spinner) findViewById(R.id.rating_select);        ArrayAdapter&lt;CharSequence&gt; ratingAdapter = ArrayAdapter.createFromResource(                this, R.array.ratings_array, android.R.layout.simple_spinner_item);        ratingAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        ratingSelect.setAdapter(ratingAdapter);        /* Accepts game publisher */        gamePub = (EditText) findViewById(R.id.gamepublisher);        /* Accepts game developer */        gameDev = (EditText) findViewById(R.id.gamedev);        /* Release date selector */        gameRelease = (EditText) findViewById(R.id.gamerelease);        /* Add the game button */        this.addGame = (Button)this.findViewById(R.id.addgame);        this.addGame.setOnClickListener(new View.OnClickListener(){            @Override            public void onClick(View v) {                processAdd();            }        });    }    private void processAdd(){        ContentValues values=new ContentValues(8);        values.put(""title"", getGameTitle());        values.put(""console"", getGameConsole());        values.put(""genre"", getGameGenre());        values.put(""style"", getGameStyle());        values.put(""rating"", getGameRating());        values.put(""publisher"", getGamePublisher());        values.put(""developer"", getGameDeveloper());        values.put(""release"", getGameRelease());        db.getWritableDatabase().insert(""constants"", ""title"", values);        constantsCursor.requery();        Intent launchgamesActivity = new Intent(this, GCM.class);        startActivity(launchgamesActivity);    }    public String getGameTitle(){        return(gameTitle.getText().toString());    }    public String getGameConsole(){        return (consoleSelect.getContext().toString());    }    public String getGameGenre(){        return(genreSelect.getContext().toString());    }    public String getGameStyle(){        return(styleSelect.getContext().toString());    }    public String getGameRating(){        return(ratingSelect.getContext().toString());    }    public String getGamePublisher(){        return(gamePub.getText().toString());    }    public String getGameDeveloper(){        return(gameDev.getText().toString());    }    public String getGameRelease(){        return(gameRelease.getText().toString());    }}</code></pre><p>and here is my database helper. The records I have pre-programmed in show up just fine:</p><pre><code>public class DatabaseHelper extends SQLiteOpenHelper {    private static final String DATABASE_NAME = ""gameDb"";    public static final String TITLE=""title"";    public static final String CONSOLE=""console"";    public static final String GENRE=""genre"";    public static final String RATING=""rating"";    public static final String PUBLISHER=""publisher"";    public static final String DEVELOPER=""developer"";//  public STATIC FINAL STRING REGION=""REGION"";    public static final String PRICE=""price"";    public static final String RELEASE=""release"";    public static final String COMPLETION=""completion"";    public static final String DESCRIPION=""description"";    public static final String IMAGE=""image"";    public DatabaseHelper(Context context) {        super(context, DATABASE_NAME, null, 1);    }    @Override    public void onCreate(SQLiteDatabase db) {        db                .execSQL(""CREATE TABLE constants (_id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, console TEXT, genre TEXT, "" +                ""rating TEXT, publisher TEXT, developer TEXT, region TEXT, price REAL, release BLOB, completion BLOB, description BLOB, image BLOB);"");        ContentValues cv = new ContentValues();        cv.put(TITLE, ""Super Mario Galaxy"");        cv.put(CONSOLE, ""Wii"");        db.insert(""constants"", TITLE, cv);        cv.put(TITLE, ""Transformers: War for Cybertron"");        cv.put(CONSOLE, ""Xbox 360"");        db.insert(""constants"", TITLE, cv);        cv.put(TITLE, ""Final Fantasy XIII"");        cv.put(CONSOLE, ""Playstation 3"");        db.insert(""constants"", TITLE, cv);        cv.put(TITLE, ""Final Fantasy VII"");        cv.put(CONSOLE, ""Playstation"");        db.insert(""constants"", TITLE, cv);        cv.put(TITLE, ""New Super Mario Bros"");        cv.put(CONSOLE, ""Nintendo DS"");        db.insert(""constants"", TITLE, cv);    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        android.util.Log.w(""Constants"",                ""Upgrading database, which will destroy all old data"");        db.execSQL(""DROP TABLE IF EXISTS constants"");        onCreate(db);    }}</code></pre><p><strong>EDIT</strong>: When submitting from InputGames, should I be closing that activity all together? I think the way I have it set now just goes back to the other activity, but nothing really gets done. Or is that not it at all?</p><p><strong>EDIT #2</strong> Well I got it to add. For some reason I have to use .execSQL. Thats fine I guess, but bow when I try to add from a spinner item in InputGames, I get this populating the respective element:</p><pre><code>com.jvavrik.gcm.InputGame@43bb0510</code></pre><p>were the number after the ""@"" is always different. Any ideas for this?</p>","325400","","1465910","","2012-09-29 11:18:57","2012-09-29 11:18:57","Android: I cant seem to add to my database","<android><database><sqlite>","1","1","2","",""
"3252140","1","3252280","","2010-07-15 02:46:27","1","2806","<p>I want do uninstall some useless apps from /system.I have super access, and the permission DELETE_PACKAGE in the manifest.But when i run Runtime.exec(""pm uninstall package"") I get ERROR/AndroidRuntime(10981): java.lang.SecurityException: Neither user 10094 nor current process has android.permission.DELETE_PACKAGES.</p><p>Anyone know how to solve this?</p>","392249","","","","","2010-07-16 20:51:35","Uninstall packages invisible in Android","<android><packages><uninstall><root>","2","1","1","",""
"3252164","1","3252225","","2010-07-15 02:50:58","2","810","<p>I want to add around 9 options to my menu but I would like all 9 options to show at once. Is there a way i can disable the grouping of the last options into the ""More"" submenu?</p>","278447","","32502","","2010-07-15 03:15:35","2010-07-15 03:15:35","Possible to display more than 6 items in a menu without the ""More"" option?","<android><menu>","1","0","","",""
"3252173","1","3252181","","2010-07-15 02:54:34","0","225","<p>here is my Arrival.java</p><pre><code>package one.two;import java.io.IOException;import java.util.ArrayList;import java.util.List;import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class Arrival extends ListActivity{    private ListView listView;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        ArrayList&lt;String&gt; retList = new ArrayList&lt;String&gt;();        System.out.println(""Start onCreate Function\n"");        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        System.out.println(""In onCreate Function\n"");        System.out.println(""In of GetData\n"");        DBAdapter db = new DBAdapter(this);         System.out.println(""DB Open\n"");        db.open();        System.out.println(""DB Opened\n"");        retList = getData();        System.out.println(""Out of GetData\n"");        // force count no. of records in table        // dump to check index        int cnt = 2;        int i=0;        for (i = 0; i&lt;cnt; i++)            System.out.println(retList.toString());        System.out.println(""Array 2 String\n"");        Cursor c = db.getCursor();        String[] from = new String[] {DBAdapter.status};        int[] to = new int[] {R.id.Text1};        listView = (ListView) findViewById(android.R.id.list);         setListAdapter(new SimpleCursorAdapter(this, android.R.id.list, c, from, to));        //ArrayAdapter&lt;String&gt; mAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.id.list);        SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this, android.R.id.list, c, null, null);        this.setListAdapter(mAdapter);        System.out.println(""Show List\n"");        db.close();    }    public static ArrayList&lt;String&gt; getData()     {        ArrayList&lt;String&gt; items = DBAdapter.getAllTitles();        System.out.println(""Return a LIST titles\n"");         return items;        }    }</code></pre><p>DBAdapter.java</p><pre><code>package one.two;import java.util.List;import android.app.ListActivity;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteDatabase.CursorFactory;import java.util.ArrayList;public class DBAdapter{    public String status = ""status"";    public String id = ""id"";    public String arrival = ""arrival"";    public String destination = ""destination"";    public String ferry = ""ferry"";    private static String DB_PATH = ""/data/data/one.two/databases/"";    private static final String DATABASE_NAME = ""ferry.db"";    private static final String DATABASE_TABLE = ""port"";    public static Context context;    public Cursor c;    public static SQLiteDatabase DbLib;        //overloaded non-null constructor    public DBAdapter(Context context)     {        DbLib = context.openOrCreateDatabase(DATABASE_NAME,  SQLiteDatabase.CREATE_IF_NECESSARY,null);        System.out.println(""OpenOrCreateDB Done"");    }    public class DatabaseHelper extends SQLiteOpenHelper    {        Context context;        DatabaseHelper(Context context)        {            super(context, DATABASE_NAME, null, DATABASE_VERSION);            this.context = context;        }//end constructor DatabaseHelper        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion,                int newVersion)        {        }//end onUpgrade()        @Override        public void onCreate(SQLiteDatabase db)        {        }//end onCreate()    }// end class DatabaseHelper    private static DatabaseHelper DBHelper;    //private static SQLiteDatabase DbLib;    private static final int DATABASE_VERSION = 1;    //// context brought up /////////////    //private final Context context;        /*public void DBAdapter() throws SQLException        {            String myPath = DB_PATH + DATABASE_NAME;            db = SQLiteDatabase.openDatabase(myPath, null,                    SQLiteDatabase.OPEN_READONLY);        }//end DBAdapter()*/        public static ArrayList&lt;String&gt; getAllTitles()        {            ArrayList&lt;String&gt; port = new ArrayList&lt;String&gt;();                Cursor c=null;                c = DbLib.query(""port"",                        new String[] { ""status"", ""id"", ""arrival"",                                ""destination"", ""ferry"" }, null, null,                        null, null, null);                try {                    if (c!=null) { // start - when there is at least 1 record                        System.out.println(""Cursor is NOT NULL"");                        int i =0;                        for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext())                         {                                    // Debug Stm                            System.out.println(""Record No. ""+i);                            System.out.println(c.getString(0));                            System.out.println(c.getString(1));                            System.out.println(c.getString(2));                            System.out.println(c.getString(3));                            System.out.println(c.getString(4));                            // Assign database cursor.records to arraylist                            port.add(i,c.getString(0));                            port.add(i,c.getString(1));                            port.add(i,c.getString(2));                            port.add(i,c.getString(3));                            port.add(i,c.getString(4));                            i = i + 1;                        }                    } // end - where there is at least 1 record                } finally {                    if (c!=null) {                    c.close();                }                }               return port;        }//end getAllTitles()        public void open() {            //Open the database            String myPath = DB_PATH + DATABASE_NAME;            DbLib = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);        }        public Cursor getCursor(){            return c;        }        public void close()        {            DbLib.close();        }    }//end class DBAdapter</code></pre><p>Error: Cannot make a static reference to the non-static field DBAdapter.status</p><p>May i know what is causing this problem, as in my Arrival.javaString[] from = new String[] {DBAdapter.status};But DBAdapter.status is taken from my DBAdapter , public String status = ""status"";</p>","358218","","","","","2010-07-15 02:57:38","Error with Database in eclipse","<android><database><eclipse><sqlite>","1","0","","",""
"3252208","1","3253186","","2010-07-15 03:08:51","-1","248","<p>onCreate, MyActivity will display five TextViews.  After you touch one of the five TextViews, it will hide three to four TextViews and color one red and one green or just color one green.</p><p>I can code everything up to here.  But how can I pause for a few seconds and then repopulate the five TextViews with new values, unhide them and make them all white?</p><p>Thanks in advance!</p><p>NEW EDIT NEW EDIT NEW EDIT</p><p>I tried a Timer in a new project and can attach the code and make my question less vague.</p><p>Here is the main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;TextView    android:id=""@+id/hello""      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Here is the TestTimer.java</p><pre><code>package com.somecompany.android.testtimer;import java.util.Timer;import java.util.TimerTask;import android.app.Activity;import android.graphics.Color;import android.os.Bundle;import android.util.Log;import android.widget.TextView;public class TestTimer extends Activity {    TextView hello;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    hello = (TextView)findViewById(R.id.hello);    hello.setTextColor(Color.rgb(0,255,0));    new Reminder(5);    }    void resetAndContinue() {    Log.d(""TESTTIMER"", ""Start resetAndContinue..."");    hello.setTextColor(Color.rgb(255,255,255));    Log.d(""TESTTIMER"", ""End  resetAndContinue..."");    }    class Reminder {    Timer timer;    public Reminder(int seconds) {        timer = new Timer();        timer.schedule(new RemindTask(), seconds*1000);    }    class RemindTask extends TimerTask {        public void run() {        Log.d(""TESTTIMER"", ""Ran TagRemindTask"");        resetAndContinue();        timer.cancel(); //Terminate the timer thread        }    }    }}</code></pre><p>The issue is that the Timer executes resetAndContinue and logs two entries, but it doesn't set the TextView color from green to white and it doesn't log anymore</p><p>07-15 13:08:46.894: DEBUG/TESTTIMER(618): Ran TagRemindTask</p><p>07-15 13:08:46.894: DEBUG/TESTTIMER(618): Start resetAndContinue...</p><p>07-15 13:08:47.264: DEBUG/dalvikvm(524): GC freed 202 objects / 8936 bytes in 156ms</p><p>07-15 13:08:52.224: DEBUG/dalvikvm(210): GC freed 43 objects / 2096 bytes in 85ms</p>","291981","","291981","","2010-07-15 13:31:05","2010-07-15 13:31:05","How can I build the following Android activity?","<android>","1","0","","",""
"3252487","1","3269195","","2010-07-15 04:33:34","0","858","<p>i used <code>android:autoLink=""web""</code> in textview inside a listView, the problem when the listview have a link, it looks like the <code>android:autoLink=""web</code>"" override the on click function for that listview .What i need is to be able to click the link and able to click on the listview that contains the link .</p>","302707","","","","","2010-07-16 22:09:27","Links and on click in ListView?","<java><android>","2","0","","",""
"3252552","1","","","2010-07-15 04:50:15","31","8710","<p>As I understand, the three ways of distributing my application are via Jar, Android Library and Android Library Project.</p><p><strong>Jar</strong> - cannot contain resources or XML layouts (so this is out for me)</p><p><strong>Android Library</strong> - I don't really know how this works but the Google API uses it...</p><p><strong>Android Library Project</strong> - includes resources but allows the client free rein on the code as it is distributed as source.</p><p>If I am to create a closed source application that requires drawables and XML files that I want to distribute to other Android programmers, what should I use?  And can someone direct me to a tutorial on creating an <strong>Android Library</strong>?</p>","248521","","139010","","2010-07-15 04:57:30","2013-09-19 05:34:57","Differences between Jar, Android Library and Android Library Project","<android>","6","3","10","",""
"3252585","1","","","2010-07-15 05:03:56","2","788","<p>I'd like to present a Contact picker, but add additional prompting when the picker is opened. On 1.5 the title is simply ""Contacts"".</p><p>I was thinking I could add an EXTRA_TITLE to the Intent which opens the picker, but it supposedly only works on ACTION_CHOOSER, not ACTION_PICK.</p><p>Or do I have to roll my own Contact picker?</p>","104181","","104181","","2010-08-13 22:25:58","2011-10-21 14:49:03","Customize the Android contact picker","<android><android-intent><contacts>","1","0","","",""
"3253069","1","11700103","","2010-07-15 06:42:02","3","506","<p>I'm newer in android development. And after using eclipse about 1 month... i hate this. I've setup NetBeans IDE for android development. It's fast, it's looks like cool and i like it. But have one trouble. I cant find how to use drawable resources (just like <em>R.drawable.icon</em>) :( . Can anyone help me?</p><p>PS: sry 4 my english</p>","392365","","392365","","2013-03-06 06:59:04","2013-11-02 20:43:42","Drawable resources and NetBeans (Android Development)","<android><netbeans><drawable>","2","0","","",""
"3253079","1","3253100","","2010-07-15 06:44:51","3","16059","<p>I've downloaded an APK from web, using the default browser and it can't be opened from the Browser -> Downloads.</p><p>It tells me ""Can't open file""</p><p>But I can use a file browser (like OI File Browser) to browse and open this APK, and it works well.</p><p>What could be the problem here? Is it about the HTTP header? </p>","234939","","","","","2013-06-22 11:48:29","Can't install APK from browser downloads","<android>","2","0","1","2013-06-22 13:34:24",""
"3253108","1","3292420","","2010-07-15 06:50:07","2","2235","<p>This question is related to <a href=""http://stackoverflow.com/questions/3236070/sound-works-on-htc-desire-but-not-on-t-mobile-g1"">this one</a>.</p><p>I managed to modify my code to use SoundPool instead of AudioManager. Know it works more or less.</p><pre><code>public class Sound {    private static boolean sound = true;    private static final int EAT_SOUND = 1;    private static final int SHORT_EAT_SOUND = 2;    private static final int EAT_CHERRY_SOUND = 3;    private static final int EAT_GHOST_SOUND = 4;    private static final int EXTRA_LIVE_SOUND = 5;    private static final int INTERMISSION_SOUND = 6;    private static final int OPENING_SOUND = 7;    private static final int PACMAN_DIES_SOUND = 8;    private static final int SIREN_SOUND = 9;    private static Context context;    private static SoundPool soundPool;    private static HashMap&lt;Integer, Integer&gt; soundPoolMap;    public static void initializeOpenSound(Context con) {        context = con;        soundPool = new SoundPool(2, AudioManager.STREAM_RING, 100);        soundPoolMap = new HashMap&lt;Integer, Integer&gt;();        soundPoolMap.put(OPENING_SOUND, soundPool.load(context, R.raw.opening_song, 1));    }    public static void initializeSounds() {        soundPoolMap.put(EAT_SOUND, soundPool.load(context, R.raw.eating, 1));        soundPoolMap.put(SHORT_EAT_SOUND, soundPool.load(context, R.raw.eating_short, 1));        soundPoolMap.put(EAT_CHERRY_SOUND, soundPool.load(context, R.raw.eating_cherry, 1));        soundPoolMap.put(EAT_GHOST_SOUND, soundPool.load(context, R.raw.eating_ghoasts, 1));        soundPoolMap.put(EXTRA_LIVE_SOUND, soundPool.load(context, R.raw.extra_lives, 1));        soundPoolMap.put(INTERMISSION_SOUND, soundPool.load(context, R.raw.intermission, 1));        soundPoolMap.put(PACMAN_DIES_SOUND, soundPool.load(context, R.raw.pac_man_dies, 1));        soundPoolMap.put(SIREN_SOUND, soundPool.load(context, R.raw.siren, 1));    }    private static void playSound(int sound) {        int streamID = soundPool.play(soundPoolMap.get(sound), 0.5f, 0.5f, 1, 0, 1f);        if (sound == OPENING_SOUND) {            soundPool.setLoop(streamID, 2);        }    }    public static void playSirenSound() throws SoundInitializationError {        if (isSoundOn()) {            if (soundPoolMap.containsKey(SIREN_SOUND)) {                System.out.println(""Play Siren sound"");                playSound(SIREN_SOUND);            } else {                throw new SoundInitializationError(""Siren Sound not initialized!"");            }        }    }    public static void playPacmanDiesSound() throws SoundInitializationError {        if (isSoundOn()) {            if (soundPoolMap.containsKey(PACMAN_DIES_SOUND)) {                System.out.println(""Play Pacman Dies sound"");                playSound(PACMAN_DIES_SOUND);            } else {                throw new SoundInitializationError(""Pacman Dies Sound not initialized!"");            }        }    }    public static void playOpeningSound() throws SoundInitializationError {        if (isSoundOn()) {            if (soundPoolMap.containsKey(OPENING_SOUND)) {                System.out.println(""Play Opening sound"");                playSound(OPENING_SOUND);            } else {                throw new SoundInitializationError(""Opening Sound not initialized!"");            }        }    }    public static void playIntermissionSound() throws SoundInitializationError {        if (isSoundOn()) {            if (soundPoolMap.containsKey(INTERMISSION_SOUND)) {                System.out.println(""Play Intermission sound"");                playSound(INTERMISSION_SOUND);            } else {                throw new SoundInitializationError(""Intermission Sound not initialized!"");            }        }    }    public static void playExtraLiveSound() throws SoundInitializationError {        if (isSoundOn()) {            if (soundPoolMap.containsKey(EXTRA_LIVE_SOUND)) {                System.out.println(""Play Extra Live sound"");                playSound(EXTRA_LIVE_SOUND);            } else {                throw new SoundInitializationError(""Extra Live Sound not initialized!"");            }        }    }    public static void playEatSound() throws SoundInitializationError {        if (isSoundOn()) {            if (soundPoolMap.containsKey(EAT_SOUND)) {                System.out.println(""Play Eat Sound"");                playSound(EAT_SOUND);            } else {                throw new SoundInitializationError(""Eat Sound not initialized!"");            }        }    }    public static void playShortEatSound() throws SoundInitializationError {        if (isSoundOn()) {            if (soundPoolMap.containsKey(SHORT_EAT_SOUND)) {                System.out.println(""Play Short Eat sound"");                playSound(SHORT_EAT_SOUND);            } else {                throw new SoundInitializationError(""Short Eat Sound not initialized!"");            }        }    }    public static void playEatCherrySound() throws SoundInitializationError {        if (isSoundOn()) {            if (soundPoolMap.containsKey(EAT_CHERRY_SOUND)) {                System.out.println(""Play Eat Cherry sound"");                playSound(EAT_CHERRY_SOUND);            }  else {                throw new SoundInitializationError(""Eat Cherry Sound not initialized!"");            }        }    }    public static void playEatGhostSound() throws SoundInitializationError {        if (isSoundOn()) {            if (soundPoolMap.containsKey(EAT_GHOST_SOUND)) {                System.out.println(""Play Eat Ghost sound"");                playSound(EAT_GHOST_SOUND);            }  else {                throw new SoundInitializationError(""Eat Ghost Sound not initialized!"");            }        }    }    public static boolean isSoundOn() {        return sound;    }    public static void setSoundOn(boolean b) {        sound = b;    }}</code></pre><p>However, I have a more or less big audio file which I want to play during startup. However if i call initializeOpenSound() and then playOpening Sound(), then the sound isn't played and logcat outputs:</p><pre><code>07-15 09:11:02.121: WARN/SoundPool(14273):   sample 1 not READY</code></pre><p>In SDK 2.2 I would use <a href=""http://developer.android.com/reference/android/media/SoundPool.OnLoadCompleteListener.html"" rel=""nofollow"">SoundPool.OnLoadCompleteListener</a> but how can I achieve the same using SDK 2.1?</p><p>Edit: I would also be happy width a solution that doesn't include a listener or something like that, but either try to play the sound file until it was successful.</p>","","anon","","anon","2010-07-20 16:41:44","2011-08-14 22:51:37","How do I know that the Soundpool is ready using SDK target below 2.2?","<java><android><sdk><target><soundpool>","2","0","1","",""
"3253148","1","3280034","","2010-07-15 06:56:32","4","3109","<p>I am implementing emoticons using the following code:</p><pre><code>            builder.setSpan(new ImageSpan(mContext, resId, ImageSpan.ALIGN_BASELINE),                        start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE );</code></pre><p>The result (builder) is set as text to a TextView. It works just fine if the span is surrounded by text, i.e. when the start > 0 and the end &lt; length - 1, but the image is cut off (shifted up) if there is no text around it. how do I fix that?</p><p>Thanks a lot.</p>","367677","","","","","2012-06-14 18:38:57","ImageSpan is cut off / incorrectly aligned","<android>","4","0","","",""
"3253193","1","3254546","","2010-07-15 07:03:19","3","2911","<p>Is it possible to capture a frame from a video in android and save it or use it in any way in the application?</p>","463607","","","","","2012-03-12 22:23:21","Video frame capture","<android>","3","2","1","",""
"3253558","1","3253610","","2010-07-15 07:58:42","1","1675","<p>Is there a method of the <a href=""http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle"" rel=""nofollow"">Activity lifecycle</a> which is called if the user presses the back button, but not if the the method startActivityForResult() is called? I couldn't find a method by testing it.</p>","","anon","","","","2012-02-29 21:53:46","Activity Lifecycle: startActivityForResult and press Back Button","<java><android><lifecycle>","2","0","0","",""
"3253616","1","3253742","","2010-07-15 08:07:16","1","655","<p>I have 2 prefs - a song title and the audio state(mute or volume) that I want to store in the same key.  This works for the clicks and the only problem I have is resetting the summary on onSharedPreferencesChanged I get errors with this.</p><pre><code>PreferenceScreen musicPrefScreen = (PreferenceScreen)getPreferenceScreen        ().findPreference(""theme"" + Team_ID); musicPrefScreen.setSummary(mPreferences.getString(""theme"" +         Team_ID, ""CantGetTeam"")); ListPreference audiostatePref = (ListPreference)getPreferenceScreen()        .findPreference(""theme"" + Team_ID);audiostatePref.setSummary(AudioState); audiostatePref.setEntryValues(audiostates_values);</code></pre><p>because the second call to findPreference returns the first Pref.  The docs say you can call findPreference on the first to get the second but they are different types of prefs and i get a cast error.  Is there another way to find the ListPreference so I can reset the Entry Values on the list?</p><p>EDIT:Here is the layout</p><pre><code>public PreferenceScreen createPreferenceHierarchy() {     PreferenceScreen prefScreenRoot = getPreferenceManager().createPreferenceScreen(this);    PreferenceCategory TeamCategory = new PreferenceCategory(this);     TeamCategory.setTitle(""Team "" + Team_ID + "" Settings"");     prefScreenRoot.addPreference(TeamCategory);        // set team name        EditTextPreference teamnamePref = new EditTextPreference(this);          teamnamePref.setTitle(""Team Name"");         teamnamePref.setKey( ""team"" + Team_ID );        teamnamePref.setSummary(TheTeamName);         teamnamePref.setDialogTitle(""Enter Name For Team "" + Team_ID);        teamnamePref.setDefaultValue(TheTeamName);        teamnamePref.getEditText().setSingleLine(true);        TeamCategory.addPreference(teamnamePref);           // select theme music        PreferenceScreen musicPrefScreen = getPreferenceManager().createPreferenceScreen(this);         Intent musicIntent = new Intent(this, MusicDroid.class);         musicIntent.putExtra( ""team_id"", Team_ID);          musicPrefScreen.setIntent(musicIntent);         musicPrefScreen.setKey( ""theme"" + Team_ID );        musicPrefScreen.setTitle(""Theme Music"");         musicPrefScreen.setSummary(TheThemeName);         TeamCategory.addPreference(musicPrefScreen);          // select audio state        ListPreference audiostatePref = new ListPreference(this);        audiostatePref.setTitle(""Audio State"");         audiostatePref.setKey( ""theme"" + Team_ID );        audiostatePref.setSummary(AudioState); //         audiostatePref.setEntries(audiostates);        audiostatePref.setEntryValues(audiostates_values);        TeamCategory.addPreference(audiostatePref);     return prefScreenRoot;}</code></pre>","293565","","293565","","2010-07-15 13:55:53","2012-08-08 07:22:59","With android I want to have 2 preferences with the same key","<android><listpreference><preferencescreen>","2","0","","",""
"3253676","1","3895595","","2010-07-15 08:15:11","34","12222","<p>I have developed an Android Widget, and it was working fine. I added some extra functionality and pushed an update through the Android Market. Now people are complaining that it doesn't work anymore.</p><p>The error I see in the logs is:</p><pre><code>07-14 10:33:44.016: WARN/ActivityManager(78): Unable to launch app ... for broadcast Intent { act=android.appwidget.action.APPWIDGET_ENABLED cmp=... }: process is bad 07-14 10:33:44.026: WARN/ActivityManager(78): finishReceiver called but none active 07-14 10:33:44.026: WARN/ActivityManager(78): Unable to launch app ... for broadcast Intent { act=android.appwidget.action.APPWIDGET_UPDATE cmp=... (has extras) }: process is bad 07-14 10:33:44.036: WARN/ActivityManager(78): finishReceiver called but none active </code></pre><p>I have searched, but I cannot find anywhere what the process is bad error means, so I have no clue on how to fix it.Restarting the phone (or emulator) makes the error go away, however, that is not what I want my users to do.Could someone please help me to explain what the cause of the error is and how to fix it?</p>","392445","","2598","","2011-06-15 02:12:36","2014-01-21 18:56:17","How to fix ""process is bad"" error for an Android Widget?","<android><android-widget>","9","2","19","",""
"3253795","1","","","2010-07-15 08:33:39","1","101","<p>I have been bitten by: ""java.lang.IllegalArgumentException: View not attached to window manager"", when using a ProgressDialog in an Activity.</p><p><strong>What is the proper way to handle a ProgressDialog using Activity lifecycle methods ?</strong>  </p><p>Working code example much appreciated...</p>","77115","","","","","2010-07-15 08:33:39","What is the proper way to handle a ProgressDialog using Activity lifecycle methods?","<android>","0","0","1","",""
"3253907","1","","","2010-07-15 08:48:09","1","9186","<p>I have a mapview page that displays the current location in the map.</p><p>I am using MyLocationOverlay for the purpose. The code for that goes as follows:</p><pre><code>myLocationOverlay = new MyLocationOverlay(this, mapView);myLocationOverlay.enableCompass();myLocationOverlay.enableMyLocation();myLocationOverlay.runOnFirstFix(new Runnable() {public void run() { geopoint = myLocationOverlay.getMyLocation(); ItemizedOverlay itemizedoverlay = new ItemizedOverlay(drawable); try{  overlayitem = new OverlayItem(geopoint, """", """"); } catch(Exception e){  e.printStackTrace(); } itemizedoverlay.addOverlay(overlayitem); mapOverlays.add(itemizedoverlay); mapController.animateTo(geoPoint); }});</code></pre><p>The above code works and gets the current location through gps and sets a marker at that point.</p><p>But the code inside try block is the issue.I am getting null value inside geopoint.</p><p>Actually I have to get that point and do some calculations with distance and all. For that I have to get the correct value inside that geopoint.</p><p>Can anyone please tell the solution for this?</p>","391238","","114066","","2010-07-15 08:51:38","2012-11-08 03:11:05","MyLocationOverlay: getMyLocation returning null","<android><google-maps><location>","5","1","1","",""
"3254002","1","","","2010-07-15 08:59:00","1","410","<p>I have records on the table list contains data that has latitude &amp; longitude on the listing widow. When I click on each row, it passes to the detail window that display the mapview and its annotation of that record.</p><p>I zoom in &amp; out, moved to different area and I clicked ""back"" button to go back to the record list.</p><p>Then, I selected on the different record to see the map on the detail window again, when I'm on the detail window suddenly I clicked on the map, there, it alerts me an error message which did not mention about the specific issues.</p><p>Here is my code:</p><pre><code>        self.listingAnnotation = Titanium.Map.createAnnotation({            pincolor: Titanium.Map.ANNOTATION_RED,            latitude: latitude,            longitude: longitude,            animate: true        });        self.region = {                latitude: latitude,                longitude: longitude        };        if(!self._mapview){            self._mapview = Titanium.Map.createView({                top: 130,                bottom: 0,                animate:true,                mapType: Titanium.Map.STANDARD_TYPE,                region: {latitude: latitude, longitude: longitude},                annotations: [self.listingAnnotation]            });         }        else{            self._mapview.removeAllAnnotations();            self._mapview.setLocation(self.region);            self._mapview.addAnnotation(self.listingAnnotation);        }        self._listingDetailWindow.add(self._mapview);</code></pre>","88400","","","","","2010-07-15 08:59:00","Map View errors when I used it for the second time in Android (Titanium)","<android><geolocation><android-mapview><titanium>","0","1","","",""
"3254157","1","4173234","","2010-07-15 09:20:51","8","1774","<p>For the next version of our application, I want to change the sharedUserId since we now use an internal control dashboard app which must write to the other app's settings files.</p><p>But since the app is already installed on many phones, will this be a problem? I ran a little test on the emulator, and I'm seeing exceptions in the device logs that *.bak versions of the preference files cannot be written. Not sure how critical that is. Curiously, safing settings still seems to work, even though the shared_prefs folder had been created using another Linux user ID.</p><p>Did anyone try this before?</p>","127013","","","","","2012-09-05 19:25:57","sharedUserId: safe to change when app is already in market?","<android><userid><sharedpreferences>","2","1","3","",""
"3254330","1","","","2010-07-15 09:42:30","2","1723","<p>I'm trying to implement some basic functionality for Google Spreadsheets,using the protocol specification with requests.</p><p>The reason i'm doing this because it is for Android, and gdata-java library doesn't really work and the alpha android one doesn't really cut it.I managed to implement authentication, and get for lists, and delete, but for editing \ updating a row i can't really wrap my mind around it.</p><p>For example i want to change the contents of a cell<a href=""http://code.google.com/apis/spreadsheets/data/2.0/developers_guide_protocol.html#UpdatingCells"" rel=""nofollow"">here</a> is the specification for the protocol</p><p>From my understanding of it, i have to send some sort of atom or xml formatted request to the edit URL. I never sent such type of requests.</p><p>I also found  <a href=""http://www.devcomments.com/I-need-to-insert-update-delete-events-in-google-calendar-using-to112717.htm"" rel=""nofollow"">this</a>, which gives a clue on how it should be done (also an unanswered question on a forum), but didn't really managed it.</p><p>Here is my authentication function if you need it, so you don't implement it again, if you want to try and code it.</p><pre><code>/** * Logs in to the Google service using the ClientLogin HttpRequest API and returns an authentification token */ private String getAuthToken() {HttpClient httpclient = new DefaultHttpClient();HttpPost httppost = new HttpPost(CLIENT_LOGIN_ADDRESS);List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();nameValuePairs.add(new BasicNameValuePair(""accountType"", ""GOOGLE""));nameValuePairs.add(new BasicNameValuePair(""Email"", ""username@gmail.com""));nameValuePairs.add(new BasicNameValuePair(""Passwd"", ""password""));nameValuePairs.add(new BasicNameValuePair(""service"", ""wise""));nameValuePairs.add(new BasicNameValuePair(""source"", SERVICE_NAME));try {  httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));}catch (UnsupportedEncodingException e) {  //Log.e(""ERROR"", ""UnsupportedEncodingException"");}//Log.v(""TEST"", ""Executing request "" + httppost.getURI());ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();String responseBody = null;try {  responseBody = httpclient.execute(httppost, responseHandler);}catch (ClientProtocolException e) {  //Log.e(""ERROR"", ""ClientProtocolException"");}catch (IOException e) {  //Log.e(""ERROR"", ""IOException"");}//Log.v(""TEST"", ""response:"" + responseBody);String[] vals = responseBody.split(""\n"")[2].split(""="");String auth_string = vals[1];//Log.v(""TEST"", ""auth_token:"" + vals[1]);return auth_string;}</code></pre><p>Here is what i'm trying as the update function, note, edit URL's are for my document won't work if you try it, it's just for an iea on what i have so far : </p><pre><code>/** * Ignore this i use it for testing */ public void justTesting() {String url = ""http://spreadsheets.google.com/feeds/cells/tl7RKkCaAxvO1f3U9Y8k5Dw/od6/private/full/R2C1/1q0cdh"";HttpClient httpclient = new DefaultHttpClient();HttpPut httpput = new HttpPut(url);httpput.addHeader(new BasicHeader(""Authorization"", ""GoogleLogin auth="" + getAuthToken()));httpput.addHeader(new BasicHeader(""GData-Version"", ""2.0""));HttpEntity he = null;String messageBody = ""&lt;entry&gt;""+                     ""&lt;id&gt;https://spreadsheets.google.com/feeds/cells/tl7RKkCaAxvO1f3U9Y8k5Dw/od6/private/full/R2C1&lt;/id&gt;""+                     ""&lt;link rel=\""edit\"" type=\""application/atom+xml\""""+                     ""  href=\""https://spreadsheets.google.com/feeds/cells/tl7RKkCaAxvO1f3U9Y8k5Dw/od6/private/full/R2C1\""/&gt;""+                     ""&lt;gs:cell row=\""2\"" col=\""2\"" inputValue=\""300\""/&gt;""+                      ""&lt;/entry&gt;"";try {  he = new StringEntity(messageBody);}catch (UnsupportedEncodingException e) {  //Log.e(""ERROR"", ""UnsupportedEncodingException"");}httpput.setEntity(he);try {  HttpResponse hr = httpclient.execute(httpput);  //Log.d(""DEBUG"", ""sl : "" + hr.getStatusLine());}catch (ClientProtocolException e) {  //Log.e(""ERROR"", ""ClientProtocolException"");}catch (IOException e) {  //Log.e(""ERROR"", ""IOException"");}//Log.v(""TEST"", ""executed"");}</code></pre><p>This currently gives a 400 Bad request.Also I'm trying to achieve this using Apache HttpClient. </p><p>Does anyone have any idea on how this might be achieved \ implemented \ how what request i should send?</p><p>Thanks, your help will be greatly appreciated.</p><hr><p>I made some progress and wrote this : </p><pre><code>public void justTesting() {String url = ""https://spreadsheets.google.com/feeds/cells/tl7RKkCaAxvO1f3U9Y8k5Dw/od6/private/full/R2C1"";HttpClient httpclient = new DefaultHttpClient();HttpPut httpput = new HttpPut(url);httpput.addHeader(new BasicHeader(""Authorization"", ""GoogleLogin auth="" + getAuthToken()));httpput.addHeader(new BasicHeader(""GData-Version"", ""3.0""));HttpEntity he = null;String messageBody = ""&lt;entry xmlns='http://www.w3.org/2005/Atom' xmlns:gs='http://schemas.google.com/spreadsheets/2006'&gt; &lt;id&gt;http://spreadsheets.google.com/feeds/cells/tl7RKkCaAxvO1f3U9Y8k5Dw/od6/private/full/R2C1 &lt;/id&gt; &lt;gs:cell row='2' col='1' inputValue='mouuuuuuuuusee'/&gt; &lt;/entry&gt;"";  //RequestEntity requestEntity = new StringRequestEntity(xml.toString(), ""application/atom+xml"", ""UTF-8"");try {  he = new StringEntity(messageBody);}catch (UnsupportedEncodingException e) {  Log.e(""ERROR"", ""UnsupportedEncodingException"");}httpput.addHeader(""Content-Type"", ""application/atom+xml"");httpput.setEntity(he);try {  HttpResponse hr = httpclient.execute(httpput);  Log.d(""DEBUG"", ""sl : "" + hr.getStatusLine());}catch (ClientProtocolException e) {  Log.e(""ERROR"", ""ClientProtocolException"");}catch (IOException e) {  Log.e(""ERROR"", ""IOException"");}Log.v(""TEST"", ""executed"");}</code></pre><p>Now it gives me a 403 Forbidden. Any idea why?</p>","118580","","1288","","2011-10-28 11:34:33","2011-10-28 11:34:33","Google Spreadsheet API update \ edit with protocol","<android><apache><xmlhttprequest><google-api><google-spreadsheet>","1","0","2","",""
"3254398","1","","","2010-07-15 09:51:20","1","343","<p>Why should I use <code>startActivity()</code> in a Service? If I need an Activity a have to call an activity and if I need a ""delayed activity"" I have to use the notification. So, why should I use <code>startActivity()</code>?</p>","392541","","56338","","2010-08-09 18:58:08","2010-08-09 18:58:08","Why should I use startActivity in a Service","<android><service><activity>","1","0","","",""
"3254406","1","","","2010-07-15 09:52:33","13","2504","<p>I have a layout with EditText and TabHost containing 2 tabs. Android 1.6.</p><p>I use hardware keyboard in following case. Steps to reproduce:</p><ol><li><p>When activity is displayed the EditText gains focus.  </p></li><li><p>As soon as I press any key the EditText loses focus and first tab gains it.  </p></li><li><p>I click on the EditText again and start typing.  </p></li><li><p>It works unless I press any numeric button. The first tab gains the focus again.  </p></li><li><p>I scroll back to the EditText with track ball. I can type anything now.  </p></li></ol><p>Using track ball left/right on focused EditText in steps 2,3 also makes the EditText lose its focus. </p><p>This is very weird. How to handle with this?</p><p>main.xml layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;    &lt;EditText android:id=""@+id/textfield"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:maxLines=""1""        android:lines=""1"" android:hint=""Search"" /&gt;    &lt;TabHost android:id=""@android:id/tabhost"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_weight=""1""&gt;        &lt;LinearLayout android:orientation=""vertical""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;            &lt;FrameLayout android:id=""@android:id/tabcontent""                android:layout_width=""fill_parent"" android:layout_height=""wrap_content""                android:layout_weight=""1""&gt;                &lt;LinearLayout android:id=""@+id/tab1""                    android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;                &lt;LinearLayout android:id=""@+id/tab2""                    android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;            &lt;/FrameLayout&gt;            &lt;TabWidget android:id=""@android:id/tabs""                android:orientation=""vertical"" android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" android:gravity=""bottom"" /&gt;        &lt;/LinearLayout&gt;    &lt;/TabHost&gt;&lt;/LinearLayout&gt;</code></pre><p>Activity class:</p><pre><code>  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    TabHost tabs = (TabHost) this.findViewById(android.R.id.tabhost);    tabs.setup();    Button vBtn;    TabSpec tspec1 = tabs.newTabSpec(""label one"");    vBtn = new Button(this);    vBtn.setText(""1"");    tspec1.setIndicator(vBtn);    tspec1.setContent(R.id.tab1);    TabSpec tspec2 = tabs.newTabSpec(""label two"");    vBtn = new Button(this);    vBtn.setText(""2"");    tspec2.setIndicator(vBtn);    tspec2.setContent(R.id.tab1);    tabs.addTab(tspec1);    tabs.addTab(tspec2);  }</code></pre>","387710","","","","","2012-10-04 14:47:16","EditText and TabHost do not like each other","<android><edittext><android-tabhost>","2","0","3","",""
"3254457","1","","","2010-07-15 10:00:12","0","827","<p>i took an android project and imported it in eclipse. in properties->android section it is showing platform 1.6 and API level 4. I have downloaded Android 2.2. Now when i try to make some changes in the source code and make an .apk file and try to install on my android device the device shows an error : Application not installed. the project is not showing any error but it is showing a warning : Attribute minSdkVersion (3) is lower than the project target API level (4) in manifest file. the person who gave me th eproject i asked him to mail his .apk file to me and that .apk file is running perfectly on the device. Please advice.</p>","392548","","1288","","2010-07-15 13:48:33","2012-04-18 11:22:39",".apk file not working on device","<android>","2","1","","",""
"3254470","1","","","2010-07-15 10:01:10","2","1349","<p>I know that google does not have the official API to get video thumbnails under API 2.0 but how do I access the video thumbnails that are shown in the Gallery application. They are stored somewhere ?</p>","388903","","","","","2013-02-23 21:50:03","android video thumbnails","<android><video><thumbnails>","1","0","1","",""
"3254487","1","3254822","","2010-07-15 10:03:37","1","1474","<p>I want to know how to move from one class to other class in android.<br>I have one main class i.e Addition.java(Main Activity) and i created other subactivity(Form.java). I want to how to make my move from one class(ie.Activity)to other.</p><p>I tried this,but not working out,just trying to figure out</p><pre><code>Intent intent = new Intent();intent.setClass(this.getParent(),Form.class);startActivity(intent);</code></pre><p>here Form.class is the subactivity, this.getParent I hope it represents main activity. And I created one activity in manifest.xml file and named it as .Form</p><p>Am i working right?</p>","138030","","114066","","2010-07-15 10:28:33","2010-07-15 11:17:54","How to move from one class to other class in android","<android><android-intent>","2","2","1","",""
"3254536","1","3326362","","2010-07-15 10:09:36","7","935","<p>Is there a way to obtain the time zone from the callbacks received  </p><pre><code>void onLocationChanged(Location location)  </code></pre><p>using the time information that can be obtained from the location parameter</p><pre><code>long Time = location.getTime();</code></pre><p>Or if there is another way please provide info!</p>","304866","","114066","","2010-07-21 15:53:11","2012-07-18 14:05:35","Obtaining Time zone in android","<android><datetime><timezone>","3","1","5","",""
"3254716","1","","","2010-07-15 10:34:09","1","1176","<p>i want to create a bitmap of whats being currently displayed of my app, one thing i went into is cant read FB buffer requires root, would like to know if it is possible to create a image file for the screen, please i want the help to code this, no 3rd party intents , thanks, answers would be much appreciated</p>","392574","","","","","2011-05-07 09:44:32","screen shot for the activity","<android>","3","0","1","",""
"3254782","1","3254859","","2010-07-15 10:42:25","0","1187","<p>I want to store a few values in the form of high scores. But since I'm not going to be storing more than 5 values, using SQLite doesn't seem appropriate. Another option I was considering was a flat file, but I'm not sure how to go about that...</p>","226220","","89334","","2011-05-21 05:52:08","2011-05-21 05:52:08","How do I store data into a flat file in Android?","<android><flat-file>","2","0","","",""
"3254947","1","","","2010-07-15 11:07:45","0","327","<p>pls help me out in following matter,,, its esstentail for me..I want to build android 2.1 with Launcher2 rather than default Launcher....for this , m taking following steps</p><hr><ol><li><p>i m changing the /buil/target/product   in this some . mk files , m changing on them Launcher to Launcher2.</p></li><li><p>I m removing or commentintg the            #LOCAL_MODULE_TAGS := optionalin /frameworks/base/libs/rs/Android.mk  and /frameworks/base/graphics/jni /Android.mk</p></li></ol><p>but everytime , while building n staring the emulator , its givng error tht fail to launch Launcher2 in emulator......</p>","392609","","21234","","2010-07-15 11:12:35","2010-07-15 16:52:10","how to build Android2.1 wid Launcher2","<android>","1","0","","",""
"3255075","1","","","2010-07-15 11:27:26","2","428","<p>I want to write a program which can install and uninstall an application over android device.As these features are provided over android device,but from where should i start and which files are required to be seen to develop my own application. please help me out.</p><p>Thnx in advance.</p><p>Praween</p>","292605","","292605","","2010-07-16 04:27:21","2012-09-17 08:56:37","How can I write a program to install and uninstall an app over android device?","<android>","2","1","1","",""
"3255153","1","3255856","","2010-07-15 11:37:20","7","6661","<p>I'm setting up OAuth for my Android app. To test it I did the following:Added signpost-core-1.2.1.1.jar and signpost-commonshttp4-1.2.1.1.jar to my project, added the variables ""CommonsHttpOAuthConsumer consumer"" and ""CommonsHttpOAuthProvider provider"" and did the following when the button is clicked:</p><pre><code>consumer = new CommonsHttpOAuthConsumer(""xxx"", ""yyy"");provider = new CommonsHttpOAuthProvider(""https://api.twitter.com/oauth/request_token"",                     ""https://api.twitter.com/oauth/access_token"",                     ""https://api.twitter.com/oauth/authorize"");oauthUrl = provider.retrieveRequestToken(consumer, ""myapp://twitterOauth"");persistOAuthData();this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(oauthUrl)));</code></pre><p>persistOAuthData() does the following:</p><pre><code>protected void persistOAuthData(){    try    {        FileOutputStream providerFOS = this.openFileOutput(""provider.dat"", MODE_PRIVATE);        ObjectOutputStream providerOOS = new ObjectOutputStream(providerFOS);        providerOOS.writeObject(this.provider);        providerOOS.close();        FileOutputStream consumerFOS = this.openFileOutput(""consumer.dat"", MODE_PRIVATE);        ObjectOutputStream consumerOOS = new ObjectOutputStream(consumerFOS);        consumerOOS.writeObject(this.consumer);        consumerOOS.close();    }    catch (Exception e) { }}</code></pre><p>So, the consumer and the provider are saved before opening the browser, like described <a href=""http://stackoverflow.com/questions/1965568/oauth-instance-state-in-android"">here</a>.</p><p>In the onResume() method I load the provider and consumer data and do the following:</p><pre><code>    Uri uri = this.getIntent().getData();    if (uri != null &amp;&amp; uri.getScheme().equals(""myapp"") &amp;&amp; uri.getHost().equals(""twitterOauth""))    {        verifier = uri.getQueryParameter(oauth.signpost.OAuth.OAUTH_VERIFIER);        if (!verifier.equals(""""))        {            loadOauthData();            try            {                provider.retrieveAccessToken(consumer, verifier);            }            catch (OAuthMessageSignerException e) {                e.printStackTrace();            } catch (OAuthNotAuthorizedException e) {                e.printStackTrace();            } catch (OAuthExpectationFailedException e) {                e.printStackTrace();            } catch (OAuthCommunicationException e) {                e.printStackTrace();            }                    }    }</code></pre><p>So, what works:1) I do get a requestToken and a requestSecret.2) I do get the oauthUrl.3) I am directed to the browser page to authorize my app4) I am getting redirected to my app.5) I do get the verifier.But calling retrieveAccessToken(consumer, verifier) fails with an OAuthCommunicationException saying ""Communication with the service provider failed: null"".</p><p>Does anyone know what might be the reason? Some people seem to have problems getting the requestToken, but that just works fine. I wonder if it might be a problem that my app has also included the apache-mime4j-0.6.jar and httpmime-4.0.1.jar which I need for multipart upload.</p>","388826","","","","","2010-11-27 11:47:10","Android OAuth: Exception on retrieveAccessToken()","<android><twitter><oauth><signpost>","2","0","8","",""
"3255169","1","","","2010-07-15 11:39:12","-2","808","<p>How can I play videos in android application,when the videos are placed in res/raw folder?</p>","379749","","766108","","2012-08-22 06:42:57","2012-08-22 06:42:57","How to play videos in android?","<android><video><playback><videoview>","1","1","","2012-08-23 06:52:19",""
"3255226","1","3255606","","2010-07-15 11:49:37","1","160","<p>I have created a listActivity with my own ListAdapter. The problem is that the list is viewed in order once launched. But When I scroll down, or go back from another activity, the listView is completely out of order.</p><p>I thought the problem was in ArrayList but no, the list is sorted and i'm sure of it because when I loop over all elements in the ArrayList they are printed in the log the same way I inserted them. </p><p>I pasted the adapter code below in case anyone would like to check it.</p><pre><code>package com.anubis.mail;import java.util.ArrayList;import android.content.Context;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.LinearLayout;import android.widget.TextView;public class EmailAdapter extends BaseAdapter {    private ArrayList&lt;EmailModel&gt; elements;    private Context c;    public EmailAdapter(Context c, ArrayList&lt;EmailModel&gt; Emails) {        this.elements = Emails;        this.c = c;    }    public int getCount() {        return elements.size();    }    public Object getItem(int position) {        return elements.get(position);    }    public long getItemId(int id) {        return id;    }    public void Remove(int id) {        notifyDataSetChanged();    }    public void Add(EmailModel email) {        this.elements.add(email);        for (EmailModel e : elements){            Log.v(""EmailAdapter"", e.getSubject());          }        notifyDataSetChanged();    }    public View getView(int position, View convertView, ViewGroup parent) {        LinearLayout rowLayout;        EmailModel email = elements.get(position);        if (convertView == null) {            rowLayout = (LinearLayout) LayoutInflater.from(c).inflate (R.layout.inbox_item, parent, false);             TextView subject_textview = (TextView)rowLayout.findViewById(R.id.subject_textview);            subject_textview.setText(email.getSubject());            String body_hint = "" - "" + email.getBodyHint();            TextView bodyhint_textview = (TextView)rowLayout.findViewById(R.id.body_hint_textview);            bodyhint_textview.setText(body_hint);            String sender_name = get_sender_name(email.getSender());            TextView sender_name_textview = (TextView)rowLayout.findViewById(R.id.sender_textview);            sender_name_textview.setText(sender_name);            TextView date_time_textview = (TextView)rowLayout.findViewById(R.id.date_time_textview);             date_time_textview.setText(email.getTime());        } else {            rowLayout = (LinearLayout) convertView;        }        return rowLayout;    }    private String get_sender_name(String from) {        String[] sender = from.split(""&lt;"");        String sender_name;        try {            sender_name = sender[0];        } catch (Exception e) {            sender_name = sender[1];        }        return sender_name;    }}</code></pre>","114890","","114066","","2010-07-15 16:28:41","2010-07-15 16:28:41","Android unsorted List","<android><listview><listadapter>","1","0","","",""
"3255228","1","4677226","","2010-07-15 11:50:06","0","811","<p>I'm building an app that uses content observers.My problem is, that I tend to register my content observers multipletimes. This causes my application to log events several times.How do I find out, if my content observer is already registered?</p>","392642","","","","","2011-01-31 15:30:26","Check for registered content observers","<android>","1","0","","",""
"3255406","1","","","2010-07-15 12:15:22","1","4196","<p>I am writing an Android app that should exchange data to a server over Bluetooth, with the server side on a PC running Ubuntu, using the bluez library, in C (or C++).</p><p>My Android app fails (IOException) when I try to connect to my server socket on the PC. </p><p>Here is essentially what I in the java code (in Android, full eclipse project here: <a href=""http://dl.dropbox.com/u/2968234/ThinBTClient.zip"" rel=""nofollow"">http://dl.dropbox.com/u/2968234/ThinBTClient.zip</a>)</p><pre><code>private static final UUID MY_UUID = UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB"");private static String address = ""00:02:72:B2:85:C7"";  // Hard coded for simplicityprivate BluetoothAdapter mBluetoothAdapter = null;private BluetoothSocket btSocket = null;..... mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);btSocket = device.createRfcommSocketToServiceRecord(MY_UUID);btSocket.connect(); // This throws IOException after a timeout of 10seconds or so.</code></pre><p>On the server side (in Ubuntu 8.10), I basically set up a Bluetooth server socket, along the lines described in the example bluez/sdp-register.c </p><p>Down below is my C++ program. To compile it do</p><pre><code>g++ -I/usr/include/glib-2.0/ -I/usr/lib/glib-2.0/include -o bt_server bt_server.cpp -lbluetooth</code></pre><p>I can do the reverse succesfully, i.e. create a server socket in Android and connect from Linux, however this is not what I want to do!I think either the problem has to do with my config of Ubuntu but I cannot seem to figure this one out and any help would be greatly appreciated!</p><pre><code>#include &lt;stdio.h&gt;#include &lt;errno.h&gt;#include &lt;fcntl.h&gt;#include &lt;stdlib.h&gt;#include &lt;unistd.h&gt;#include &lt;sys/ioctl.h&gt;#include &lt;sys/socket.h&gt;#include &lt;bluetooth/bluetooth.h&gt;#include &lt;bluetooth/bluetooth.h&gt;#include &lt;bluetooth/sdp.h&gt;#include &lt;bluetooth/sco.h&gt;#include &lt;bluetooth/sdp_lib.h&gt;#include &lt;bluetooth/rfcomm.h&gt;#include &lt;bluetooth/l2cap.h&gt;#include &lt;glib.h&gt;sdp_session_t* register_service(uint8_t rfcomm_channel){ // Adapted from http://www.btessentials.com/examples/bluez/sdp-register.c    uint32_t svc_uuid_int[] = {   0x01110000, 0x00100000, 0x80000080, 0xFB349B5F };    const char *service_name = ""Roto-Rooter Data Router"";    const char *svc_dsc = ""An experimental plumbing router"";    const char *service_prov = ""Roto-Rooter"";    uuid_t root_uuid, l2cap_uuid, rfcomm_uuid, svc_uuid,           svc_class_uuid;    sdp_list_t *l2cap_list = 0,               *rfcomm_list = 0,               *root_list = 0,               *proto_list = 0,               *access_proto_list = 0,               *svc_class_list = 0,               *profile_list = 0;    sdp_data_t *channel = 0;    sdp_profile_desc_t profile;    sdp_record_t record = { 0 };    sdp_session_t *session = 0;    // set the general service ID    sdp_uuid128_create( &amp;svc_uuid, &amp;svc_uuid_int );    sdp_set_service_id( &amp;record, svc_uuid );    char str[256] = """";    sdp_uuid2strn(&amp;svc_uuid, str, 256);    printf(""Registering UUID %s\n"", str);    // set the service class    sdp_uuid16_create(&amp;svc_class_uuid, SERIAL_PORT_SVCLASS_ID);    svc_class_list = sdp_list_append(0, &amp;svc_class_uuid);    sdp_set_service_classes(&amp;record, svc_class_list);    // set the Bluetooth profile information    sdp_uuid16_create(&amp;profile.uuid, SERIAL_PORT_PROFILE_ID);    profile.version = 0x0100;    profile_list = sdp_list_append(0, &amp;profile);    sdp_set_profile_descs(&amp;record, profile_list);    // make the service record publicly browsable    sdp_uuid16_create(&amp;root_uuid, PUBLIC_BROWSE_GROUP);    root_list = sdp_list_append(0, &amp;root_uuid);    sdp_set_browse_groups( &amp;record, root_list );    // set l2cap information    sdp_uuid16_create(&amp;l2cap_uuid, L2CAP_UUID);    l2cap_list = sdp_list_append( 0, &amp;l2cap_uuid );    proto_list = sdp_list_append( 0, l2cap_list );    // register the RFCOMM channel for RFCOMM sockets    sdp_uuid16_create(&amp;rfcomm_uuid, RFCOMM_UUID);    channel = sdp_data_alloc(SDP_UINT8, &amp;rfcomm_channel);    rfcomm_list = sdp_list_append( 0, &amp;rfcomm_uuid );    sdp_list_append( rfcomm_list, channel );    sdp_list_append( proto_list, rfcomm_list );    access_proto_list = sdp_list_append( 0, proto_list );    sdp_set_access_protos( &amp;record, access_proto_list );    // set the name, provider, and description    sdp_set_info_attr(&amp;record, service_name, service_prov, svc_dsc);    // connect to the local SDP server, register the service record,    // and disconnect    session = sdp_connect(BDADDR_ANY, BDADDR_LOCAL, SDP_RETRY_IF_BUSY);    sdp_record_register(session, &amp;record, 0);    // cleanup    sdp_data_free( channel );    sdp_list_free( l2cap_list, 0 );    sdp_list_free( rfcomm_list, 0 );    sdp_list_free( root_list, 0 );    sdp_list_free( access_proto_list, 0 );    sdp_list_free( svc_class_list, 0 );    sdp_list_free( profile_list, 0 );    return session;}int main(int argc, char **argv){    int port = 3;    sdp_session_t* session = register_service(port);    struct sockaddr_rc loc_addr = { 0 }, rem_addr = { 0 };    char buf[1024] = { 0 };    int s, client, bytes_read;    socklen_t opt = sizeof(rem_addr);    // allocate socket    s = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);    printf(""socket() returned %d\n"", s);    // bind socket to port 1 of the first available    // local bluetooth adapter    loc_addr.rc_family = AF_BLUETOOTH;    loc_addr.rc_bdaddr = *BDADDR_ANY;    loc_addr.rc_channel = (uint8_t) port;    int r;    r = bind(s, (struct sockaddr *)&amp;loc_addr, sizeof(loc_addr));    printf(""bind() on channel %d returned %d\n"", port, r);    // put socket into listening mode    r = listen(s, 1);    printf(""listen() returned %d\n"", r);    //sdpRegisterL2cap(port);    // accept one connection    printf(""calling accept()\n"");    client = accept(s, (struct sockaddr *)&amp;rem_addr, &amp;opt);    printf(""accept() returned %d\n"", client);    ba2str( &amp;rem_addr.rc_bdaddr, buf );    fprintf(stderr, ""accepted connection from %s\n"", buf);    memset(buf, 0, sizeof(buf));    // read data from the client    bytes_read = read(client, buf, sizeof(buf));    if( bytes_read &gt; 0 ) {        printf(""received [%s]\n"", buf);    }    // close connection    close(client);    close(s);    sdp_close( session );    return 0;}</code></pre>","392433","","","","","2013-12-30 08:26:21","Trouble connecting android bluetooth client socket to ubuntu server socket","<android><bluetooth><sdp>","2","0","","",""
"3255607","1","","","2010-07-15 12:46:55","1","641","<p>I read the first tutorials today on SOAP webs ervices and I'd like to create my own service, e.g. a java class Person that should be my web service. I don't know what application do I need to store this web service for accesing it as a test, and neither how to access it from ANDROID.</p><p>Please help me with this.</p><p>All the best</p>","392696","","","","","2011-03-26 15:29:15","Web service beginner, using Android","<android><soap><web-services><connection>","1","0","1","",""
"3255650","1","3255794","","2010-07-15 12:53:10","1","2628","<p>I have a <code>ListView</code> that I want to use with an <code>ArrayAdapter</code> to add different styled rows. The rows are created on different states in my application, and depending on the different states the rows should be styled(like colors and stuff).</p><p>Here is some pseudo-code:</p><p>on creation:</p><pre><code>mArrayAdapter = new ArrayAdapter(this, R.layout.message);mView = (ListView) findViewById(R.id.in);mView.setAdapter(mArrayAdapter);</code></pre><p>On different states, which is triggered by another thread using a MessageHandler, add a row to the list containing a message:</p><pre><code>mArrayAdapter.add(""Message"");</code></pre><p>This works fine, messages are popping up in the list depending on different states, but I want to have the rows styled differently. How to do this? Is the solution to create a custom <code>ArrayAdapter</code> with a custom Add() method?</p>","387543","","1288","","2011-05-10 13:05:27","2011-05-10 13:05:27","Styling added rows to ArrayAdapter ListView Android","<java><android><listview><android-arrayadapter>","1","0","1","",""
"3255698","1","3256051","","2010-07-15 12:59:13","1","4413","<p>What's the best way to implement an Android Market-like tabbar (Apps/Games/Downloads)?</p><p><img src=""http://farm4.static.flickr.com/3505/3967919035_ec51923ac2.jpg"" alt=""alt text""></p><p>It would be great if I could use TabHost, but I believe it doesn't allow this level of customization.</p>","143378","","","","","2011-11-22 12:20:32","Android Market-like tabbar","<android><tabbar><android-tabhost>","4","0","2","",""
"3255999","1","3256065","","2010-07-15 13:36:07","0","555","<p>Android I am using jTwitter</p><ol><li>Twitter my_twiter = new Twitter(""my_user_name"",""my_pass"");</li><li>my_twiter.setStatus(""hello world"");</li></ol><p>line 2 throws </p><p>winterwell.jtwitter.TwitterException$E403: Forbidden <a href=""http://twitter.com/statuses/update.json"" rel=""nofollow"">http://twitter.com/statuses/update.json</a> (my_user_name)</p><p>what does that mean ??</p>","216431","","","","","2010-07-16 10:28:14","Android Jtwitter forgidden exception","<android><jtwitter>","2","0","","",""
"3256152","1","3262804","","2010-07-15 13:50:19","10","11364","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/5934050/check-whether-activity-is-active"">Check whether activity is active</a>  </p></blockquote><p>I want to show a progress dialog on the screen if the activity is showing. But when the activity window is not showing, it will not do anything. Please suggest, how do I check whether my activity is showing or not?</p>","152867","","147141","","2011-05-12 10:47:26","2012-01-22 19:27:55","How to check whether an activity is running or not","<android><activity>","2","1","","2012-07-25 13:05:41",""
"3256339","1","3256438","","2010-07-15 14:11:57","0","772","<p>i'm trying to retrieve the current date via unix time like this:</p><pre><code>   long unixTime = System.currentTimeMillis()/1000;    Date d = new Date(unixTime);    StringBuffer tmp = new StringBuffer();    tmp.append(d.getYear());    tmp.append("" - "");    tmp.append(d.getMonth());    tmp.append("" - "");    tmp.append(d.getDay());`</code></pre><p>When i later print this out via <code>tmp.getString()</code> i get the following date 70 - 0 - 4 , is there something im missing ?</p><p>//Thx in advance</p>","267822","","","","","2010-07-15 14:20:52","Retrieve current date , sqlite android","<android>","2","0","1","",""
"3256391","1","","","2010-07-15 14:17:01","2","496","<p>For a site I'm working on I'm implementing image preloading with javascript however i most certainly do not want to call my <code>preload_images()</code> function if someone is on slow bandwidth.</p><p>For my market the only people with slow bandwidth are those using mobile internet on a smartphone.</p><p>What's the best approach for detecting these users so i can avoid image preloading for them?</p><hr><p>option 1 : detect browser width</p><pre><code>if($(window).width() &gt; 960){ preload... }</code></pre><hr><p>option 2: detect user-agent with a list of browser to preload for</p><pre><code>if($.browser in array safelist){ preload... }</code></pre><hr><p>are there any better options?</p>","289666","","289666","","2010-07-15 14:30:50","2010-07-15 14:59:16","best method of detecting mobile browsers with javascript/jquery?","<javascript><jquery><iphone><android>","3","2","2","",""
"3256420","1","3265031","","2010-07-15 14:18:44","5","11243","<p>I'm trying to get the output from a servlet on an Android phone.</p><p>This is my servlet:</p><pre><code>    /*     * To change this template, choose Tools | Templates     * and open the template in the editor.     */    package main;    import java.io.IOException;    import java.io.PrintWriter;    import javax.servlet.ServletException;    import javax.servlet.http.HttpServlet;    import javax.servlet.http.HttpServletRequest;    import javax.servlet.http.HttpServletResponse;    /**     *     * @author Bert Verhelst &lt;verhelst_bert@hotmail.com&gt;     */    public class servlet1 extends HttpServlet {        /**         * Processes requests for both HTTP &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt; methods.         * @param request servlet request         * @param response servlet response         * @throws ServletException if a servlet-specific error occurs         * @throws IOException if an I/O error occurs         */        protected void processRequest(HttpServletRequest request, HttpServletResponse response)                throws ServletException, IOException {            response.setContentType(""text/html;charset=UTF-8"");            PrintWriter out = response.getWriter();            out.println(""&lt;html&gt;"");            out.println(""&lt;head&gt;"");            out.println(""&lt;title&gt;Servlet servlet1&lt;/title&gt;"");            out.println(""&lt;/head&gt;"");            out.println(""&lt;body&gt;"");            out.println(""&lt;h1&gt;processing...&lt;/h1&gt;"");            out.println(""&lt;/body&gt;"");            out.println(""&lt;/html&gt;"");        }        // &lt;editor-fold defaultstate=""collapsed"" desc=""HttpServlet methods. Click on the + sign on the left to edit the code.""&gt;        /**         * Handles the HTTP &lt;code&gt;GET&lt;/code&gt; method.         * @param request servlet request         * @param response servlet response         * @throws ServletException if a servlet-specific error occurs         * @throws IOException if an I/O error occurs         */        @Override        protected void doGet(HttpServletRequest request, HttpServletResponse response)                throws ServletException, IOException {            processRequest(request, response);            PrintWriter out = response.getWriter();            out.println(""&lt;!DOCTYPE HTML PUBLIC \""-//W3C//DTD HTML 4.0 ""                    + ""Transitional//EN\""&gt;\n""                    + ""&lt;html&gt;\n""                    + ""&lt;head&gt;&lt;title&gt;Hello WWW&lt;/title&gt;&lt;/head&gt;\n""                    + ""&lt;body&gt;\n""                    + ""&lt;h1&gt;doget...&lt;/h1&gt;\n""                    + ""&lt;/body&gt;&lt;/html&gt;"");        }        /**         * Handles the HTTP &lt;code&gt;POST&lt;/code&gt; method.         * @param request servlet request         * @param response servlet response         * @throws ServletException if a servlet-specific error occurs         * @throws IOException if an I/O error occurs         */        @Override        protected void doPost(HttpServletRequest request, HttpServletResponse response)                throws ServletException, IOException {            processRequest(request, response);            PrintWriter out = response.getWriter();            out.println(""&lt;!DOCTYPE HTML PUBLIC \""-//W3C//DTD HTML 4.0 ""                    + ""Transitional//EN\""&gt;\n""                    + ""&lt;html&gt;\n""                    + ""&lt;head&gt;&lt;title&gt;Hello WWW&lt;/title&gt;&lt;/head&gt;\n""                    + ""&lt;body&gt;\n""                    + ""&lt;h1&gt;dopost...&lt;/h1&gt;\n""                    + ""&lt;/body&gt;&lt;/html&gt;"");        }        /**         * Returns a short description of the servlet.         * @return a String containing servlet description         */        @Override        public String getServletInfo() {            return ""Short description"";        }// &lt;/editor-fold&gt;    }</code></pre><p>This is my Android main page:</p><pre><code>     package be.smarttelecom.MyTest;     import android.app.Activity;     import android.os.Bundle;     import android.widget.TextView;     public class Main extends Activity {         /** Called when the activity is first created. */         @Override         public void onCreate(Bundle savedInstanceState) {             super.onCreate(savedInstanceState);             setContentView(R.layout.main);             TextView output = (TextView) findViewById(R.id.output);             try {                 output.append(""starting\n"");                 RestClient client = new  RestClient(""http://10.0.0.188:8084/Servlet_1/servlet1"");                 try {                     client.Execute(RequestMethod.GET);                 } catch (Exception e) {                     e.printStackTrace();                 }                 output.append(""after execute\n"");                 String response = client.getResponse();                 output.append(""class - "" + response  +  ""\n"" );                 output.append(response);                 output.append(""done\n"");             }             catch (Exception ex) {                 output.append(""error: "" + ex.getMessage() + ""\n"" + ex.toString() +  ""\n"");             }         }     }</code></pre><p>And finally we have the RestClient:</p><pre><code>     package be.smarttelecom.MyTest;     import java.io.BufferedReader;     import java.io.IOException;     import java.io.InputStream;     import java.io.InputStreamReader;     import java.util.ArrayList;     import org.apache.http.HttpEntity;     import org.apache.http.HttpResponse;     import org.apache.http.NameValuePair;     import org.apache.http.client.ClientProtocolException;     import org.apache.http.client.HttpClient;     import org.apache.http.client.entity.UrlEncodedFormEntity;     import org.apache.http.client.methods.HttpGet;     import org.apache.http.client.methods.HttpPost;     import org.apache.http.client.methods.HttpUriRequest;     import org.apache.http.impl.client.DefaultHttpClient;     import org.apache.http.message.BasicNameValuePair;     import org.apache.http.protocol.HTTP;     public class RestClient {         private ArrayList &lt;NameValuePair&gt; params;         private ArrayList &lt;NameValuePair&gt; headers;         private String url;         private int responseCode;         private String message;         private String response;         public String getResponse() {             return response;         }         public String getErrorMessage() {             return message;         }         public int getResponseCode() {             return responseCode;         }         public RestClient(String url)         {             this.url = url;             params = new ArrayList&lt;NameValuePair&gt;();             headers = new ArrayList&lt;NameValuePair&gt;();         }         public void AddParam(String name, String value)         {             params.add(new BasicNameValuePair(name, value));         }         public void AddHeader(String name, String value)         {             headers.add(new BasicNameValuePair(name, value));         }         public void Execute(RequestMethod method) throws Exception         {             switch(method) {                 case GET:                 {                     //add parameters                     String combinedParams = """";                     if(!params.isEmpty()){                         combinedParams += ""?"";                         for(NameValuePair p : params)                         {                             String paramString = p.getName() + ""="" + p.getValue();                             if(combinedParams.length() &gt; 1)                             {                                 combinedParams  +=  ""&amp;"" + paramString;                             }                             else                             {                                 combinedParams += paramString;                             }                         }                     }                     HttpGet request = new HttpGet(url + combinedParams);                     //add headers                     for(NameValuePair h : headers)                     {                         request.addHeader(h.getName(), h.getValue());                     }                     executeRequest(request, url);                     break;                 }                 case POST:                 {                     HttpPost request = new HttpPost(url);                     //add headers                     for(NameValuePair h : headers)                     {                         request.addHeader(h.getName(), h.getValue());                     }                     if(!params.isEmpty()){                         request.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));                     }                     executeRequest(request, url);                     break;                 }             }         }         private void executeRequest(HttpUriRequest request, String url)         {             HttpClient client = new DefaultHttpClient();             HttpResponse httpResponse;             try {                 httpResponse = client.execute(request);                 responseCode = httpResponse.getStatusLine().getStatusCode();                 message = httpResponse.getStatusLine().getReasonPhrase();                 HttpEntity entity = httpResponse.getEntity();                 if (entity != null) {                     InputStream instream = entity.getContent();                     response = convertStreamToString(instream);                     // Closing the input stream will trigger connection release                     instream.close();                 }             }             catch (ClientProtocolException e)  {                 client.getConnectionManager().shutdown();                 e.printStackTrace();             } catch (IOException e) {                 client.getConnectionManager().shutdown();                 e.printStackTrace();             }         }         private static String convertStreamToString(InputStream is) {             BufferedReader reader = new BufferedReader(new InputStreamReader(is));             StringBuilder sb = new StringBuilder();             String line = null;             try {                 while ((line = reader.readLine()) != null) {                     sb.append(line + ""\n"");                 }             }             catch (IOException e) {                 e.printStackTrace();             }             finally {                 try {                     is.close();                 } catch (IOException e) {                     e.printStackTrace();                 }             }             return sb.toString();         }     }</code></pre><p>Unfortunately this doesn't work. Here is what I get for output (null),</p><p><img src=""http://i.stack.imgur.com/KFo82.png"" alt=""Screenshot of ""></p><p>What am I doing wrong?</p><p>I request the DoGet method of my servlet and convert the output to a string, but it appears to be empty.</p><p>I allowed the Internet connection in the manifest file just after the closing bracket of application,</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre>","373207","","63550","","2011-12-30 10:12:46","2011-12-30 10:17:26","Call Java servlet from Android","<java><android><servlets><httpclient>","1","2","2","",""
"3256624","1","","","2010-07-15 14:37:15","0","175","<p>I have 4 tabs, in my application which is been developed in android.I wanted to know which event is fired when i navigate from one tab to another.</p><p>@Matthew Vines<strong>*<em>Where should i use this event in my code, as i am a fresher with android</em>*</strong></p><p>public class Test extends TabActivity{    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);                TabHost host = getTabHost();<br>                host.addTab(host.newTabSpec(""Test1"").setIndicator(new MyView(this,                 R.drawable.icon, ""Test1"")).setContent(new Intent(this, Test1.class)));<br>                host.addTab(host.newTabSpec(""Test2"").setIndicator(new MyView(this,<br>                R.drawable.compass, ""Test2"")).setContent(new Intent(this, Test2.class)));                host.addTab(host.newTabSpec(""Test3"").setIndicator(new MyView(this,<br>                R.drawable.mosquebg, ""Test3"")).setContent(new Intent(this,                 Test3.class)));</p><pre><code>            host.addTab(host.newTabSpec(""Settings"").setIndicator(new MyView(this,              R.drawable.icon, ""Settings"")).setContent(new Intent(this, Settings.class)));            host.getTabWidget().setBackgroundResource(R.drawable.background);            host.getTabWidget().getChildAt(0).getLayoutParams().height=35;            host.getTabWidget().getChildAt(1).getLayoutParams().height=35;            host.getTabWidget().getChildAt(2).getLayoutParams().height=35;            host.getTabWidget().getChildAt(3).getLayoutParams().height=35;}</code></pre><p>}</p>","392835","","392835","","2010-07-16 07:56:33","2010-07-16 07:56:33","which view is getting loaded in TabControl","<android><android-tabhost>","1","0","","",""
"3256729","1","3256811","","2010-07-15 14:48:15","0","579","<p>I am having problems with Eclipse (3.5.x Galileo) crashing after installing <code>ADT 0.9.7</code>, so I want to try a downlevel version of the Android ADT (with Android SDK <code>r06_windows</code>)  to better isolate the issue.  When I try to 'check for software' athttps://dl-ssl.google.com/android/eclipse/ I can only select 0.9.7?  Is there a trick to get the older version or an archive of the older version?</p>","157804","","","","","2010-07-15 15:02:14","Where can I get ADT 0.9.6 for Eclipse 3.5?","<eclipse><android><adt>","3","0","","",""
"3256961","1","4257688","","2010-07-15 15:12:42","1","1331","<p>I am trying to create a ListView with headers based on a number of predefined categories. </p><p>I am using <a href=""http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/"" rel=""nofollow"">Jeff Sharkey's separating lists with headers</a> as a basis. The classes and XML are identical except for SimpleAdapter. The difference is my data is coming from a local SQLite database. The code crashes when I switch out of the view. Any ideas why this could be? Error and code below.</p><pre><code>07-15 14:58:44.950: ERROR/AndroidRuntime(582): Uncaught handler: thread main exiting due to uncaught exception07-15 14:58:44.970: ERROR/AndroidRuntime(582): java.lang.NullPointerException07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.SimpleCursorAdapter.bindView(SimpleCursorAdapter.java:149)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.CursorAdapter.getView(CursorAdapter.java:186)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at com.XYZ.XYZ.SeparatedListAdapter.getView(SeparatedListAdapter.java:94)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.AbsListView.obtainView(AbsListView.java:1256)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.ListView.makeAndAddView(ListView.java:1668)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.ListView.fillDown(ListView.java:637)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.ListView.fillSpecific(ListView.java:1224)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.ListView.layoutChildren(ListView.java:1499)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.AbsListView.onLayout(AbsListView.java:1113)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.view.View.layout(View.java:6830)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.view.View.layout(View.java:6830)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.view.View.layout(View.java:6830)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.view.View.layout(View.java:6830)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.view.View.layout(View.java:6830)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.view.View.layout(View.java:6830)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.view.View.layout(View.java:6830)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.view.View.layout(View.java:6830)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.view.ViewRoot.performTraversals(ViewRoot.java:996)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.os.Handler.dispatchMessage(Handler.java:99)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.os.Looper.loop(Looper.java:123)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at android.app.ActivityThread.main(ActivityThread.java:4363)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at java.lang.reflect.Method.invokeNative(Native Method)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at java.lang.reflect.Method.invoke(Method.java:521)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)07-15 14:58:44.970: ERROR/AndroidRuntime(582):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p><code>Category.java</code> - my equivalent to SimpleAdapter from Starkey's tutorial:</p><pre><code>package com.XYZ.ipantrylite;import java.util.HashMap;import java.util.Map;import android.app.Activity;import android.database.Cursor;import android.os.Bundle;import android.util.Log;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class Category extends Activity {    public final static String ITEM_TITLE = ""title"";    public final static String ITEM_CAPTION = ""caption"";    public SeparatedListAdapter adapter;    private static final String TAG = ""Category"";    public Map&lt;String,?&gt; createItem(String title, String caption) {        Map&lt;String,String&gt; item = new HashMap&lt;String,String&gt;();        item.put(ITEM_TITLE, title);        item.put(ITEM_CAPTION, caption);        return item;    }    @Override//  protected void onCreate(Bundle savedInstanceState) {//      // TODO Auto-generated method stub//      super.onCreate(savedInstanceState);    public void onCreate(Bundle icicle) {          super.onCreate(icicle);         // create our list and custom adapter        adapter = new SeparatedListAdapter(this);        fillData();        ListView list = new ListView(this);        list.setTextFilterEnabled(false);        list.setAdapter(adapter);        this.setContentView(list);    }    private void fillData()    {        String[] types = new String[] {                 ""Baby Food"",                 ""Baking Supplies"",                 ""Beverages"",                 ""Dairy Products &amp; Eggs"",                ""Fresh Produce, Fruits &amp; Vegetables"",                ""Canned, Dried, Frozen Goods"",                ""Grains, Cereals, Breads, Pasta"",                ""Herbs &amp; Spices"",                ""Misc Canned Goods"",                ""Oils &amp; Fats"",                ""Prepackaged Foods"",                ""Protein, Meat, Fish"",                ""Snacks &amp; Sweets"",                ""Soups, Sauces, &amp; Gravies"",                ""Toiletries""};        for(int i = 0; i &lt; types.length - 1; i++)         {                       Cursor c = managedQuery(PantryItemsProviderLite.CONTENT_URI, null, ""TYPE = '""+types[i]+""'"", null, ""name desc"");            startManagingCursor(c);            if (c.moveToFirst()) {                c.setNotificationUri(getContentResolver(), PantryItemsProviderLite.CONTENT_URI);                 String[] from = new String[] { PantryItemsProviderLite.NAME};                int[] to = new int[] { R.id.textName};                SimpleCursorAdapter items = new SimpleCursorAdapter(this, R.layout.items_row_cat, c, from, to);                adapter.addSection(types[i], items);            }            adapter.notifyDataSetChanged();        }    }    @Override    protected void onPause(){        super.onPause();        clearData();        Log.d("""",""on Pause called"");    }    @Override    protected void onResume() {        super.onResume();        fillData();        Log.d("""",""on Resume called"");    }    public void clearData(){        adapter.headers.clear();        adapter.sections.clear();    }}</code></pre><p>Line of code referred to in debugger at crash:</p><pre><code>Line 94if(position &lt; size) return adapter.getView(position - 1, convertView, parent);</code></pre>","300972","","2291","","2012-12-03 16:36:35","2012-12-03 16:40:24","Listview with headers. SeparatedListAdapter using database data crash","<android><listview>","1","0","","",""
"3256997","1","","","2010-07-15 15:15:41","0","845","<p>How to obtain ID of an image by the ID of the thumbnail? </p><p>And what about going from original image to thumbnail ID? Is that possible? I saw <code>MINI_THUMB_MAGIC</code> but it seems there is an issue with it.</p>","388903","","110204","","2010-07-17 14:13:51","2010-07-17 14:13:51","Original ID of image through thumbnail ID in Android","<android><image><thumbnails>","2","0","","",""
"3257106","1","","","2010-07-15 15:27:57","2","1056","<p>If I have a webkit view loaded in my Android or iPhone app, can I pass data back and forth from the page in webkit? </p><p>For example, can I pull an html view down from the web and populate a form in that view with data stored on my device?</p>","203604","","","","","2010-07-15 15:55:31","Webkit communication with native environment","<iphone><android><webkit>","2","0","2","",""
"3257261","1","","","2010-07-15 15:42:32","1","721","<p>I need to statically link the 3.6.2 version of SQLite against my android application due to a bug that affects the dynamic library bundled with Android &lt; 2.2. I've already compiled and installed 3.6.2 on my development machine, but I'm not sure how I go about linking it to my Android app (developing with Eclipse).</p><p>I'm not familiar with building and compiling options, so if someone could walk me through step-by-step, it'd be much appreciated.</p>","392907","","","","","2010-07-16 08:21:50","How do I statically link sqlite to my android application?","<android><eclipse><sqlite><static-linking>","2","3","","",""
"3257293","1","3257478","","2010-07-15 15:45:52","54","27845","<p>Is there a method which returns the width ( in pixels ) of a text to be drawn on an Android canvas using the drawText() method according to the Paint used to draw it?</p>","376373","","759866","","2013-12-29 13:14:16","2013-12-29 13:14:16","Measuring text width to be drawn on Canvas ( Android )","<android><text><android-canvas><draw>","1","1","12","",""
"3257372","1","","","2010-07-15 15:54:14","0","2936","<p>I am trying to run and publish my JUnit tests in HTML using a build.xml file calling the JUnit target but it doesn't seem to work.</p><p>here is how my build.xml looks like:</p><pre><code>&lt;target name=""Unity Agent SDK Test ""&gt;    &lt;mkdir dir=""${junit.output.dir}"" /&gt;    &lt;echo message=""making directory"" /&gt;    &lt;junit fork=""yes"" printsummary=""yes""&gt;        &lt;formatter type=""xml"" /&gt;        &lt;test name=""com.kc.AllTests"" todir=""${junit.output.dir}"" /&gt;        &lt;test name=""com.kc.unity.agent.util.ActivityOneTestcase"" todir=""${junit.output.dir}"" /&gt;        &lt;test name=""com.kc.unity.agent.util.FaceBookRestManagerTestCase"" todir=""${junit.output.dir}"" /&gt;        &lt;test name=""com.kc.unity.agent.util.OAuthManagerTestCase"" todir=""${junit.output.dir}"" /&gt;        &lt;classpath refid=""Unity Agent SDK Test.classpath"" /&gt;        &lt;bootclasspath&gt;            &lt;path refid=""run.Unity Agent SDK Test (1).bootclasspath"" /&gt;        &lt;/bootclasspath&gt;    &lt;/junit&gt;    &lt;echo message=""junit finished"" /&gt;&lt;/target&gt;&lt;target name=""junitreport""&gt;    &lt;junitreport todir=""${junit.output.dir}""&gt;        &lt;fileset dir=""${junit.output.dir}""&gt;            &lt;include name=""TEST-*.xml"" /&gt;        &lt;/fileset&gt;        &lt;report format=""frames"" todir=""${junit.output.dir}"" /&gt;    &lt;/junitreport&gt;&lt;/target&gt;</code></pre><p>Here is the error I get:</p><pre><code>Unity Agent SDK Test :     [echo] making directory    [junit] Exception in thread ""main"" java.lang.RuntimeException: Stub!    [junit]  at junit.framework.TestResult.&lt;init&gt;(TestResult.java:4)    [junit]  at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:315)    [junit]  at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911)    [junit]  at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)BUILD FAILEDC:\xxxxxxxxx\Android\Projects\Unity Agent SDK Test\build.xml:85: java.lang.RuntimeException: Stub!Total time: 1 second</code></pre>","357652","","304","","2012-02-24 10:51:19","2012-02-24 10:51:19","Generate Junit test results from a build.xml in a android project","<android><junit><build.xml>","1","0","","",""
"3257402","1","3257419","","2010-07-15 15:56:00","2","129","<p>What's the best way to create an app that periodically gets location (via the GPS or cell towers, or whatever) even when the app isn't running?</p><p>The first idea I had is to use the AlarmManager to wake up at a specified interval and check.  I'm wondering if there's a more specific API to use.</p>","238849","","","","","2010-07-15 16:02:31","Creating an app that has an option to get location information even when it's not running","<android>","1","0","","",""
"3257524","1","","","2010-07-15 16:06:53","0","791","<p>I am using one class which extends ListActivity and One class extending BaseAdapter.The Base Adapter uses getView function to inflate layout from xml.The xml contains a text and a button to delete the row of list.Please let me know how to handle the button click in the ListActivity class.Send me a sample snapshotThanks</p>","392931","","161424","","2010-07-15 16:44:32","2012-06-25 01:58:25","Implementing button click from a custom list view","<java><android>","1","4","","",""
"3257629","1","3257677","","2010-07-15 16:19:53","0","130","<p>I need to test Android App specifically on LG Ally mobile. I am on windows and unable to find driver. I am unable to test it.I can deploy app on Droid, however it doesn't work with Droid (I know Apps should be universal and should work independent of Device make, but this acts weird as it involves muting and unmuting of microphone and for some reason Droid gives up on me). Is there a way to download app on Droid and then transfer it to LG mobile. </p>","357349","","","","","2010-07-15 16:30:36","Transfer App from LG to Droid","<android>","2","3","","2010-07-15 17:24:14",""
"3257656","1","6789914","","2010-07-15 16:23:22","17","3923","<p>Is there any way to make a style inherit from multiple other styles, instead of just being limited to:</p><pre><code>&lt;style name=""WidgetTextBase""&gt;    &lt;item name=""android:typeface""&gt;serif&lt;/item&gt;    &lt;item name=""android:textSize""&gt;12dip&lt;/item&gt;    &lt;item name=""android:gravity""&gt;center&lt;/item&gt;&lt;/style&gt;&lt;style name=""BOSText"" parent=""WidgetTextBase""&gt;    &lt;item name=""android:textColor""&gt;#051C43&lt;/item&gt;&lt;/style&gt;</code></pre><p>I would like BOSText to also inherit from:</p><pre><code>&lt;style name=""WidgetTextHeader""&gt;    &lt;item name=""android:textStyle""&gt;bold&lt;/item&gt;&lt;style&gt;</code></pre>","289182","","","","","2012-10-01 09:42:05","styles multiple inheritance","<android><styles>","2","0","3","",""
"3257733","1","3258301","","2010-07-15 16:31:41","3","5134","<p>I have used the algorithm on <a href=""http://www.movable-type.co.uk/scripts/latlong.html"" rel=""nofollow"">http://www.movable-type.co.uk/scripts/latlong.html</a> to find the distance between two points.</p><p>My two points are</p><pre><code>long1 = 51.507467;lat1 = -0.08776;long2 = 51.508736;lat2 = -0.08612;</code></pre><p>According to <a href=""http://www.movable-type.co.uk/scripts/latlong.html"" rel=""nofollow"">Movable Type Script</a> the answer is 0.1812km</p><p>My application gives the result (<code>d</code>) as 0.230km</p><p>Check Haversine formula: <a href=""http://www.movable-type.co.uk/scripts/latlong.html"" rel=""nofollow"">http://www.movable-type.co.uk/scripts/latlong.html</a>      </p><pre><code>    double R = 6371; // earth’s radius (mean radius = 6,371km)    double dLat =  Math.toRadians(lat2-lat1);    double dLon =  Math.toRadians(long2-long1);     a = Math.sin(dLat/2) * Math.sin(dLat/2) +            Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) *             Math.sin(dLon/2) * Math.sin(dLon/2);     double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));     double d = R * c;</code></pre>","239774","","1967597","","2014-01-03 07:14:33","2014-01-03 07:14:33","Distance between two locations isn't right","<android><maps><distance><haversine>","3","0","3","",""
"3257742","1","","","2010-07-15 16:33:30","3","538","<p>Some users want to rename my Android app to something else.</p><p>So I'd like to provide a text field for them to put in a new name inside my app.Then how can I programatically rename my app name to the new name?</p>","392971","","63550","","2010-08-10 08:21:21","2012-02-21 13:32:40","How to rename an Android app programatically?","<android><rename>","1","0","","",""
"3257856","1","","","2010-07-15 16:45:05","2","411","<p>I have a test class that extends ProviderTestCase2&lt;>.</p><p>I would like to populate this test class database with data from some .db files.</p><p>Is there some particular method to push some .db file into the Mock Context of a ProviderTestCase2?</p><p>Otherwise which way is the easier to populate the database from the .db file?!</p><p>Thank you very much!!</p>","373542","","","","","2011-08-04 06:41:14","How to populate a test database in Android?","<android><database><testing><database-testing>","1","0","","",""
"3257864","1","","","2010-07-15 16:45:36","0","4793","<p>I want to use the codecs in Android from my application. For now I just want to use the H.264 codec for testing, unless the mp3 or aac codecs provide functions for sending the audio to the device's speaker in which case I would prefer one of those.</p><p>I have the NDK installed along with Cygwin, GNU Make, and GNU Awk. I can't figure out what I need to do from here though. I'm downloading the <a href=""http://android.git.kernel.org/?p=platform/external/opencore.git;a=summary"" rel=""nofollow"">entire OpenCORE tree</a> right now but I don't even know how to build it or make Eclipse plugin know it needs to include the files.</p><p>An example or a tutorial would be much appreciated.</p><p><em>EDIT:</em></p><p>It looks like I can use JNI like P/Invoke which would mean I don't have to build the OpenCORE libraries myself. However, I can't find any documentation on the names of the libraries I need to load. </p><p>I'm also confused as to how to do it. I'm looking at <a href=""http://www.koushikdutta.com/2009/01/jni-in-android-and-foreword-of-why-jni.html"" rel=""nofollow"">http://www.koushikdutta.com/2009/01/jni-in-android-and-foreword-of-why-jni.html</a> and I don't understand what the purpose of writing a library to access a library is. Couldn't you just use something like System.loadLibrary(""opencore.so"")?</p>","370556","","370556","","2010-07-15 18:25:35","2014-03-21 14:45:39","How do I use Android OpenCORE codecs using JNI?","<android><android-ndk>","2","0","2","",""
"3257969","1","","","2010-07-15 16:56:44","5","2870","<p>I have a homescreen widget with an imagebutton. I have the button working with a pending intent, but I can't seem to figure out how to change the button image when it is pressed.</p><p>I tried using a selector and it works in my widget test activity, but not in the remoteview.</p><p>How could I implement this functionality in the  home screen widget?</p>","392997","","","","","2011-06-05 21:01:02","ImageButton in Android homescreen widget","<android><widget><selector><imagebutton><homescreen>","2","1","","",""
"3258014","1","3260903","","2010-07-15 17:01:20","0","70","<p>I have developed an application with Target build as API 4. It supports Normal Screen and all Densities. But Now i would need to set the App's Target as API 3. In Eclipse Environment, I changed the Build Target to API 3. But  I get the Following Error. </p><ul><li>R file gone Automatically. So i get Can not Resolved error allover my app where R is present.</li><li><code>drawable-ldpi</code>,<code>drawable-mdpi</code>,<code>drawable-hdpi</code>, <code>value-long</code>,etc are not supported.</li></ul><p>How to Downgrade my app to Android 1.5  and It should can accessible on up to Android 2.1? Any Idea?</p>","267269","","244296","","2010-07-15 17:02:25","2010-07-15 23:38:37","Getting Problem TargetVersion from 1.6 to 1.5 in Android?","<android>","3","0","","",""
"3258431","1","","","2010-07-15 17:58:49","0","624","<p>I'm running some code on the nexus one - and I am having a very strange issue. The ""server"" sends UDP packets out on the multicast socket that the phone is joined to. The phone receives and sends stuff to the multicast group fine, but it appears that the phone chokes when it receives a large number of packets at one time.</p><p>For example, the server will occasionally send out 80 or so 512 byte packets in one go around. The phone starts receiving the packets, but then at the 31st packet (~16KB of data) the receive hangs (indicating that there is nothing on the socket anymore.) I've done wireshark testing and stuff so I know for sure that the packets are not being lost. Even if some are being lost, it is very strange that EVERY test produces the same result --- a large amount of data gets jammed onto the socket at one time, but the socket only allows me to socket.receive() for 16KB worth of data.</p><p>I have tried socket.setReceiveBufferSize() with a variety of values (up to 1MB) -- but that doesn't seem to work. Interestingly, a call to getReceiveBufferSize() tells me that the socket should hold roughly 100KB worth of data.</p><p>If I tell the server to slow down its send method (which I cannot deploy, I can only do that for testing purposes) - everything works fine, presumably because the packets aren't jammed onto the phone's socket all at one time (ie. I tell the server to wait 1/2 a second between packets.)</p><p>Has anyone else experienced this - if so - how did you get around it? I <em>cannot</em> switch the application to TCP.</p><p>Thanks!</p><p>Dan</p><p>PS. The Java code works fine if I run it on a regular machine...</p>","393055","","491044","","2011-03-10 15:16:00","2011-03-10 15:16:00","Problem with Android Multicast Sockets","<android>","1","0","","",""
"3258550","1","","","2010-07-15 18:12:24","3","843","<p>For web applications split testing various options get usually split tested to maximize their effectiveness with tools like Google Website Optimizer. One of the most impressive example might be Google and how the split tested dozens of shades of blue to find the right one.</p><p>When developing android applications are there best practices to follow for A/B testing or multivariate testing?</p>","25282","","","","","2012-10-21 06:38:05","Best practices for split testing Android apps","<android><testing><multivariate-testing>","3","0","1","",""
"3258575","1","3365594","","2010-07-15 18:15:58","10","6496","<p>I'm in the process of extending monkey for software testing purposes,so I would like to replace the current monkey.jar which my owncompiled monkey.jar in the emulator.  The current monkey.jar islocated at /system/framework/monkey.jar.</p><p>When I try to run the following command:</p><pre><code>adb push monkey.jar /system/framework/monkey.jar</code></pre><p>i get the following:'failed to copy 'monkey.jar' to '/system/framework/monkey.jar': Out ofmemory'</p><p>Any ideas on how to replace the current monkey.jar?</p><p>This actually works if I'm running Android 1.6 in the Emulator, but nothing after that.Yes, i've tried 'abd remount'</p><p><strong>EDIT: This is not a .jar specific issue.  I can't push any type of file to /system/framework</strong></p><p>Thanks.</p>","25","","25","","2010-07-29 17:47:58","2013-06-13 23:46:02","writing to /system/framework in emulator","<android><android-emulator><monkey>","4","0","5","",""
"3258595","1","","","2010-07-15 18:19:00","12","1645","<p>I am playing about with RTSP in Android, getting it to stream using Media Player. Now I am wanting to test them locally, but finding it incredibly difficult.</p><p>What I have done is run a local Wowza server and published the RTSP url and I am then entering that URL into the android api demos MediaPlayerDemo.java. However, because it will not work on the emulator I have to debug this on my phone (HTC Hero 1.5) BUT I can not get my Hero to see my network in anyway.</p><p>Of course I can not use the 10.0.2.2 because that is for the emulator. I have also used the IP address of my computer and my other computer on the network but that doesn't either.</p><p>How do I get my Hero to see my network so I can test the RTSP streaming ?I've tried connecting via USB and also connecting to my wifi router, but neither work.</p><p>RegardsAnthoni</p>","298882","","","","","2010-07-15 18:19:00","Connect android to local Lan via Phone (Over wifi OR via USB connection)","<android><networking><video-streaming><lan><rtsp>","0","3","0","2012-01-17 21:54:10",""
"3258846","1","","","2010-07-15 18:47:48","5","4344","<p>Currently I am using Android emulator for development, but it is very slow. I am looking for some android port that can run on real CPU. </p><p>For example I installed this product <a href=""http://www.android-x86.org/documents/installhowto"">http://www.android-x86.org/documents/installhowto</a> on VMware, and it seems to work much faster, but I have no idea how to setup network connection here.</p><p>The question is if some one is using alternative android setup for development, instead of emulator? If so, a link to configure instructions would be great.</p>","62192","","","","","2011-07-28 20:26:21","Run Android on virtual machine for development","<android>","4","5","2","",""
"3258875","1","","","2010-07-15 18:51:05","0","1121","<p>If I wanted to develop my mobile app's front end using js,css,html in order to target both Android and iPhone, what gotchas do I need to look out for?</p><p>I'm not looking for the comparison of native vs web development as much as I'm concerned about performance and development issues. </p>","203604","","","","","2011-04-08 00:20:56","webkit gotchas for android / iphone development","<iphone><android><webkit>","2","0","2","",""
"3258968","1","3259078","","2010-07-15 18:59:59","0","417","<p>I am in the process of building an mobile/web application. I want to use cookies for persistence, but I am wondering of the cookies in firefox workings the sames as say the mobile browsers and will it be recognized. Thanks in advance</p>","109849","","","","","2010-07-15 19:11:40","Cookies on Android/Iphone vs Desktop","<asp.net><iphone><android><cookies>","1","0","","",""
"3259079","1","3259176","","2010-07-15 19:11:48","0","1298","<p>I am designing an Android app and I'm having a couple of layout issues.</p><p>I have a screen with 3 EditTexts on it in a row, and I would like for the 'next' key on the soft keyboard to cycle between the EditText fields.  As for now, the 'next' key has no effect.</p><p>Also, when the soft keyboard is displayed, it covers up the third of the EditTexts.  Is there any way to push up the layout in the event that the soft keyboard is drawn?</p><p>Thanks!</p>","393123","","13793","","2012-05-01 01:26:10","2012-05-01 01:26:10","Issues with Android soft-keyboard interaction","<android><layout><focus><android-softkeyboard>","1","0","","",""
"3259231","1","3259620","","2010-07-15 19:31:21","0","225","<p>I'm currently stuck on AT&amp;T due to my wife having a new iPhone so I've been eagerly waiting for a phone to come out on AT&amp;T that would be working picking up. That time comes this Sunday with the Samsung Captivate... but I'm concerned with something. With AT&amp;T locking up it's phones to non-Marketplace apps... does that hinder me in any way on developing on the phone?</p><p>Sorry if that seems like a stupid question or doesn't belong here... hoping a user with an AT&amp;T phone (HTC Aria or... something) can help.</p>","351060","","","","","2010-07-16 01:39:53","Develop on AT&T Phones","<android>","3","2","","",""
"3259273","1","3260672","","2010-07-15 19:35:33","2","625","<p>I'm developing a Android desktop app, and I would like that when it first starts it (confirm with user and) set itself as default action for Home button.</p><p>Currently this option is given to the user by the Android system only when he first press the Home button after running my app.</p><p>Any idea how to do this?</p><p>--update</p><p>Actually, I want that the ""back"" button do not return to the default desktop, as my app will be de default desktop. Maybe the solution for this is the same of the one for the Home button..?</p>","287316","","","","","2010-07-26 02:26:09","How to set my App as default Home?","<android><desktop><home>","2","0","3","",""
"3259314","1","","","2010-07-15 19:41:13","1","534","<p>Anybody worked on PayPal integration. Actually i integrated it using apis provided by PayPal. But unable to login in live environment that's why not able to make transaction.</p><p>If anyone have suggession please share with me.</p><p>Thanks</p>","320676","","","","","2010-07-15 19:41:13","Problem in PayPal integration for Android","<android>","0","1","","",""
"3259355","1","3259828","","2010-07-15 19:45:15","3","2195","<p>I am very new to Android. </p><p>I am trying to build inflate a context menu within the sample GridView provided on the Android dev site. Eclipse tells me that the referenced items cannot be resolved, if someone could help find where I coded s.th. wrong, that would be great because I am stuck at the moment. Thanks. </p><p>I posted my entire code below. I get the error message at: <code>if (item.getItemId() == R.id.menu_facebook)</code> and the other R.id.'s </p><hr><p>This is the ShareGalleryView.java file: </p><pre><code> import android.app.Activity;  import android.content.Context;  import android.os.Bundle;  import android.view.ContextMenu;  import android.view.MenuInflater;  import android.view.MenuItem;  import android.view.View;  import android.view.ViewGroup;  import android.view.ContextMenu.ContextMenuInfo; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageView; import android.widget.AdapterView.AdapterContextMenuInfo; public class ShareGalleryView extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.videogrid);        GridView vGrid=(GridView) findViewById(R.id.vgrid);        registerForContextMenu(vGrid);        vGrid.setAdapter(new VideoAdapter(this));    }    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {      super.onCreateContextMenu(menu, v, menuInfo);      MenuInflater inflater = getMenuInflater();      inflater.inflate(R.menu.menu_gallery_share, menu);    }    public boolean onContextItemSelected (MenuItem item){    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();        if (item.getItemId() == R.id.menu_facebook)        {         //TODO open fb            return true;        }        else if (item.getItemId() == R.id.menu_youtube)        {            //TODO open youtube            return true;        }        else if (item.getItemId() == R.id.menu_email)        {         //TODO open email            return true;        }        else if (item.getItemId() == R.id.menu_bluetooth)        {            // TODO send via bluetooth            return true;        }    }    public class VideoAdapter extends BaseAdapter {        private Context mContext;        public VideoAdapter(Context c) {            mContext = c;        }        public int getCount() {            return mThumbIds.length;        }        public Object getItem(int position) {            return null;        }        public long getItemId(int position) {            return 0;        }        // create a new ImageView for each item referenced by the Adapter        public View getView(int position, View convertView, ViewGroup parent) {            ImageView imageView;            if (convertView == null) {  // if it's not recycled, initialize some attributes                imageView = new ImageView(mContext);                imageView.setLayoutParams(new GridView.LayoutParams(85, 85));                imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);                imageView.setPadding(8, 8, 8, 8);            } else {                imageView = (ImageView) convertView;            }            imageView.setImageResource(mThumbIds[position]);            return imageView;        }        // references to our images        private Integer[] mThumbIds = {                R.drawable.sample_2, R.drawable.sample_3,                R.drawable.sample_4, R.drawable.sample_2,                R.drawable.sample_6, R.drawable.sample_3,                R.drawable.sample_4, R.drawable.sample_1        };    }}</code></pre><p>and this is the menu_gallery_share.xml file: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;     &lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:id=""@+id/menu_facebook""          android:title=""@string/Facebook"" /&gt;    &lt;item android:id=""@+id/menu_youtube""          android:title=""@string/YouTube"" /&gt;    &lt;item android:id=""@+id/menu_email""          android:title=""@string/Email"" /&gt;    &lt;item android:id=""@+id/menu_bluetooth""          android:title=""@string/Via Bluetooth"" /&gt;   &lt;/menu&gt;&lt;/menu&gt;</code></pre>","390782","","390782","","2010-07-15 20:03:10","2010-07-15 21:21:44","Context Menu Problem - how to resolve these menu items?","<android><contextmenu>","2","3","1","",""
"3259380","1","6036159","","2010-07-15 19:48:02","8","11359","<p>I have my Nexus One connected with the USB.</p><p>When I visit the File Explorer of the DDMS, if I click on the ""data"" folder the little plus near the name ""data"" disappear for 2-6 seconds and then reappear but the contenct of the folder ""data"" is not showed!</p><p>Here some other information:</p><ul><li><p>the folder data has permissions drwxrwx--x</p></li><li><p>the OS of my PC is Windows XP</p></li><li><p>Eclipse v. 3.5.2</p></li><li><p>Android SDK 1.6</p></li></ul>","373542","","612606","","2011-05-19 07:58:42","2011-05-19 07:58:42","Can't access data folder in the File Explorer of DDMS using a Nexus One!","<android><ddms>","2","4","4","",""
"3259626","1","3259654","","2010-07-15 20:14:16","2","2890","<p>I have a simple ExpandalbeList.  For the group header view, I'm using a simple TextView, I am setting the background of the text to a drawable.  I have the textview parameters set to FILL_PARENT, but the background of the TextView only covers the width of the text.  I realize that I can put this all inside of a Linear Layout, but that just seems like a waste.  isn't there a way to make the bounds of the text view stretch to the edge of the listview?</p><pre><code>        public TextView getGenericView() {        // Layout parameters for the ExpandableListView        AbsListView.LayoutParams lp = new AbsListView.LayoutParams(                ViewGroup.LayoutParams.FILL_PARENT, 64);        TextView textView = new TextView(PulseSearchResults.this);        textView.setLayoutParams(lp);        // Center the text vertically        textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);        // Set the text starting position        textView.setPadding(6, 0, 0, 0);        textView.setTextColor(Color.BLACK);        textView.setTypeface(Typeface.DEFAULT_BOLD);        textView.setTextSize(16.0f);        textView.setBackgroundResource(R.drawable.search_section_group);        return textView;    }    @Override    public View getGroupView(int groupPosition, boolean isExpanded,            View convertView, ViewGroup parent) {        TextView textView = getGenericView();        textView.setText(getGroup(groupPosition).toString());        return textView;    }</code></pre><p>thxBen</p>","372405","","","","","2010-07-15 20:16:54","android textview fill parent","<android><background><textview>","1","0","","",""
"3259720","1","","","2010-07-15 20:23:56","5","7522","<p>How can one resize the initial size of android datepicker control to be smaller or bigger. Is there only way to reimplement it?</p>","104014","","","","","2010-12-13 08:51:06","Resize android datepicker control","<android><android-widget><android-controls>","1","0","1","",""
"3259907","1","3259922","","2010-07-15 20:44:39","3","455","<p>Are Activities in the background considered ""running"" (and can execute code) or are they in a suspended state?</p>","440093","","","","","2010-07-15 20:46:48","Android: Can background Activities execute code?","<android>","1","0","","",""
"3259912","1","3259975","","2010-07-15 20:45:18","0","1821","<p>How do I start my app from my other app? (they will not be package together)</p><p>--update </p><p>Manifest of the second app:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.example.helloandroid""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".HelloAndroid""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;                &lt;category android:name=""android.intent.category.HOME""/&gt;                &lt;category android:name=""android.intent.category.DEFAULT""/&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name="".HelloAndroid""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""com.example.helloandroid.HelloAndroid"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre><p>I calling it with:</p><pre><code>startActivity(new Intent(""com.example.helloandroid.HelloAndroid""));</code></pre><p>and it throws:</p><pre><code>07-16 15:11:01.455: ERROR/Desktop(610): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.example.helloandroid.HelloAndroid }</code></pre><p>Ralated:<br><a href=""http://stackoverflow.com/questions/1605074/how-to-launch-android-applications-from-another-application"">http://stackoverflow.com/questions/1605074/how-to-launch-android-applications-from-another-application</a></p>","287316","","287316","","2010-07-16 18:11:36","2010-07-16 18:11:36","How do I start my app from my other app?","<android>","2","0","1","",""
"3260010","1","3260219","","2010-07-15 20:57:50","3","1721","<p>I am following the Android Gallery tutorial (http://developer.android.com/guide/tutorials/views/hello-gallery.html) but instead of simple images I'd like to be able to horizontally move to a complete new screen, e.g. a LinearLayout. The idea is a kind of tabbing behaviour but the user can swipe though the screens.</p><p>I created a gallery, created a GalleryAdapter that extends from BaseAdapter and in the getItem() method I try to return the complex view:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    /*ImageView i = new ImageView(this.c);    i.setImageResource(R.drawable.login);    i.setLayoutParams(new Gallery.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    i.setScaleType(ImageView.ScaleType.FIT_XY);    return i;*/         ScrollView view = (ScrollView)this.c.getResources().getLayout(R.layout.main);    return view;}</code></pre><p>In the above example, it will work if I am using an ImageView, but it fails once I use a more complex view like a scrollView loaded from resources. </p><p>Any idea why? The exception is:</p><pre><code>07-15 13:47:36.498: ERROR/AndroidRuntime(446): java.lang.ClassCastException: android.content.res.XmlBlock$Parser07-15 13:47:36.498: ERROR/AndroidRuntime(446):     at de.flavor.myviews.GalleryAdapter.getView(GalleryAdapter.java:44)07-15 13:47:36.498: ERROR/AndroidRuntime(446):     at android.widget.AbsSpinner.onMeasure(AbsSpinner.java:192)07-15 13:47:36.498: ERROR/AndroidRuntime(446):     at android.view.View.measure(View.java:8171)07-15 13:47:36.498: ERROR/AndroidRuntime(446):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)07-15 13:47:36.498: ERROR/AndroidRuntime(446):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)07-15 13:47:36.498: ERROR/AndroidRuntime(446):     at android.view.View.measure(View.java:8171)07-15 13:47:36.498: ERROR/AndroidRuntime(446):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)07-15 13:47:36.498: ERROR/AndroidRuntime(446):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)07-15 13:47:36.498: ERROR/AndroidRuntime(446):     at android.view.View.measure(View.java:8171)07-15 13:47:36.498: ERROR/AndroidRuntime(446):     at android.view.ViewRoot.performTraversals(ViewRoot.java:801)07-15 13:47:36.498: ERROR/AndroidRuntime(446):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)</code></pre><p>ThanxSven</p>","320938","","418183","","2011-01-18 14:40:32","2011-07-04 21:33:04","Using a Gallery to swipe between Views","<android><gallery>","2","0","3","",""
"3260424","1","","","2010-07-15 21:57:38","3","3040","<p>The application that I am trying to develop for andriod, records frames at 48Khz (PCM 16bits &amp; mono) and sends them to the network. Also, there is an incoming stream of audio at 8Khz. So, I receive 8Khz sampled frames and play them (my AudioTrack object is set to 8Khz), but when playing them, everything works but the latency is HUGE. It takes like around 3 seconds until you hear something.</p><p>I think that if I upsample the received frames from 8Khz to 48Khz and play them, there won't be such a huge playing latency. In fact when I record and play frames at the same rate, the latency is really low. The bad thing is that I am forced to do it this way: send to 48Khz and receive to 8Khz.</p><p>As explained before, I'm trying to upsample a sound frame (16bits PCM) from 8Khz to 48Khz. Does anybody know any routine/library/API  in Java that does this???</p><p>I know the basics about upsampling a discreet signal, but I consider that to design and implement my own FIR filter and convolute it with the audio stream ....is way too much. Also, it is over my knowledge.</p><p>So...does anybody can help me with this?? Does anybody know any library/routine in java that I can use?? Any suggestions or alternatives??</p><p>Thanks in advanced!!</p>","353261","","","","","2013-02-28 15:33:24","resample / upsample sound frames from 8Khz to 48Khz (Java/Android)","<java><android><audio><audio-streaming><resampling>","2","0","","",""
"3260471","1","","","2010-07-15 22:06:42","1","2346","<p>Is it possible to open up the default Android Messaging activity from inside an activity you write yourself?  Like for example:  I press a ""Mail"" button inside my program, and it opens the Android Messaging app just like as if I was to press the Messaging icon on the main screen.</p><p>I did something similar to this with the Contacts activity, but only the contact list comes up, no extra functionality like Adding/Modifying/Deleting, etc.</p><p>Any ideas?</p><p>edit:  I found this way to open the ""Compose New Message"" Activity, I just need to back it up a step.  Does anyone know the correct MIME type instead of this one?</p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_VIEW); sendIntent.setType(""vnd.android-dir/mms-sms""); m_activity.startActivity(sendIntent); </code></pre>","393288","","393288","","2010-07-16 00:23:07","2010-07-16 12:18:28","Accessing Android Inbox/Messaging from Activity?","<android><messaging><android-ndk><inbox>","1","0","1","",""
"3260490","1","","","2010-07-15 22:09:53","0","1547","<p>I have searched through this and a few other sites for the answer, but I have been unable to find it. I am trying to save a boolean and an int using onSaveInstanceState and onRestoreInstanceState, but I can't seem to get it to work. It doesn't crash or anything, but it either isn't saving it or it isn't restoring it, or I am stupid and have no idea what I am doing. </p><hr><p>Here is what I have for my activity, do I need to have it in my onCreate somewhere or something?</p><pre><code>public class CannonBlast extends Activity {/** Called when the activity is first created. */private panel panelStuffz;@Overridepublic void onCreate(Bundle savedInstanceState) {    final Window win = getWindow();    super.onCreate(savedInstanceState);    panelStuffz = new panel(this);    requestWindowFeature(Window.FEATURE_NO_TITLE);    win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);     setContentView(panelStuffz);}@Overridepublic void onSaveInstanceState(Bundle savedInstanceState){    savedInstanceState.putInt(""HighLevel"", panelStuffz.getLevel());    savedInstanceState.putBoolean(""soundstate"", panelStuffz.getSound());    super.onSaveInstanceState(savedInstanceState);}@Overridepublic void onRestoreInstanceState(Bundle savedInstanceState) {    super.onRestoreInstanceState(savedInstanceState);    panelStuffz.setHighLevel(savedInstanceState.getInt(""HighLevel""));    panelStuffz.setSound(savedInstanceState.getBoolean(""soundstate""));}@Overridepublic void onResume(){    super.onResume();}@Overridepublic void onPause(){    super.onPause();    panelStuffz.setThread(null);}@Overridepublic void onStop(){}</code></pre><p>I tried putting stuff in the onStop, but it crashes, which is why its empty, in case that matters, thanks in advance</p>","390927","","","","","2010-07-23 08:43:00","Saving and restoring state in android","<java><android>","2","0","0","",""
"3260502","1","3260536","","2010-07-15 22:11:13","0","369","<p>So i have a list and i wan to check is the view is returned so i can call <code>loadingAnimation.start()</code> to make a imageview insite listview animateLet me tell you what i mean..</p><pre><code>   public View getView(final int position, View convertView, ViewGroup parent) {final ViewHolder holder;        if (convertView == null) {             .... blah blah          } else {        holder = (ViewHolder) convertView.getTag();                    //HERE IMAGE IS LOADED (SHOWN) SO .start() WILL WORK        holder.loadingAnimation.start();    }</code></pre><p>using this code if i scroll down the animation starts to work.But the first initial positions of the listview don't work at the start</p><p>Note that if i make the call of <code>loadingAnimation.start()</code> inside the if <code>(convertView == null) {</code> or only outside the if .. else .. the animation will not ever work</p><p>So i need a way inside the adapter (doesn't have to be inside the getView) to get if a view is loaded (shown) Ty</p><p><strong>EDIT</strong>I got it to work by emulation lag and then call the .start() to the animation</p><pre><code>class emulateLag extends AsyncTask {        protected Drawable doInBackground(Object... urls) {            SystemClock.sleep(500);            holder.loadingAnimation.start();            return null;        }        protected void onPostExecute(Object result) {        }    }    new emulateLag().execute(""JUSTFORANIMATION"");        return convertView;</code></pre><p>But i really don't like this approach so i keep the Question unanswered </p>","348058","","348058","","2010-07-15 22:20:55","2010-07-15 22:20:55","Is there any way to detect in an adapter,when getview() returned the view?,Android","<android>","1","0","0","",""
"3260506","1","3260520","","2010-07-15 22:12:27","0","1169","<p>Hallo all,</p><p>I have two files, one called ""part1.txt"" and another one called ""part2.txt"", which look like following</p><pre><code>part1.txt           part2.txtlili                like eating applelucy                like playing football</code></pre><p>Now i want to insert the contents of these two files into a single table with the schema </p><pre><code>table_name(linefrompart1 varchar(100), linefrompart2 varchar(50))</code></pre><p>My program reads the first file line by line and insert the data into the first column. But if it reads the second file and tries to insert the data line by line into the second column, it doesn't work the way i want. A table which i want should look like following</p><pre><code>linefrompart1   linefrompart2  lili            like eating apple  lucy            like playing football</code></pre><p>But instead i got the following table</p><pre><code>  linefrompart1   linefrompart2  lili            null  lucy            null  null            like eating apple  null            like playing football</code></pre><p>Does somebody know how i can fix this problem? Thank you!!</p>","353857","","","","","2010-07-15 22:15:53","Android SQLite: How to insert data in to a single column of an existed table","<android><sqlite><insert>","1","0","","",""
"3260576","1","3260592","","2010-07-15 22:23:54","2","3320","<p>uncaught handler:thread main exiting due to uncaught exceptionandroid.app.SuperNotCalledException:Activity did not call through to super.OnCreate()</p><p>My Code is:</p><pre><code>  public void onCreate(Bundle savedInstanceState) {        boolean isEnabled = Settings.System.getInt(this.getApplicationContext().getContentResolver(),Settings.System.AIRPLANE_MODE_ON, 0) == 1;                Settings.System.putInt(this.getApplicationContext().getContentResolver(),Settings.System.AIRPLANE_MODE_ON, isEnabled ? 0 : 1);                // Post an intent to reload                Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);                //intent.putExtra(""state"",! isEnabled);//Call ON                try {                    Thread.sleep(15000);                } catch (InterruptedException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }                intent.putExtra(""state"", isEnabled);                                                                                           this.getApplicationContext().sendBroadcast(intent);}</code></pre>","357349","","250260","","2012-09-07 22:47:11","2012-09-07 22:47:11","Error in Android ""SuperNotCalledException:Activity did not call through to super.OnCreate()""","<android>","1","0","","",""
"3260649","1","3260882","","2010-07-15 22:40:00","0","179","<p>I am having trouble with with getting my application to function on android 1.5. It works fine in 1.6, 2.1, and 2.2 but whenever I attempt to run it in 1.5, I get an immediate force close with the LogCat output: </p><pre><code>java.lang.RuntimeException: Unable to start activityComponentInfo{com.qrohlf.activites/com.qrohlf.activites.BookmarkHistoryTabActivity}:android.view.InflateException: Binary XML file line #2: Error inflating classjava.lang.reflect.Constructor</code></pre><p>This strikes me as very odd, as line #2 of my layout XML is just </p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""</code></pre><p>Any ideas? Is there some major API change between 1.5 and 1.6 in the way layout XMLs are done that I'm missing?(I've included the rest of my layout xml below for reference)</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;include android:id=""@+id/custom_titlebar"" layout=""@layout/custom_titlebar"" /&gt;    &lt;ViewFlipper android:id=""@+id/frame_content""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1"" &gt;        &lt;ListView android:id=""@+id/soccerteams_listview""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:background=""#FFFFFFFF""/&gt;        &lt;ListView android:id=""@+id/countries_listview""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:background=""#FFFFFFFF""/&gt;    &lt;/ViewFlipper&gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:gravity=""center_horizontal""        android:background=""@android:color/black""        android:padding=""0px""&gt;        &lt;Button android:id=""@+id/bookmarks_button""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""@string/bookmarks""            android:textColor=""@android:color/primary_text_dark""            android:drawableTop=""@drawable/ic_bookmark_tab""             android:background=""@drawable/tab_background""            android:layout_weight=""1""/&gt;        &lt;Button android:id=""@+id/history_button""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""@string/history""            android:textColor=""@android:color/primary_text_dark""            android:drawableTop=""@drawable/ic_history_tab""             android:background=""@drawable/tab_background""            android:layout_weight=""1""/&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","381299","","61332","","2010-07-15 23:06:55","2010-07-15 23:31:49","Android 1.5-specific error","<android><android-layout>","1","2","","",""
"3260746","1","3260773","","2010-07-15 23:04:33","1","1653","<p>All I want to do is to send a URL String into my RESTFUL web service with some kind of code like this</p><p><pre><code>URL someURL= new URL(""http://myWebService:port/service/""+CharSequence.getText());</pre></code></p><p>Its all going well until I found error with <code>space</code> character in my URL. I found some solution about replacing the space character with %20 which is I already defined with something like this :</p><p><pre><code>URL someURL= new URL(""http://myWebService:port/service/""+CharSequence.getText().replace("" "", ""%20""));</pre></code></p><p>Everything, again, seems going well until i found that the <code>replace(Char oldChara, Char newChara)</code> function can only replace ONE space character, and not two. </p><p>For brief example when I send the <code>CharSequence.getText()</code> with values <code>""We won""</code> there will be no error, but when I change the values into <code>""We won the battles""</code> there will be an error issuing that there are some illegal character sent to my RESTFUL web service.</p><p>Any kind of answer will come up with my great thanks and big salute~Regards~</p>","393316","","","","","2010-07-15 23:14:26","Android: Parsing URL into web service without space character","<android><url><parsing><rest><illegal-characters>","1","0","","",""
"3260749","1","","","2010-07-15 23:05:07","1","83","<p>I am developing an android application that needs to have the user sign in using their google premier login. My question is can I accomplish this programmatically and if so how?</p>","393317","","313137","","2011-09-01 18:01:41","2011-09-01 18:01:41","How can I use the google premier login in an android application?","<android>","0","0","","",""
"3260776","1","","","2010-07-15 23:09:58","1","1009","<p>I execute the following code:</p><blockquote>  <p>Uri uri =  Uri.withAppendedPath(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,  imageIdStr); Intent intent = new  Intent();  intent.setAction(android.content.Intent.ACTION_VIEW);<br>  intent.setData(uri);  activity.startActivity(intent);</p></blockquote><p>which opens the image viewer activity but I don't want to see the navigation arrows as well as the items in the menu. I only want the zoom controls. Is it possible to have it like that ?</p>","388903","","","","","2010-07-19 21:13:44","modified android ACTION_VIEW intent","<android><image><android-intent>","1","0","","",""
"3260786","1","3267239","","2010-07-15 23:11:59","0","470","<p>I have an Android project with an NDK/JNI library in Eclipse Ganymede. Inexplicably, the bin folder contains a copy of all my C++ sources from the jni folder. So does the APK, if you rename it to ZIP and examine. If I delete those files from bin, then clean and rebuild, they're there again. What going on, please? I have no intention of distributing the sources along with the app.</p>","219159","","219159","","2010-07-15 23:28:58","2010-07-16 17:03:02","JNI sources in the APK","<android><eclipse><android-ndk><android-ndk-r4>","1","1","","",""
"3260815","1","","","2010-07-15 23:18:20","-4","280","<pre><code>private void datafill(){        Cursor notesCursor = mDbHelper.fetchAllNotes();        startManagingCursor(notesCursor);        /* JournalRowId is the row id from the first database containing all journal names        All notes are kept in database 2. I want only the notes that correspond to each         journal to be listed, KEY_HOMEID is the non visible field that shows where         each note came from.         *          */       if (editjournalDbAdapter.KEY_HOMEID == journalRowId){        String[] from =  new String[]{editjournalDbAdapter.KEY_HEIGHT};        int[] to = new int[]{R.id.detail1};      }            //Error here ""from"" and ""to"" are not defined outside of if statement        SimpleCursorAdapter notes =             new SimpleCursorAdapter(this, R.layout.journaldetailrow, notesCursor, from, to);        setListAdapter(notes);    }</code></pre>","393328","","244296","","2010-07-16 02:08:58","2010-07-16 03:48:22","An IF statement in a cursor adapter?","<java><android><sqlite><cursor>","1","2","","",""
"3260868","1","4589234","","2010-07-15 23:28:57","37","17952","<p>I need a user account or two in my Android Emulator so that I can test some texting/mailing function of my app. The trouble is that when I try to do this in the emulator:</p><p>Settings --> Accounts &amp; sync --> Add account --> (my_gmail_account/password) --> Next</p><p>I get the message ""<strong>Setup could not finish - Unable to open connection to server</strong>.""</p><p>My emulator works fine &amp; is able to connect to internet through it's browser. So not sure why it is not working. Has anyone run across this problem?</p><p>Thanks!</p>","289918","","","","","2012-11-29 06:37:22","Android Emulator - Trouble creating user accounts","<android><android-emulator>","3","0","14","",""
"3260876","1","3260886","","2010-07-15 23:30:21","7","12183","<p>I've created my own view by creating a subclass of the SurfaceView class.</p><p>However I can't figure out how to add it from the xml layout file. My current main.xml looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;View    class=""com.chainparticles.ChainView""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""     /&gt;&lt;/LinearLayout&gt;</code></pre><p>What have I missed?</p><p>Edit</p><p>More info</p><p>My view looks like this</p><pre><code>package com.chainparticles;public class ChainView extends SurfaceView implements SurfaceHolder.Callback {    public ChainView(Context context) {        super(context);        getHolder().addCallback(this);    }// Other stuff}</code></pre><p>And it works fine like this:</p><pre><code>ChainView cview = new ChainView(this);setContentView(cview);</code></pre><p>But nothing happens when trying to use it from the xml.</p>","242348","","242348","","2010-07-15 23:48:37","2011-10-05 13:31:10","Custom view in xml layout","<android><xml><layout>","2","0","2","",""
"3260909","1","3270183","","2010-07-15 23:41:12","1","757","<p>I was wondering if there was a way to see who is or isn't using your application on Facebook. For example, sets say I have an application X that a user Y has just connected to. I want to find out if Y's friend Z has allowed X or not. </p><p>Then, if friend Z has not allowed/used X with Facebook before -- I want to invite that friend to use X.</p><p>Is there any way to do this using the GraphAPI and the Facebook-android-sdk?</p><p>Thanks in advance,</p><p>hwrd </p>","354247","","","","","2012-09-13 18:49:19","How to invite people not on your application from Facebook(android sdk)","<android><facebook><social-networking>","1","0","1","",""
"3260988","1","","","2010-07-16 00:00:05","2","3057","<p>I have an AutoCompleteTextView and i want it to autocomplete contact names on input.  The problem is that Contacts.People has been deprecated.  The new documentation says to use ContactsContract but i can't find any proper tutorial.  Can anyone give me a sample code or point me to an appropriate tutorial.</p><p>Thanks.</p>","381203","","","","","2012-09-08 21:10:33","How to populate an AutoCompleteTextView with contacts names in android 2.1","<android><autocompletetextview>","1","1","","",""
"3261012","1","","","2010-07-16 00:08:12","11","7111","<p>I am trying to use gson to do my object mapping on the android emulator.</p><p>It has been ridiculously slow when processing json data around 208 kb. I do not have any hierarchies in my json.</p><p>After the object mapping is done, i can see it that gson created around 500 records.</p><p>It is taking it over 3 minutes on the android emulator to map the input json.</p><p>I have annotated my entity which comprises of strings and couple of floats. </p><p>An I missing something? </p><p>Any ideas, best practices would greatly help.</p><p>Are there any ways of quickly object mapping the json data?</p><pre><code>        URL myURL = new URL(url);        /* Open a connection to that URL. */        URLConnection ucon = myURL.openConnection();        /*         * Define InputStreams to read from the URLConnection.         */        InputStream is = ucon.getInputStream();        InputStreamReader reader = new InputStreamReader(is);        long tickCount = System.currentTimeMillis();        Policy[] policies = new Gson().fromJson(reader, Policy[].class);        long endCount = System.currentTimeMillis() - tickCount;        Log.d(""Time to pull policies in milliseconds"", """" + endCount);</code></pre>","300352","","","","","2013-02-20 15:56:26","android: gson performance","<android><performance><gson>","4","1","5","",""
"3261021","1","","","2010-07-16 00:10:51","0","89","<p>This might be a really simple answer but I cant seem to come up with an answer for it, I'm aiming for android 2.1.</p><p>Any help would be great :-)</p>","393358","","","","","2010-12-22 09:19:41","How TO: obtain the list of names from the phonebook to be used in a list view?","<android><android-widget>","2","0","","",""
"3261084","1","3261375","","2010-07-16 00:26:55","0","1386","<p>I just ran into a problem when trying to launch the phone's email app via a button in the options menu because as soon as I click the button in the emulator it causes a force close error. If s.o. help me out here to find the error in my code, that would be great. </p><hr><p>This is my java file:</p><pre><code>package com.mobilevideoeditor.moved;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.BaseAdapter;import android.widget.GridView;import android.widget.ImageView;import android.widget.AdapterView.OnItemClickListener;public class ShareGalleryView extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.videogrid);        GridView vGrid=(GridView) findViewById(R.id.vgrid);        registerForContextMenu(vGrid);        vGrid.setAdapter(new VideoAdapter(this));        vGrid.setOnItemClickListener(new OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; parent, View v,                    int position, long id) {                // TODO Auto-generated method stub                openOptionsMenu();            }        });    }    @Override    public boolean onCreateOptionsMenu(Menu menu) {      MenuInflater inflater = getMenuInflater();      inflater.inflate(R.menu.menu_gallery_share, menu);      return super.onCreateOptionsMenu(menu);    }    @Override    public boolean onOptionsItemSelected (MenuItem item){        Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);        emailIntent.setType(""plain/text"");     if (item.getItemId() == R.id.menu_facebook)        {         //TODO open fb            return true;        }        else if (item.getItemId() == R.id.menu_youtube)        {            //TODO open youtube            return true;        }        else if (item.getItemId() == R.id.menu_email)        {          startActivity(emailIntent);              return true;        }        else if (item.getItemId() == R.id.menu_bluetooth)        {            // TODO send via bluetooth            return true;        }        return super.onContextItemSelected(item);    }    public class VideoAdapter extends BaseAdapter {        private Context mContext;        public VideoAdapter(Context c) {            mContext = c;        }        public int getCount() {            return mThumbIds.length;        }        public Object getItem(int position) {            return null;        }        public long getItemId(int position) {            return 0;        }        // create a new ImageView for each item referenced by the Adapter        public View getView(int position, View convertView, ViewGroup parent) {            ImageView imageView;            if (convertView == null) {  // if it's not recycled, initialize some attributes                imageView = new ImageView(mContext);                imageView.setLayoutParams(new GridView.LayoutParams(85, 85));                imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);                imageView.setPadding(8, 8, 8, 8);            } else {                imageView = (ImageView) convertView;            }            imageView.setImageResource(mThumbIds[position]);            return imageView;        }        // references to our images        private Integer[] mThumbIds = {                R.drawable.sample_2, R.drawable.sample_3,                R.drawable.sample_4, R.drawable.sample_2,                R.drawable.sample_6, R.drawable.sample_3,                R.drawable.sample_4, R.drawable.sample_1        };    }}</code></pre><hr><p>This is what the DDMS prints out:</p><pre><code>07-16 01:05:55.782: WARN/System.err(2096): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND }07-16 01:05:55.792: WARN/System.err(2096):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)07-16 01:05:55.812: WARN/System.err(2096):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)07-16 01:05:55.822: WARN/System.err(2096):     at android.app.Activity.startActivityFromChild(Activity.java:2989)07-16 01:05:55.822: WARN/System.err(2096):     at android.app.Activity.startActivityForResult(Activity.java:2769)07-16 01:05:55.832: WARN/System.err(2096):     at android.app.Activity.startActivity(Activity.java:2855)07-16 01:05:55.842: WARN/System.err(2096):     at com.mobilevideoeditor.moved.ShareGalleryView.onOptionsItemSelected(ShareGalleryView.java:79)07-16 01:05:55.842: WARN/System.err(2096):     at android.app.Activity.onMenuItemSelected(Activity.java:2170)07-16 01:05:55.842: WARN/System.err(2096):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:730)07-16 01:05:55.852: WARN/System.err(2096):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:139)07-16 01:05:55.852: WARN/System.err(2096):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)07-16 01:05:55.852: WARN/System.err(2096):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:525)07-16 01:05:55.862: WARN/System.err(2096):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)07-16 01:05:55.862: WARN/System.err(2096):     at android.view.View.onTouchEvent(View.java:4179)07-16 01:05:55.872: WARN/System.err(2096):     at android.widget.TextView.onTouchEvent(TextView.java:6541)07-16 01:05:55.882: WARN/System.err(2096):     at android.view.View.dispatchTouchEvent(View.java:3709)07-16 01:05:55.882: WARN/System.err(2096):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)07-16 01:05:55.882: WARN/System.err(2096):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)07-16 01:05:55.882: WARN/System.err(2096):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)07-16 01:05:55.892: WARN/System.err(2096):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)07-16 01:05:55.902: WARN/System.err(2096):     at android.os.Handler.dispatchMessage(Handler.java:99)07-16 01:05:55.912: WARN/System.err(2096):     at android.os.Looper.loop(Looper.java:123)07-16 01:05:55.912: WARN/System.err(2096):     at android.app.ActivityThread.main(ActivityThread.java:4363)07-16 01:05:55.922: WARN/System.err(2096):     at java.lang.reflect.Method.invokeNative(Native Method)07-16 01:05:55.922: WARN/System.err(2096):     at java.lang.reflect.Method.invoke(Method.java:521)07-16 01:05:55.932: WARN/System.err(2096):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)07-16 01:05:55.932: WARN/System.err(2096):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)07-16 01:05:55.932: WARN/System.err(2096):     at dalvik.system.NativeStart.main(Native Method)07-16 01:05:55.992: WARN/InputManagerService(53): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43cd4d30</code></pre>","390782","","390782","","2010-07-16 01:11:11","2010-07-16 01:44:00","How to stop email intent to cause force close error?","<android><email>","2","1","","",""
"3261121","1","3261246","","2010-07-16 00:35:49","2","20467","<p>Does anyone know the UUID to connect an android 2.2 device to a WiiMote?  The wiimote will not pair, as the wiimote does not require a PIN #.  </p>","17712","","","","","2013-04-27 17:11:48","Connecting a WiiMote to an android device","<android><bluetooth><uuid><wiimote>","2","1","3","",""
"3261160","1","3261166","","2010-07-16 00:44:12","2","1145","<p>I'm looking for an android code example on how I would be able to make my phone listen for a ""shake"" and then have it trigger webview.reload(); to simply reload the webview on the activity. Anyone have any insight on this topic?</p>","393373","","","","","2010-07-17 13:20:21","Does anyone know of any sample code for simple shake detector?","<java><android><webview><accelerometer><shake>","2","0","1","",""
"3261277","1","","","2010-07-16 01:17:14","0","1454","<p>I am developing a Music Player and I have a view flipper to control all the artist view, album view, so on and so forth. What I am doing now is that I have list view in each view of the view flipper. However, I do not want to put all my codes inside one activity but rather, to have different activities for each view. Is that possible to implement?</p>","372107","","","","","2012-01-09 00:38:46","Using different activities for different views in a ViewFlipper","<android>","2","0","","",""
"3261370","1","3261384","","2010-07-16 01:42:20","23","8029","<p>The Android doc says ""Like activities and the other components, services run in the main thread of the application process.""</p><p>Is the main thread here the same thing as UI thread?</p>","256239","","73488","","2010-09-22 23:28:18","2012-09-24 20:30:54","Is main thread the same as UI thread?","<android>","5","0","3","",""
"3261374","1","3261381","","2010-07-16 01:43:21","1","646","<p>Are onTouch(), onClick(), runOnUiThread() running in the same UI thread sequentially? Or do I have to worry about synchronization issue among them?</p><p>Thanks.</p>","256239","","","","","2010-07-16 01:46:16","Are onTouch(), onClick() running sequentially in the same thread?","<android>","1","0","1","",""
"3261541","1","3261564","","2010-07-16 02:35:07","3","6248","<p>I'm currently using something like: <code>TextView.SetBackgroundColor(Color.WHITE);</code> in my java code. I'd like to be able to add some transparancy to the textview through the java... This is easy to do in the XML via <code>#AARRGGBB</code> format, but I have not found a way to accomplish this programmatically.</p>","382252","","","","","2012-12-05 13:03:32","Apply ARGB color to a textview programmatically","<android><colors><argb>","2","0","0","",""
"3261739","1","","","2010-07-16 03:30:26","2","2788","<p>I'm attempting to draw in orthographic mode with OpenGL ES, and the point (0,0) is in the lower-left corner of the screen.  However, I want to make it be in the upper-left hand corner.</p><p>Here's where I'm setting things up in my Android app:</p><pre><code>public void onSurfaceChanged(final GL10 gl, final int width, final int height) {    assert gl != null;    // use orthographic projection (no depth perception)    GLU.gluOrtho2D(gl, 0, width, 0, height);}</code></pre><p>I tried changing the above call in many ways, including:</p><pre><code>    GLU.gluOrtho2D(gl, 0, width, 0, height);    GLU.gluOrtho2D(gl, 0, width, 0, -height);    GLU.gluOrtho2D(gl, 0, width, height, 0);    GLU.gluOrtho2D(gl, 0, width, -height, 0);</code></pre><p>I also tried playing with the viewport to no avail:</p><pre><code>public void onSurfaceChanged(final GL10 gl, final int width, final int height) {    assert gl != null;    // define the viewport    gl.glViewport(0, 0, width, height);    gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glLoadIdentity();    // use orthographic projection (no depth perception)    GLU.gluOrtho2D(gl, 0, width, 0, height);}</code></pre><p>And again, I tried playing with the viewport settings to no avail:</p><pre><code>    gl.glViewport(0, 0, width, height);    gl.glViewport(0, 0, width, -height);    gl.glViewport(0, height, width, 0);    gl.glViewport(0, -height, width, 0);</code></pre><p>Any clues on how to get the point (0,0) to the top-left of the screen?  Thanks!</p>","107277","","44729","","2010-07-16 14:45:03","2010-12-19 02:31:19","Flip Y-axis in OpenGL ES?","<android><graphics><opengl-es>","3","0","1","",""
"3261776","1","3261794","","2010-07-16 03:41:00","7","6026","<p>I'm trying to determine the degree size of the field-of-view of a Droid Incredible smartphone's camera. I need to know this value for an application that I'm developing. Does anyone know how I can find out/calculate it programmatically? </p>","155726","","","","","2012-08-30 06:26:04","Determine angle of view of smartphone camera","<android><math><camera><angle>","3","0","4","",""
"3261790","1","","","2010-07-16 03:45:20","0","82","<p>Is it possible for a program to mimic the Android Homepage?  Can widgets, contacts, and canvases all interact at the appropriate FPS?  Is it possible for an app to make calls and IMs?  Or are the ISOs used to make the original too different from Java to mimic correctly?</p>","393444","","","","","2010-07-16 04:11:14","Android Development","<android>","1","1","","",""
"3262118","1","","","2010-07-16 05:17:21","3","13528","<p>There are a set of buttons, I want to get the result:</p><p>When I click one of them, first I divide them into two parts: the clicked one and the others. I'm trying to set different color or alpha value to different them.</p><p>Now I use <code>setAlpha</code>, but when I change the value from <strong>0 to 255</strong>, it works, but when I change the value from <strong>255 to 0</strong> , it doesnot work. I don't know why.</p><p>Maybe after I invoke the method<code>Button.setAlpha()</code>, I need invoke another method?</p><p>my code:</p><pre><code>public class MainActivity extends Activity { // button alpha value: minimize value public static int BUTTON_ALPHA_MIN = 0; // button alpha value: maximize value public static int BUTTON_ALPHA_MAX = 255; private LinearLayout centerRegion; private LinearLayout bottomRegion; private Button btnCheckIn; private Button btnReview; private Button btnMyCircles; private Button btnSettings; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  // get all the widgets  getAllWidgets();  // set buttons click response function  btnCheckIn.setOnClickListener(new OnClickListener() {   public void onClick(View v) {    centerRegion.setBackgroundColor(android.graphics.Color.RED);    btnReview.getBackground().setAlpha(BUTTON_ALPHA_MIN);    btnMyCircles.getBackground().setAlpha(BUTTON_ALPHA_MIN);    btnSettings.getBackground().setAlpha(BUTTON_ALPHA_MIN);    btnCheckIn.getBackground().setAlpha(BUTTON_ALPHA_MAX);   }  });  btnReview.setOnClickListener(new OnClickListener() {   public void onClick(View v) {    centerRegion.setBackgroundColor(android.graphics.Color.BLUE);    btnCheckIn.getBackground().setAlpha(BUTTON_ALPHA_MIN);    btnMyCircles.getBackground().setAlpha(BUTTON_ALPHA_MIN);    btnSettings.getBackground().setAlpha(BUTTON_ALPHA_MIN);    btnReview.getBackground().setAlpha(BUTTON_ALPHA_MAX);   }  });  btnMyCircles.setOnClickListener(new OnClickListener() {   public void onClick(View v) {    centerRegion.setBackgroundColor(android.graphics.Color.YELLOW);    btnCheckIn.getBackground().setAlpha(BUTTON_ALPHA_MAX);    btnReview.getBackground().setAlpha(BUTTON_ALPHA_MAX);    btnSettings.getBackground().setAlpha(BUTTON_ALPHA_MAX);    v.getBackground().setAlpha(BUTTON_ALPHA_MIN);   }  });  btnSettings.setOnClickListener(new OnClickListener() {   public void onClick(View v) {    centerRegion.setBackgroundColor(android.graphics.Color.MAGENTA);    btnCheckIn.getBackground().setAlpha(BUTTON_ALPHA_MAX);    btnReview.getBackground().setAlpha(BUTTON_ALPHA_MAX);    btnMyCircles.getBackground().setAlpha(BUTTON_ALPHA_MAX);    v.getBackground().setAlpha(BUTTON_ALPHA_MIN);   }  }); } /**  * get all the widgets  */ public void getAllWidgets() {  this.centerRegion = (LinearLayout) this.findViewById(R.id.center_region);  this.bottomRegion = (LinearLayout) this.findViewById(R.id.bottom_region);  this.btnCheckIn = (Button) this.findViewById(R.id.button_check_in);  this.btnReview = (Button) this.findViewById(R.id.button_review);  this.btnMyCircles = (Button) this.findViewById(R.id.button_my_circles);  this.btnSettings = (Button) this.findViewById(R.id.button_setting); }}</code></pre>","339018","","475052","","2013-01-09 06:00:57","2013-08-20 07:36:28","Android Button setAlpha","<android><button>","4","0","1","",""
"3262157","1","3262212","","2010-07-16 05:27:24","9","15978","<p>I used Toast to make notification, but it seems it will appear even its activity is not in the current screen and some other activity has been started.</p><p>I want to check this situation, when the activity is not the current one, I'd not send the Toast notification. But how to do ?</p>","238061","","","","","2012-01-22 19:23:17","How to check if my activity is the current activity running in the screen","<android><activity><screen><lifecycle>","3","0","2","",""
"3262381","1","12491670","","2010-07-16 06:19:46","0","259","<p>By ""Program"", I mean a desktop front end for installing/uninstalling apps on a phone.Can u please help me out from this? I am not clear what to do ?</p><p>Thnx,Praween     </p>","292605","","","","","2012-09-19 09:11:26","How can I write a front end program to install and uninstall an app over android device?","<android>","2","1","","",""
"3262494","1","3262548","","2010-07-16 06:41:21","0","558","<p>Hi i want to display the imageviews one by one that means if image1 is displayed after 2 sec another image is displayed .but i don't want to use threads why because my application is small.I want to use handlers.So give me some suggestions,Thanks in advance</p>","454808","","","","","2010-07-16 06:51:36","Display images one by one","<android>","1","0","2","",""
"3262510","1","","","2010-07-16 06:44:57","0","4778","<p>Hi i try to add event to google Calendar it gives the error message</p><pre><code>07-16 11:56:34.692: ERROR/dalvikvm(749): Could not find method javax.xml.parsers.SAXParserFactory.getSchema, referenced from method com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory$SecureSAXParserFactory.getSchema</code></pre><p>My application add the event in google calendar but i am not able to view the screen properly android emulator gives the alert force to close the application.How to solve this? am i missing any libs?</p>","383489","","","","","2011-03-05 01:35:19","Add Event to Google Calendar in android?","<android>","1","1","","",""
"3262771","1","3262842","","2010-07-16 07:28:25","2","711","<p>I want to show feeds from a blog in a listview. It would be really help if you guys can suggest some tutorials or how to do it?</p><p>thanks in adv.</p>","152867","","152449","","2010-07-16 08:05:28","2011-06-23 14:06:29","Show feeds in android","<android><rss><feeds><feedburner>","1","0","","",""
"3262781","1","","","2010-07-16 07:30:12","23","21420","<p>Here, my android device supports both wifi and 3g. At particular time which network is available on this device. Because my requirement is when 3g is available I have to upload small amount of data. when wifi is available entire data have to upload. So, I have to check connection is wifi or 3g. Please help me. Thanks in advance.  </p>","437612","","","","","2012-12-07 19:16:00","how to check wifi or 3g network is available on android device","<java><android>","1","3","13","",""
"3262898","1","","","2010-07-16 07:48:08","1","959","<p>I am programming an android application and my ""testing"" device is a Motorola Milestone (Droid). I have done a grid that scroll like the iPhone home menu ( with ""points"").I got two problems:</p><ol><li>The first one : the drag only works on the Android Device Emulator and don't on the Droid! (Maybe the multi-touch screen is a problem?)</li><li>The drag is too responsible, and flip views sometimes one by one (this is ok) and sometimes 2 by 2 or 3 by 3! That is clearly problematic!</li></ol><p>Here is the code of my OnTouch method:</p><pre><code>public boolean onTouch(View v, MotionEvent event) {    if (v instanceof GridView){        int eventaction = event.getAction();        switch (eventaction) {        case MotionEvent.ACTION_MOVE:            if (event.getEdgeFlags()==MotionEvent.EDGE_LEFT){                vf2.setInAnimation(this, R.anim.slide_left);                vf2.setOutAnimation(this, R.anim.slide_right);                vf2.showNext();                if (numCurrentPage==2){                    numCurrentPage= 0;                } else {                    numCurrentPage++;                }                notifyPageNumber(numCurrentPage);            }            if (event.getEdgeFlags()==MotionEvent.EDGE_RIGHT){                vf2.setInAnimation(this, R.anim.slide_in);                vf2.setOutAnimation(this, R.anim.slide_out);                vf2.showPrevious();                if (numCurrentPage==0){                    numCurrentPage= 2;                } else {                    numCurrentPage--;                }                notifyPageNumber(numCurrentPage);            }            break;        default:            break;        }    }    return false;}</code></pre><p>Thanks for your help!</p><p>Update : It doesn't work anymore on the Google Nexus One!</p>","393590","","393590","","2010-07-16 09:29:52","2010-07-19 07:34:07","Finger drag on motorola droid","<android><touch>","2","0","","",""
"3263169","1","3271041","","2010-07-16 08:34:37","18","8850","<p>I have a linear layout in which each row is inflated programatically and I want the rows to behave like the ListView when clicked on. That is, I want the row to highlight in the exact same way/colour that the default ListView does. How would I go about doing this?</p>","362476","","","","","2013-11-12 08:56:27","Android how to make View highlight when clicked?","<android><xml><listview><layout><user-interface>","3","0","11","",""
"3263259","1","","","2010-07-16 08:47:49","23","14877","<p>Ok.. I must be overlooking something real simple here, but i think i'm trying to do something fairly basic.. Simply retain the scrollbar position of a ScrollView on orientation change... </p><p>Here is the code for my onSaveInstanceState and onRestoreInstanceState.. sView is the container for the ScrollView layout. Within my scrollview is a linearlayout with a lot of textviews. </p><pre><code>    @Override public void onSaveInstanceState(Bundle outState) {    //---save whatever you need to persist—    outState.putInt(""sViewX"",sView.getScrollX());    outState.putInt(""sViewY"",sView.getScrollY());super.onSaveInstanceState(outState);}@Overridepublic void onRestoreInstanceState(Bundle savedInstanceState) {    super.onRestoreInstanceState(savedInstanceState);    sViewX = savedInstanceState.getInt(""sViewX"");       sViewY = savedInstanceState.getInt(""sViewY"");    sView.scrollTo(sViewX, sViewY);}</code></pre><p>If I set a Toast with the values of sViewX and sViewY on the Restore, the values are kept and correct. </p><p>Edit: I just tried to do a sView.scrollTo(0,150); in my onCreate.. just to see if that would open the activity at 150px down, and it didn't. I think my issue has to do with the .scrollTo method. </p>","350237","","","","","2013-12-02 10:05:53","ScrollView .scrollTo not working? Saving ScrollView position on rotation","<android>","1","1","7","",""
"3263265","1","","","2010-07-16 08:48:47","62","60876","<p>I was working on Android 1.5, but now moved to the latest version.So there is only one ""drawable"" folder in Android 1.5, but now there are 3 different folders for storing images in the android project.</p><p>And as I have found some articles for these 3 folders that </p><ol><li>hdpi means High-dpi </li><li>mdpi means medium-dpi </li><li>ldpi means low-dpi</li></ol><p>But still I have some confusion around what is the exact purpose of these 3 folders and when to use a particular folder to store images in.</p><p>Please give me some suggestions.</p>","379693","","312172","","2012-03-06 02:08:52","2013-07-06 10:40:35","Drawable-hdpi, Drawable-mdpi, Drawable-ldpi Android","<android><image>","3","0","19","",""
"3263321","1","","","2010-07-16 08:57:34","2","993","<p>I got a strange problem with replacing a table row from code.</p><p>My XML code looks like this:</p><p></p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:orientation=""vertical""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;&lt;TableLayout  xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/columnheadings"" android:layout_height=""wrap_content""  android:layout_width=""fill_parent""/&gt;        &lt;ListView    android:id=""@+id/android:list""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:dividerHeight=""2px""    /&gt;    ...     &lt;/LinearLayout&gt;</code></pre><p>When the activity is created, I can successfully insert a TableRow to the TableLayout ""columnheadings"":</p><pre><code> table = (TableLayout)findViewById(R.id.columnheadings); table.removeAllViews(); TableRow tr = new TableRow(this); TextView tv = new TextView(activity); tv.setText(""asdf""); tr.addView(tv); table.addView(tr); table.postInvalidate();</code></pre><p>The contents (and width) of the table columns are dynamically calculated.</p><p>Now I want to also redraw the TableLayout, when there are updates within the Adapter of the ListView. For this purpose, I'm creating the adapter with a reference to the activity.</p><p>From within the adapter I can successfully change e.g. the text of a column.</p><p>What I try to do (without success):</p><pre><code> TableLayout tableLayout = (TableLayout)activity.findViewById(android.app.R.id.columnheadings);          tableLayout.removeAllViews(); TableRow row=new TableRow(activity); TextView tv = new TextView(activity); tv.setText(""test""); row.addView(tv); tableLayout.addView(row); tableLayout.postInvalidate();</code></pre><p>Unfortunately, the only thing that happens is a removal of the current table row. The new row isn't added to the tableLayout from the adapter.</p><p>Any suggestions ?</p>","393646","","","","","2011-01-04 21:03:45","Android changing tableLayout from code doesn't work","<android><listview><tablelayout>","1","0","1","",""
"3263524","1","","","2010-07-16 09:27:10","2","5075","<p>I want to diplay an image so that it takes up a minmum width of the screen and should scale in its aspect ratio (the image width might be smaller or larger than the minimun width) I also want to have a fixed size border around this image. This is my xml section for it:</p><pre><code>&lt;ImageView        android:id=""@+id/detailed_view_boxArt""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:minWidth=""150dp""        android:layout_alignParentLeft=""true""        android:layout_below=""@id/detailed_view_heading""        android:padding=""10dp""        android:layout_marginLeft=""5dp""        android:scaleType=""centerInside""        android:background=""#000""/&gt; </code></pre><p>This however does not produce what I want...the problem is that it does not scale the image horizontally far enough (ie. the 10px padding that I have seems a lot more on the right and left)</p><p>How would I produce the result that I want?</p>","362476","","","","","2013-11-10 01:05:42","Android how to make ImageView with a minWidth have a border?","<android><xml><layout><user-interface><imageview>","2","0","0","",""
"3263538","1","3264214","","2010-07-16 09:29:52","2","90","<p>i want to retreive the latitude and longtitude of the user's present location,i already tried using  location observer which fires event based upon the given input distance and time,Hence it triggers the event to identify the location based upon the given time duration and distance.</p><p>And What i want is method,to get the location,just by calling that method.When ever i call that method,it should notify me of the lattitude and longitude.</p><p>Is there any methods  in android?</p><p>Regards</p><p>Rakesh Shankar.P</p>","138030","","","","","2010-07-16 11:13:50","Abt Retreiving the latitude and longtitude of the device","<android>","1","0","1","",""
"3263611","1","3264140","","2010-07-16 09:43:56","112","87989","<p>How can I set a border for an <code>ImageView</code> and change its color in Android?</p>","267269","","403455","","2012-08-02 14:07:46","2013-08-12 13:03:21","Border for an Image view in Android?","<android><border><imageview>","5","1","55","",""
"3263631","1","","","2010-07-16 09:48:15","1","532","<p>I'm running the Calendar widget of the Android SDK2.1 on my device, and get authentication exception. It sounds that something is wrong with the account manager. How could I fixed that problem. Thanks!</p><p>Here is the log:</p><blockquote>  <p>root@jacky-desktop:~# I/ActivityManager(  753): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.calendar/.LaunchActivity }  I/ActivityManager(  753): Start proc com.android.calendar for activity com.android.calendar/.LaunchActivity: pid=1184 uid=10011 gids={3003}  D/ddm-heap( 1184): Got feature list request  I/ActivityThread( 1184): Publishing provider calendar: com.android.providers.calendar.CalendarProvider  D/LauchAcitivity.java( 1184): icicle bundle = null, this is the first launch  D/AccountManagerService(  753): bind attempt failed for Session: expectLaunch false, connected false, stats (0/0/0), lifetime 0.0, getAccountsByTypeAndFeatures, legacy_hosted_or_google  D/AccountManagerService(  753): bind attempt failed for Session: expectLaunch false, connected false, stats (0/0/0), lifetime 0.001, getAccountsByTypeAndFeatures, legacy_hosted_or_google  E/ActivityThread( 1184): Failed to find provider info for subscribedfeeds  W/CalendarProvider( 1184): onAccountsChanged  W/CalendarProvider( 1184): android.accounts.AuthenticatorException: bind failure  W/CalendarProvider( 1184):      at android.accounts.AccountManager.convertErrorToException(AccountManager.java:1096)  W/CalendarProvider( 1184):      at android.accounts.AccountManager.access$500(AccountManager.java:74)  W/CalendarProvider( 1184):      at android.accounts.AccountManager$BaseFutureTask$Response.onError(AccountManager.java:1003)  W/CalendarProvider( 1184):      at android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:69)  W/CalendarProvider( 1184):      at android.os.Binder.execTransact(Binder.java:287)  W/CalendarProvider( 1184):      at dalvik.system.NativeStart.run(Native Method)</p></blockquote>","393687","","1288","","2011-06-13 12:09:30","2011-06-13 12:09:30","Account exception about Calendar widget of Android sdk 2.1","<android><authentication><calendar><accountmanager>","0","0","0","",""
"3263641","1","","","2010-07-16 09:49:31","0","443","<p>How to fetch Email from android device like as fetch  SMS from android device  ?any body have idea about it?  if possible , plz give me code about it ...</p>","1101841","","","","","2011-02-14 13:13:09","How to fetch the Email form device?","<android>","1","0","","",""
"3263680","1","3263730","","2010-07-16 09:55:33","2","737","<p>I will have to develop some android applications. Witch mobile phone is better for application development : Google Nexus One / Htc Droid Incredible /  Htc Evo 4G / Motorola Droid ?</p><p>I have to develop on Android 2.1 and 2.2. All those devices will have the update I think.</p><p>Thanks for ideas</p>","293995","","","","","2012-12-09 15:48:23","What's the best android mobile phone for application development","<android><hardware>","1","0","","",""
"3263695","1","","","2010-07-16 09:57:41","3","2587","<p>I am developing an android application in which,the first activity is that for Login. After successful authentication, user can see an activity with 4 Tabs. My problem is that when user taps on the home button,the application should terminate and when the user again starts my application, he should be able to see the Login screen again and after successful Login, user should be able to see the tab on which he was working before application terminated(i.e., save state for all the tabs). Please help me out in this. Thanks in advance.</p>","393698","","","","","2012-04-12 13:35:53","Save State in my Android application","<android>","3","1","2","",""
"3263736","1","3516707","","2010-07-16 10:03:41","20","45546","<p>I can't figure out why am i not able to play the video in my VideoView. All i'm getting a message is Cannot Play Video : Sorry, this video cannot be played. </p><p>I created an SD card for my emulator as well. Do i need to place me SD card in a particular folder in my SDK? Please comment. </p><p>Here's the layout: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    android:id=""@+id/LinearLayout01""   android:layout_height=""fill_parent""        android:paddingLeft=""2px""   android:paddingRight=""2px""   xmlns:android=""http://schemas.android.com/apk/res/android""   android:paddingTop=""2px""   android:paddingBottom=""2px""   android:layout_width=""fill_parent""   android:orientation=""vertical""&gt;      &lt;VideoView          android:layout_height=""fill_parent""         android:layout_width=""fill_parent""          android:id=""@+id/VideoView"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Here is the code:</p><pre><code>package com.examples.videoviewdemo;import android.app.Activity;import android.os.Bundle;import android.widget.MediaController;import android.widget.VideoView;public class VideoViewDemo extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        VideoView videoView = (VideoView)findViewById(R.id.VideoView);        //MediaController mediaController = new MediaController(this);        // mediaController.setAnchorView(videoView);        //videoView.setMediaController(mediaController);        videoView.setVideoPath(""/sdcard/blonde_secretary.3gp"");        videoView.start();      }}</code></pre><p>Waiting for the reply...</p>","2355649","","114066","","2010-08-18 10:38:55","2013-07-22 22:32:27","Playing a video in VideoView in Android","<android>","7","9","12","",""
"3263780","1","3264187","","2010-07-16 10:08:59","1","754","<p>I have boot loader listener. But After user install the application my listener does not start until first boot-up. is there any way to check whether my listener running or not?</p>","377438","","243782","","2010-07-16 11:08:45","2011-08-30 23:08:33","Check Listener running or not","<android>","2","0","","",""
"3263831","1","3263945","","2010-07-16 10:19:20","2","1014","<p>This has got me all confused! I'm trying to return the max value from a column in my database but the return value is always the name of the column.   </p><p>The query I use:</p><pre><code>private static final String SELECTMAX = ""SELECT MAX(?) FROM "" + TABLE_NAME ;</code></pre><p>The (test) function to return the max value:</p><pre><code>public int getMaxValue(String field){   int r = 0;   String f[] = new String[] {field};   Cursor c = this.db.rawQuery(SELECTMAX, f);   if (c.moveToFirst()) {       String s = c.getString(0);       Log.i(""XXXXX"",""Max num: "" + s);    }   return r;}</code></pre><p>The column i'm querying is an INTEGER type but the result 's' is always the column name and not the desired value.  </p><p>Thanks</p>","288973","","","","","2010-07-16 11:07:10","SELECT MAX(column) returning only column name","<java><android><sqlite>","2","0","0","",""
"3263939","1","3264205","","2010-07-16 10:34:21","1","210","<p>The same code that displays the lists running on the emulator doesn't run on the mobile (Motorola Milestone). I'm using the same android platform (2.1-update).</p><h2>Inbox Code</h2><pre><code>private ArrayList&lt;EmailModel&gt; email_list;private EmailAdapter email_adapter; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  try {   this.email_list = populate_list();   email_adapter = new EmailAdapter(this, email_list);   setListAdapter(email_adapter);  } catch (Exception e) {   Log.v(""Inbox"", ""Adapting Problem: "" + e.toString());  } }</code></pre><h2>EmailAdapter Code</h2><pre><code>public class EmailAdapter extends BaseAdapter {private ArrayList&lt;EmailModel&gt; elements;private Context c;public EmailAdapter(Context c, ArrayList&lt;EmailModel&gt; Emails) { this.elements = Emails;    this.c = c;}public int getCount() {    return elements.size();}public Object getItem(int position) {    return elements.get(position);}public long getItemId(int id) {    return id;}public void Remove(int id) {    notifyDataSetChanged();}public void Add(EmailModel email) { this.elements.add(email); notifyDataSetChanged();}public View getView(int position, View convertView, ViewGroup parent) {    LinearLayout rowLayout;    EmailModel email = elements.get(position);    if (convertView == null) {     rowLayout = (LinearLayout) LayoutInflater.from(c).inflate(R.layout.inbox_item, parent, false);     } else {        rowLayout = (LinearLayout) convertView;    } TextView subject_textview = (TextView)rowLayout.findViewById(R.id.subject_textview); subject_textview.setText(email.getSubject()); String body_hint = "" - "" + email.getBodyHint(); TextView bodyhint_textview = (TextView)rowLayout.findViewById(R.id.body_hint_textview); bodyhint_textview.setText(body_hint); String sender_name = get_sender_name(email.getSender()); TextView sender_name_textview = (TextView)rowLayout.findViewById(R.id.sender_textview); sender_name_textview.setText(sender_name); TextView date_time_textview = (TextView)rowLayout.findViewById(R.id.date_time_textview);  date_time_textview.setText(email.getTime());    return rowLayout;}private String get_sender_name(String from) { String[] sender = from.split(""&lt;"");String sender_name;  try {   sender_name = sender[0];  } catch (Exception e) {   sender_name = sender[1];  }  return sender_name;    }}</code></pre><h2>exception output</h2><blockquote>  <p>07-16 13:15:21.190: VERBOSE/Inbox(429): Adapting Problem: java.lang.ArrayIndexOutOfBoundsException</p></blockquote><h2>Stack Trace</h2><blockquote>  <p>07-16 14:00:49.690: WARN/System.err(703): java.lang.ArrayIndexOutOfBoundsException  07-16 14:00:49.698: WARN/System.err(703):     at com.anubis.mail.Inbox.populate_list(Inbox.java:237)  07-16 14:00:49.698: WARN/System.err(703):     at com.anubis.mail.Inbox.onCreate(Inbox.java:69)  07-16 14:00:49.698: WARN/System.err(703):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)  07-16 14:00:49.698: WARN/System.err(703):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)  07-16 14:00:49.706: WARN/System.err(703):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)  07-16 14:00:49.706: WARN/System.err(703):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)  07-16 14:00:49.706: WARN/System.err(703):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)  07-16 14:00:49.706: WARN/System.err(703):     at android.os.Handler.dispatchMessage(Handler.java:99)  07-16 14:00:49.706: WARN/System.err(703):     at android.os.Looper.loop(Looper.java:123)  07-16 14:00:49.706: WARN/System.err(703):     at android.app.ActivityThread.main(ActivityThread.java:4363)  07-16 14:00:49.706: WARN/System.err(703):     at java.lang.reflect.Method.invokeNative(Native Method)  07-16 14:00:49.706: WARN/System.err(703):     at java.lang.reflect.Method.invoke(Method.java:521)  07-16 14:00:49.706: WARN/System.err(703):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)  07-16 14:00:49.706: WARN/System.err(703):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)  07-16 14:00:49.706: WARN/System.err(703):     at dalvik.system.NativeStart.main(Native Method)</p></blockquote>","114890","","715269","","2012-02-29 12:04:30","2012-02-29 12:04:30","Adapter won't run on a real device","<android>","2","3","","",""
"3263940","1","3264522","","2010-07-16 10:34:21","1","254","<p>i have made an android application for ""Project Build Target"" as </p><p>Target name:: ""Android 2.2""</p><p>Vendor :: ""Android Open Source Project""</p><p>Platform :: ""2.2""</p><p>API Level :: ""8""</p><p>I am using Eclipse helios and android sdk r_06.</p><p>But the phone where i am want to run my application has platform 1.6</p><p>how do make this application run on that phone with that platform because when i installed the application it gave me error ""incompatible platform"",""package corrupted"",""package not found""</p><p>how do i make it compatible??</p><p>also in eclipse when i changed target name as ""Android 1.5"" it gave me error in res folder tellin ""invalid resources directory""</p>","379749","","","","","2010-07-16 12:00:41","android - platform incompatible and package incompatible error when installing application on phone","<android><build><platform><android-2.2-froyo>","1","0","1","",""
"3264235","1","","","2010-07-16 11:16:29","7","982","<p>I've develop android application, and one question. </p><p>As you know, When we use LiveActivity, we must specify @id/android:list for ListView ID.</p><p>But, When I use @+id/android:list instead of @id/android:list, it is working fine.</p><p>What is different between @+id/android:list and @id/android:list ??</p>","393763","","19750","","2011-04-20 15:43:31","2013-04-07 22:07:54","What is different between @+id/android:list and @id/android:list?","<android><syntax>","3","0","2","",""
"3264383","1","3264468","","2010-07-16 11:35:42","61","26487","<p>What is the difference between Service, Async Task &amp; Thread. If i am not wrong all of them are used to do some stuff in background. So, how to decide which to use and when?</p>","393792","","","","","2013-10-01 12:35:23","Difference between Service, Async Task & Thread?","<android>","2","1","33","",""
"3264488","1","3271046","","2010-07-16 11:48:01","1","807","<p>I had found a lot of stackoverflow post about save an Activity and the reload it. My question: How can I have an Activity with an MapView and after reload the same mapview ?  What is the best way to switch between activity and views ?  Thanks:Karoly</p>","393809","","","","","2010-07-17 10:13:23","Save an Android MapView and reload","<android><load><save><android-mapview>","2","0","","",""
"3264610","1","3264647","","2010-07-16 12:02:35","67","40465","<p>First of all: yes, I read all the other threads on this topic. And not only those from this site... (you see, I'm a little frustrated)</p><p>Most of them come with the advice to use <code>android:id</code> instead of just <code>id</code> in the XML file. I did.</p><p>From others, I learned, that <code>View.findViewById</code> works different than <code>Activity.findViewById</code>. I handled that, too.</p><p>In my <code>location_layout.xml</code>, I use:</p><pre><code>&lt;FrameLayout .... &gt;    &lt;some.package.MyCustomView ... /&gt;    &lt;LinearLayout ... &gt;        &lt;TextView ...            android:id=""@+id/txtLat"" /&gt;        ...    &lt;/LinearLayout&gt;&lt;/FrameLayout&gt;</code></pre><p>In my Activity I do:</p><pre><code>...setContentView( R.layout.location_layout );</code></pre><p>and in my custom view class:</p><pre><code>... TextView tv = (TextView) findViewById( R.id.txtLat );</code></pre><p>which returns <code>null</code>. <strong>Doing this, my Activity works fine.</strong> So maybe it's because of the <code>Activity.findViewById</code> and <code>View.findViewById</code> differences. So I stored the context passed to the customs view constructor locally and tried:</p><pre><code>...TextView tv = (TextView) ((Activity) context).findViewById( R.id.txtLat );</code></pre><p>which also returned <code>null</code>.</p><p>Then, I changed my custom view to extend <code>ViewGroup</code> instead <code>View</code> and changed the <code>location_layout.xml</code> to let the <code>TextView</code> be a direct child of my custom view, so that the <code>View.findViewById</code> should work as supposed. Suprise: it didn't solve anything.</p><p>So what the heck am I doing wrong? </p><p>I'll appreciate any comments.</p>","393827","","707111","","2012-06-21 19:57:18","2014-04-11 15:49:50","findViewByID returns null","<android>","8","1","4","",""
"3264785","1","","","2010-07-16 12:26:21","0","954","<p>I have created a widget to display some long text. I want this text to have ""marquee"" effect . I've already set TextView propertie ellipsize=""marquee"" but it doesn't works .Any idea? </p><p>Edit: For example Stocks widget of HTC</p>","346665","","","","","2010-07-16 13:12:12","Scrollable text in Android widget","<android><scrolling><scroll><textview><marquee>","1","0","","",""
"3264891","1","3265130","","2010-07-16 12:38:58","0","502","<p>After having solved every of my previous issues to get the code running for retrieving videos from the sdcard and displaying them in the GridView, I still cannot see the videos. I don't know what I have done wrong that they won't show and the array isn't passed on. </p><p>If someone could help me out, please, because I really haven't got a clue what's wrong... :(( Thank you...</p><p>This is the java file that tries to retrieve and display the videos from the sdcard in the GridView:</p><pre><code>package com.mobilevideoeditor.moved;import java.util.ArrayList;import android.app.Activity;import android.content.Context;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.provider.MediaStore;import android.util.Log;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.GridView;import android.widget.VideoView;public class EditGalleryView extends Activity {    Uri[] vidUris;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.videogrid);        GridView vGrid=(GridView) findViewById(R.id.vgrid);        vGrid.setAdapter(new VideoAdapter(this));        Uri uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;        Log.d(""EditGalleryView"", ""uri:""+uri);        String[] projection = {                MediaStore.Video.Media.DESCRIPTION,                MediaStore.Video.Media.DATA      };        Cursor c = this.managedQuery(uri, projection, null, null,                MediaStore.Video.Media.DATE_ADDED);                         Log.d(""EditGalleryView"", ""vids available:"" +c.getCount());                         ArrayList&lt;Uri&gt; experimentVids = new ArrayList&lt;Uri&gt;();                             if (c.getCount() != 0) {                                 c.moveToFirst();                                 experimentVids.add(Uri.parse(c.getString(1)));                                 while (c.moveToNext()) {                                         experimentVids.add(Uri.parse(c.getString(1)));                                  }                      }                             Log.d(""ClassName"", ""experimentVids.length:"" +experimentVids.size());                                                  if (experimentVids.size() != 0) {                                                    vidUris = new Uri[experimentVids.size()];                                                      for (int i = 0; i &lt; experimentVids.size(); i++) {                                                          vidUris[i] = experimentVids.get(i);                                                      }                                                      Log.d(""EditGalleryView"", ""vidUris:""+vidUris.length);                                                  }                                              }    public class VideoAdapter extends BaseAdapter {        private Context mContext;        public VideoAdapter(Context c) {            mContext = c;        }        public int getCount() {            //return mThumbIds.length;           if(vidUris!=null){            return vidUris.length;}        return 0;        }        public Object getItem(int position) {            //return null;            return position;        }        public long getItemId(int position) {            //return 0;            return position;        }        // create a new ImageView for each item referenced by the Adapter        public View getView(int position, View convertView, ViewGroup parent) {           VideoView videoView;            if (convertView == null) {  // if it's not recycled, initialize some attributes                videoView = new VideoView(mContext);                videoView.setVideoURI(vidUris[position]);                videoView.setLayoutParams(new GridView.LayoutParams(85, 85));               //videoView.setScaleType(VideoView.ScaleType.CENTER_CROP);                videoView.setPadding(8, 8, 8, 8);            } else {                videoView = (VideoView) convertView;            }          //  imageView.setImageResource(mThumbIds[position]);            return videoView;        }       /* // references to our images        private Integer[] mThumbIds = {                R.drawable.sample_2, R.drawable.sample_3,                R.drawable.sample_4, R.drawable.sample_2,                R.drawable.sample_6, R.drawable.sample_3,                R.drawable.sample_4, R.drawable.sample_1,        };*/    }   }</code></pre><hr><h2>Force close Error - ISSUE SOLVED</h2><hr><h2>App Disappearance - ISSUE SOLVED</h2><hr><h2>Array Issue - ISSUE SOLVED</h2>","390782","","1039608","","2013-03-19 16:49:52","2014-01-02 04:07:18","Videos not rendered in GridView","<android><video><sd-card>","2","2","","",""
"3265053","1","3686625","","2010-07-16 13:01:27","5","5613","<p>I have a self signed server certificate (cert.pem) and need to enable it for SSL sockets in an Android application. Ideally I'd like to package the code as .jar file and not need an external certificate file (i.e. include it into the code).</p><p>With this code I can accept all certificates, which is not what I want:</p><pre><code>SSLContext sc = SSLContext.getInstance(""TLS"");sc.init(null, new TrustManager [] { new MyTrustManager() }, new SecureRandom());</code></pre><p>Do I need to add the certificate to a custom KeyManager or the custom TrustManager? </p><p>One problem I've encountered is that Android does not accept JKS keystores (KeyStore.getDefaultType() returns ""BKS""): ""<i>java.security.KeyStoreException: KeyStore JKS implementation not found</i>""</p><p>Any ideas how to proceed would be highly appreciated!</p>","257773","","257773","","2010-07-16 13:08:35","2010-09-10 17:05:15","How to enable a self-signed certificate for SSL sockets on Android?","<android><ssl>","1","0","7","",""
"3265265","1","3265352","","2010-07-16 13:25:45","12","11747","<p>Im in the conceptualizing/design phase of building an app and i've hit a bit of a snag. Essentially i was looking for a way to embed one activity into the UI of another similar to how a TabHost/TabActivity. There would be a window at the top of the screen which would contain the other activity, and below that would be buttons and controls that are independent of the above activity and should always be visible. The user would be able to navigate from one activity to another in the window without causing any change to the below controls.</p><p>While looking into the issue i ran across ActivityGroup, which looked like it would be useful, but how would i implement it? Anyone have experience with ActivityGroup or have another idea?</p>","339428","","","","","2011-03-22 15:56:07","android: using ActivityGroup to embed activities","<android><activity><embed><embedding><android-tabhost>","2","0","9","",""
"3265290","1","3265934","","2010-07-16 13:28:07","10","5553","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2963152/android-how-to-resize-a-custom-view-programmatically"">Android: How to resize a custom view programmatically?</a>  </p></blockquote><p>What's the best way to change width/height of a widget (I mean, a UI widget, subclass of android.view.View) programmatically?</p><p>Doing something like this works, but it doesn't seem quite right:</p><pre><code>ViewGroup.LayoutParams params = mSomeView.getLayoutParams();params.height += 10;mSomeView.setLayoutParams(params);</code></pre>","238849","","238849","","2010-07-16 13:57:17","2010-07-16 19:31:37","Best way to change width/height of a widget programmatically?","<android>","2","2","1","2012-08-17 14:15:00",""
"3265510","1","","","2010-07-16 13:52:36","1","742","<p>I'm developing an HTML/Javascript mobile web application using Dashcode. Normally I wouldn't use such WYSIWYG stuff, but I've found it a very rapid development process.</p><p>Unfortunately it seems like I can't get it to run on Android's browser currently. The main display loads and all the correct data is pulled from web services, but you cannot press on anything to activate it.</p><p>I suspect that the android browser is sending different javascript events, which the Dashcode objects are not configured to pick up.</p><p>In addition, the adb logcat debugger refuses to output any log messages from the browser on the emulator, and as such I'm having a very hard time sorting this out.</p><p>So my question is: Can someone help me find out what events I need to be watching for, so I can iterate over all the touch handlers and duplicate them for the android events, or offer help in any other way on this situation?</p>","127770","","","","","2011-10-26 14:19:35","Incorrect touch events from Android's browser with Dashcode mobile projects","<javascript><android><dashcode>","3","1","2","",""
"3265518","1","3265533","","2010-07-16 13:53:14","2","3781","<p>How to get GEO Coordinates ( latitude &amp; longitude ) without using GPS in android ?Any Suggestion ?..</p>","366300","","","","","2010-07-16 13:54:01","Android get current GEO Coordinates","<android>","1","0","2","",""
"3265648","1","","","2010-07-16 14:04:23","0","2028","<p>I have a layout like :</p><pre><code>&lt;ll vertical&gt;&lt;ll horizental&gt;&lt;textview&gt;&lt;/textview&gt;&lt;textview&gt;&lt;/textview&gt;&lt;/ll&gt;&lt;ll horizental&gt;&lt;textview&gt;&lt;/textview&gt;&lt;textview&gt;&lt;/textview&gt;&lt;/ll&gt;&lt;/ll&gt;</code></pre><p>The problem is i need to display this as part of my whole screen. </p><p>i am doing</p><pre><code>    mCustomDrawableView = new CustomDrawableView((Context)this, R.drawable.mychart);    setContentView(mCustomDrawableView);</code></pre><p>and on ondraw of my custom view i am drawing the bitmaps etc. </p><p>The problem is how can I make above layout into a ibitmap, so that I can draw it in this custom drawing ?</p><p>I need to do this because in the layout, one <code>TextView</code> will have right aligned text which is difficult to do in custom drawing.</p>","384185","","244296","","2010-07-16 14:06:25","2010-07-16 15:13:20","drawing layout through canvas","<android><layout><drawing><bitmap>","1","0","","",""
"3266143","1","","","2010-07-16 14:57:56","1","4821","<p>My custom view looks as below</p><hr><pre><code>package com.mypackage;import java.util.ArrayList;import java.util.List;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.drawable.ShapeDrawable;import android.graphics.drawable.shapes.RectShape;import android.widget.ImageView;public class CustomDrawableView extends ImageView {    // private ShapeDrawable mDrawable;    public int imageid = 0;    ShapeDrawable bgDrawable = null;    List&lt;ShapeDrawable&gt; ls = new ArrayList&lt;ShapeDrawable&gt;();    final int COUNT_SUMMERY = 3;    final int VERTICAL_OFFSET = 200;    final int HORIZENTAL_OFFSET = 20;    final int HORIZENTAL_GAP = 85;    final int VERTICAL_Y_POINT = 15;    final int VERTICAL_MAX_HEIGHT = 195;    final int HORIZENTAL_WIDTH = 60;    final int percentage[] = {25, 40, 35};    public CustomDrawableView(Context context, int id) {        super(context);        imageid = id;        switch(id) {        case R.drawable.summarychart:            for(int i = 0; i &lt; COUNT_SUMMERY; i++) {                int x = HORIZENTAL_OFFSET + (HORIZENTAL_GAP * i);                int width = HORIZENTAL_WIDTH;                int height = VERTICAL_MAX_HEIGHT * percentage[i] / 100;                int y = VERTICAL_OFFSET + VERTICAL_Y_POINT + VERTICAL_MAX_HEIGHT - height;                ShapeDrawable objDrawable = new ShapeDrawable(new RectShape());                int color = 0;                 switch(i) {                case 0:                    color = Color.RED;                    break;                case 1:                    color = Color.GREEN;                    break;                case 2:                    color = Color.YELLOW;                    break;                }                objDrawable.getPaint().setColor(color);                objDrawable.setBounds(x, y, x + width, y + height);                ls.add(objDrawable);            }            break;        default:            break;        }        int x = 0;        int y = 0;        int width = 320;        int height = 480;        bgDrawable = new ShapeDrawable(new RectShape());        bgDrawable.getPaint().setColor(0xffffffff);        bgDrawable.setBounds(x, y, x + width, y + height);    }    protected void onDraw(Canvas canvas) {/*      // Draw the white background        // bgDrawable.draw(canvas);        // Draw the bitmaps        Bitmap bmp = BitmapFactory.decodeResource(getResources(), imageid);                     canvas.drawBitmap(bmp, 0, VERTICAL_OFFSET, null);*/        // Draw bars        super.onDraw(canvas);        for(int i = 0; i &lt; COUNT_SUMMERY; i++) {            ShapeDrawable objDrawable = ls.get(i);            objDrawable.draw(canvas);        }    }}</code></pre><hr><p>And in the layout I have:</p><pre><code>&lt;com.mypackage.CustomDrawableView        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:src=""@drawable/mychart"" /&gt;</code></pre><p>However I see the message:</p><blockquote>  <p>NoSuchMethodException:com.mypackage.CustomDrawableView.(Android.context.Context, Android.util.AttributeSet)</p></blockquote><p>and if I try to run it the application crashes. If I uncomment the drawable way, then it works, but other layouts are not displayed. </p><p>Any help is appreciated.</p>","384185","","12707","","2010-07-16 16:27:13","2010-07-16 16:27:13","custom image view android","<java><android><imageview>","2","0","","",""
"3266173","1","3266397","","2010-07-16 14:59:39","2","1302","<p>Is there a way to code-sign (to allow it to open only on a device with specific ID) your Android app when using ad-hoc distribution (sending app to testers or clients as a subcontractor)?</p><p>I know I can share apk file pretty easily, but what if I don't want other people to redistribute the app before it is ready? I don't want testers to be able to distribute not finished and buggy version of my app for example. Or I would like to show my client the final version of the app, but not allow them to distribute it until the payment is made.</p>","345048","","250260","","2012-01-27 16:53:47","2012-01-27 16:53:47","Android app ad-hoc distribution and code signing ( detecting  UID )","<android><code-signing><ad-hoc-distribution>","1","0","1","",""
"3266217","1","","","2010-07-16 15:06:11","1","1430","<p>I was looking into PhoneGap and Titanium framework, and I did not clearly understand how to they work, let's suppose I have already developed an app for android or iphone, can I run this app on another mobile with a different OS with PhoneGap or Titanium help?</p><p>Or I have to develop again my app with PhoneGap/Titanium framwork?In this case I have full support at all the features like thread, JSON or XML parsing and so on?Thank you</p>","386823","","","","","2011-12-16 19:48:00","phoneGap/Titanium developing","<iphone><android><cross-platform><phonegap><titanium>","4","0","","",""
"3266278","1","14155277","","2010-07-16 15:11:13","2","456","<p>I have a cross-platform C library that I need to compile for Android as a *.so file. The library consist of many .c and .h files, and it use autotools as it's buid system. (./configure &amp;&amp; make dep &amp;&amp; make). Afaik, the library does not depend on other libraries, other than libc and OpenSSL (which should be present on Andriod). </p><p>I'm trying to find the simplest (read fastest in terms or not needing to read hundreds of pages of manuals and then apply try &amp;&amp; fail brute-force approaches to complete the task) way of getting the library off my machine in source code form, and into the Android phones as a .so. The library will eventually be accessed from Java's native library interface. For development, I have both Windows and Debian machines on my desk. </p>","2266322","","","","","2013-01-04 10:24:25","Simplest way to compile an autotools based shared C library for Android?","<android><autotools><shared-libraries>","2","0","","",""
"3266355","1","","","2010-07-16 15:19:06","2","1878","<p>I'm making an application that locks the phone down after some event. Basically it just turns off the screen and the android lock screen activates. I've set the LOCK_PATTERN_ENABLED setting in order to make sure that the lock pattern is visible when the user has to unlock the device.</p><p>The problem is if the user had the lock pattern turned off, even if the lock pattern was previously enabled, the lock pattern is erased and the user must set a new one each time they enable the lock pattern. Therefore, when my application enables the lock pattern, no pattern exists and any entered pattern will unlock the phone. </p><p>My question: Is there any way to make a lock pattern permanent such that when you enable or disable 'required pattern to unlock', the pattern will stay saved? An alternate question would be is there any way to set the lock pattern? I've browsed the LockPatternUtil.java and I can see there is a saveLockPattern() function but that package is internal so I can't use it.</p>","384815","","","","","2011-09-20 00:45:13","Setting android unlock pattern from code","<android><design-patterns><lockscreen>","1","0","","",""
"3266373","1","","","2010-07-16 15:20:53","0","739","<p>I've got a script which gets data from a MySQL database through an http request, puts it into a json array, then puts each item into an itemized overlay array so that each item can be put onto a map.</p><p>Problem is, it takes > 5 minutes to load all the items into the itemized overlay, and is then dog-slow at actually running. It starts by adding then quickly, then slows down to around 5-10 seconds per item later on.</p><p>So, my question is this: how can I speed it up? Do I need to free up each overlay item after I use it (if so how), or would it be faster to put everything into a local SQLite database and use that instead?</p><p>Cheers in advance! </p><pre><code>MySQLConnect mysql = new MySQLConnect();        JSONObject jObjSite = new JSONObject();        JSONArray jArray = mysql.parseJson(); // create overlays arrayList&lt;Overlay&gt; mapOverlays = mapView.getOverlays();Drawable marker = this.getResources().getDrawable(R.drawable.icon);PzlItemizedOverlay itemizedoverlay = new PzlItemizedOverlay(marker, this);try {               for(int i=0;i&lt;jArray.length();i++){        try {        jObjSite = jArray.getJSONObject(i);    //parse address    String strAddress = jObjSite.getString(""address"");;    Integer intLat = jObjSite.getInt(""lat"");    Integer intLng = jObjSite.getInt(""lng"");    if (strAddress.length() &gt; 1 ) {        String strName = jObjSite.getString(""name"");        Log.i(""Site.added"",strName);        GeoPoint point = new GeoPoint(intLat,intLng);        OverlayItem overlayitem = new OverlayItem(point, strName, jObjSite.getString(""phone""));                 itemizedoverlay.addOverlay(overlayitem);    }    } catch (JSONException e) {        e.printStackTrace();            } catch (Exception e){    e. printStackTrace();    }    };} catch (IllegalArgumentException e) {e.printStackTrace();            }// add overlay to mapmapOverlays.add(itemizedoverlay); </code></pre>","376164","","376164","","2010-07-16 15:26:47","2010-07-16 15:26:47","Android itemized overlay Array slowing down","<java><android><json><sqlite><itemizedoverlay>","0","5","","",""
"3266446","1","3266598","","2010-07-16 15:29:43","0","443","<p>I am trying to use the android dev emualtor to create a virtual phone with the same spec as the droid.</p><p>I am using the WVGA 854 profile, High deinsity (240) and scaling the emulator screen to 3.7 inch on launch.</p><p>Problem is it seems to be emulating it like it has WVGA 854 resolution but with a medium or low density screen, as the icons are teeny tiny and the whole thing looks wrong.</p><p>Im sure the droid does have teeny tiny icons and apps, can anyone tell me where i am going wrong?</p><p>Thanks</p>","236743","","","","","2010-07-16 15:47:05","Using Android Emulator to emulate a phone with Droid spec","<android><android-emulator>","1","0","","",""
"3266451","1","","","2010-07-16 15:30:17","0","783","<p>i just followed the tutorial on tabs creation from the android dev <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">documentation</a>and my tabs didn't turn out the way they probably should. Here is a screen on how it looks for me:<img src=""http://bombhot.se/files/923947/messedtabs.png"" alt=""alt text""></p><p>and here is how it should look like:</p><p><img src=""http://developer.android.com/resources/tutorials/views/images/hello-tabwidget.png"" alt=""alt text""></p><p>I found som threads that talks about putting localisation on the tabhost and make every activity follow the same configuration but it hasn't worked for me so far. Wondering if there's something i'm missing, here is my manifest file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.koollateral.myWallet""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon""                  android:label=""@string/app_name""&gt;        &lt;activity android:name="".mywallet""                  android:label=""@string/app_name""                  android:theme=""@android:style/Theme.NoTitleBar""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;         &lt;activity android:name="".homeActivity""                    android:label=""@string/app_name""                   android:theme=""@android:style/Theme.NoTitleBar""&gt;                    &lt;/activity&gt;            &lt;activity android:name="".calendarActivity""                    android:label=""@string/app_name""                   android:theme=""@android:style/Theme.NoTitleBar""&gt;                    &lt;/activity&gt;      &lt;/application&gt;&lt;/manifest&gt;</code></pre>","267822","","8562","","2010-07-16 15:33:07","2010-07-20 16:11:39","Android TabHost appearance not as expected","<android><android-manifest>","3","1","","",""
"3266452","1","","","2010-07-16 15:30:32","0","647","<p>Essentially what I will be writing is a quiz type application. Basically there will be a paragraph or so to read, with one or more choices below. There will be several criteria to decide what the next question will be, ie. If it was a hard question and get it wrong, the next is easier, or maybe less choices, etc.</p><p>Where would I put the logic to determine what the next question would be? Also, once I have what the next question would be, how do I update both the text part, as well as the new choices?</p>","386680","","1228","","2013-09-09 18:18:21","2013-09-09 18:18:21","how to move from question to question for a quiz app","<android>","2","0","1","",""
"3266856","1","9804859","","2010-07-16 16:12:34","7","1288","<p>Is there any way to tell linkify not to underline my links?  I am already using <code>textView.setLinkTextColor(stateList)</code> to change the color, but I'd like to remove the underline that is inserts on the link.  </p><p>Is this even possible?</p>","372405","","3800","","2011-09-01 20:05:48","2012-10-28 15:00:14","How do I tell linkify not to underline links?","<android><underline><linkify>","1","2","","",""
"3266938","1","3267319","","2010-07-16 16:21:48","0","348","<p>I am looking for help/resource that will help me in bringing up a image as follows in android view.</p><ol><li><p>Image looks like x-y axis graph, with sawtooth waves along x-axis, this is a static image developed using certain tool.</p></li><li><p>I need help to make a line move, parallel to y-axis (red in color) that waits at origin(0,0) and starts moving along x axis until the sawtooth wave ends.</p></li></ol><p>3.If you imagine this as image, there is a wave on x axis and a red line that moves across wave, which is the noise generated in android mobile.</p><p>Concern: How to overlap a static image (wave+x-y axis) with a dynamic image (red line) and make it move as the code runs. There is a timer that will generate the noise (mute/unmute microphone) and user gets to see it in screen when these interference occurs. I thank you for spending time to read my post. Please let me know if there are any redundant info , I will edit my question. </p>","357349","","357349","","2010-07-16 16:27:42","2010-07-16 17:14:41","Android graphics , dynamic view","<android>","1","0","","",""
"3267060","1","","","2010-07-16 16:37:46","0","3255","<p>I am just getting set up to do Android app dev using Eclipse 3.6 on Windows, and am following the instuctions at developer.android.com/sdk/adding-components.html.</p><p>When I open the repository at <a href=""http://dl-ssl.google.com/android/repository/repository.xml"" rel=""nofollow"">http://dl-ssl.google.com/android/repository/repository.xml</a>, only 7 packages are found: 6 are ""Google APIs"" and 1 is the ""Usb Driver package"".</p><p>There are no ""SDK Platforms Android"" listed! Therefore, I can't install a platform.</p><p>When I look at the XML in a browser, it looks like there are platforms in it, but the ""Android SDK and AVD Manager"" is not displaying them.</p>","394106","","","","","2011-06-08 18:27:27","Android SDK and AVD Manager not listing SDK Platforms","<android>","2","0","","",""
"3267133","1","3481462","","2010-07-16 16:47:02","1","2730","<p>I am trying to change the heap size of the emulator, to make sure that my app doesn't run out of memory with 16 mb available? How can i change the heap size on the emulator?I run the emulator through Eclipe.</p>","242769","","","","","2010-08-14 00:27:14","android emulator ==> change heapSize?","<android><android-emulator><heap-memory>","1","0","1","",""
"3267161","1","3267354","","2010-07-16 16:50:46","5","7285","<p>Is there an easy way to be notified when USB or AC power is connected to an Android phone?</p>","289182","","","","","2013-06-14 06:13:50","How to detect power connected state?","<android>","3","0","","",""
"3267180","1","","","2010-07-16 16:52:52","0","290","<p>Theres <b>Activity A</b> with a ListView using <code>SimpleCursorAdapter</code> and for each row, theres a ImageView that should be displayed, according to a column result number in SQLite. Then theres <b>Activity B</b> which is a Activity with the <code>Theme.Dialog</code>. When i open up the <b>Activity B</b> (via startActivityForResult) i have some items, selecting one item, causes the <b>Activity B</b> to be finished. So, when i get back to <b>Activity A</b>, i can see through the LogCat that bindView is being called but not newView, causing the ImageView to not be refreshed with the new image.</p><p>I've tried calling notifyDataSetChanged() in <code>onResume()</code> and <code>onActivityResult()</code>, since both are called when i get back from <b>Activity B</b> but nothing happens!</p><p>So, theres a <b>Activity C</b> which is a regular Activity that does the same thing as <b>Activity B</b>, but its NOT a <code>Theme.Dialog</code> Activity, and when i get back from <b>C</b> to <b>A</b>, newView is being called and thus the ImageView is being refreshed! :D</p><p>What should i do?</p>","2443607","","210916","","2011-12-15 14:20:00","2011-12-15 14:20:00","Adapter & Theme.Dialog & refreshing content","<android><listview><adapter><imageview>","1","3","","",""
"3267216","1","3267401","","2010-07-16 16:58:56","9","10367","<p>If I have an apk can I remove the current signing and some how resign it with a different .keystore file and still have the application install?</p><p><strong>Update</strong>: I managed to get it to work with Jorgesys' solution and where I messed up before was that I unzipped the .apk then rezipped it after removing the META-INF folder and changed the file extension back into .apk. What I should have done is simply opened it with winzip and delete the folder inside of winzip.</p>","340","","340","","2010-07-21 15:40:01","2014-02-14 15:20:15","Can I resign an .apk with a different certificate than what it came with?","<android><signing><apk>","4","0","8","",""
"3267362","1","","","2010-07-16 17:21:40","1","595","<p>How can I intercept menu button long press, in order to launch my app ?Is there any configuration in manifest.xml able to do this ?</p><p>Thank you.</p><p>A.L.</p>","348175","","","","","2011-01-26 08:14:46","Long press menu button (for Samsung Galaxy S i9000)","<android>","0","2","1","",""
"3267390","1","","","2010-07-16 17:25:41","0","372","<p>I don't see the point of using a local service in Android. If I want to do backgound stuff, I can create a thread and use Handlers.</p><p>Creating a local service is a big headache, you have to mess with Binders, worry about the start/stop/bind/unbind lifecycle, etc. </p><p>What does a local service get me that a thread doesn't ?</p>","3265981","","","","","2010-07-16 19:06:34","Android local services : are they that useful?","<android><service><multithreading><local>","2","0","","",""
"3267413","1","","","2010-07-16 17:29:18","1","878","<p>I followed the online directions for building HelloAndroid and HelloAndroidTest in Eclipse. The test runs, the logcat shows the correct results going to stdout, but the JUnit testrunner window in Eclipse is silent - nothing.</p><p>I am running the test on a Nexus One with Android 2.2 installed via OTA. I've been unable to find any mention of this problem.</p><p>I'm wondering if the plumbing is broken in this latest release, or if running on a phone is not supported in terms of the JUnit view. I'll try the emulator and see if that makes a difference.</p><p>Thanks.</p>","394152","","","","","2011-12-08 00:52:51","Android JUnit has no output in Eclipse JUnit view","<android><eclipse><junit>","2","0","","",""
"3267468","1","3267473","","2010-07-16 17:39:04","0","128","<p>I created a new project from an example provided in the SDK, using:</p><blockquote>  <p>Eclipse IDE for Java Developers</p>    <p>Version: Helios Release Build id:  20100617-1415</p></blockquote><p>The application builds and runs successfully but doesn't show what it should be showing. This is what it is showing:</p><p><a href=""http://www.flickr.com/photos/51941830@N07/4799160565/"" rel=""nofollow"">screenshot of improperly shown UI</a></p>","216743","","","","","2010-07-16 17:54:08","Why is my example Android application not showing properly?","<android>","3","0","","",""
"3267517","1","3268348","","2010-07-16 17:46:39","2","1296","<p>I have a ListActivty and I overload the onListItemClick(ListView listView, View view, int position, long id) in my List Activity.  </p><p>My question is why onListItemClick() not getting called back (i have breakpoint in my debugger) when I have an ImageButton in my list item view (the one view created by my list adaptor from cursor)?</p><p>Thank you.</p>","286802","","","","","2013-02-27 07:24:47","Question about onListItemClick in ListActivity","<android>","1","2","","",""
"3267554","1","3267839","","2010-07-16 17:50:43","1","2564","<p>So here's some code on <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/16a2216b39513674"" rel=""nofollow"" title=""http://groups.google.com/group/android-developers/browse_thread/thread/16a2216b39513674"">http://groups.google.com/group/android-developers/browse_thread/thread/16a2216b39513674</a> in which the poster writes that he's shortened ideas into a single threaded app.  A respondent below his post says, essentially, that's great, nice work, but there are benefits to multithreading so things don't interfere with other stuff on your handset.</p><p>My question is:  Evidently, the original poster reduced, distilled ideas from multithreaded examples he saw in order to make them easier to read, posted them, cool.  But what would a multithreaded version of the below code look like?</p><p>Would Runnable be on a separate thread?  Or the whole callback?  Or not those but something else?  Anything else?</p><p>Would it be even better if it were run as a service, and then a Runnable thread spawned from the service?  Is a service considered a separate thread from the UI?</p><p>As you can tell this question is about the basics of multithreading for Android.  Thanks for any info.</p><pre><code>public class Something extends Activity {     @Override    protected void onCreate(Bundle saved) {       super.onResume();       final EGL10 egl = (EGL10) EGLContext.getEGL();       final EGLDisplay eglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);       int[] version = new int[2];       egl.eglInitialize(eglDisplay, version);       int[] configSpec = {           // EGL10.EGL_DEPTH_SIZE, 8,           EGL10.EGL_NONE       };       final EGLConfig[] config = new EGLConfig[1];       int num_configs[] = new int[1];       egl.eglChooseConfig(eglDisplay, configSpec, config, 1, num_configs);       final EGLContext eglContext = egl.eglCreateContext(eglDisplay, config[0], EGL10.EGL_NO_CONTEXT, null);       // Setting up layouts and views       SurfaceView view = new SurfaceView(this);       setContentView(view);       SurfaceHolder holder = view.getHolder();       holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);       final GL10 gl = (GL10) eglContext.getGL();       final Handler handler = new Handler();       holder.addCallback(new Callback() {        private EGLSurface surface;         private Runnable painter;         @Override         public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {           // initialize GL projection and other stuff           // gl.glMatrixMode(GL10.GL_PROJECTION);           // gl.glFrustumf(left, right, bottom, top, zNear, zFar);           // ...           painter = new Runnable() {             @Override             public void run() {               drawFrame(gl);               egl.eglSwapBuffers(eglDisplay, surface);               handler.post(this);             }           };           handler.post(painter);         }         @Override         public void surfaceCreated(SurfaceHolder holder) {           surface = egl.eglCreateWindowSurface(eglDisplay, config[0], holder, null);           egl.eglMakeCurrent(eglDisplay, surface, surface, eglContext);         }         @Override         public void surfaceDestroyed(SurfaceHolder holder) {           handler.removeCallbacks(painter);         }       });    }     private void drawFrame(GL10 gl) {       // Frame drawing...       long t = System.currentTimeMillis() % 10000;       gl.glClearColor(t / (float) 10000, t / (float) 10000 ,1 , 1);       gl.glClear(GL10.GL_COLOR_BUFFER_BIT);     } }</code></pre>","225626","","225626","","2010-07-16 18:00:27","2010-07-16 18:32:58","Multithreading this sample code:","<android>","1","0","","",""
"3267655","1","","","2010-07-16 18:02:24","3","415","<p>Is there a way to retrieve the the amount of time since the battery has been charged?</p><p>It doesn't appear like there is a way to do so with <code>BatteryManager</code>, but they show it to you in the settings.  I see it here <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Settings.git;a=blob;f=src/com/android/settings/BatteryInfo.java;h=1cbe47f988a7478c9fe65c10307448fbf7290dd7;hb=HEAD"" rel=""nofollow"">source</a> , but it doesn't appear like there is a way to grab it. Any help?</p>","274365","","244296","","2010-07-16 18:14:04","2010-08-18 13:17:07","retreive battery uptime for android","<android><battery>","1","2","","",""
"3268020","1","3268440","","2010-07-16 19:00:32","2","10416","<p>I have to do Login Authentication to post the tweets. I got the <code>Jtwitter.jar</code> and <code>SignPost.jar</code> file from <a href=""http://www.winterwell.com/software/jtwitter.php"" rel=""nofollow"">this link</a>. As far as i searched, the xAuth Authendication is more efficient. But i did not get any simple tutorial or piece of code for Login Authendication yet. I found <a href=""http://www.mobisoftinfotech.com/blog/android/1089/"" rel=""nofollow"">this Article</a> and used this code. thats get <code>NullPointerException</code>. </p><p>I created the customer key and Secret key also used the code where  got the jar site. That gets <code>Verification Error</code>. </p><p>Please Share some idea or steps to follow to verify the username and password of the user?</p><p>Edit:</p><p>I want to post to from the <code>user's account</code>. what do you prefer to use the Api whether <code>Jtwitter</code> or <code>Oauth</code>? and Tell me <code>How-to</code> or <code>Related Articles</code> ?</p>","267269","","267269","","2010-07-17 10:31:59","2010-07-23 07:36:56","Twitter Login Authentication in Android?","<android><twitter>","2","0","2","",""
"3268055","1","3268321","","2010-07-16 19:05:43","31","28930","<p>I selected API minimum level 1.5 for my android app and I'm just about to integrate gestures in to it which came in 1.6. Is there a way in Eclipse to change the minimum level from 1.5 to 1.6 halfway through building an app?</p><p>Many thanks</p>","300037","","","","","2014-03-05 19:01:06","Can you change min. API level for your Android app in Eclipse?","<android><eclipse><api>","4","0","2","",""
"3268068","1","","","2010-07-16 19:07:17","26","10565","<p>I spent sometime yesterday struggling with android layouts (... or better custom layouts). For general purposes forms the out of the box layouts that androids offers are more than enough. But when it comes to more complex use cases (let's take the example of the carousel with overlapping of images that are laid on an elliptical path) I quickly realized the limitation and complexity of android APIs. This was my approach:</p><ol><li><p>Using out of the box layouts is not an option (to many unmanageable issues to handle) , however the need of graphical objects that can be added to a container (let's say ImageView for instance) is necessary in order to easily perform translation, rotations, etc... through built in animation.</p></li><li><p>The AbsoluteLayout seems the most reasonable layout available for the purpose. It allows to add derived view objects and write your own algorithm to position them. But... it is deprecated. That's a shame! Who wants to use deprecated apis ?</p></li><li><p>The next most reasonable thing to do is to write your own layout sub-classing the mystic ViewGroup.. and here is where the all thing fall apart (at least it did for me). It is complicated, misleading and tricky to do it  as much as it is to write your own custom layout for swing (I actually did it years ago, and I remember to be simpler).</p></li><li><p>Then (driven by desperation) sub-classing a View, overriding the onDraw method and drawing directly on a Canvas seems the only straightforward solution (although this reminds me the days of java2D... long hours spent to achieve the high 1% of your project), but then you are giving up the handy built in animation APIs that you wish to apply to the graphics drawn on the canvas.</p></li></ol><p>The conclusion is that, unless I have missed something, the current android architecture is a bit far from the programming paradigm offered by some other UI technologies such as flash or javafx (I can easily implement the above described carousel in javafx and flash).The reason is that, in javafx for instance, the Scene object (comparable to the View concept of android) offers by default an absolute layout. You can then apply other out of the box layouts if you want to. But for scenarios where a custom layout is necessary you don't have to do anything.</p><p>I am a little bit surprise that this option is not available in android, after all is a quite common need that is addressed by other ui technologies. I still like to think there is a 5th option in android that I haven't found.Any expert out there that could provide some information on the topic?</p><p>Thanks.</p>","394113","","844882","","2012-05-20 05:41:47","2012-12-20 22:08:39","Android custom layout","<android><android-layout>","4","1","8","",""
"3268163","1","3268254","","2010-07-16 19:23:07","4","1803","<p>I am developing an Android app which needs to poll a specific webpage in time intervals. I've got it to the point where it does indeed poll the page on a specific interval, and that interval is specified in a SharedPreference which can be changed by the user in the settings page of the app. But complications arise when network connectivity is flaky.</p><p>For example, how do I ensure that the Service ""wakes up"" the network adapter and gives it ample time to connect before polling the page, in the case that the phone was sleeping to save power? This polling action can happen as little as once every 24 hours, so I don't want to miss one action just because the network was out (but turned on a few seconds, minutes, or even hours later).</p><p>Or there are times when the web service doesn't respond, or DNS doesn't respond, or what have you, and for any reason it doesn't get a response even though the phone is technically connected. What sort of rule do I put in place to make this retry later, so that I'm not retrying repeatedly when the user specifically turned off their internet but I'm retrying soon enough that if it was just a hiccup, the data can be received soon after the first try?</p><p>Are there any examples for this type of situation? What is the logic to best handle this?</p>","47493","","","","","2011-03-16 18:50:18","Tips on making an Android Service which polls a web service handle bad connectivity","<android>","2","0","3","",""
"3268363","1","3293005","","2010-07-16 19:49:59","0","699","<p>I am following very closely to the sample codes in the resources for TicTacToeLib as well as an example of how to display a bitmap in a book titled Android Application Development. I am doing all the same things they are doing, the only difference is I am using a SurfaceView instead of a view.  Can anyone tell me what I am doing wrong? The end goal is to display the preview image of the camera manually as well as display an image over top of it.</p><p>Sorry I forgot to include what the problem was. The onDraw method is not being called ever. and I was under the impression it should be called by the invalidate method. Secondly the lockCanvas() method is returning a NULL canvas. Even after I fixed the code to not use the PUSH_BUFFER constant from SurfaceHolder (I have edited the code for this correction).</p><pre><code>package com.test.combine;import android.content.res.XmlResourceParser;import android.app.Activity;import android.content.Context;import android.hardware.Camera;import android.hardware.Camera.Size;import android.os.Bundle;import android.view.MotionEvent;import android.view.View;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.view.Window;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Paint;import android.util.AttributeSet;import java.io.IOException;import android.util.Log;import java.util.List;public class CombineTestActivity extends Activity{private Preview mPreview;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Hide the window title.    requestWindowFeature(Window.FEATURE_NO_TITLE);    // Create our Preview view and set it as the content of our activity.    mPreview = new Preview(this);    setContentView(mPreview);} }// ----------------------------------------------------------------------class Preview extends SurfaceView implements SurfaceHolder.Callback {private SurfaceHolder mHolder;private Camera mCamera;private Paint mPaint;private Canvas canvas;private Bitmap currentprev;private Picture mPicture;private Camera.PreviewCallback mPrevCallback = new Camera.PreviewCallback() {        public void onPreviewFrame( byte[] data, Camera Cam ) {                Log.d(""CombineTestActivity"", ""Preview registered"");                Log.d(""CombineTestActivity"", ""Data length = ""                         + data.length );               // currentprev = BitmapFactory.decodeByteArray( data, 0,                //       data.length );               currentprev = BitmapFactory.decodeResource( getResources(),                   R.drawable.creature00 );               if( currentprev == null )                   Log.d(""CombineTestActivity"", ""currentprev is null"" );                Log.d(""CombineTestActivity"", ""Preview Finished"" );                invalidate();        }};private OnTouchListener mCorkyListener = new OnTouchListener() {        public boolean onTouch(View v, MotionEvent me) {                Log.d(""CombineTestActivity"", ""touch registered"" );                mCamera.takePicture( null, null, mPicCallback );                return false;        }};private Camera.PictureCallback mPicCallback = new Camera.PictureCallback() {        public void onPictureTaken( byte[] data, Camera mCamera ) {                Log.d(""CombineTestActivity"", ""picture method run"" );        }};Preview(Context context) {    super(context);    // Install a SurfaceHolder.Callback so we get notified when the    // underlying surface is created and destroyed.mPicture = new Picture();    mHolder = getHolder();    mHolder.addCallback(this);    mHolder.setType(SurfaceHolder.SURFACE_TYPE_NORMAL);    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);    canvas = mHolder.lockCanvas();    if(canvas==null)        Log.d( ""CombineTestActivity"", ""canvas is null in constructor"");this.setOnTouchListener( mCorkyListener );invalidate();}@Overrideprotected void onDraw( Canvas mCanvas ) {        if( mCanvas == null )                Log.e(""CombineTestActivity"", ""canvas is null"" );        if( currentprev == null ) {                Log.e(""CombineTestActivity"", ""currentprev is null"" );                return;        }        mCanvas.drawBitmap( currentprev, 0.0f, 0.0f, mPaint );        Log.d(""CombineTestActivity"", ""exiting onDraw"" );}public void surfaceCreated(SurfaceHolder holder) {    // The Surface has been created, acquire the camera and tell it where    // to draw.    mCamera = Camera.open();    mCamera.setPreviewCallback( mPrevCallback );    /*            try {       mCamera.setPreviewDisplay(holder);    } catch (IOException exception) {        mCamera.release();        mCamera = null;        // TODO: add more exception handling logic here    }    */      }public void surfaceDestroyed(SurfaceHolder holder) {    // Surface will be destroyed when we return, so stop the preview.    // Because the CameraDevice object is not a shared resource, it's very    // important to release it when the activity is paused.    mCamera.stopPreview();   mCamera.release();    mCamera = null;}private Size getOptimalPreviewSize(List&lt;Size&gt; sizes, int w, int h) {    final double ASPECT_TOLERANCE = 0.05;    double targetRatio = (double) w / h;    if (sizes == null) return null;    Size optimalSize = null;    double minDiff = Double.MAX_VALUE;    int targetHeight = h;    // Try to find an size match aspect ratio and size    for (Size size : sizes) {        double ratio = (double) size.width / size.height;        if (Math.abs(ratio - targetRatio) &gt; ASPECT_TOLERANCE) continue;        if (Math.abs(size.height - targetHeight) &lt; minDiff) {            optimalSize = size;            minDiff = Math.abs(size.height - targetHeight);        }    }    // Cannot find the one match the aspect ratio, ignore the requirement    if (optimalSize == null) {        minDiff = Double.MAX_VALUE;        for (Size size : sizes) {            if (Math.abs(size.height - targetHeight) &lt; minDiff) {                optimalSize = size;                minDiff = Math.abs(size.height - targetHeight);            }        }    }    return optimalSize;}public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {    // Now that the size is known, set up the camera parameters and begin    // the preview.    Camera.Parameters parameters = mCamera.getParameters();    List&lt;Size&gt; sizes = parameters.getSupportedPreviewSizes();    if( sizes.isEmpty() )        Log.d( ""CameraTestActivity"", ""sizes null"");    else        Log.d( ""CameraTestActivity"", ""sizes not null"");     Size optimalSize = getOptimalPreviewSize(sizes, w, h);    if( optimalSize == null )        Log.d( ""CameraTestActivity"", ""optimalSize null"");    else        Log.d( ""CameraTestActivity"", ""optimalSize not null"");    parameters.setPreviewSize(optimalSize.width, optimalSize.height);if( parameters == null )    Log.d( ""CameraTestActivity"", ""parameters null"" );else    Log.d( ""CameraTestActivity"", ""parameters not null"" );    mCamera.setParameters(parameters);    mCamera.startPreview();}}</code></pre>","379220","","379220","","2010-07-19 15:40:37","2010-07-20 18:15:19","I can't figure out why this code does not display an Image in Android","<android><image><bitmap>","1","2","","",""
"3268459","1","3268551","","2010-07-16 20:01:59","0","1648","<p>I have two Image Views that are two football helmets facing each other.  I'm wanting to center them and then offset them left/right a little to provide a little space between them.  Here is one of the image view's xml at the moment.</p><pre><code>&lt;ImageView   android:id=""@+id/hometeam""   android:scaleType=""centerInside""   android:layout_width=""fill_parent""   android:layout_height=""70px""   android:layout_y=""90px""   android:layout_marginLeft=""25px""&gt;</code></pre><p>I was trying to offset it using [android:layout_marginLeft=""25px""] however I'm guessing that's not working for me because of the [android:scaleType=""centerInside""]. Anyone know a solution? Thanks!</p>","394241","","","","","2010-07-16 20:15:50","How to center an ImageView and then offset it to the left or right?","<android><xml><layout><imageview>","1","1","","",""
"3268649","1","","","2010-07-16 20:31:43","1","431","<p>I finally got everything in my app done, but now whenever I exit it with anything except the Home button, it flashes a force close screen, and then it goes away. I know its not that big of a deal, but I really want that to stop happening, I finally got a logcat on it and it said there was no super.onStop(), so I added that, then it force closed again giving me a nullPointer, </p><p>I am closing the application by using moveTaskToBack(true), and any time I use it that is what it does, gives me a nullpointer in my onDraw method. I'm not sure what other info is needed, so let me know, thanks in advance for any help</p><pre><code>public void onDraw(Canvas canvas){        if(checkState == -9){            canvas.drawColor(Color.BLACK);            canvas.drawBitmap(bG, 0, 0, paint);            canvas.drawBitmap(title, display.getWidth()/2 - title.getWidth()/2, 10, paint);            canvas.drawBitmap(start, display.getWidth()/2 - start.getWidth()/2, 40 + title.getHeight(), paint);            canvas.drawBitmap(instructions, display.getWidth()/2 - instructions.getWidth()/2, 80 + title.getHeight() + start.getHeight(), paint);            canvas.drawBitmap(exit, display.getWidth()/2 - exit.getWidth()/2, 120 + title.getHeight() + start.getHeight() + exit.getHeight(), paint);            canvas.drawBitmap(highScore, 0, display.getHeight() - highScore.getHeight(), paint);            String high = highLevel + """";            for(int i = 0; i &lt; high.length(); i++){                levelOnMenu = high.charAt(i) + """";                levelPiece = Integer.parseInt(levelOnMenu);                int placeX = highScore.getWidth() + levelNumber.getWidth()/2 ;                if(high.length() == 1){                }                else if(high.length() == 2){                    if(i == 0){                    }                    else{                        placeX = placeX + levelNumber.getWidth();                    }                }</code></pre><p>it is telling me that the first part of the onDraw is null, the drawColor...which doesn't make a lot of sense to me</p><p>Here is where I use moveTaskToBack()</p><pre><code>if(checkState == -11){            if(event.getAction() == MotionEvent.ACTION_UP){                if(x &gt;= display.getWidth()/2 - pauseMenu.getWidth()/2 &amp;&amp; x &lt;= display.getWidth()/2 + pauseMenu.getWidth()/2 &amp;&amp; y &gt;=  display.getHeight()/2 - pauseMenu.getHeight()/2 &amp;&amp; y &lt;=  display.getHeight()/2 - pauseMenu.getHeight()/2 + pauseMenu.getHeight()/3){                    checkState = previousState;                }                if(x &gt;= display.getWidth()/2 - pauseMenu.getWidth()/2 &amp;&amp; x &lt;= display.getWidth()/2 + pauseMenu.getWidth()/2 &amp;&amp; y &gt;=  display.getHeight()/2 - pauseMenu.getHeight()/2 + pauseMenu.getHeight()/3 &amp;&amp; y &lt;=  display.getHeight()/2 - pauseMenu.getHeight()/2 + 2*(pauseMenu.getHeight()/3)){                    if(sound){                        sound = false;                    }                    else{                        sound = true;                    }                }                if(x &gt;= display.getWidth()/2 - pauseMenu.getWidth()/2 &amp;&amp; x &lt;= display.getWidth()/2 + pauseMenu.getWidth()/2 &amp;&amp; y &gt;=  display.getHeight()/2 - pauseMenu.getHeight()/2 + 2*(pauseMenu.getHeight()/3) &amp;&amp; y &lt;=  display.getHeight()/2 - pauseMenu.getHeight()/2 + pauseMenu.getHeight()){                    moveTaskToBack(true);                }            }        }</code></pre>","390927","","390927","","2010-07-19 23:34:20","2012-02-23 23:31:16","Force Close because of onStop()","<java><android>","1","8","","",""
"3268962","1","3283118","","2010-07-16 21:25:25","6","12778","<p>I just got burned by a widget.  I could see the cause of the problem, but I could not determine why or its solution.  My widget was issuing a search (SearchManager) and the activity launched a search dialog, but when it called-back to my widget, it created another reference to the widget (i.e., the thread-id was the same, but the widget-id changed from 65 to 0).</p><p>This led me to believe that a new instance was getting created and I searched the documentation for settings that would apply to the problem.  Eventually, I stumbled upon the <code>android:launchMode=""singleTop""</code> and as soon as I set it in the AndroidManifest, viola!  My widget worked.</p><p>This took me the better part of two days to debug.</p><p>Are there any other situations or is there a more technically-correct answer to my problem?</p>","157804","","997708","","2012-11-18 15:14:53","2012-11-18 15:14:53","When is it necessary to use singleTop launchMode in an android widget or application?","<android><android-widget><android-searchmanager>","1","3","1","",""
"3269105","1","3269485","","2010-07-16 21:49:15","0","601","<p>I'm wondering if anyone knows of any method for taking a bunch of text and displaying it in a ScrollView that has multiple columns that scroll horizontally.</p><p>I'm trying to create an experience very similar to Aldiko or the Kindle app in which the user can tap left or right to go to the previous or next page of text.</p><p>Hope this makes sense, thanks for reading,</p><p>Tony</p>","215056","","","","","2010-07-16 23:27:05","Android: Creating a horizontal ScrollView with columns of text","<android><layout>","1","0","1","",""
"3269176","1","3269187","","2010-07-16 22:03:13","0","497","<p>I'm trying to understand remote services at the moment and everything works fine, i can start the service and know how to communicate with it through the AIDL-interface. My problem is that the service seems to still run in the same process like the activity it was started from, because the activity crashes too, if there is an error thrown in the Service.</p><p>I set the service process to remote (   android:process="":remote"" ) so what am i doing wrong? Or what do i have to do to unbind the service-process completely from the activity-process?</p>","165106","","","","","2010-07-16 22:06:56","Activity crashes when remote service crashes","<android><service><crash>","1","0","","",""
"3269199","1","4035654","","2010-07-16 22:10:28","5","5302","<p>I've created a custom view in an SQLite database for an Android application.<br>I'm using Sqliteman on Ubuntu to test my SQL statements before I put them in my app.<br>I'm trying to do a simple select statement on my view.<br>The select statement works fine in SQLiteman but when I put the same statement in my code it throws an error.  </p><p>The statement:</p><pre><code>select * from item_view where parent_item_id = 0;</code></pre><p>The view (converted to Java as a String):</p><pre><code>""create view if not exists item_view as select "" +    ""item._id, item.status, item.name, item.position, "" +    ""item.parent_item_id, item.note_id, item.other_id, "" +     ""note.contents, other.priority "" +""from item, note, other where item.note_id = note._id and item.other_id = other._id""</code></pre><p>The error:</p><pre><code>07-16 14:21:15.153: ERROR/AndroidRuntime(5054): Caused by: android.database.sqlite.SQLiteException: no such column: parent_item_id: , while compiling: SELECT * FROM item_view WHERE parent_item_id = 0</code></pre><p>I first tried calling the field item.parent_item_id in my select statement, but that didn't work.<br>Then I pulled the db and opened it with Sqliteman.<br>The fields were listed as they were in the original tables (_id, status, name, etc.)<br>So I ran the SQL above in Sqliteman and was able to retrieve the appropriate data no problem but I can't get it to work in my app either way.<br>I also noticed that dropping the view as a DROP TABLE command worked in SQLiteman but not in my app.<br>I'm wondering if I'm maybe missing some other VIEW specific functionality.<br>I didn't see any in either the android documentation or any SQL documentation though.  </p><p>Technically I could just do this with a more complex SQL call using the original tables, but  all my tables follow certain guidelines so that I can dynamically generate SQL calls. I'd like to have the view tables work to keep my code uniform and always reusing the same calls to avoid maintenance and other buggy issues from duplicate code.</p>","376766","","","","","2010-10-27 17:25:10","SQLite for Android custom table view (SQL VIEW, not Android view) discrepancy?","<sql><android><sqlite>","1","0","3","",""
"3269257","1","3269465","","2010-07-16 22:22:50","0","338","<p>How can I create a dialog with each dialog item being a label and then a checkbox?</p><p>And when user click 'ok' to the dialog, I can tell in my code which on of the dialog item has been checked?</p><p>Thank you.</p>","286802","","","","","2010-07-16 23:19:44","How can I create a dialog with each dialog item being a label and then a checkbox?","<android>","2","0","","",""
"3269419","1","","","2010-07-16 23:00:46","10","1553","<p>I have an Android app which I distribute to several different market providers; the app is functionally the same for each, but requires certain distinct configuration parameters.  Ideally I would like to produce all the individual APKs in one build step.  Is there an ""official"" way to achieve this?</p><p>I am considering an approach in which I have a template file in the project structure, and at build time use ant to interpolate values into an output file such as res/xml/config.xml.</p><p>Thanks in advance!</p>","4328","","","","","2011-08-18 10:40:45","How do you inject build-specific configuration into an APK?","<android><configuration><build>","4","0","5","",""
"3269433","1","3272143","","2010-07-16 23:08:41","0","707","<p>when i try to animate custom View (created in java code), there is no effect, animation doesn't start. This is how i do that:</p><pre><code>    final Animation animation = AnimationUtils.loadAnimation(this, R.anim.animation);    final CustomView background = new CustomView(this);    background.setBackgroundResource(R.drawable.bg);    background.startAnimation(animation);</code></pre><p>CustomView extends ImageView.</p><p>This code doesn't start animation, i tried also with ImageView, and also doesn't work.</p><p>Animation works only when i am getting View from findViewById(id).</p><p>Here is animation code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""    android:shareInterpolator=""false""    &gt;    &lt;alpha        android:fromAlpha=""0.0""        android:toAlpha=""1.0""        android:duration=""1000""        /&gt;    &lt;alpha        android:fromAlpha=""1.0""        android:toAlpha=""1.0""        android:startOffset=""1000""        android:duration=""6000""        /&gt;    &lt;alpha        android:fromAlpha=""1.0""        android:toAlpha=""0.0""        android:startOffset=""7000""        android:duration=""1000""        /&gt;&lt;/set&gt;</code></pre>","367786","","367786","","2010-07-17 00:20:27","2011-12-22 22:41:35","Animating custom View class","<android>","1","2","","",""
"3269490","1","4029599","","2010-07-16 23:29:23","2","445","<p>I'm applying an AlphaAnimation to a Button.  The animation is extremely simple.</p><pre><code>&lt;alpha xmlns:android=""http://schemas.android.com/apk/res/android""       android:interpolator=""@android:anim/accelerate_decelerate_interpolator""       android:fromAlpha=""1.0"" android:toAlpha=""0.0"" android:duration=""500""/&gt;</code></pre><p>On the emulator, the button fades out nicely with no discernable artifacts.  On actual devices (Nexus One &amp; Motorola Droid), there is a noticeable black artifact from the actual frame of the button.</p><p>Is there any way to avoid this?  It looks like crap.</p><p>Emulator:</p><p><img src=""http://img.skitch.com/20100716-e66fgyg4pdyium15cu4e4ijr9c.jpg"" alt=""Emulator""></p><p>Device:</p><p><img src=""http://img.skitch.com/20100716-fhs149r5ftkm3pte1sajkfnabh.jpg"" alt=""alt text""></p><p>(Images have been doctored because it's hard to capture the same fade state during an animation, but that's exactly what it looks like)</p>","205192","","","","","2010-10-27 02:38:54","Android AlphaAnimation causes black box","<android><animation>","1","0","3","",""
"3269701","1","3269775","","2010-07-17 00:36:31","3","1006","<p>I'm trying to just make an activity that simply loads a random image when it's loaded. It compiles fine and loads fine. But simply doesn't work. Any ideas what i'm doing wrong? It's making my eyes bleed.</p><p>------------Here my RandomImage Class --------------------------------------</p><pre><code>package com.package.name; import java.util.Random; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View.OnClickListener; public class RandomImage extends Activity implements OnClickListener{     private static final Random rgenerator = new Random();     Integer [] mImageIds = {             R.drawable.pictureone,             R.drawable.picturetwo,             R.drawable.picturethree,             }; @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.randomimage);     Integer q = mImageIds[rgenerator.nextInt(mImageIds.length)];     ImageView iv = (ImageView) findViewById(R.id.imageviewyeah);     iv.setTag(q);     View nextButton = findViewById(R.id.next_image_button);     nextButton.setOnClickListener(this); }     @Override     public void onClick(View v) {     switch (v.getId()) {     case R.id.next_image_button:         Intent i = new Intent(this, RandomImage.class);         startActivity(i);         break;     } }     @Override         public boolean onCreateOptionsMenu (Menu menu) {                 super.onCreateOptionsMenu(menu);                 MenuInflater inflater = getMenuInflater();                 inflater.inflate(R.menu.menu3, menu);                 return true;         } @Override public boolean onOptionsItemSelected (MenuItem item) {                 switch (item.getItemId()) {                 case R.id.menu:                         startActivity(new Intent(this, Main.class));                         return true; } return false;         } }</code></pre><p>------------Here my layout --------------------------------------</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout     android:orientation=""vertical"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/widget0"" android:background=""@drawable/nhiebg"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""     android:layout_gravity=""center"" &gt; &lt;ImageView         android:id=""@+id/imageviewyeah""         android:tag=""q""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_gravity=""center""&gt; &lt;/ImageView&gt; &lt;Button         android:id=""@+id/next_image_button""         android:text=""Next Image""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:padding=""10dip""         android:typeface=""serif""/&gt; &lt;/LinearLayout&gt;</code></pre><hr><p>Thanks you've been a huge help, well i tried what you said. But, it just loads a random image on start, the button just does nothing. I press it then the image that was up goes away and nothing loads in its place. A whole bunch of stuff goes thru logcat, but here's the first two lines </p><p>07-17 04:15:33.102: WARN/ResourceType(30476): No package identifier when getting value for resource number 0x0000000207-17 04:15:33.112: WARN/ImageView(30476): Unable to find resource: 2</p><p>----------------------------WHAT I HAVE NOW----------------------------</p><pre><code>public class RandomImage extends Activity implements OnClickListener{    private Integer [] mImageIds = {             R.drawable.one,             R.drawable.two,             R.drawable.three,             };    private static final Random rgenerator = new Random();    private ImageView iv;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.randomimage);    Integer q = mImageIds[rgenerator.nextInt(mImageIds.length)];    iv = (ImageView) findViewById(R.id.imageviewyeah);    iv.setImageResource(q);    View nextButton = findViewById(R.id.next_image_button);    nextButton.setOnClickListener(this);}    @Override    public void onClick(View v) {    switch (v.getId()) {    case R.id.next_image_button:        iv.setImageResource(rgenerator.nextInt(mImageIds.length));        break;    }}</code></pre><p>I'd also like to point out, i tried removing the lines</p><pre><code>Integer q = mImageIds[rgenerator.nextInt(mImageIds.length)];</code></pre><p>and the line</p><pre><code>and iv.setImageResource(q);</code></pre><p>and it still didn't work</p>","393373","","393373","","2010-07-17 08:27:19","2010-07-17 09:37:41","Need help displaying randomly chosen image on activity load and button press","<java><android><random><imageview>","1","0","","",""
"3269747","1","","","2010-07-17 00:52:50","1","146","<p>I have an activity which uses the Android search and the auto search-suggestions capability.</p><p>The thumbnails I am using in my activity are all stored on the SD card (there's a lot of them) and are all in MDPI resolution.</p><p>When using them in my activity this is fine as I can account for this and scale appropriately, however in the search suggestions view it seems the thumbnail is assumed to be at the current DPI, and thus the thumbnails look small on HDPI devices.</p><p>I am retrieving the thumbnails for the search suggestions view using a custom <code>ContentProvider</code> and overriding the <code>openFile</code> method - however I can't see how this gives me any control over setting the DPI as it just returns a generic <code>ParcelFileDescriptor</code>.</p><p>Is it possible to use the <code>ParcelFileDescriptor</code> to inform the search suggestions view of the DPI? Or  is there another possible method?I cannot control it directly myself as the Android framework handles the mapping of data to the auto-suggestions view.</p><p>My <code>openFile</code> method looks like:</p><pre><code>public ParcelFileDescriptor openFile( Uri uri, String mode ) {        String deletePackage = ""content://"" + PACKAGE_NAME + ""/"";        String url = uri.toString();        String filePath = url.substring(deletePackage.length());        Log.d(""AssetsContentProvider"", ""openFile: "" + filePath);        File file = new File( filePath );        ParcelFileDescriptor parcel = null;        try {            parcel = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);        } catch (FileNotFoundException e) {            Log.e( ""AssetsContentProvider"", ""Error finding: "" + file.getPath() + ""\n"" + e.toString() );        }        return parcel;}</code></pre><p>This seems to be the only place I have any control over the file between the auto-suggest manager requesting it and it being displayed.</p>","290028","","290028","","2010-07-17 01:00:04","2010-07-17 01:00:04","How do I inform the search suggestions view of the DPI of my images displayed as thumbnails?","<android><search><dpi><autosuggest><android-searchmanager>","0","0","1","",""
"3269854","1","","","2010-07-17 01:36:51","5","684","<p>I'm allowing the user to push buttons to play sounds via a SoundPool.  Is it possible to record whatever the SoundPool is playing so that the user can record a sequence of sounds?</p>","394417","","","","","2012-11-18 19:47:04","Android: Recording SoundPool output","<android><audio><recording><soundpool>","1","2","","",""
"3269863","1","3271769","","2010-07-17 01:39:33","1","2733","<p>I have a query that pulls everything from a database into a list view.</p><p><code>return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_HEIGHT,                    KEY_BODY, KEY_HOMEID},null , null, null, null, null,null);</code></p><pre><code>                                |               String Having is the 3rd from                                                           last null.</code></pre><p>I want only the records where the field KEY_HOMEID matches a variable called journalId which should be a numeric string.</p><p>I would also like to know how to bring the variable into my DatabaseAdapter... would <code>((resource) this.getApplication()).getjournalId())</code> work?? resource is a class that extends application. </p>","393328","","","","","2010-07-17 14:03:10","SQLite and Android. How do I use String Having in my query?","<android><sqlite>","2","0","","",""
"3269868","1","","","2010-07-17 01:41:35","1","486","<p>I'm trying to create an app that will display a video in a VideoView in a transparent activity but keep the touch focus on any underlying activity. For example, if I have one app opened and my app is launched, the video will show but the user can still interact with the app they were previously viewing. I have the transparent activity and video working but I can not find a way to keep interaction in the activity under mine. Please tell me if this is possible and how to do it. Thanks</p><p>Matt</p>","394416","","","","","2012-10-06 15:37:32","Overlay VideoView but keep touch focus on underlying activities in Android","<java><android>","1","0","","",""
"3270019","1","","","2010-07-17 02:43:36","0","872","<p>I am working in an android application that uses a list view. I currently have a XML for the row layout with only one text view. Based on certain conditions, some rows will have one additional button and some other rows may have 2 additional buttons. Can I override the getView method of the adapter class to do this logic? is there any performance issue?</p>","238457","","","","","2010-07-17 02:56:45","Adding buttons at run time to each row in a list view","<android><list><view>","1","0","","",""
"3270206","1","3270254","","2010-07-17 04:04:19","13","4385","<p>I have 10-15 activities in my project. I want to have the option menu mostly in all Activities. Then is their any way we can do it at one place and it appears in all activities.</p><p>Also, I will like to hide the option menu in some. So, is it possible or I have to write option menu code in all activities.</p><p>Regards</p><p>Sunil</p>","261566","","","","","2012-11-20 20:30:48","Same option menu in all Activities in Android","<android><menu><option>","2","0","3","",""
"3270308","1","","","2010-07-17 04:54:38","3","647","<p>My program uses a BroadcastReceiver to scan for SMS (which works and can create a toast message based on text content). But I would like for this to fire off a notification (just like the system generated ones, but I am going to dynamically drive this based upon the content. So far I have tried the following code after I have recieved the SMS and filtered for my application:</p><pre><code>    Notifier notice = new Notifier();    Intent noticeIntent = new Intent(context, Preferences.class);       notice.setNotice(context, noticeIntent,noticeId ,    R.drawable.gong_icon, ""Gong Text"", true);</code></pre><p>which then calls the class </p><p>public class Notifier extends Activity{</p><pre><code>public class Notifier extends Activity{            private int count;    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);     }    // Proven working Notification call</code></pre><p>from this point I call a piece of notification code that I have tested and is working. </p><p>But when I run the above code I recieve an error so I have tried to debug with adb.When I run adb catlob I receive this error:</p><p>java.lang.RuntimeException: Unable to start receiver com.mattwinder.android.gong.SmsReceiver: java.lang.IllegalStateException: System services not available to Activities before onCreate()</p><p>Please help!</p>","394479","","","","","2010-07-17 04:54:38","Android - Creating a notification from a SMS BroadcastReceiver","<android>","0","1","","",""
"3270336","1","3270743","","2010-07-17 05:08:27","3","1230","<p>I would like to capture an image from the camera on Android, and send it to Google App Engine, which will store the image in the blob store. Sounds simple enough, and I can get the multi-part POST to GAE happening, but storing to the Blob store requires the servlet return an HTTP redirect (302). So, I need a connection that can follow redirects after doing an HTTP POST. Here is the code I <em>WISH</em> would work:</p><pre><code>public static String sendPhoto(String myUrl, byte[] imageData) {    HttpURLConnection connection = null;    DataOutputStream outputStream = null;    String pathToOurFile = ""/data/file_to_send.jpg"";    String urlServer = myUrl;    String lineEnd = ""\r\n"";    String twoHyphens = ""--"";    String boundary = ""*****"";    // Please follow redirects    HttpURLConnection.setFollowRedirects(true);    BufferedReader rd = null;    StringBuilder sb = null;    String line = null;    try {        URL url = new URL(urlServer);        connection = (HttpURLConnection) url.openConnection();        // Allow Inputs &amp; Outputs        connection.setDoInput(true);        connection.setDoOutput(true);        connection.setUseCaches(false);        // I really want you to follow redirects        connection.setInstanceFollowRedirects(true);        connection.setConnectTimeout(10000); // 10 sec        connection.setReadTimeout(10000); // 10 sec        // Enable POST method        connection.setRequestMethod(""POST"");        connection.setRequestProperty(""Connection"", ""Keep-Alive"");        connection.setRequestProperty(""Content-Type"",            ""multipart/form-data;boundary="" + boundary);        connection.connect();        outputStream = new DataOutputStream(connection.getOutputStream());        outputStream.writeBytes(twoHyphens + boundary + lineEnd);        outputStream                .writeBytes(""Content-Disposition: form-data; name=""                    + ""\""file1\"";filename=\""""                    + pathToOurFile + ""\"""" + lineEnd);        outputStream.writeBytes(lineEnd);        outputStream.write(imageData);        outputStream.writeBytes(lineEnd);        outputStream.writeBytes(twoHyphens + boundary + twoHyphens            + lineEnd);        outputStream.flush();        outputStream.close();        rd = new BufferedReader(new InputStreamReader(                connection.getInputStream()));        sb = new StringBuilder();        while ((line = rd.readLine()) != null) {            sb.append(line + '\n');        }        Log.i(""Response: "", sb.toString());        // Responses from the server (code and message)        int serverResponseCode = connection.getResponseCode();        String serverResponseMessage = connection.getResponseMessage();        Log.i(""Response: serverResponseCode:"",            String.valueOf(serverResponseCode));        Log.i(""Response: serverResponseMessage:"", serverResponseMessage);    } catch (Exception ex) {        ex.printStackTrace();    }}</code></pre><p>As much as I try, this code will not follow redirects. The input steam is always empty, and the response is always 302. The image is uploaded nicely though. If someone could tell me what I can do to make it follow the redirect so I can read the response, I would really appreciate it.</p><p>Alternatively, if there is a better approach, I would love to hear it. I know there are libraries out there like Apache HTTP Client, but it requires so many dependencies that is seems like too much bloat for a simple task.</p><p>Thanks</p>","106717","","281545","","2013-10-19 17:08:05","2013-10-19 17:08:05","Best approach: HTTP POST (multi-part) from Android to GAE","<java><android><http><google-app-engine><multipart>","2","2","","",""
"3270409","1","3270422","","2010-07-17 05:40:38","22","8175","<p>I have an application with two activities and I'd like to be able to have two icons appear in the launcher, each launching the respective activity within the app. </p><p>Specifically, I want one icon to launch my main app, and another icon to launch my settings activity. Is this possible?</p><p>Here is what I've tried so far:</p><pre><code>    &lt;activity android:label=""MyApp"" android:name="".MyApp""&gt;        &lt;intent-filter&gt;            &lt;action android:name="".MyApp""/&gt;            &lt;action android:name=""android.intent.action.MAIN""/&gt;            &lt;category android:name=""android.intent.category.LAUNCHER""/&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:label=""Settings"" android:name="".Settings""&gt;        &lt;intent-filter&gt;            &lt;action android:name="".Settings""/&gt;            &lt;action android:name=""android.intent.action.MAIN""/&gt;            &lt;category android:name=""android.intent.category.LAUNCHER""/&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>This creates two launcher icons, but they both run my main app instead of the second icon running my settings app. I've tried just having the launcher category but then I don't get an icon so it looks like I need the main action as well.</p><p>Is this the right approach or should I be declaring two applications in the manifest instead?</p>","309885","","","","","2010-07-17 08:30:31","How do I get multiple icons to launch different activities in one application?","<android><android-manifest>","2","0","11","",""
"3270564","1","","","2010-07-17 06:52:51","1","1077","<p>hi i try to add a event to google calendar from my application.It adds the event to google calendar but it gives the UI ""The application has stoped unexpectedly.Please try again.""</p><p>code is here:</p><pre><code>  myService.setUserCredentials(userName, userPassword);             Log.d(""debug"", ""Login accepted "");            SimpleDateFormat sdf = new SimpleDateFormat(""yyyyMMdd'T'HHmmss"");            sdf.setTimeZone(TimeZone.getTimeZone(""UTC""));            DateTime startTime = null;            DateTime endTime=null;            try {                startTime = new DateTime(sdf.parse(DTSTART), TimeZone.getDefault());                endTime = new DateTime(sdf.parse(DTEND), TimeZone.getDefault());                Log.d(""debug"", ""Time set Ok"");                }            catch (ParseException e) {                // TODO Auto-generated catch block                Log.e(""My Error"", e.toString());                e.printStackTrace();                }             URL postUrl =                  new URL(""http://www.google.com/calendar/feeds/""+userName+""/private/full"");                CalendarEventEntry myEntry = new CalendarEventEntry();                myEntry.setTitle(new PlainTextConstruct(SUMMARY));                myEntry.setContent(new PlainTextConstruct(DESCRIPTION));                                    When eventTimes = new When();                eventTimes.setStartTime(startTime);                eventTimes.setEndTime(endTime);                                 myEntry.addTime(eventTimes);                // Send the request and receive the response:                CalendarEventEntry insertedEntry = myService.insert(postUrl, myEntry);</code></pre><p>The LogCat response is:</p><pre><code>07-17 12:04:04.518: ERROR/dalvikvm(760): Could not find method javax.xml.parsers.SAXParserFactory.getSchema, referenced from method com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory$SecureSAXParserFactory.getSchema07-17 12:04:04.528: WARN/dalvikvm(760): VFY: unable to resolve virtual method 16278: Ljavax/xml/parsers/SAXParserFactory;.getSchema ()Ljavax/xml/validation/Schema;07-17 12:04:04.528: WARN/dalvikvm(760): VFY:  rejecting opcode 0x6e at 0x000207-17 12:04:04.528: WARN/dalvikvm(760): VFY:  rejected Lcom/google/gdata/util/common/xml/parsing/SecureGenericXMLFactory$SecureSAXParserFactory;.getSchema ()Ljavax/xml/validation/Schema;07-17 12:04:04.528: WARN/dalvikvm(760): Verifier rejected class Lcom/google/gdata/util/common/xml/parsing/SecureGenericXMLFactory$SecureSAXParserFactory;07-17 12:04:04.528: WARN/dalvikvm(760): threadid=15: thread exiting with uncaught exception (group=0x4000fe70)07-17 12:04:04.538: ERROR/AndroidRuntime(760): Uncaught handler: thread Thread-8 exiting due to uncaught exception07-17 12:04:04.547: ERROR/AndroidRuntime(760): java.lang.VerifyError: com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory$SecureSAXParserFactory07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory.getSAXParserFactory(SecureGenericXMLFactory.java:51)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.util.XmlParser.getSAXParserFactory(XmlParser.java:90)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.util.XmlParser.parse(XmlParser.java:679)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.util.XmlParser.parse(XmlParser.java:576)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.data.BaseEntry.parseAtom(BaseEntry.java:1015)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:59)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:100)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:66)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:34)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.client.Service.parseResponseData(Service.java:2165)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.client.Service.parseResponseData(Service.java:2098)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.client.Service.insert(Service.java:1410)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.google.gdata.client.GoogleService.insert(GoogleService.java:606)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at com.mygoogle.GoogleCalendarActivity$GcalUpload.run(GoogleCalendarActivity.java:355)07-17 12:04:04.547: ERROR/AndroidRuntime(760):     at java.lang.Thread.run(Thread.java:1058)</code></pre><p>how to solve this ??</p>","389404","","","","","2011-03-08 07:30:18","How to add event to Google calendar in android?","<android>","1","1","","",""
"3270861","1","","","2010-07-17 08:51:40","1","219","<p>How do I obtain a handle on each image that the camera feeds into your recorder application?</p>","381699","","381699","","2010-07-20 06:41:05","2010-09-11 15:50:09","Android: how to get a handle on each image while recording from camera","<android>","0","2","","",""
"3270908","1","","","2010-07-17 09:25:02","1","1540","<p>I've built the bare bones of my app so far in Eclipse using an adapted version of the LunarLander app provided by Android Developers. I've adjusted bits and pieces and have no errors at all though when I run it in the emulator it keeps saying ""the application has stopped unexpectedly"" and i have to Force Close.</p><p>Is it possible that my main.xml layout file is causing this issue? Mine looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/distractions_layout""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextViewandroid:id=""@+id/text""  android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""@string/hello""/&gt;&lt;/LinearLayout&gt;</code></pre><p>but their's looks like:</p><p></p><p></p><pre><code>&lt;com.example.android.lunarlander.LunarView  android:id=""@+id/lunar""  android:layout_width=""match_parent""  android:layout_height=""match_parent""/&gt;&lt;RelativeLayout    android:layout_width=""match_parent""    android:layout_height=""match_parent"" &gt;    &lt;TextView      android:id=""@+id/text""              android:text=""@string/lunar_layout_text_text""              android:visibility=""visible""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:layout_centerInParent=""true""      android:gravity=""center_horizontal""      android:textColor=""#88ffffff""      android:textSize=""24sp""/&gt; &lt;/RelativeLayout&gt;</code></pre><p></p><p>Could this be responsible for the app being unable to launch? If I need to post my code I will but its over 900 lines so thought I would just see if this was possibly the problem first?</p><p>Thanks to all that can enlighten me!</p>","300037","","","","","2013-08-01 09:45:06","Android app stopping unexpectedly when built...XML layout file problem?","<android><xml><eclipse>","2","3","","",""
"3271083","1","3280316","","2010-07-17 10:23:08","0","390","<p>i'm using a timer wich needs context..Now i have the following code :</p><pre><code>   mContext=context;    mEventID=eventID;    CountDownTimer cdTimer = new CountDownTimer(20000, 1000) {        public void onTick(long millisUntilFinished) {            // Do nothing onTick... Sorry        }        public void onFinish() {            int deletedRows = mContext.getContentResolver().delete()            // ..rest of code        }    };    cdTimer.start();</code></pre><p>Is this safe to use , or may i be leaking the context here?btw. this is in a broadcastreceiver.</p>","368598","","","","","2011-06-24 14:58:13","Passing context into timer..is this safe","<android><context>","1","0","","",""
"3271142","1","3271457","","2010-07-17 10:43:48","1","737","<p>I developed application on 1.6.in manifest i gave:</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""4""/&gt;.</code></pre><p>When I run application in android 1.5 version.i am getting error </p><pre><code>java.io.FileNotFoundException: res/drawable/title_bar_shadow.9.png</code></pre><p>If I make one drawable folder and keep the images inside drawable. It is working is it good for make one drawable folder with android 1.6.</p><p>How to make it run on android 1.5?</p>","1746300","","119895","","2010-07-17 12:12:47","2011-09-27 13:05:48","minsdk problem in android","<android>","2","0","","",""
"3271180","1","3271377","","2010-07-17 10:52:30","0","741","<p>I am trying to communicate between two android emulators for communication , thus I am trying to forward port X to port Y on 127.0.0.1 where port X is the port I am transmitting too and Y is the one I am receiving  . Is this possible and if so how do I forward the local ports?</p>","304673","","","","","2010-07-17 11:58:06","Port forwarding on linux local loop to connect two android emulators","<android><linux><sockets><emulator><portforwarding>","3","0","","",""
"3271200","1","3271474","","2010-07-17 11:02:40","3","9368","<p>Here is my LogCat log:</p><pre><code>07-17 14:05:10.226: INFO/ActivityManager(71): Starting activity: Intent { cmp=com.mohit.gtd/.TaskEdit }  07-17 14:05:10.316: VERBOSE/GTDActivity(579): Starting TaskEdit activity  07-17 14:05:10.576: DEBUG/PhoneWindow(579): couldn't save which view has focus because the focused view com.android.internal.policy.impl.PhoneWindow$DecorView@43e477b0 has no id.  07-17 14:05:10.775: DEBUG/AndroidRuntime(579): Shutting down VM  07-17 14:05:10.785: WARN/dalvikvm(579): threadid=1: thread exiting with uncaught exception (group=0x4001d800)  07-17 14:05:10.825: ERROR/AndroidRuntime(579): FATAL EXCEPTION: main  07-17 14:05:10.825: ERROR/AndroidRuntime(579): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mohit.gtd/com.mohit.gtd.TaskEdit}: java.lang.NullPointerException07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at android.os.Handler.dispatchMessage(Handler.java:99)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at android.os.Looper.loop(Looper.java:123)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at java.lang.reflect.Method.invokeNative(Native Method)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at java.lang.reflect.Method.invoke(Method.java:521)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at dalvik.system.NativeStart.main(Native Method)07-17 14:05:10.825: ERROR/AndroidRuntime(579): Caused by: java.lang.NullPointerException07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at com.mohit.gtd.TaskEdit.onCreate(TaskEdit.java:18)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)07-17 14:05:10.825: ERROR/AndroidRuntime(579):     ... 11 more07-17 14:05:10.875: WARN/ActivityManager(71):   Force finishing activity com.mohit.gtd/.TaskEdit07-17 14:05:10.916: WARN/ActivityManager(71):   Force finishing activity com.mohit.gtd/.GtdActivity07-17 14:05:11.426: WARN/ActivityManager(71): Activity pause timeout for HistoryRecord{43fb2be0 com.mohit.gtd/.TaskEdit}07-17 14:05:13.625: INFO/Process(579): Sending signal. PID: 579 SIG: 907-17 14:05:13.775: INFO/ActivityManager(71): Process com.mohit.gtd (pid 579) has died.07-17 14:05:13.835: INFO/WindowManager(71): WIN DEATH: Window{43fd4e70 com.mohit.gtd/com.mohit.gtd.GtdActivity paused=true}07-17 14:05:13.976: WARN/InputManagerService(71): Got RemoteException sending setActive(false) notification to pid 579 uid 1003207-17 14:05:22.884: WARN/ActivityManager(71): Activity destroy timeout for HistoryRecord{43e46998 com.mohit.gtd/.GtdActivity}07-17 14:05:23.069: WARN/ActivityManager(71): Activity destroy timeout for HistoryRecord{43fb2be0 com.mohit.gtd/.TaskEdit}</code></pre><p>What could be causing an error? <code>TaskEdit</code> is a subclass of <code>Activity</code> and it is listed as an activity in the <code>AndroidManifest</code> file.</p>","200477","","119895","","2010-07-17 12:30:36","2010-07-17 12:31:17","Android Unable to start activity","<java><android><android-intent>","1","1","2","",""
"3271215","1","","","2010-07-17 11:07:07","2","5580","<p>I created layout through code so that i can add multiple views on that layout using code below.</p><pre><code>public class AndroidPrepChart extends Activity {    GraphicalView gView;    GraphicalView gView2;    GraphicalView gView3;    BarChart barChart = new BarChart();    BarChart2 barChart2 = new BarChart2();    BarChart3 barChart3 = new BarChart3();    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        gView = barChart.execute2(this);        gView2 = barChart2.execute2(this);        gView3 = barChart3.execute2(this);        LinearLayout layout = new LinearLayout(this);        layout.addView(gView, 150, 200);        layout.addView(gView2, 150, 200);        layout.addView(gView3, 150, 150);        setContentView(layout);     }}</code></pre><p>Here output screen contains three charts but i want to position third chart in the second line. Please help me to solve this problem. I am beginner in Android.</p>","394607","","119895","","2010-07-17 12:35:57","2010-07-17 12:56:51","create layout through code","<android>","2","0","","",""
"3271251","1","","","2010-07-17 11:16:11","0","201","<p>When I launch my app I get the following errors in the log. Can you anyone decipher some of them for me, and give me a potential solution? I would be so grateful if you could as its proving very frustrating and I am new to Android development. I am using Eclipse SDK with an Android AVD at 1.6 SDK level.</p><p>Thanks..</p><blockquote>  <p>07-17 11:05:57.046:<br>  ERROR/AndroidRuntime(226): Uncaught<br>  handler: thread main exiting due to<br>  uncaught exception   07-17<br>  11:05:57.056:<br>  ERROR/AndroidRuntime(226):<br>  java.lang.RuntimeException: Unable to   start activity<br>  ComponentInfo{com.darius.android.distractions/com.darius.android.distractions.Distractions}:  java.lang.ClassCastException:<br>  android.widget.FrameLayout 07-17<br>  11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  android.app.ActivityThread.access$2100(ActivityThread.java:116)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  android.os.Handler.dispatchMessage(Handler.java:99)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  android.os.Looper.loop(Looper.java:123)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  android.app.ActivityThread.main(ActivityThread.java:4203)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  java.lang.reflect.Method.invokeNative(Native  Method)   07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  java.lang.reflect.Method.invoke(Method.java:521)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  com.android.internal.os.ZygoteInit<br>  $MethodAndArgsCaller.run(ZygoteInit.java:791)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  dalvik.system.NativeStart.main(Native   Method)     07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226): Caused by:   java.lang.ClassCastException:<br>  android.widget.FrameLayout     07-17<br>  11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  com.darius.android.distractions.Distractions.onCreate(Distractions.java:87)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     at<br>  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)  07-17 11:05:57.056:<br>  ERROR/AndroidRuntime(226):     ... 11   more</p></blockquote>","300037","","82118","","2011-02-23 23:02:14","2011-02-23 23:02:14","Trouble with Android App Uncaught Exceptions in the Log","<android><eclipse><avd>","1","0","","",""
"3271290","1","3348722","","2010-07-17 11:28:51","1","194","<p>I am trying to implement a RESTful API in which I have to upload files that are relatively large for a mobile platform. The upload could take anywhere from 30 seconds to 5 minutes. </p><p>I would like my application to be completely usable while the upload takes place. I've been doing some research and I've come across a few methods from which I can't decide which is the correct solution to my problem.</p><p>These are the two things I have come across.</p><ol><li>Using an <code>IntentService</code> -- handles the worker thread so I don't have to.</li><li>Using my own type of <code>Service</code>-- still need to implement an <code>AsyncTask</code> to handle the   large process.</li><li>Implement an <code>AsyncTask</code> in a singleton file that would allow me to do all the work there but without using the service class.</li></ol><p>My question is which method is the best -- if one isn't listed but is a more apt solution to my problem then I would appreciate suggestions. </p><p>After researching all these methods I am still also confused on one thing. Lets say I upload a 2MB files, but I want to know when it is done. For example, lets say I have a service that uploads an image and returns and imageID -- I need to be able to know when that service returns an imageID -- process that and then move on to the next upload until the rest are finished. </p><p>As always, thanks in advance.</p><p>EDIT: I forgot to specify that while uploading I want the app to be usable-- that means that I can switch activities and still have the same service run.</p>","354247","","119895","","2010-07-17 12:09:00","2010-07-27 23:12:35","Which Android service path to choose for implementing a large upload?","<android><multithreading><service><rest>","1","2","","",""
"3271375","1","","","2010-07-17 11:57:29","1","908","<p>I've got some code which queries a rest api on a service which then updates a database, I then have a cursor which looks at the database.  I got some of the underlaying framework from the google iosched app.  </p><p>Calls to <code>mRunnersAdapter.notifyDataSetChanged()</code> in the <code>onReceiveResult</code> method don't seem to do anything, it's only by manually initiating a query with <code>mRunnerHandler.startQuery</code> in the Runnable <code>mRefreshRunnersRunnable</code> does the data update.  I think there's something wrong here, I'm sure I shouldn't need to restart the query again but I can't seem to get anything else to work.</p><p>Can anyone see where I'm going wrong?</p><pre><code>public class exampleActivity extends Activity implements DetachableResultReceiver.Receiver {    public void onCreate(Bundle savedInstanceState) {        mState = (AppState) activity.getApplication();        mState.mReceiver.setReceiver(this);        mRunnerHandler = new NotifyingAsyncQueryHandler(getContentResolver(), runnersListener);        mRunnersAdapter = new RunnerAdapter(this);        setListAdapter(mRunnersAdapter);        refreshRunnerPriceInfo();    }    public void resetTimer() {        nextRefreshTimePeriod = (SystemClock.uptimeMillis() / refreshPeriod + 1) * refreshPeriod;    }    public void refreshRunnerPriceInfo() {        resetTimer();        getRunnerPriceInfo();    }    private void getRunnerPriceInfo() {        Intent serviceIntent = new Intent(Intent.ACTION_SYNC, null, getBaseContext(), QueryService.class);        serviceIntent.putExtra(QueryService.EXTRA_STATUS_RECEIVER, mState.mReceiver);        serviceIntent.putExtra(QueryService.EXTRA_STATUS_URL_EXTENSION, Price.buildUrlExtension(marketId));        serviceIntent.putExtra(QueryService.EXTRA_STATUS_TYPE, Price.CONTENT_TYPE);        startService(serviceIntent);    }    public void onWindowFocusChanged(boolean hasFocus) {        if (!hasFocus) {            nextRefreshTimePeriod = -1;        } else {            refreshRunnerPriceInfo();        }        super.onWindowFocusChanged(hasFocus);    }    AsyncQueryListener runnersListener = new AsyncQueryListener() {        public void onQueryComplete(int token, Object cookie, Cursor cursor) {            startManagingCursor(cursor);            mRunnersAdapter.changeCursor(cursor);        }    };    private Runnable mRefreshRunnersRunnable = new Runnable() {        public void run() {            if (queriesStarted) {                getRunnerPriceInfo();                resetTimer();                mRunnerHandler.startQuery(Runner.buildUri(marketId), RunnerPriceQuery.PROJECTION, Price.DEFAULT_SORT);                mMessageHandler.postAtTime(mRefreshRunnersRunnable, nextRefreshTimePeriod);            }        }    };    private class RunnerAdapter extends CursorAdapter implements Filterable {        public RunnerAdapter(Context context) {            super(context, null);        }        public View newView(Context context, Cursor cursor, ViewGroup parent) {            return getLayoutInflater().inflate(R.layout.market_view_list_item, parent, false);        }        public void bindView(View view, Context context, Cursor cursor) {            // populate view        }    }    protected void onResume() {        super.onResume();        mMessageHandler.post(mRefreshRunnersRunnable);    }    protected void onPause() {        mMessageHandler.removeCallbacks(mRefreshRunnersRunnable);        super.onPause();    }    interface RunnerPriceQuery {        String[] PROJECTION = { BaseColumns._ID, etc };    }    public void onReceiveResult(int resultCode, Bundle resultData) {        switch (resultCode) {            case QueryService.STATUS_RUNNING: {                break;            }            case QueryService.STATUS_FINISHED: {                String intentReturnType;                try {                    intentReturnType = resultData.getString(QueryService.EXTRA_STATUS_TYPE);                } catch (NullPointerException e) {                    BLog.e(getClass(), ""No results found, probably network issues"", e);                    break;                }                if (Price.CONTENT_TYPE.equals(intentReturnType)) {                    if (!queriesStarted) {                        mMessageHandler.post(mRefreshRunnersRunnable);                        mRunnerHandler.startQuery(Runner.buildUri(marketId), RunnerPriceQuery.PROJECTION, Price.DEFAULT_SORT);                        queriesStarted = true;                    }                    if (mRunnersAdapter != null)                        mRunnersAdapter.notifyDataSetChanged();                }                break;            }            case QueryService.STATUS_ERROR: {                final String errorText = getString(R.string.toast_sync_error, resultData.getString(Intent.EXTRA_TEXT));                Log.i(this.getClass(), ""STATUS_ERROR\n"" + errorText);                Toast.makeText(MarketActivity.this, errorText, Toast.LENGTH_LONG).show();                break;            }        }    }}</code></pre>","264276","","264276","","2010-07-17 14:29:05","2010-07-17 14:29:05","Android: Extended CursorAdapter issues","<android><cursor><adapter>","0","0","","",""
"3271378","1","3271399","","2010-07-17 11:58:08","1","917","<p>I am using the available code of PackageInstaller for testing my own application of installing and uninstalling the apk over the device.There is lots of error within Froyo for building this app. Please help me out of this.</p><p>See <code>PackageInstaller</code> code <a href=""http://android.git.kernel.org/?p=platform/packages/apps/PackageInstaller.git;a=tree;h=refs/heads/donut;hb=refs/heads/donut"" rel=""nofollow"">here</a>.</p>","292605","","119895","","2010-07-17 11:59:31","2010-07-17 12:04:53","import android.content.pm.packageParser cannot be resolved","<android>","1","0","","",""
"3271440","1","3271895","","2010-07-17 12:20:18","1","241","<p>i came across this <a href=""http://www.brighthub.com/mobile/google-android/articles/48845.aspx"" rel=""nofollow"">http://www.brighthub.com/mobile/google-android/articles/48845.aspx</a></p><p>i understand i can create a view. But i want to define a layout xml and put that into my view. for example in layout i will have a few textviews, i will set value to them dynamically and add them to view and display. is this possible if yes how ? if no whats the alternative ?</p>","384185","","","","","2014-02-11 21:16:49","view from layout","<java><android><layout>","1","0","","",""
"3271452","1","","","2010-07-17 12:23:40","-1","4413","<p>I can't understand how this works in Android. I traversed samples and have no idea. For instance I need 2x2 grid view of TextView widgets. How to write needed code?</p>","394634","","","","","2013-03-01 10:34:27","Android GridView","<android><gridview>","1","0","","",""
"3271550","1","","","2010-07-17 12:53:32","1","1069","<p>is there any way by which i can save the checked state of the radiobutton whose effect remains even after i have call radiogroupinstance.clearCheck()</p>","379749","","","","","2010-11-07 18:09:20","android - RadioButton and RadioGroup","<android><radio-button>","1","0","2","",""
"3271577","1","3612053","","2010-07-17 13:06:18","2","181","<p>Smart-phones have built in ROM and RAM separately. Also a few phones has virtual memory support too. I would like to know what these memories are basically used for. I understand that RAM is available to user processes. But why do they have a big chunk of ROM?</p><p>E.g. The wiki page for Droid Incredible says</p><ul><li>512 MB DDR RAM</li><li>1 GB ROM (748 MB free to user) - <em>what's this free to user?</em></li><li>plus 8 GB moviNAND - typically used for data storage</li></ul>","229106","","229106","","2010-08-03 18:28:33","2010-08-31 18:31:06","Smartphone Memory Configuration","<iphone><android><memory><smartphone>","1","0","","",""
"3271740","1","3271835","","2010-07-17 13:53:06","4","18594","<p>I would like to limit the results to those whose KEY_HOMEID is equal to journalId.I've been on this for a couple days any help would be appreciated.</p><p><code>public Cursor fetchAllNotes(String journalId) {</code>    <code>            return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_HEIGHT,                    KEY_BODY, KEY_HOMEID},""FROM DATABASE_TABLE WHERE KEY_HOMEID = journalId"",null, null, null, null,null);        }</code></p>","393328","","","","","2012-03-18 17:58:22","how to add WHERE clause to Query on android","<android><sqlite><where-clause>","2","0","1","",""
"3271772","1","6177756","","2010-07-17 14:03:31","19","20278","<p>I know there is the <a href=""http://developer.android.com/reference/android/widget/ExpandableListView.html"">ExpandableListView</a> but it only supports up to 2 levels. I need a true treeview vertical list with at least up to ~5 levels (more is better).</p><p>Any suggestions?</p><p>edit:</p><p>I see talk about using a Custom Adapter and setting the padding based on the items level.</p><p>I have an unsorted ArrayList of objects that have an ID and parent ID, and I dynamically add items to this array as well. </p><p>Can anyone give me some examples of how I can go about doing this?</p>","51133","","41956","","2011-04-04 13:05:33","2014-01-06 08:45:08","Android Treeview","<java><android><treeview>","8","1","14","",""
"3271810","1","","","2010-07-17 14:13:12","1","1700","<p>I followed this tutorial: <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a>and it runs ok, except when I click on my icon in the map, the dialogue box does not come up.  And the application stops.  Did anyone else run into a similar problem?  </p><p>I don't know what is google api; can someone explain it to me please?  Does this mean that the code in above tutorial will not run on an android handset?  </p><p>Here is my code:</p><pre><code>package com.example.hellogooglemaps;import java.util.List;import android.graphics.drawable.Drawable;import android.os.Bundle;import com.google.android.maps.GeoPoint;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;import com.google.android.maps.Overlay;import com.google.android.maps.OverlayItem;public class Hellogooglemaps extends MapActivity {    /*Called to say that we are not displaying any route information*/    @Override    protected boolean isRouteDisplayed() {        return false;    }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        MapView mapView = (MapView) findViewById(R.id.mapview);        mapView.setBuiltInZoomControls(true);        List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();        Drawable drawable = this.getResources().getDrawable(R.drawable.icon);        HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable);        GeoPoint point = new GeoPoint(19240000,-99120000);        OverlayItem overlayitem = new OverlayItem(point, ""Hola, Mundo!"", ""I'm in Mexico City!"");        itemizedoverlay.addOverlay(overlayitem);        mapOverlays.add(itemizedoverlay);    }}</code></pre>","383760","","65977","","2010-09-19 21:30:57","2010-09-19 21:30:57","target platform android vs. google api","<android><google-api>","1","0","","",""
"3272001","1","3299117","","2010-07-17 15:00:08","0","539","<p>I'm new to JNI, i'm developing a native library for an Android project. I read some papers about JNI programming but i didn't understand if it is possible to create a library that can be loaded in different project classes with different packages. I read that to declare a new JNI method the syntax is:</p><ul><li>the prefix ""Java_""</li><li>an encoded fully qualified class name</li><li>an underscore (""_"") separator</li><li>an encoded method name</li></ul><p>Based on this definition it shouldn't be possible...</p><p>Suppose i had defined a class A in the package pkg1 with the native method foo contained in libfoo, and then i defined a class B in the package pkg2. Can i use libfoo and the foo method in B? How should i define the native method to achieve the result?</p><p>Thanks!</p>","302798","","","","","2010-07-21 12:23:41","JNI - How to create a library for different classes","<java><android><jni><android-ndk>","2","1","","",""
"3272142","1","","","2010-07-17 15:37:11","5","4036","<p>I want to override the behaviour of the <kbd>ENTER</kbd> key of the virtual keyboard so that:  </p><ul><li>when there are more fields on the screen, it 'tabs' to the next field</li><li>when it is the last field of the screen, it performs the default action of the screen</li></ul><p>I've been playing with the IME options and labels, but just don't get what I want. Anybody have any suggestions?</p>","394705","","250259","","2012-08-01 11:45:16","2013-10-24 13:38:34","How to override the <ENTER> key behaviour of the virtual keyboard in Android","<android><keyboard><virtual>","1","0","2","",""
"3272182","1","3273490","","2010-07-17 15:49:05","1","1650","<p>Can anyone help me achieve rounded corners for the TabWidget with android 2.1 + .  I am basically trying to give the TabWidget a custom theme purely via xml configuration.  I have tried the following, but only the text color changes.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;color name=""Tab_ForeColor""&gt;#6095C1&lt;/color&gt;    &lt;color name=""Tab_BackgroundColor""&gt;#411485&lt;/color&gt;    &lt;style name=""TestTheme"" parent=""android:Theme.Black""&gt;        &lt;item name=""android:tabWidgetStyle""&gt;@style/TestTab&lt;/item&gt;    &lt;/style&gt;    &lt;style name=""TestTab"" parent=""@android:style/Widget.TabWidget""&gt;        &lt;item name=""android:textAppearance""&gt;@style/TestTextApperance&lt;/item&gt;        &lt;item name=""android:drawable""&gt;            &lt;drawable name=""rounded_tab""&gt;                &lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""                    android:shape=""rectangle""&gt;                    &lt;stroke android:width=""3dip"" android:color=""@android:color/white"" /&gt;                    &lt;solid android:color=""@android:color/white"" /&gt;                    &lt;corners android:bottomRightRadius=""0.1dip""                        android:bottomLeftRadius=""0.1dip"" android:topLeftRadius=""15dip""                        android:topRightRadius=""15dip"" /&gt;                &lt;/shape&gt;            &lt;/drawable&gt;        &lt;/item&gt;    &lt;/style&gt;    &lt;style name=""TestTextApperance""&gt;        &lt;item name=""android:textSize""&gt;14dp&lt;/item&gt;        &lt;item name=""android:textStyle""&gt;normal&lt;/item&gt;        &lt;item name=""android:textColor""&gt;@color/Tab_ForeColor&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>TIA</p><p>Andrew</p>","67959","","","","","2010-07-17 22:14:55","How to achieve rounded tabs in Android 2.1 +","<java><android>","1","0","4","",""
"3272214","1","3272588","","2010-07-17 16:00:59","0","317","<p>i was just wondering, if i wanted to reset the actual preference file used with SharedPreferences could i just rename the preference file ? , wouldn't that mean that the filestill exist or does overwrite it ?</p>","267822","","","","","2010-07-17 17:46:14","About SharedPreferences in android","<android><android-preferences>","1","0","","",""
"3272372","1","","","2010-07-17 16:44:49","1","2007","<p>Since there is the permission called</p><pre><code>android.permission.READ_OWNER_DATA</code></pre><p>there MUST be a way to read the phone owner info on an android device.</p><p>The only thing I could find on the net is this:</p><pre><code>Uri uri = Uri.withAppendedPath(Contacts.People.CONTENT_URI, ""owner"");Cursor c = managedQuery(uri, null, null, null, null);</code></pre><p>But 1) that doesn't work (owner path unknown) and 2) Contacts.People is deprecated (I guess this should now be ContactsContract.Contacts.CONTENT_URI)</p><p>I can't even get the mobile phone number of the device using the TelephonyManager (getLine1Number) ... even the built-in phoneinfo screen shows ""unknown"" for the phonenumber.</p><p>Anyway, seems like I can't figure it out on my own and can't find anything useful on the web either (except for the outdated (?) code above). Although I believe the above approach must be the right one (using some content provider that provides the owner info). There simply is no documentation about this except that Android provides the permission setting ""android.permission.READ_OWNER_DATA"" but no info about how to actually do that kind of thing.</p><p>Does anybody know how to get to the phone owner info (name, address, email, phone, ...) on Android? Thanks a mill!</p><p>(Background: Developing on Android SDK 2.1, Testing on Emulator and HTC Desire)</p>","126197","","","","","2012-10-17 08:18:21","Android: Getting phone owner info","<android>","2","2","0","",""
"3272427","1","","","2010-07-17 16:59:29","3","660","<p>I'm writing an Android app and I need the ability to take a lat/long value and find the lat/long value of the nearest road to it. I've read the article at <a href=""http://econym.org.uk/gmap/snap.htm"" rel=""nofollow"">http://econym.org.uk/gmap/snap.htm</a>, and tried to implement this, but I've had to use the Google Maps Webservices rather than javascript (since it's an android app). When I make a request like </p><p>maps.google.com/maps/api/directions/xml?origin=52.0,0&amp;destination=52.0,0&amp;sensor=true</p><p>it doesn't return me the closest road at all! Seems that the above method doesn't work with the webservices. Has anyone got any other ideas about how to solve this problem?</p>","394757","","","","","2011-11-07 22:35:15","Snap to Roads Android","<java><android><google-maps><web-services><map-directions>","1","0","1","",""
"3272435","1","3272986","","2010-07-17 17:01:27","1","474","<p>Ok so from my understanding each application normally gets 16 mb memory to work with.This is what is shown on the heap tool for eclipse:</p><pre><code>Heap Size: 4.5 mbAllocated: 3.2 mbFree : 1.5 mbUsed : 66.7%</code></pre><p>Which one is the total memory being used? Heap size, or Allocated?</p>","242769","","","","","2010-07-17 19:37:57","Android ==> Eclipse Heap tool question?","<android><eclipse><heap-memory>","1","0","","",""
"3272500","1","","","2010-07-17 17:19:54","10","12648","<p>MyCode:</p><pre><code>public class MainActivity extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final TabHost tabHost = (TabHost) findViewById(R.id.tabhost);//      LocalActivityManager mLocalActivityManager = new LocalActivityManager(this, false);        tabHost.setup();        TabSpec tabSpecCheckIn = tabHost.newTabSpec(getResources().getText(R.string.button_check_in).toString());        tabSpecCheckIn.setIndicator(getResources().getText(R.string.button_check_in).toString(), getResources().getDrawable(android.R.drawable.star_off));        tabSpecCheckIn.setContent(R.id.check_in);        tabHost.addTab(tabSpecCheckIn);        TabSpec tabSpecReview = tabHost.newTabSpec(getResources().getText(R.string.button_review).toString());        tabSpecReview.setIndicator(getResources().getText(R.string.button_review).toString(), getResources().getDrawable(android.R.drawable.star_off));        tabSpecReview.setContent(R.id.review);        tabHost.addTab(tabSpecReview);        TabSpec tabSpecMyCircles = tabHost.newTabSpec(getResources().getText(R.string.button_my_circles).toString());        tabSpecMyCircles.setIndicator(getResources().getText(R.string.button_my_circles).toString(), getResources().getDrawable(android.R.drawable.star_off));        tabSpecMyCircles.setContent(R.id.my_circle);        tabHost.addTab(tabSpecMyCircles);        TabSpec tabSpecMySettings = tabHost.newTabSpec(getResources().getText(R.string.button_settings).toString());        tabSpecMySettings.setIndicator(getResources().getText(R.string.button_settings).toString(), getResources().getDrawable(android.R.drawable.star_off));        tabSpecMySettings.setContent(new Intent(this,CheckInActivity.class));        tabHost.addTab(tabSpecMySettings);        tabHost.setCurrentTab(0);    }}</code></pre><p>XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TabHost android:id=""@+id/tabhost""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;TabWidget android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:id=""@android:id/tabs""            android:layout_gravity=""bottom"" /&gt;        &lt;FrameLayout android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""            android:paddingTop=""65px""&gt;            &lt;LinearLayout android:id=""@+id/check_in""                android:orientation=""vertical"" android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" android:padding=""5px""&gt;                &lt;TextView android:layout_width=""wrap_content""                    android:layout_height=""wrap_content"" android:text=""date""                    android:textStyle=""bold"" /&gt;            &lt;/LinearLayout&gt;            &lt;LinearLayout android:id=""@+id/review""                android:orientation=""vertical"" android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" android:padding=""5px""&gt;                &lt;TextView android:layout_width=""wrap_content""                    android:layout_height=""wrap_content"" android:text=""lieu""                    android:textStyle=""bold"" /&gt;            &lt;/LinearLayout&gt;            &lt;LinearLayout android:id=""@+id/my_circle""                android:orientation=""vertical"" android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" android:padding=""5px""&gt;            &lt;/LinearLayout&gt;            &lt;LinearLayout android:id=""@+id/setting""                android:orientation=""vertical"" android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" android:padding=""5px""&gt;            &lt;/LinearLayout&gt;        &lt;/FrameLayout&gt;    &lt;/TabHost&gt;&lt;/LinearLayout&gt;</code></pre><p>When I click the button of Setting, exctption:</p><blockquote>  <p>Did you forget to call 'public void setup (LocalActivityManager activityGroup)'</p></blockquote><p>Who Can help me. I try to extends from <code>TabActiviy</code> or <code>ActivityGroup</code> still other exceptions!!!<br>I want to put the buttons of Tabhost at bottom and when I click the button invoke different Activities!</p>","339018","","12707","","2010-07-17 17:22:11","2013-05-14 10:14:14","Android Exception: Did you forget to call 'public void setup (LocalActivityManager activityGroup)'","<android><exception><android-tabhost>","2","0","10","",""
"3272551","1","3272587","","2010-07-17 17:33:14","1","645","<p>How do you replace the ""smiley"" button with a return key in an EditText?</p>","238849","","","","","2010-07-17 17:45:46","How do you replace the ""smiley"" button with a return key in an EditText?","<android>","1","0","","",""
"3272561","1","","","2010-07-17 17:36:04","1","48","<p>Imagine a use case, where an activity starts a service. When starting the Service, the Activity also passes a callback function to be called when Service is completed. What will happen, if the activity is not in focus(onPause) and Service tries to call, the callback function?</p>","393792","","","","","2010-07-17 17:36:04","How will a Service Behavior, when its Activity is not available?","<android>","0","0","","",""
"3272618","1","4993182","","2010-07-17 17:54:21","0","1170","<p>I'm using the following 9 patch image as the row background in a list view.</p><p><img src=""http://img39.imageshack.us/img39/9346/rowbackground9.png"" alt=""alt text""></p><p>(the image is right above this line, in case you missed it)</p><p>I've placed this image in drawable-hdpi. When I run the app in a high density device, the grey border appears only while scrolling, and disappears when the list view is still. Why is this?</p><p>The goal is to have a row divider like the Android Market app.</p><p><img src=""http://farm4.static.flickr.com/3505/3967919035_ec51923ac2.jpg"" alt=""alt text""></p>","143378","","1140748","","2012-05-06 16:49:49","2012-05-06 16:49:49","9 patch row background appears irregularly in Android","<android><nine-patch>","1","0","","",""
"3272763","1","3273445","","2010-07-17 18:36:27","2","2208","<p>im trying to understand what the difference between a service and a broadcast receiver is,as i see it they can do the same thing.</p><p>For example i have an application : App1that provide a service called ToastHelloWorld which just creates a Toast and stopSelf().I expose it to other applications using an intent filter with the action name: ""com.test.HelloToast""</p><p>Now i have another application : App2 i want to implicit use a service with the action ""com.test.HelloToast"" so i call startService(new Intent(""com.test.HelloToast""));</p><p>and it works.</p><p>Why would i use broadcast receivers when i can do everything with services and dont have the restriction of a 5sec execution limit?.</p><p>I know most ""system events"" is exposed via broadcasts' but couldnt they just aswell be published as Service Intents ? </p>","246234","","","","","2012-08-27 05:25:17","difference between services and broadcast receivers","<android>","2","0","1","",""
"3272841","1","","","2010-07-17 18:56:35","2","3918","<p>I'm working on Android game and there are some problem appearI want to fill a color on bitmap object but can notI tried bitmap.setPixel but my Image is PNG format (like a circle or unsharp, surrounded with transparent color) and android can not getHeight() or getWidth(), ie</p><p><pre>ImageView i = new ImageView(mContext);Bitmap bMap = BitmapFactory.decodeResource(this.mContext.getResources(), mImageIds[position]);</p><p>//        for(int i1 = 0; i1 &lt; bMap.getHeight();i1++)//         for(int j = 0; j &lt; bMap.getWidth(); j ++)//          bMap.setPixel(i1, j, Color.RED);   //can not set</p><code>    i.setImageBitmap(bMap);            i.setLayoutParams(new Gallery.LayoutParams(150, 100));    i.setScaleType(ImageView.ScaleType.FIT_XY);            i.setBackgroundResource(mGalleryItemBackground);    i.setBackgroundColor(Color.TRANSPARENT);</code></pre><p></p>","394803","","","","","2012-08-17 14:45:29","How to fill bitmap object with color in Android","<android><bitmap>","2","0","","",""
"3272958","1","3272989","","2010-07-17 19:30:32","2","1580","<p>Can GPS on a phone, such as iPhone or Android determine your Z coordinates ?</p><p>I know it certainly has to be able to determine X and Y, well longitude, latitude that is, but what about the Z coordinates ? Can it determine your height, and can I obtain height relative to ground ?</p>","155077","","","","","2010-07-17 19:39:40","GPS coordinates on mobile phones","<iphone><android><gps><coordinates>","3","0","1","",""
"3273057","1","","","2010-07-17 20:00:18","1","99","<p>I creating a small application that will basically use a background server to send data over HTTP. I dont know how to create services. Secondly there will be a couple of activities in my application. I want the activities to display a Context Menu when data becomes available. How can i do both. I have search for a while but the code i keep getting dose not seem to run on 1.6 api. How can i create the service and how can my activities listen to updates so that when a update is available they display a message. </p><p>NOTE: I do not need help on the HTTP part and the server part only creating the service and my activities listening to updates.</p><p>Kind Regards,</p>","365019","","","","","2010-07-18 08:43:30","first android service","<android><service><activity>","1","0","0","",""
"3273072","1","3273713","","2010-07-17 20:05:05","1","1105","<p>currently I'm working on my 1st Android app and I encounter something I cannot solve. When I try to insert data into my own database there is an error: 07-18 03:41:04.414: ERROR/AndroidRuntime(3480): java.lang.NullPointerException </p><p>My code for inserting into table is:</p><pre><code>public long createRecord(String created_time, String modified_time,        long reading, String unit, String period, String remark) {    ContentValues values = new ContentValues(6);    values.put(KEY_CREATED_TIME, created_time);    values.put(KEY_MODIFIED_TIME, modified_time); //System.out.println(values);    values.put(KEY_RECORD, reading); //System.out.println(values);    values.put(KEY_UNIT, unit); //System.out.println(values);    values.put(KEY_PERIOD, period);// System.out.println(values);    values.put(KEY_REMARK, remark);     System.out.println(values);    return mDb.insert(DATABASE_TABLE, null , values);}</code></pre><p>This is under my Adapter class which is an instance of my DatabaseHelper class. For my DatabaseHelper class, I can copy created database from assets folder into system databases folder. But just cannot create data into table, I tried to print out the ""values"", it showed that:</p><p><strong>created_time=2010-07-18 03:41:04 remark=on unit=mg/dL reading=67 period=Before Meal modified_time=00:00:00</strong> which was not the way it supposed to be, so I guessed this might be the problem. Can anyone help me with this? Searched online but not so many info on this. Thanks in advance:)     </p>","394815","","","","","2012-05-21 05:59:11","Values stored using ContentValues are not in correct order, WHY?","<android><database><sqlite>","3","0","","",""
"3273103","1","","","2010-07-17 20:16:22","4","1837","<p>I'm trying to set the tab style to a light theme. Giving me white tabs. I've tried several ways but I can't get the guys to change color! Can I assign the theme in Manifest, TabHost or Tab Widget?</p><p>style.xml</p><pre><code>&lt;style name=""SBstyle"" parent=""@android:style/Theme.Light""&gt;    &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;    &lt;item name=""android:tabWidgetStyle""&gt;@style/LightTabWidget&lt;/item&gt;&lt;/style&gt;&lt;style name=""LightTabWidget"" parent=""@android:style/Widget.TabWidget""&gt;&lt;item name=""android:textColor""&gt;#de6001&lt;/item&gt;</code></pre><p></p><p>then I havemy Manifest.xml</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:theme=""@style/SBstyle""&gt;</code></pre><p>and finally my tab.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@android:id/tabhost""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""#ffffff""&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""0dp""    &gt;    &lt;include layout=""@layout/nav_bar"" android:layout_height=""47dp""        android:layout_width=""fill_parent"" android:layout_alignParentTop=""true"" /&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""#f8a96e""        android:tabStripEnabled=""false""        /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:padding=""5dp"" /&gt;&lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>I appreciate any help on this, thanks!</p>","385854","","","","","2011-10-07 16:58:12","How to set Tab style to light theme w colored text?","<android><xml>","1","2","4","",""
"3273107","1","3273741","","2010-07-17 20:17:32","2","10616","<p>I want to use a singleton pattern to hold a database and some other data/methods for my Android application.</p><p>I realize there are many reasons against singletons, but for this case I'd like to use it.</p><p>I've sub-classed UIApplication and made a data class within it called MyAppData.</p><p>MyAppData needs to have access to the SQLite database.</p><p>When I create the databse, I need to pass a context.  I could pass the application context, but it will not directly relate to MyAppData.</p><p>I don't know if this wlll cause problems with my code.</p><p>So my thought is to have MyAppdata extend android.content.ContextWrapper.  I don't think I should extend Activity because it's really not an activity, its a data class with methods to access the database.</p><p>I'm wondering if I extend ContextWrapper will there be something deep in the code I'm missing that will cause big problems down the road (memory leaks, etc).</p><p>This may not be the ideal approach to this (and I've considered other options), but my goal is to:</p><p>Have a singleton class in UIApplication that can encapsulate the database and be retrieved easily from any activity in my app.</p><p>Thanks in advance for your suggestions/warnings/advice.</p>","386541","","","","","2012-03-10 09:05:06","How to make an Android singleton and custom data class with database?","<android><sqlite>","2","0","2","",""
"3273127","1","3502962","","2010-07-17 20:22:38","1","3782","<p>I was finishing up the ""Hello World"" tutorial in Eclipse (with the ADT plugin) and apparently, you are supposed to rename the string resource ""hello"" with ""Hello Android, I am a string resource"". Well, Java.Lang.NullPointerException pops up with four, ""An error has occurred. See error log for details."" Well, there is NOTHING in the error log! For every letter I type to rename this thing, Java.Lang.NullpointerException pops up and I have no clue what is wrong! I don't have any other errors or problems with my code...Does it have something to do with the ""missing"" gen file, because I had to change my Java to 1.6 to solve that... Maybe I need an update, I think? </p>","394842","","23897","","2010-07-17 20:26:56","2012-12-28 07:53:48","I get a NullPointerException when trying the Eclipse ""Hello World"" tutorial","<java><android><eclipse><sdk><adt>","3","1","0","",""
"3273342","1","3274576","","2010-07-17 21:26:24","24","13844","<p>So far and thanks to this website, I've been able to set up an alarm that will be set up and active, even if I turn of my phone.</p><p>Now, I set up a alarm to show a reminder for event A and I need the application to setup another alarm to show <strong>another</strong> reminder for event B.</p><p>I must be doing something wrong, because it only fires the reminder for event A.  It seems that once set up, any other alarm is understood as the same one. :-(</p><p>Here is the detail of what I am doing in two steps:</p><p>1) From an activity I set an alarm that at certain time and date will call a receiver</p><pre><code>                Intent intent = new Intent(Activity_Reminder.this,                        AlarmReceiver_SetOnService.class);                intent.putExtra(""item_name"", prescription                        .getItemName());                intent                        .putExtra(                                ""message"",                                Activity_Reminder.this                                        .getString(R.string.notif_text));                intent.putExtra(""item_id"", itemId);                intent.putExtra(""activityToTrigg"",                        ""com.companyName.appName.main.Activity_Reminder"");                PendingIntent mAlarmSender;                mAlarmSender = PendingIntent.getBroadcast(                        Activity_Reminder.this, 0, intent, 0);                long alarmTime = dateMgmt.getTimeForAlarm(pickedDate);                Calendar c = Calendar.getInstance();                c.setTimeInMillis(alarmTime);                // Schedule the alarm!                AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);                am.set(AlarmManager.RTC_WAKEUP, alarmTime + 15000,                        mAlarmSender);</code></pre><p>2) From the receiver I call a service</p><pre><code>        Bundle bundle = intent.getExtras();        String itemName = bundle.getString(""item_name"");        String reminderOrAlarmMessage = bundle.getString(""message"");        String activityToTrigg = bundle.getString(""activityToTrigg"");        int itemId = Integer.parseInt(bundle.getString(""item_id""));        NotificationManager nm = (NotificationManager) context.getSystemService(""notification"");        CharSequence text = itemName + "" ""+reminderOrAlarmMessage;        Notification notification = new Notification(R.drawable.icon, text,                System.currentTimeMillis());        Intent newIntent = new Intent();        newIntent.setAction(activityToTrigg);        newIntent.putExtra(""item_id"", itemId);        CharSequence text1= itemName + "" ""+reminderOrAlarmMessage;        CharSequence text2= context.getString(R.string.notif_Go_To_Details);        PendingIntent pIntent = PendingIntent.getActivity(context,0, newIntent, 0);        notification.setLatestEventInfo(context, text1, text2, pIntent);        notification.flags = Notification.FLAG_AUTO_CANCEL;        notification.defaults = Notification.DEFAULT_ALL;        nm.notify(itemId, notification);</code></pre><p>Thanks in Advance,</p><p>monn3t</p>","372475","","","","","2011-10-25 08:01:37","How can I setup multiple alarms in Android?","<android><alarms>","1","0","10","",""
"3273386","1","","","2010-07-17 21:39:45","0","280","<p>I am quite new to Java, let alone Android. I am stuck with a problemthat I encountered while instrumenting (using the instrumentationframework of android) the code of a Android project. I have a ListViewand using the getTouchables() API I have store the view in aArrayList. When in debug session, I saw that each view has children(mChildren) when expanded I could see that there is a ""ImageView"" and""TextView"" present. when the ""TextView"" is expanded, I could accessthe mText variable which contains the text value I am looking for. Inbrief, the value I am looking for, when looking at the ""variables""window of the debug perspective of Eclipse, is present at 'myview->mChildren->[1] (TextView)->mText->value'</p><p>Here ""myview"" is the name of the object of View class.</p><p>how do I access/ read the content of the ""value"" variable?</p><p>Please let me know if you need any info in this regard?</p><p>Thank you-BA</p>","394869","","","","","2010-07-18 01:14:14","accessing the children views of a View in Android","<java><android>","1","0","","",""
"3273403","1","3274183","","2010-07-17 21:44:20","0","54","<p>I'm working on an app, where I need to determine which sqlite rows are closest to me given my current lat/long. I have a table with lat and long columns, I'm just having a bit of trouble working out how to get ones that are closest based on my devices current location. Any help would be appreciated. </p>","394873","","244296","","2010-07-18 14:28:00","2010-07-18 14:28:00","Android Location Promixity Query","<java><android>","1","0","","",""
"3273462","1","3273745","","2010-07-17 22:05:39","1","261","<p>I have a widget that currently takes a random string from an array and sets it to text view on update. The issue here is that the same item can be re-used multiple times in a row due to the string being 'random'</p><p>In order to solve this I was going to create a table that held String text, and int viewednum and increment the viewed number each time 'get text' was called. (on update in the widget).</p><p>My Question: If I put the insert statements in the widget, won't the data be inserted every time 'on update' is called?</p><p>Would it be better for it to go in the DBadapter class somewhere? I'm just unsure about the best way to make sure I don't enter duplicate data. If there is a better alternative like saving a csv file somewhere and using that I'm open to it, it seemed like a sqlite database was the way to go.</p><p>Thank you for your time.</p>","394877","","","","","2010-07-19 14:26:17","Android Widgets: Where would the 'insert' step for a database occur?","<android><sqlite><widget>","2","0","","",""
"3273652","1","","","2010-07-17 23:26:45","1","1371","<p>so i've been trying to get my application to run an Activity via an intent and it works fine, when i then assign the <code>finish();</code> method, it returns to the activity that called it. The only thing i don't understand is that i'm not sure if the callee Activity is put onPause while the called Activity is in-front. I've tried to setup a toast message in the <code>onPause()</code> method of the callee Acitivty but it won't appear. </p><p>I first tried to call the second Activity with <code>startActivity(intentname)</code> and then a <code>finish()</code> method on the first Acitivty, i then tried to use the <code>startActivityForResult()</code> <em>(even though i don't really need to recieve any information from the called Activity)</em> method and closed it  with <code>onActivityResult()</code>. </p><p>I can't  find any information about the side-effects that these Activity methods has on a Activity that's calling another. So i'm wondering if anybody could help me out ?</p><p>//Thx in advance</p>","267822","","","","","2010-07-18 12:43:35","startActivity on Android","<android>","3","0","","",""
"3273834","1","3273941","","2010-07-18 00:34:30","3","5163","<p>I have a click event hooked up to my listview as shown.</p><pre><code>int[] GenusListIDs = { R.id.txt_ID, R.id.txt_Genus, R.id.txt_Count };        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.genusitem, cursor_genuslist, service.GenusListColumns, GenusListIDs);        ListView list_Genus = (ListView)findViewById(R.id.list_Genus);        list_Genus.setAdapter(adapter);        list_Genus.setOnItemClickListener(new OnItemClickListener(){            @Override            public void onItemClick(AdapterView parent, View view, int position, long id)            {                try                {                    Log.println(1, ""ItemClick"", view.toString());                    TextView tv = (TextView)view;                    String genus = (String) tv.getText();                    Intent i = new Intent(getBaseContext(), Cat_Species.class);//new Intent(this, Total.class);                    /*view                    i.putExtra(""id"", id);*/                    startActivity(i);                }                catch(Exception ex)                {                    Log.println(1, ""item-click-event"", ex.getMessage());                }            }        });</code></pre><p>I need to pass a string param to the new intent based on which listitem they clicked on.  The value I want to pass is in the listitem called txt_Genus.  How do I get that value out of the listitem to pass to the intent?  Don't pay attention to my experiments please haha.</p>","1491425","","","","","2010-07-18 09:22:22","Trying to get value out of text view in list view click event in android","<java><android><events><listview><listviewitem>","1","0","2","",""
"3273855","1","3276922","","2010-07-18 00:42:20","2","908","<p><strong>[UPDATE 2]:</strong> Hi there again,</p><p>after still trying to attach a video to an email, I think (not sure though!) that I am a little closer to my goal, but I discovered two problems... </p><p><strong>PROBLEM 1: FILENAME DOESN'T SHOW PROPERLY</strong>: what I was trying was to toast the name of the video I clicked on to see how I can get the name. This is what I have done...</p><pre><code>vGrid.setOnItemClickListener(new OnItemClickListener() {    @Override // click on item and open options menu    public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {        String [] proj={MediaStore.Video.Media.DATA};        videocursor = managedQuery( MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null,null,null);         video_column_index = videocursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA);        videocursor.moveToPosition((int) vGrid.getSelectedItemId());        // And here we get the filename        String filename = videocursor.getString(video_column_index);        Toast.makeText(ShareGalleryView.this, filename, Toast.LENGTH_SHORT).show();        openOptionsMenu(); //Opens Options Menu by clicking on an item        }    });</code></pre><p>...but instead of only displaying the filename I get sdcard/filename.mp4, so my first question is how to get rid of the ""sdcard/"" part because if I use</p><p><code>videocursor.getString(video_column_index)</code> in </p><p><code>i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(Environment.getExternalStorageDirectory(),videocursor.getString(video_column_index))));</code> </p><p>for attaching the video to the mail, I get the following Logcat output: </p><p><code>07-18 18:53:47.518: ERROR/Mms/media(179): java.io.FileNotFoundException: /sdcard/sdcard/Video0004.mp4</code>That was problem 1...now Problem 2</p><p><strong>[PROBLEM 2]</strong> I also discovered that no matter on which button I click the filename output is always the same and only shows the ""sdcard/Video0004.mp4"", so when I click on Video0010 it also shows ""sdcard/Video0004.mp4"", thus my second problem is how do I make sure in my code that the item that was clicked on is shown and also attached to the email and always the first video. </p><p><strong>Please, please, help me</strong>...This is really confusing me...and I have no Idea right now, how to solve these problems.</p><p>I will post the entire code below...Thank you</p><pre><code>package com.mobilevideoeditor.moved;import java.io.File;import android.app.Activity;import android.app.AlertDialog;import android.content.Context;import android.content.DialogInterface;import android.content.Intent;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.provider.MediaStore;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.BaseAdapter;import android.widget.GridView;import android.widget.TextView;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;public class ShareGalleryView extends Activity {    private Cursor videocursor;    private int video_column_index;    GridView vGrid;    int count;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.videogrid);        //create new Grid View        vGrid=(GridView) findViewById(R.id.vgrid);        registerForContextMenu(vGrid);        vGrid.setAdapter(new VideoAdapter(this));        init_phone_video_grid();        vGrid.setOnItemClickListener(new OnItemClickListener() {        @Override // click on item and open options menu        public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {            String [] proj={MediaStore.Video.Media.DATA};            videocursor = managedQuery( MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null,null,null);             video_column_index = videocursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA);            videocursor.moveToPosition((int) vGrid.getSelectedItemId());            // And here we get the filename            String filename = videocursor.getString(video_column_index);            Toast.makeText(ShareGalleryView.this, filename, Toast.LENGTH_SHORT).show();            openOptionsMenu(); //Opens Options Menu by clicking on an item            }        });    }    private void init_phone_video_grid() {        System.gc();        String[] proj = {                MediaStore.Video.Media._ID,                MediaStore.Video.Media.DISPLAY_NAME,                MediaStore.Video.Media.DATA        };        videocursor = managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null, null, null);        count = videocursor.getCount();        GridView vGrid=(GridView) findViewById(R.id.vgrid);        vGrid.setAdapter(new VideoAdapter(this));        }    @Override //creates options menu with menu-items    public boolean onCreateOptionsMenu(Menu menu) {      MenuInflater inflater = getMenuInflater();      inflater.inflate(R.menu.menu_gallery_share, menu);      return super.onCreateOptionsMenu(menu);    }    @Override //what happens when a menu item is clicked    public boolean onOptionsItemSelected (MenuItem item){         try{        //Facebook            if (item.getItemId() == R.id.menu_facebook)        {         //TODO open fb        new AlertDialog.Builder(this)          .setTitle(""No Service"")          .setMessage(""Sorry, Facebook is not supported yet!"")          .setNeutralButton(""Close"", new DialogInterface.OnClickListener() {                            @Override            public void onClick(DialogInterface dialog, int which) {                // TODO Auto-generated method stub            }}).show();            return true;        }       //YouTube        else if (item.getItemId() == R.id.menu_youtube)        {            //TODO open YouTube            new AlertDialog.Builder(this)              .setTitle(""No Service"")              .setMessage(""Sorry, YouTube is not supported yet!"")              .setNeutralButton(""Close"", new DialogInterface.OnClickListener() {                                @Override                public void onClick(DialogInterface dialog, int which) {                    // TODO Auto-generated method stub                }}).show();              return  true;        }        else if (item.getItemId() == R.id.menu_email)        {            Intent i = new Intent(Intent.ACTION_SEND);            i.setType(""text/plain"");            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);            i.setType(""video/mp4"");            i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(Environment.getExternalStorageDirectory(),videocursor.getString(video_column_index))));            startActivity(i);            return true;        }        else if (item.getItemId() == R.id.menu_bluetooth)        {            // TODO send via bluetooth            new AlertDialog.Builder(this)              .setTitle(""No Service"")              .setMessage(""Sorry, Bluetooth is not supported yet!"")              .setNeutralButton(""Close"", new DialogInterface.OnClickListener() {                                @Override                public void onClick(DialogInterface dialog, int which) {                    // TODO Auto-generated method stub                }}).show();            return true;        }            }         catch(Exception e)            {            e.printStackTrace();            }               return super.onContextItemSelected(item);    }    public class VideoAdapter extends BaseAdapter {        private Context vContext;        public VideoAdapter(Context c) {            vContext = c;        }        public int getCount() {            return count;        }        public Object getItem(int position) {            return null;        }        public long getItemId(int position) {            return 0;        }        // create a new ImageView for each item referenced by the Adapter        public View getView(int position, View convertView, ViewGroup parent) {            System.gc();              TextView tv = new TextView(vContext.getApplicationContext());              String id = null;              if (convertView == null) {                    video_column_index =                     videocursor.getColumnIndexOrThrow(MediaStore.Video.Media.DISPLAY_NAME);                    videocursor.moveToPosition(position);                    id = videocursor.getString(video_column_index);                    tv.setText(id);              } else                    tv = (TextView) convertView;              return tv;                }        }  }</code></pre><hr><p>Hi everyone, </p><p>I am working on a Video App, where you can click on a video from the sdcard. This click event opens a menu (I used a options menu) that provides the user with different sharing options, e.g. email, bluetooth etc. This part works fine so far... What I am now trying to do is, when the user chooses ""email"" the app should open the email app of the phone via an intent (this also works fine) and should directly attach the video he clicked before to the new email . </p><p><strong>[UPDATE]</strong> The last part is, where I am stuck because I don't know how to get the image filename that was clicked to open the image. This is the part in my code, where I got the problem (see <strong><em>""DON'T KNOW WHAT TO PUT HERE""</em></strong>)</p>","390782","","390782","","2010-07-18 19:27:56","2010-07-18 20:41:42","REALLY Need help - How to attach a video to an email ?? [2 new problems]","<android><email><video><attachment>","1","0","1","",""
"3273865","1","3274785","","2010-07-18 00:46:08","2","1005","<p>There are a lot of different classes that can be used in various ways to read/write to files in Android. For example, you can make use of java.nio.ByteBuffer, FileOutputStream and BufferedOutputStream. Are there any general guidelines for what to use to read/write quickly to the SD card? For example, BufferedOutputStream seems as if it should make things faster but I'm unsure the buffer size should be set for.</p><p>Specifically, I want to read/write byte arrays that are ~1Mb in size as quickly as I can. </p>","394922","","","","","2010-07-18 08:10:00","Fastest method to read/write to SD card in Android?","<java><android><file><optimization>","1","1","1","",""
"3274054","1","3274168","","2010-07-18 02:11:38","1","3470","<p>When I call intent </p><pre><code>public class TInfo extends ListActivity     implements OnSharedPreferenceChangeListener{@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    prefs = PreferenceManager.getDefaultSharedPreferences(this);    initvars();    setListAdapter(new TAdapter());  // class TAdapter extends ArrayAdapter&lt;String&gt;}</code></pre><p>where and how do I call registerOnSharedPreferenceChangeListener</p>","293565","","","","","2010-07-18 03:10:49","How can I add registerOnSharedPreferenceChangeListener on to a ListActivity?","<android><listactivity><sharedpreferences>","1","0","","",""
"3274078","1","","","2010-07-18 02:20:34","1","455","<pre><code> AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();                dDbHelper.deletedJournal(info.id);                mDbHelper.deleteJournal(info.id);public boolean deletedJournal(long homeId){        return mDb.delete(DATABASE_TABLE, KEY_HOMEID + ""="" + homeId, null )&gt;0;    }</code></pre><p><code>dDbHelper.deletedJournal(info.id)</code> gives me a null pointer exception</p>","393328","","244296","","2010-07-18 02:40:14","2011-01-29 02:08:17","Null Pointer Exception when using delete","<android><sqlite><delete>","2","1","","",""
"3274243","1","3384509","","2010-07-18 03:50:58","5","1668","<p>I have a dialog window that covers 1/3 of the entire screen height and is displayed on top of my activity. The dialog holds two AutoCompleteTextView fields.</p><p>The problem I'm facing is that when the user starts typing something into the AutoCompleteTextView, the list with all suggestions only shows up to the bottom end of the dialog, but doesn't go beyond that even the list is longer. It looks like it's cut off. (screenshot left)</p><p>Only after I long-press an item from the suggestion list, the list will be shown in full length. (screenshot right)</p><p>Screenhot is at: <a href=""http://img704.imageshack.us/i/dialogdropdown.png/"" rel=""nofollow"">http://img704.imageshack.us/i/dialogdropdown.png/</a><img src=""http://img704.imageshack.us/img704/1893/dialogdropdown.png"" alt=""screenshot""></p><p><strong>How to fix this behaviour so that the list shows in full length right from the beginning, when the user starts typing something?</strong></p><p>Code-wise there's nothing special, all I do is:</p><pre><code>ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this.getContext(), R.layout.nav_route_autocomplete_row, locStrings);        AutoCompleteTextView txtStartPos = (AutoCompleteTextView) findViewById(R.id.txtStartPos);txtStartPos.setAdapter(adapter);...</code></pre><p>One workaround idea is to somehow dispatch a motion event to simulate a touch (but then not selecting though) one of the list items. Any concrete idea in code for a solution, anybody?</p>","241475","","241475","","2010-08-02 05:51:18","2014-01-28 17:23:09","Selection list cut off in AutoCompleteTextView in Dialog","<android>","5","0","4","",""
"3274294","1","3278474","","2010-07-18 04:21:24","1","777","<p>I was testing android minSDKVersion property and find a strange behavior-</p><p>I put minSDKVersion=3 (1.5) and targetSDKVersion=4 (1.6) in androidManifest.xml file.</p><p>For testing, I put following lines in onCreate method of launching activity -</p><pre><code> android.telephony.SmsManager sm = android.telephony.SmsManager.getDefault(); ArrayList&lt;String&gt; stringArray = sm.divideMessage(""this is message""); Toast.makeText(this, stringArray.get(0), Toast.LENGTH_LONG).show(); </code></pre><p>android.telephony.SmsManager class is being introduced in android 1.6.</p><p>After adding these lines, on 1.6 emulator it was showing toast, but on 1.5 emulator it did not show toast and did not crashed either.</p><p>I was expecting that the application will crash on 1.5 emulator but this did not happen.Can anyone explain this?</p><p>Thanks</p>","215419","","","","","2010-07-19 04:35:00","Android minSdkVersion and using classes introduced in higher level SDK","<android>","1","0","2","",""
"3274332","1","3274337","","2010-07-18 04:38:46","1","1050","<p>Does anyone know how to add a floating bar that will stay at the top of a layout page, even when a user is scrolling through the contents of that layout? </p>","301991","","","","","2010-09-05 05:47:39","Android: Floating Bar in Layout","<android>","1","0","","",""
"3274412","1","3276761","","2010-07-18 05:09:28","1","952","<p>Im trying to display this listview, but I keep getting a: </p><p>07-17 21:14:22.233: ERROR/AndroidRuntime(349): java.lang.NullPointerException</p><p>I think I know what the problem is but I dont know how to fix it. </p><p>I have a String array which I will be using to be displayed in my list </p><pre><code>parser topicparser = new parser();  final String[] TOPICS = topicparser.topic(""http://www.test.com"");</code></pre><p>Dont worry the parser works great. the only problem I see with it is that the parser doesnt know how many strings the website will have so I am setting the String array in the parser to be very big:</p><pre><code>String substr[] = new String[250];</code></pre><p>but I know that mostly there are only like 11 to 13 values that I will be storing in that array, the problem I think is when i do this:</p><pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.topics, TOPICS));  ListView lv = getListView();</code></pre><p>since the String array is set to have up to 250 values in it and I only actually store say 12 then there are a null entries so when I run the code it shows me my list view, but when I get to the bottom of the view it force closes and the log tells me that there was nullpointer. I can tell how many entries I collected while I am parsing, but how do I tell my listview to only show say 12 items in the list so there wont be any null entries. or is there any other solution for my problem. </p><p>Thank you, </p><p>@Cristian C.</p><p>I tried doing what you said, but now I am getting a: </p><p>java.lang.ClassCastException: java.util.Arrays$ArrayList </p><p>this is what I did: </p><pre><code>String[] TOPICS = topicparser.topic(""test.com""); ArrayList&lt;String&gt; niceArray = (ArrayList&lt;String&gt;) Arrays.asList(TOPICS); // eclipse told me I had to add the cast setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.topics, niceArray)); </code></pre><p>any ideas ? Thanks</p>","222421","","222421","","2010-07-18 18:35:35","2011-12-27 17:07:22","android listview nullpointer.exception","<android><listview>","3","1","","",""
"3274417","1","3274423","","2010-07-18 05:17:11","2","866","<p>I'm very new to Android so I've been working primarily with information from the android developer's page.  Everything was going great until I added the code from the alert dialog section.  The code they give alone gives me an error when I try to run it on the last line, saying I must initialize dialog, but I feel like I'm getting the NullPointerException no matter what the case is... Heres my code:</p><pre><code>protected Dialog onCreateDialog(int id) {        Dialog dialog = null;        switch(id) {        case NAME_MISSING_ID:            // do the work to define the Dialog            AlertDialog.Builder builder = new AlertDialog.Builder(this);            builder.setMessage(""Proceed without a name?"")                   .setCancelable(false)                   .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {                       public void onClick(DialogInterface dialog, int id) {                            MainActivity.this.finish();                       }                   })                   .setNegativeButton(""No"", new DialogInterface.OnClickListener() {                       public void onClick(DialogInterface dialog, int id) {                            dialog.cancel();                       }                   });            AlertDialog alert = builder.create();            break;        case HARD_SELECTION_ID:            // do the work to define the Dialog            AlertDialog.Builder builder2 = new AlertDialog.Builder(this);            builder2.setMessage(""This is INSANE! Are you sure?"")                   .setCancelable(false)                   .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {                       public void onClick(DialogInterface dialog, int id) {                            MainActivity.this.finish();                       }                   })                   .setNegativeButton(""No"", new DialogInterface.OnClickListener() {                       public void onClick(DialogInterface dialog, int id) {                            dialog.cancel();                       }                   });            AlertDialog alert2 = builder2.create();            break;        default:            dialog = null;        }        return dialog;    }</code></pre><p>If I don't instantiate ""dialog"" to ""null"" at the beginning, I cannot run the program.  I'm not even trying to do anything crazy yet, any help would be great because I'm having alot of trouble trying to figure out what exactly this code is trying to do.</p><p>Thanks guys!</p>","394991","","244296","","2010-07-18 05:18:33","2010-07-18 05:24:07","Difficulty displaying alert dialog, why does this code force close my app?","<android><interface><dialog>","2","1","","",""
"3274583","1","4125204","","2010-07-18 06:37:24","4","3438","<p>Does Android wake from deep sleep in order to broadcast <code>ACTION_TIME_TICK</code>?  From experimenting, I don't think it does, but I'm looking for a definitive answer.</p><p>My experiment involved registering a simple <code>BroadcastReceiver</code> to update a <code>TextView</code> on receive:</p><pre><code>registerReceiver(new BroadcastReceiver() {    int ctr = 0;    @Override    public void onReceive(Context context, Intent intent) {        testView.setText(""Time ticks: "" + ++ctr);    }}, new IntentFilter(Intent.ACTION_TIME_TICK));</code></pre><p>At 4 ticks, I turned off the screen for about 5 minutes, then turned it back on, and it read 6 ticks.  At 13 ticks, I turned the screen for 10 minutes, then turned it back on, and the number of ticks read 14.  It only seems to increase by 1-2 ticks no matter how long I leave the phone off, which is why I suspect it doesn't broadcast the action during deep sleep.</p>","292728","","","","","2010-11-08 15:25:23","Will TIME_TICK broadcast in deep sleep?","<android>","2","1","0","",""
"3274592","1","","","2010-07-18 06:42:31","1","616","<p>I`m trying to launch an Intent filter from one process to run an activity of another proccess.</p><p>This is pretty easy:</p><pre><code>    protected void startIntent()    {       Intent i = new Intent(target);       i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);       i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);       context.startActivity(i);     }</code></pre><p>Now as my topic says, I am willing to run the target activity as <strong>multiply instances</strong>.</p><p>Each instance of that activity is supposed to do some operation and then it has <code>finish();</code></p><p>So now I call <code>startIntent();</code> 4 times in a row. </p><p>I want to have 4 instances parallel in the stack of the same target activity (each activity will finish after it does some operations. with finish(); ).</p><p>The problem is that it doesn't work properly. I tried some LoadTest, and when I call the method 3 (or below) times in a row it works fine, but when I call startIntent() 4+ times some instances of that activity never get launched(for example the second Intent in the order that has been called). </p><p>This is some warning I get:</p><blockquote>  <p>WARN/ActivityManager(966): Duplicate finish request for HistoryRecord{4367ed60     {com.test.targetActivity/com.idan.external.callingActivity}}</p></blockquote><p>Btw: In the target activity I've setted in the manifest the flag: </p><pre><code>android:launchMode=""standard"" (also tried without it, and it didnt work).</code></pre><p>Any idea?</p>","273550","","3800","","2011-09-01 19:47:01","2011-09-01 19:47:01","Failing with multiply instances","<android>","0","6","","",""
"3274954","1","","","2010-07-18 09:15:29","0","2587","<p>I need to play an RTSP audio stream on an Android phone, linked to from a web-page.</p><p>What's the simplest way to achieve this? I hope this will be very simple but unfortunately I don't have a phone on which to test.</p>","62871","","","","","2010-07-18 09:28:40","How to link to an RTSP stream on Android phone?","<android><audio><audio-streaming><rtsp>","1","0","","",""
"3275042","1","","","2010-07-18 09:50:23","15","9307","<p>When i have a broadcastReceiver say android.intent.action.MEDIA_BUTTON and i want to update the current activity's UI without creating a new activity, is there any good practice on this one?</p><p>What i know (might not be correct)</p><p>1) I can put the BroadcastReceiver in the same class as the activity and call the updateUI function after certain activity</p><p>2) Create a ContentObserver?</p><p>3) Communicate to a service created by the activity, use aidl. (I dont know how to get the current service if its registered from an activity)</p><p>4) Create a custom filter on the broadcastReceiver located on the same class as the activity, and use context.sendBroadcast(msg of custom filter) and in the custom filter call updateUI (same as one but more generic?)</p><p>The final flow is it would come from a BroadcastReceiver and ends up updating the UI without renewing the activity (unless the activity is dead?) </p><p>Kindly provide links/source code on your how you tackle this kind of problem. Thanks a lot in advance :)</p>","258648","","","","","2013-10-16 16:23:01","Android Best Practice on Updating the UI from BroadcastReceiver to a certain activity","<android><activity><broadcastreceiver>","2","0","13","",""
"3275204","1","3436455","","2010-07-18 10:51:08","0","945","<p>I want to inflate a childView of ExpandableChildView component.</p><p>Code:</p><pre><code>    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {        View v = convertView;        LinearLayout linearOpt = themesOptions.get(childPosition);        if(v == null) {            v = mInflater.inflate(R.layout.itemrow, null);        }        LinearLayout ll = (LinearLayout) v.findViewById(R.id.root);        ll.addView(linearOpt);        return v;    }</code></pre><p>Where linearOpt is a vector that contains a lot of LinearLayout objects that I have instantiated.</p><pre><code>    private void prepareThemes(){        View v = mInflater.inflate(R.layout.widget_configure, null);        LinearLayout theme = (LinearLayout) v.findViewById(R.id.themeLayout);        LinearLayout color = (LinearLayout) v.findViewById(R.id.colorLayout);        LinearLayout trans = (LinearLayout) v.findViewById(R.id.transpLayout);        themesOptions.add(theme);        themesOptions.add(color);        themesOptions.add(trans);    }</code></pre><p>This is R.layout.itemrow xml:</p><p>    </p><p></p><p>But I received this error:</p><blockquote>  <p>07-18 10:48:49.740:  ERROR/AndroidRuntime(2738):  java.lang.IllegalStateException: The  specified child already has a parent.  You must call removeView() on the  child's parent first.</p></blockquote><p>How I can resolve this issue?</p>","353030","","71059","","2010-07-18 11:27:41","2010-08-08 23:20:06","LinearLayout in ExpandableListView","<android><android-linearlayout><expandablelistview><inflate>","1","0","","",""
"3275333","1","5351787","","2010-07-18 11:31:39","9","28607","<p>I defined a drawable</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;shape xmlns:android=""http//schemas.android.com/apk/res/android""       android:shape=""rectangle""&gt;  &lt;solid android:color=""#ffffffff"" /&gt;  &lt;size android:width=""60dp""        android:height=""40dp"" /&gt;&lt;/shape&gt;</code></pre><p>But how to use it in the layout definition?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:orientation=""vertical""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              &gt;    &lt;ImageView        android:src=""@drawable/ic_title""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>I still see only black background.</p><p>Edited:</p><p>It turns out I missed one ':' in the drawable xmlns declaration. Now this example works in the Gingerbread device :)</p>","228116","","228116","","2011-03-24 04:27:20","2012-06-25 12:55:35","How to use a XML shape drawable?","<android><drawable>","2","2","1","",""
"3275467","1","7872332","","2010-07-18 12:19:05","9","67410","<p>I'm having a problem with setting text to a TextView:</p><pre><code>TextView android:editable = ""true"".</code></pre><p>In my .java it seems like that this should work:</p><pre><code> text = (EditText) findViewById(R.id.this_is_the_id_of_textview);text.setText(""TEST"");</code></pre><p>But it doesn't. Can anyone tell me what's wrong here?</p>","395135","","19679","","2013-10-30 16:53:48","2013-10-30 16:53:52","Why can't I set text to an Android TextView?","<android><text><textview>","2","0","3","",""
"3275477","1","","","2010-07-18 12:24:44","2","2474","<p>I am writing an android application in which users can pick a photo from their gallery and upload it to a server. How should I accomplish this ?</p><p>The application mainly uses SOAP webservices to communicate with the server, but I do not know how to serialize a stream of bytes in KSOAP and therefore I need some help. The solution should not necessarily use KSOAP. A valid solution would be to upload the photo on some server, and just retrieve the URL, which will be stored in the database.</p>","371006","","365695","","2010-07-18 13:00:59","2010-07-18 19:47:59","How can you upload photos from android gallery to server?","<android><photo><ksoap>","1","0","3","",""
"3275607","1","3275699","","2010-07-18 13:04:05","0","570","<p>I have implemented an activity that retrieves data from a web service and display it in the AutoCompleteTextView. This has been working quite well. </p><p>I'm interested in displaying a spinning animation while the data is being retrieved (The same effect like the Quick Search Box)  </p><p>I try to figure out how the QSB is doing it (10x Open Source!) but couldn't find any place where the spinner image is being put/set/drawn onto the EditText control.</p><p><img src=""http://img704.imageshack.us/img704/8210/spinnera.png"" alt=""alt text"" title=""Spinner""></p>","48387","","","","","2011-07-26 17:46:55","How to display animation image like the Quick Search Box","<android><gui>","1","1","","",""
"3275662","1","","","2010-07-18 13:23:48","0","822","<p>I have built a game. When the user clicks a button on the main page, he is redirected to another activity for a predefined time(say 20 s) and then he returns to the main page where he can choose another button. Now, this works perfectly on the emulator but on the phone when I clicks another button on the main page, it says the application has stopped unexpectedly. Force close. However, if I wait for say 3 s before clicking another button, it works. Is it because the images on the background of the buttons are too heavy?? Kindly help. Thanks in advance. </p>","388920","","","","","2012-11-19 00:06:29","the application has stopped unexpectedly","<android>","2","1","0","",""
"3275749","1","3278498","","2010-07-18 13:46:36","5","9583","<p>I have a fairly simple app that launches the camera from a menu. The camera launches fine, but when I hit ok after taking a picture I get a NPE on my nexus one:</p><pre><code>E/AndroidRuntime( 3891): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=null} to activity {net.asplode.tr/net.asplode.tr.PostImage}: java.lang.NullPointerExceptionE/AndroidRuntime( 3891):    at android.app.ActivityThread.deliverResults(ActivityThread.java:3515)E/AndroidRuntime( 3891):    at android.app.ActivityThread.handleSendResult(ActivityThread.java:3557)E/AndroidRuntime( 3891):    at android.app.ActivityThread.access$2800(ActivityThread.java:125)E/AndroidRuntime( 3891):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2063)E/AndroidRuntime( 3891):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 3891):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 3891):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime( 3891):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 3891):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 3891):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime( 3891):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime( 3891):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime( 3891): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime( 3891):    at net.asplode.tr.PostImage.onActivityResult(PostImage.java:92)E/AndroidRuntime( 3891):    at android.app.Activity.dispatchActivityResult(Activity.java:3890)E/AndroidRuntime( 3891):    at android.app.ActivityThread.deliverResults(ActivityThread.java:3511)E/AndroidRuntime( 3891):    ... 11 moreW/ActivityManager(   85):   Force finishing activity net.asplode.tr/.PostImage</code></pre><p>Code:</p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    if (item.getItemId() == R.id.mnuCamera) {        Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);        ContentValues values = new ContentValues();        values.put(Media.TITLE, ""image"");        Uri tempPhotoUri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);        cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, tempPhotoUri);        startActivityForResult(cameraIntent, FROM_CAMERA);        return true;}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    if (resultCode != RESULT_OK) {        return;    }    Uri imageUri = data.getData();    Log.i(""imageUri: "", imageUri.toString());}</code></pre>","395163","","","","","2012-04-04 03:39:25","I'm getting a NullPointerException when I use ACTION_IMAGE_CAPTURE to take a picture","<android>","4","0","1","",""
"3275767","1","","","2010-07-18 13:50:59","-1","563","<p>I need some help on the following:</p><ol><li>I have the following class:</li></ol><p>public class Game extends Activity {...</p><p>...}</p><ol><li><p>My questions is:</p><ul><li>Where and how do I create my View (do I use another class that extends View....)</li><li>Where and how do I implement the Runnable interface so I would be able to use threads.</li><li>Where and how do I connect all three (the Activity, the View, the Run() method)</li></ul></li></ol><p>Any help is appreciated.</p>","386946","","","","","2011-03-25 08:04:30","Creating a skeleton for a Game Algorithm in Android","<android><view><activity><runnable>","2","0","","",""
"3276249","1","","","2010-07-18 16:12:53","1","1099","<p>Can anybody tell me how to get the size of a file before downloading it from server(may be http,ftp or anything) in android?.Does streaming works?. Please Help me..</p><p>RegardsVarnesh</p>","395238","","","","","2012-07-27 20:18:07","getting the file size before downloading in android","<android>","2","0","","",""
"3276260","1","3276329","","2010-07-18 16:15:23","2","12892","<p>I'm trying to get into android development and I'm going through the tutorials, however I'm really stuck on the <a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"" rel=""nofollow"">HelloGridView</a> tutorial and I'm surrounded by apple developers, so have nobody with any android experience to ask!</p><p>I've attempted to do the HelloGridView tutorial and I get 17 Errors but cant see where am I going wrong?!? I have a feeling I'm missing a library or something?!?</p><p>As I've got so many errors I cant solve I have taken a screenshot:<a href=""http://users.cscs.wmin.ac.uk/~w1128683/help/Untitled.jpeg"" rel=""nofollow"">http://users.cscs.wmin.ac.uk/~w1128683/help/Untitled.jpeg</a></p><p>The problems lie in the HelloGridView and ImageAdapter classes:</p><p>HelloGridView class:</p><pre><code>    package com.example.HelloGridView;    import android.app.Activity;    import android.os.Bundle;    public class HelloGridView extends Activity {        /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            GridView gridview = (GridView) findViewById(R.id.gridview);            gridview.setAdapter(new ImageAdapter(this));            gridview.setOnItemClickListener(new OnItemClickListener() {                public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {                    Toast.makeText(HelloGridView.this, """" + position, Toast.LENGTH_SHORT).show();                }            });        }</code></pre><p>ImageAdapter class:</p><pre><code>    package com.example.HelloGridView;    public class ImageAdapter extends BaseAdapter {        private Context mContext;    public ImageAdapter(Context c) {        mContext = c;    }    public int getCount() {        return mThumbIds.length;    }    public Object getItem(int position) {        return null;    }    public long getItemId(int position) {        return 0;    }    // create a new ImageView for each item referenced by the Adapter    public View getView(int position, View convertView, ViewGroup parent) {        ImageView imageView;        if (convertView == null) {  // if it's not recycled, initialize some attributes            imageView = new ImageView(mContext);            imageView.setLayoutParams(new GridView.LayoutParams(85, 85));            imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);            imageView.setPadding(8, 8, 8, 8);        } else {            imageView = (ImageView) convertView;        }        imageView.setImageResource(mThumbIds[position]);        return imageView;    }    // references to our images    private Integer[] mThumbIds = {            R.drawable.sample_2, R.drawable.sample_3,            R.drawable.sample_4, R.drawable.sample_5,            R.drawable.sample_6, R.drawable.sample_7,            R.drawable.sample_0, R.drawable.sample_1,            R.drawable.sample_2, R.drawable.sample_3,            R.drawable.sample_4, R.drawable.sample_5,            R.drawable.sample_6, R.drawable.sample_7,            R.drawable.sample_0, R.drawable.sample_1,            R.drawable.sample_2, R.drawable.sample_3,            R.drawable.sample_4, R.drawable.sample_5,            R.drawable.sample_6, R.drawable.sample_7    };    }</code></pre><p>If anyone could tell me where I'm going wrong or at least point me in the right direction, it would be much appreciated! </p>","230646","","1288","","2013-01-28 17:31:33","2013-01-28 17:31:33","Gridview Tutorial problems","<android><xml><android-widget>","2","0","","",""
"3276261","1","","","2010-07-18 16:15:42","0","1276","<p>Would it be possible to create an ad-hoc multiplayer connection (close range) between two or several phones in a flash application?</p>","395240","","","","","2010-07-18 22:47:29","Ad-hoc (WiFi or bluetooth) in flash-app on Android","<android><flash><adhoc><multiplayer>","2","0","","",""
"3276353","1","","","2010-07-18 16:44:01","1","549","<p>I have a question about Spinner widget in android. All works well except that when I change device with small screen Spinner widgets are overlapped. Is there good practice with managing of sizes of Spinners? In runtime or during design of layout?</p>","394634","","","","","2010-07-18 23:02:12","Android: Spinners for different screen sizes","<android><spinner>","1","0","","",""
"3276380","1","3286921","","2010-07-18 16:50:48","15","19521","<p>I have been trying to get my EditText box to word wrap, but can't seem to do it.</p><p>I have deal with much more complicated issues while developing Android applications, and this seems like it should be a straight-forward process.</p><p>However, the issue remains, and I have a large text box that is only allowing me to enter text on one line, continuing straight across, scrolling horizontally as I enter text.</p><p>Here is the XML code for the EditText object from my layout file.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    android:id=""@+id/myWidget48""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""    xmlns:android=""http://schemas.android.com/apk/res/android""    &gt; &lt;ScrollView    android:id=""@+id/myScrollView""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_weight=""1""    &gt;    &lt;LinearLayout        android:id=""@+id/widget37""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""vertical""    &gt;&lt;EditText        android:id=""@+id/txtNotes""        android:layout_width=""300px""        android:layout_height=""120px""        android:scrollbars=""vertical""        android:textSize=""18sp""        android:gravity=""left""        android:layout_marginTop=""10dip""        android:inputType=""textCapSentences""        &gt;    &lt;/EditText&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre>","323696","","323696","","2010-07-19 16:41:45","2013-11-30 11:38:23","Android Word-Wrap EditText text","<android><xml><word><wrap><edittext>","6","0","2","",""
"3276448","1","3277237","","2010-07-18 17:05:41","22","19261","<p>I have an Edit Text that is defined as follows.</p><pre><code>&lt;EditText  android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:maxLines=""1""android:inputType=""text"" android:hint=""@string/field_text""android:id=""@+id/field""/&gt;</code></pre><p>I want to set a custom command so that when somebody clicks on the Done/Go button on the onscreen keyboard a button is clicked or just run the methods that are run by the button. I think this has something to do with ime options but I havent been able to figure out how they work. Thanks in advance for any help!</p>","395256","","","","","2011-10-20 00:04:03","Android: Edit Text Go Button","<android><edit><ime>","2","0","5","",""
"3276583","1","5153202","","2010-07-18 17:50:36","5","551","<p>Are there constants for the various resource types (ie: ""drawable"") in Android?</p><p>I want to code some conditional logic based on the return value of <a href=""http://developer.android.com/reference/android/content/res/Resources.html#getResourceTypeName%28int%29"" rel=""nofollow"">getResourceTypeName</a> and I would prefer to avoid hardcoding the resource types.</p><p>Example:</p><pre><code>final String type = context.getResources().getResourceTypeName(resid);if (""drawable"".equalsIgnoreCase(type)) {    // Something} else if (""xml"".equalsIgnoreCase(type)) {    // Something else}// TODO: Replace above strings with system constants</code></pre><p>(I can create my own constants, obviously, but I would prefer to use system constants to ensure upward compatibility)</p>","143378","","143378","","2010-07-18 21:51:02","2011-03-01 10:25:35","Constants for resource types in Android","<android><resources><constants><hardcode>","1","2","1","",""
"3276702","1","3277995","","2010-07-18 18:23:04","2","208","<p>I'm trying stuff with android animation and I would like to know if there is a way to execute some code every time an animation is repeated? I looked at the google doc but didn""t find any method to do that...</p>","263521","","","","","2010-07-19 01:39:46","Execute action when an animation is repeated in Android","<android><animation><repeat>","1","0","","",""
"3276921","1","3277681","","2010-07-18 19:30:23","6","1967","<p>The app I'm currently developing depends on a third party application (OIFileManager).</p><p>My question is what is the general way to handle these kind of dependancies?</p><p>Tell the user to resolve it?</p><p>Embed the 3d-party apk (if its license allows it)</p><p>Automatically resolve it (maybe android market has a system for it).</p><p>Thanks!</p>","242348","","","","","2010-07-18 23:34:49","How to handle app dependencies to 3d party","<android><third-party>","1","0","4","",""
"3276938","1","","","2010-07-18 19:34:50","0","4808","<p>I tried to create a video thumbnail as described <a href=""http://stackoverflow.com/questions/1334694/android-is-it-possible-to-display-video-thumbnails/2349063#2349063"">here</a>.I also read the reference <a href=""http://developer.android.com/reference/android/provider/MediaStore.Video.Thumbnails.html"" rel=""nofollow"">here</a>.</p><p>In my app I first let the user choose a video with:</p><pre><code>startActivityForResult(new Intent(Intent.ACTION_GET_CONTENT).setType(""video/*""), ACTIVITY_PICKVIDEO);</code></pre><p>Then I determine the video ID with:</p><pre><code>fileID = Integer.parseInt(contentUri.getLastPathSegment());</code></pre><p>So, the video content://media/external/video/media/5 would have the ID 5.</p><p>Then I try to get the thumbnail bitmap with:</p><pre><code>ContentResolver crThumb = getContentResolver();BitmapFactory.Options options = new BitmapFactory.Options();options.inSampleSize = 1;Bitmap curThumb = MediaStore.Video.Thumbnails.getThumbnail(crThumb, fileID, MediaStore.Video.Thumbnails.MICRO_KIND, options);</code></pre><p>There's no exception thrown but the bitmap has a width and height of -1.I'm not sure if the ID needed in getThubnail() is actually the ID that I determined above.Does anyone know of a working example how to get the thumbnail bitmap if you have the content Uri?</p><p>Interestingly (maybe so) I get null when trying with MediaStore.Video.Thumbnails.MINI_KIND as thumbnail size and an IllegalArgumentException (""Unsupported kind: 2"") when I try FULL_SCREEN_KIND.</p><p>I'm using a Motorola Milestone with Android 2.1.</p><p>/EDIT:I also tried getting the ID with querying for the BaseColumns._ID but it turns out to be the same as in the Uri (in the given example the _ID is 5).</p>","388826","","388826","","2010-07-18 20:00:40","2011-04-29 09:25:14","Can't get a video thumbnail in Android 2.0+","<android><video><bitmap><thumbnails>","2","0","","",""
"3276960","1","","","2010-07-18 19:40:29","5","2515","<p>I'm using my Nexus One with Android 2.2 Froyo in my car dock. For the audio output I'm using a a2dp receiver which is hooked up to my car stereo.Now, when I put the phone in the car dock it automatically connects to the car dock but not to my a2dp receiver, I have connect it manually in the settings (already paired).</p><p>I'm also using a custom app for audio playback. I thougt I maybe could force the a2dp connection to the a2dp receiver. But as far as I know, the default Bluetooth API does not support such a thing.</p><p>Is there any Intent for establishing the connection, or any other way? I would also accept an undocumented solution.</p>","371979","","","","","2012-04-11 00:54:35","How to force a connection to a a2dp bluetooth device by an activity or service","<android><connection><bluetooth>","3","1","2","",""
"3276968","1","3277008","","2010-07-18 19:42:10","4","19454","<p>this is my first time here (I find the website very useful). I'm new to android and I need to find out why I can't dynamically load images in my list view.</p><p>I have three arrays of strings:</p><pre><code>private String lv_arr[]={""News"",         ""Events"",         ""Other""};private String lv_arr_d[]={""Get the latest news"",         ""Latest events"",         ""Other description here""};private String lv_arr_icons[]={""news"", ""events"", ""other""};</code></pre><p>My list displays an icon to the left and two lines of text to the right in each list item.It works ok when I hard code the name of the image (e.g. news).</p><pre><code>ArrayList &lt;HashMap &lt;String, Object&gt;&gt; users =      new ArrayList &lt;HashMap &lt;String, Object&gt;&gt; ();     int l = lv_arr.length;     for (int i = 0; i &lt;l; i++) {     HashMap &lt;String, Object&gt; user = new HashMap &lt;String, Object&gt; ();     //get icons     String uri = ""drawable/""+lv_arr_icons[i];     user.put ( ""icon"", (Drawable)getResources().getDrawable(             getResources().getIdentifier(uri, null, getPackageName())));//the above works ok if i set R.drawable.news      user.put ( ""label"", lv_arr[i].toString());      user.put ( ""description"",  lv_arr_d[i].toString());      users.add (user);      }     String[] names = {""icon"", ""label"", ""description""};     int[] views = {R.id.icon, R.id.label, R.id.description};     SimpleAdapter saImageItems = new SimpleAdapter(this.getApplicationContext(),              users,  R.layout.optionslistitem, names, views);       lv1.setAdapter(saImageItems); //lv1 is my ListView</code></pre><p>All images are in the drawable folder.Any ideas why no image loads when i try to pass on their name and get them from resources?</p>","395224","","","","","2011-11-13 11:35:50","drawable getResources().getIdentifier problem","<android>","2","0","","",""
"3277124","1","3277201","","2010-07-18 20:24:27","2","274","<p>I defined a dialog the following way:</p><pre><code>public void displayAvailableDevices(Vector&lt;UserDevice&gt; availableDevices) {        connector.setDevicesFound(true);        UserDevice[] devices = new UserDevice[availableDevices.size()];        for (int i = 0; i &lt; availableDevices.size(); i++) {            devices[i] = availableDevices.elementAt(i);        }        Arrays.sort(devices);        Vector&lt;UserDevice&gt; sorted = new Vector&lt;UserDevice&gt;();        for (int j = 0; j &lt; devices.length; j++) {            sorted.add(devices[j]);        }        allAvailableDevices = sorted;        connector.stopNeighbourDiscovery();        if (dialog != null) {            dialog.dismiss();            checkedUser = null;        }        dialog = new Dialog(this);        dialog.setContentView(R.layout.available_users);        dialog.setTitle(""Available Devices"");        RelativeLayout rootLayer = (RelativeLayout) dialog.findViewById(R.id.dialogRoot);        rootLayer.setBackgroundColor(Color.WHITE);        ListView userTable = (ListView) dialog.findViewById(R.id.userList);        adapter = new UserAdapter();        userTable.setAdapter(adapter);        userTable.setOnItemClickListener(new UserListener());        DisplayMetrics dm = new DisplayMetrics();        getWindowManager().getDefaultDisplay().getMetrics(dm);         connect = (Button) dialog.findViewById(R.id.userList_connect);        connect.setMinWidth(dm.widthPixels / 2);        connect.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                if (checkedUser != null) {                    dialog.dismiss();                    connector.connectToDevice(checkedUser);                }            }        });        Button start = (Button) dialog.findViewById(R.id.userList_start);        start.setMinWidth(dm.widthPixels / 2);        start.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                dialog.dismiss();                startProfileView();             }        });        Button refresh = (Button) dialog.findViewById(R.id.userList_refresh);        refresh.setMinWidth(dm.widthPixels / 2);        refresh.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                dialog.dismiss();                getGameBaseLayer().resetAvailableUserDevices();                connector.refresh();            }        });        Button cancel = (Button) dialog.findViewById(R.id.userList_cancel);        cancel.setMinWidth(dm.widthPixels / 2);        cancel.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                finish();            }        });        dialog.show();        if (checkedUser == null) {            connect.setEnabled(false);        }    }</code></pre><p>If this dialog is displayed and the user presses the back button, the dialog is dismissed. However I would like to do some further processing, but how can i detect if the user has pressed the back button?</p>","","anon","","","","2010-07-18 20:49:44","Which method is called when user presses back button if a dialog is shown?","<java><android><gui>","1","0","","",""
"3277196","1","","","2010-07-18 20:48:49","35","13550","<p>Is it possible when creating a relative layout at runtime, to set the equivalent of <code>android:layout_below</code> programmatically?</p>","385457","","435093","","2012-10-24 08:58:39","2014-02-11 15:22:14","Can I set ""android:layout_below"" at runtime, programmatically?","<android><android-layout><relativelayout>","2","0","9","",""
"3277325","1","","","2010-07-18 21:28:55","2","356","<p>I've written my own Android <code>ContentProvider</code> for accessing certain Internet resources.  I'm trying to write some unit tests, but I do not want those tests to actually access the Internet.</p><p>Behind the scenes, my code is using the <code>DefaultHttpClient</code> class to access the web.  Basically, I'd like to know how I can use the <code>ProviderTestCase2</code> class to intercept any HTTP requests and return a predefined String ""response"" instead.  </p><p>I'm assuming there is something I can mock inside either <code>ContentResolver</code> or <code>Context</code> to do this, but I need a bit of guidance.</p>","62571","","","","","2012-12-14 09:55:49","Testing Android ContentProvider that accesses the Internet","<android><unit-testing><http><junit><android-2.2-froyo>","0","1","","",""
"3277514","1","3368493","","2010-07-18 22:27:41","0","1682","<p>HiWhen I try to compile to following code, I get two errors:</p><p>Description Resource Path Location TypeSyntax error on token ""void"", invalid Expression AsyncTask.java /AsyncTask Project/src/org/me/asynctask line 19 Java Problem</p><p>Description Resource Path Location TypeThe type AsyncTask is not generic; it cannot be parameterized with arguments  AsyncTask.java /AsyncTask Project/src/org/me/asynctask line 25 Java Problem</p><p>package org.me.asynctask;</p><p>import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.widget.TextView;import android.widget.Toast;import android.os.<em>;public class AsyncTask extends Activity {    /</em>* Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code>    TextView mytextview = new TextView(this);    TextView secondtextview = new TextView(this);    new MyAsyncClass().execute(mytextview, void, secondtextview);}private class MyAsyncClass extends AsyncTask&lt;TextView, Void, Void&gt; { protected TextView doInBackground(TextView tv) {  tv.setText(""Your AsyncTask was successful!"");  return tv; } protected void onPostExecute(TextView Result) {  Context context = context.getApplicationContext();        Toast mytoast = Toast.makeText(context, ""AsyncTask processing complete"", Toast.LENGTH_LONG);        mytoast.show(); }}</code></pre><p>Obviously AsyncTask IS a generic (http://developer.android.com/reference/android/os/AsyncTask.html#execute(Params...)  so why do i get those errors?</p>","389943","","","","","2010-07-30 03:13:22","AsyncTask not generic?","<android><generics><android-asynctask>","2","0","","",""
"3277661","1","3277988","","2010-07-18 23:23:52","1","684","<p>This may sound a little strange, but I'm making a game for the Android phone, but I don't own one myself.  I'm in a bit of a loss in designing my UI and need some suggestions from Anroid phone owners. The general idea is to have a screen where a user can start a board from the beginning or load a previous save game.  I'm trying to minimize the UI and would like to give the user to remove any unwanted level or save game from the same selection. Here is what the UI looks like.</p><pre>Play Level+============+| level 1    || level 2    || level 3    |+============+Saved Game+============+| save 1     || save 2     || save 3     |+============+</pre><p>So in terms of a vertical linear layout, there is a textview, listview, textview, listview.  The user can touch/click the desired level/save_game to play. But I want to give them the option to delete any old saved game from this same screen.  On my palm pre, I would just flick them to the side.  This gesture doesn't seem to be available here.  So my question is, How does other Andoid apps do this?</p><p>[update] I was half way through typing this when a friend of mine called. I remembered that he has an Android phone and he answered my question.  Rather than scrapping this message, I thought I would post the answer to my question on the chance it may help someone else.</p><p>[answer] Use press+hold to pop-up a dialog.  So clicking an item from either list will go right into play game mode.  Pressing+holding an item will open a dialog with the option to delete or cancel.</p><p>I'd be interested in hearing other suggestions if you have any.</p>","395389","","","","","2010-07-19 01:38:40","What is the recommended UI design for removing items from a list","<android><listview><user-interface>","1","1","","",""
"3277715","1","3278374","","2010-07-18 23:54:13","0","356","<p>I'm working on an Android app that will send an automated response every time a text message is received.  I <a href=""http://developer.android.com/search.html#q=text%20message&amp;t=0"" rel=""nofollow"">looked around a bit</a> on android's development site but haven't had anything that points me in the right direction.  Does anyone have any ideas on where I should start with this or have any good links that might help?</p><p>I am a total beginner with developing Android apps so please bear with me if I'm a little slow with this.</p>","226897","","","","","2010-07-19 03:57:50","How to perform an action when a text message is received?","<android>","1","0","2","",""
"3277759","1","","","2010-07-19 00:10:37","0","735","<p>I'm trying to create a simple camcorder application using mediarecorder and have spent 12+ hours trying to get it to work... its been frustrating as all hell. I've searched all over for the solution and attempted to use multiple pieces of sample code but still can't get it to work. The program keeps crashing and I get errors when I call prepare on the mediarecorder. </p><p>Layout Below////////////////////////////////////////////////////////////////</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/camera_layout"" android:layout_height=""fill_parent""    android:layout_width=""fill_parent""&gt;    &lt;android.view.SurfaceView android:id=""@+id/preview""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:layout_alignParentTop=""true""&gt;    &lt;/android.view.SurfaceView&gt;    &lt;Button android:id=""@+id/start_video"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""Start Video""&gt;    &lt;/Button&gt;    &lt;Button android:id=""@+id/stop_video"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""Stop Video""        android:layout_toRightOf=""@id/start_video""&gt;    &lt;/Button&gt;&lt;/RelativeLayout&gt;</code></pre><p>Code Below////////////////////////////////////////////////////////////////</p><pre><code>public class start extends Activity {    private SurfaceView preview;    private SurfaceHolder previewHolder;    private String locationName;    private String filepath;    private File video;    public void onCreate(Bundle videocawk) {        super.onCreate(videocawk);        setContentView(R.layout.video_layout);        setSurface();        //locationName = getIntent().getStringExtra(""locationName"");        locationName = ""dan"";        filepath = getFilePath(locationName);        try {            MediaRecorder r = getMediaRecorder(filepath, previewHolder.getSurface());            setButtonListeners(r);        } catch (IllegalStateException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }    private String getFilePath(String locName) {        String dir = Environment.getExternalStorageDirectory().getPath();        String add = ""/vext/"";        String name = locName + "" -- 1"";        String total = dir + add + name;        video = new File(total);        return total;    }    private void setSurface() {        preview = (SurfaceView) findViewById(R.id.preview);        previewHolder = preview.getHolder();        previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);    }    private void setButtonListeners(final MediaRecorder r) {        Button start = (Button) findViewById(R.id.start_video);        Button end = (Button) findViewById(R.id.stop_video);        start.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                startRecording(r);            }        });        end.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                stopRecording(r);                finish();            }        });    }    private void startRecording(MediaRecorder r) {        r.start();    }    private void stopRecording(MediaRecorder r) {        r.stop();    }    private MediaRecorder getMediaRecorder(String filepath, Surface s)            throws IllegalStateException, IOException {        MediaRecorder m_recorder = new MediaRecorder();        m_recorder.setPreviewDisplay(s);        m_recorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);        m_recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);        m_recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);        m_recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);        m_recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);        m_recorder.setMaxDuration(20000); // length of video in MS        m_recorder.setVideoSize(320, 240);        m_recorder.setVideoFrameRate(15);        m_recorder.setOutputFile(video.getPath());        m_recorder.prepare();        return m_recorder;    }}</code></pre><p>The errors I get are:</p><p>07-18 19:43:40.044: ERROR/audio_input(987): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value</p><p>07-18 19:43:40.044: ERROR/audio_input(987): VerifyAndSetParameter failed</p><p>07-18 19:43:40.044: ERROR/CameraInput(987): Unsupported parameter(x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value)</p><p>07-18 19:43:40.044: ERROR/CameraInput(987): VerifiyAndSetParameter failed on parameter #0</p><p>HELP PLEASE!!!!</p>","395408","","","","","2011-04-14 04:03:47","Desperate Help Needed on media recorder","<android>","3","0","","",""
"3277768","1","3278329","","2010-07-19 00:13:24","17","20492","<p>Newbie Question from an iPhone developer.</p><p>I have called the startActivity(intent) and the new activity loads. How do I go 'back' to the calling activity once a button is pushed. 'Popping' the activity off the stack basically.</p>","172861","","","","","2011-12-22 23:57:12","Android - Return to calling Activity","<android><activity>","3","0","3","",""
"3277893","1","3293481","","2010-07-19 01:08:30","1","788","<p>Why when a call is answered idle is not called after it finishes? I cannot figure out for the life of me how to detect the end of an incoming call. Idle works fine for missed called, but subsequent to an answered call seems like a mysterious state.</p><p>Anyone know how to detect the end of an incoming call?</p>","371532","","","","","2010-12-17 09:10:53","Android: the three phone states","<android><python-idle>","1","0","1","",""
"3277908","1","3278251","","2010-07-19 01:15:58","20","13598","<p>I am trying to find out the best way to do a simple table join on my two tables using a sqlite database in an android application.  Is the simplest way to use CursorJoiner or is there any easier way?</p>","1491425","","","","","2012-02-17 13:35:06","Best way to join tables using sqlite in android","<java><android><sqlite><join><cursor>","1","3","6","",""
"3277920","1","","","2010-07-19 01:19:36","0","899","<p>As the title, I create a ByteArray to store the file in blob like this:<br>byte[] red_buf = myCursor.getBlob(1);<br>But I don't know what's the next step to open the file :(</p>","364979","","","","","2010-07-19 01:23:49","Open file which is stored in SQLite as blob","<android><sqlite><blob>","1","2","","",""
"3278091","1","3278122","","2010-07-19 02:18:04","26","8676","<p>I'm trying to create define a custom Application class as follows:</p><ol><li>create an empty subclass ofApplication called MyApp</li><li>in the manifest, specifyandroid::name for my application: <code>&lt;application android:name="".MyApp""...</code></li></ol><p>However, when I attempt to run my app, I get:<code>java.lang.RuntimeException: Unable to instantiate application com.test.MyApp java.lang.IllegalAccessException: access to class not allowed</code></p>","440093","","","","","2012-11-14 13:23:19","Android: java.lang.IllegalAccessException when attempting to use a custom ""Application"" class","<android>","2","0","2","",""
"3278153","1","3278287","","2010-07-19 02:40:25","0","639","<p>When you launch an external activity (from another app), is the new activity loaded in the existing app's process or does Android spawn a new process corresponding to the other app?</p>","440093","","","","","2010-07-19 03:27:11","Android: are external activities launched in a new process or current process?","<android>","1","0","","",""
"3278233","1","","","2010-07-19 03:09:49","0","579","<p>I created a custom view loading an image of a small ball. So that the onDraw method would look like this:</p><pre><code>public void onDraw(Canvas canvas) {    canvas.drawBitmap(...);}</code></pre><p>Later, I added an onTouch listener to be able to listen to touch events to enable the ball to be dragged around. </p><pre><code>public boolean onTouchEvent(MotionEvent event) {         int eventaction = event.getAction();         int X = (int)event.getX();         int Y = (int)event.getY();         switch (eventaction ) {         case MotionEvent.ACTION_MOVE:   // touch drag with the ball             // move the balls the same as the finger             ball.setX(X-25);             ball.setY(Y-25);             break;         }         // redraw the canvas         invalidate();         return true;     } </code></pre><p>Now, I am trying to make the ball move ONLY along a curve and if its not moved beyond a fixed point, make it swing back to its original position. So there are two problems I am currently facing:</p><ol><li>Fixing the movement path of the ball</li><li>Flinging it back by animating it.One problem I am observing is if Iuse <code>ball.startAnimation</code>, and ifthe ball was slightly out of focus,the ball appears sliced.</li></ol><p><img src=""http://www.freeimagehosting.net/uploads/b68d5434ed.png"" alt=""Ball Swing""></p><p>Any suggestions please?</p>","184046","","184046","","2010-07-19 03:30:41","2010-07-19 08:49:55","Android::Creating a draggable elastic ball?","<java><android><animation><physics>","1","0","","",""
"3278247","1","5872558","","2010-07-19 03:13:31","7","7612","<p>Is it possible to detect all touch events in an Activity and capture it and then in return pass that pass event to another View?</p><p>For example:</p><p>Button 1 and Button 2. When Button 1 is pressed I want to capture that touch/click event and automatically pass that touch event to Button 2, basically with one touch/press you get the click generated and that same click is passed on to the second button automatically.</p>","395458","","418183","","2011-06-08 06:00:41","2011-06-08 06:02:11","How to detect touch events in Android","<android>","2","0","5","",""
"3278259","1","","","2010-07-19 03:18:05","0","251","<p>I am at a stage where I can understand and write a decent Android application. At this stage, I am still not comfortable with <strong>SurfaceHolder</strong>, <strong>Canvas</strong>, View <strong>invalidate()</strong> etc. I don't have a CS background so I must've missed these from a CS Graphics course or something. </p><p>Starting directly with Android seemed like a bad idea because there are not many examples out there. And sometimes I am getting things done, but I don't understand what the heck is going on. For instance, there are a few dangling observations. Calling invalidate() from within a view calls its onDraw method but from outside it doesn't do anything and I don't know why this is happening. I know SurfaceHolder can be a powerful thing but I don't know how to use it.</p><p>For an absolute beginner to be able to handle this stuff, what are the resources one should follow? Is it animation basics or screen rendering or something else altogether? I mean, it cannot be the case that Android guys invented these concepts right? They must be similar to something out there which has some tutorials already. My end goal is to put myself in a position where I can write some simple custom views that can animate themselves and use some basic physics to react to touch events.</p>","184046","","","","","2010-07-20 17:14:07","Android: What is the starting point for animations?","<java><android><graphics><animation>","1","0","","",""
"3278400","1","","","2010-07-19 04:08:52","1","1553","<p>I could not figure out how to implement two basic functionalities with the expandable lists: 1. The onClick for the child 2. Using linear layout for the children, so that I can have multiple clickable items in same row under the parent item</p><p>Can somebody help me with some sample code for the above?</p>","395482","","","","","2010-11-01 00:08:57","Android Expandable lists having multiple child items in a single row and their onClick event","<android><list><expandable>","1","0","","",""
"3278466","1","","","2010-07-19 04:32:58","0","2734","<p>i am drawing text in my custom view in android using canvas.drawtext. i need to change back color, and want text right aligned. for example i want to print the text in a 10, 10, 100, 20 rectangle of color yellow and text color red and right aligned. how can i do that ?</p>","384185","","","","","2010-07-19 09:34:41","canvas.drawText question","<java><android>","2","0","1","",""
"3278763","1","3278906","","2010-07-19 05:59:28","5","2312","<p>OK, there is at least one, arguably more, PC based IDE for developing Android apps.</p><p>But now that Android based tablets are becoming common, what's a good IDE for developing Android apps - in Android? </p><hr><p>Edit: I'd be more than happy to use Eclipse if it runs in Android ... or Netbeans, although that seems less likely?</p><p>Reason for the question is that I just acquired an Android slate &amp; Want it to eat its own dog food.</p>","192910","","51382","","2010-07-19 08:40:59","2012-02-29 12:15:07","Good Android based IDE for developing Android apps","<android><ide>","7","4","1","",""
"3278801","1","11010221","","2010-07-19 06:11:37","0","511","<p>i want to know get the number of device by telephoneManager and getLine1Number() ,it is workly well in analog machine,but in real device i donot get,could you tell me why?</p><p>in the com.android.internal.telephony inlude getLine1Number() ,how can use the inner class?</p>","233618","","233618","","2010-07-19 08:06:38","2012-06-13 07:39:10","how to get the telephone number in real device","<android>","1","4","","",""
"3278829","1","3278931","","2010-07-19 06:19:10","0","946","<p>I love how SharedPreferences work in android and I would like to know if there is an easy way to save them to another file so I could load a previous instance of the prefs and vice versa.  Basically when you load this file, all the preferences would change to how you had it before at once.  I want to be able to swap 3 or 4 different versions of the same pref keys in this way. Is there an easy way to do this?</p>","293565","","","","","2010-07-19 06:41:27","Can I save SharedPreferences to file so I can have multiple instances of the prefs?","<android><preferences>","1","0","","",""
"3278895","1","","","2010-07-19 06:33:19","11","20011","<p>I want to check current running applications in android programmatically, similar to how it shows 6 applications if we press and hold the <strong>HOME</strong> button.</p><p>I'm mostly interested in the application names.</p>","249991","","29995","","2011-11-11 12:58:00","2012-12-04 09:31:30","How to check current running applications in Android?","<android>","3","0","16","",""
"3279013","1","","","2010-07-19 07:01:58","0","696","<p>I have an application to be developed in android.It has two tabs in it.I am using tabactivity to achieve the same.One of the tab, consist of listview so i have extended listactivity.</p><p>But now the problem is, how can i get the click event notification on listview.</p><p>At the same time , whenver there is a change event in tab,i should be notified for the same,</p><p>so how should i implement the same..</p><pre><code>public class xyz extends TabActivity implements OnTabChangeListener{ @Override public void onCreate(Bundle savedInstanceState)  { } public void setOnTabChangedListener(TabHost.OnTabChangeListener l) {String arg0=""girish"";l.onTabChanged(arg0);            Toast.makeText(getApplicationContext(),""Tabchanged"",Toast.LENGTH_LONG).show(); }  @Override  public void onTabChanged(String tabId)   {// TODO Auto-generated method stubToast.makeText(getApplicationContext(),""Tab changed1"",Toast.LENGTH_LONG).show();  }}</code></pre><p>Rgds </p><p>Robert Sharma</p>","395563","","395563","","2010-07-19 10:09:59","2010-11-13 04:02:35","Detecting click event on listview control in android","<android>","1","0","","",""
"3279044","1","3316128","","2010-07-19 07:08:19","3","837","<p>I want to select an image from an android image gallery and upload it to a web server </p><p>Can any one guide me how to achieve this?</p>","249991","","114066","","2010-07-23 07:29:53","2010-07-23 07:29:53","how to attach image to upload in android?","<android>","2","0","1","",""
"3279081","1","3279252","","2010-07-19 07:15:54","4","3558","<p>I've a <code>RelativeLayout</code> thus:</p><pre><code>&lt;RelativeLayout&gt;&lt;TextView1/&gt;&lt;TextView2/&gt; // &lt;-- View.VISIBLE OR View.GONE&lt;TextView3/&gt;&lt;TextView4/&gt;&lt;/RelativeLayout&gt;</code></pre><p>Each <code>TextView</code> is anchored below the previous <code>TextView</code> with <code>android:layout_below</code>.</p><p>The problem is that TextView2 may or may not be there (either <code>View.VISIBLE</code> or <code>View.GONE</code>); if it's <code>View.VISIBLE</code>, then all is fine, but if it's <code>View.GONE</code>, then TextView3 ends up being rendered on top of TextView1.</p><p>I've tried various ways to fix this, but each time am caught out by <code>RelativeLayout</code>'s 'you cannot reference an id before it's defined' rule.</p><p>I'm hoping that I'm missing something obvious here. </p>","286160","","168175","","2011-09-02 18:57:21","2012-02-15 04:04:37","Issue with RelativeLayout when View visibility is View.GONE","<android><relativelayout>","5","0","1","",""
"3279150","1","","","2010-07-19 07:28:34","0","4670","<p>I am trying to make a non-editable EditText that is placed in a ScrollView and scrolling is controlled programmatically (when a left/right fling is detected).</p><p>Ok, here's my simple layout:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;ScrollView        android:id=""@+id/sv""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        &gt;        &lt;EditText android:id=""@+id/maintext""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:longClickable=""false""            android:selectAllOnFocus=""false""            android:focusable=""false""            android:editable=""false""/&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre><p>And here is my simple program:</p><pre><code>    package com.test.testscroll;import android.app.Activity;import android.os.Bundle;import android.view.GestureDetector;import android.view.MotionEvent;import android.view.View;import android.view.GestureDetector.SimpleOnGestureListener;import android.widget.EditText;import android.widget.ScrollView;import android.widget.Toast;public class TestScroll extends Activity {    private EditText mMainText;    private ScrollView mScrollView;    private GestureDetector gestureDetector;     View.OnTouchListener gestureListener;     private GestureDetector scrollGestureDetector;    View.OnTouchListener scrollGestureListener;    private static final int SWIPE_MIN_DISTANCE = 120;    private static final int SWIPE_MAX_OFF_PATH = 250;    private static final int SWIPE_THRESHOLD_VELOCITY = 200;    private final String testString = ""This is a very long line for testing purpose. Line number    1"" +    ""This is a very long line for testing purpose. Line number  2"" +    ""This is a very long line for testing purpose. Line number  3"" +    ""This is a very long line for testing purpose. Line number  4"" +    ""This is a very long line for testing purpose. Line number  5"" +    ""This is a very long line for testing purpose. Line number  6"" +    ""This is a very long line for testing purpose. Line number  7"" +    ""This is a very long line for testing purpose. Line number  8"" +    ""This is a very long line for testing purpose. Line number  9"" +    ""This is a very long line for testing purpose. Line number  10"" +    ""This is a very long line for testing purpose. Line number  11"" +    ""This is a very long line for testing purpose. Line number  12"" +    ""This is a very long line for testing purpose. Line number  13"" +    ""This is a very long line for testing purpose. Line number  14"" +    ""This is a very long line for testing purpose. Line number  15"" +    ""This is a very long line for testing purpose. Line number  16"" +    ""This is a very long line for testing purpose. Line number  17"" +    ""This is a very long line for testing purpose. Line number  18"" +    ""This is a very long line for testing purpose. Line number  19"" +    ""This is a very long line for testing purpose. Line number  20"" +    ""This is a very long line for testing purpose. Line number  21"" +    ""This is a very long line for testing purpose. Line number  22"" +    ""This is a very long line for testing purpose. Line number  23"" +    ""This is a very long line for testing purpose. Line number  24"" +    ""This is a very long line for testing purpose. Line number  25"" +    ""This is a very long line for testing purpose. Line number  26"" +    ""This is a very long line for testing purpose. Line number  27"" +    ""This is a very long line for testing purpose. Line number  28"" +    ""This is a very long line for testing purpose. Line number  29"" +    ""This is a very long line for testing purpose. Line number  30"" +    ""This is a very long line for testing purpose. Line number  31"" +    ""This is a very long line for testing purpose. Line number  32"" +    ""This is a very long line for testing purpose. Line number  33"" +    ""This is a very long line for testing purpose. Line number  34"" +    ""This is a very long line for testing purpose. Line number  35"" +    ""This is a very long line for testing purpose. Line number  36"" +    ""This is a very long line for testing purpose. Line number  37"" +    ""This is a very long line for testing purpose. Line number  38"" +    ""This is a very long line for testing purpose. Line number  39"" +    ""This is a very long line for testing purpose. Line number  40"" +    ""This is a very long line for testing purpose. Line number  41"" +    ""This is a very long line for testing purpose. Line number  42"" +    ""This is a very long line for testing purpose. Line number  43"" +    ""This is a very long line for testing purpose. Line number  44"" +    ""This is a very long line for testing purpose. Line number  45"" +    ""This is a very long line for testing purpose. Line number  46"" +    ""This is a very long line for testing purpose. Line number  47"" +    ""This is a very long line for testing purpose. Line number  48"" +    ""This is a very long line for testing purpose. Line number  49"" +    ""This is a very long line for testing purpose. Line number  50"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mMainText = (EditText) findViewById(R.id.maintext);        mScrollView = (ScrollView) findViewById(R.id.sv);        mMainText.setText(testString);     // Gesture detection         gestureDetector = new GestureDetector(new MyGestureDetector());         gestureListener = new View.OnTouchListener() {             public boolean onTouch(View v, MotionEvent event) {                 if (gestureDetector.onTouchEvent(event)) {                     return true;                 }                 return false;             }         };         mMainText.setOnTouchListener(gestureListener);        scrollGestureDetector = new GestureDetector(new ScrollGestureDetector());         scrollGestureListener = new View.OnTouchListener() {             public boolean onTouch(View v, MotionEvent event) {                 if (scrollGestureDetector.onTouchEvent(event)) {                     return true;                 }                 return false;             }         };         mScrollView.setOnTouchListener(scrollGestureListener);     }    class MyGestureDetector extends SimpleOnGestureListener {         @Override         public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {             try {                 if (Math.abs(e1.getY() - e2.getY()) &gt; SWIPE_MAX_OFF_PATH)                     return false;                 // right to left swipe                 if(e1.getX() - e2.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                     Toast.makeText(TestScroll.this, ""Left Swipe"", Toast.LENGTH_SHORT).show();                    mScrollView.pageScroll(ScrollView.FOCUS_UP);                    return true;                }  else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                     Toast.makeText(TestScroll.this, ""Right Swipe"", Toast.LENGTH_SHORT).show();                     mScrollView.pageScroll(ScrollView.FOCUS_DOWN);                    return true;                }             } catch (Exception e) {                 // nothing             }             return false;         }    }    class ScrollGestureDetector extends SimpleOnGestureListener {         @Override         public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {             return true;         }        @Override        public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)        {            return true;        }        @Override        public void onLongPress(MotionEvent e)        {            // Do nothing        }    }}</code></pre><p>So, to explain it simply, I have two custom simplegesture classes that I attached to the EditText and the ScrollView. For the EditText, I'm trying to detect a left/right fling and when detected, I'm scrolling the it up 1 page up/down. The custom simplegesture attached to the ScrollView is to disable finger scrolling. </p><p>Here's a screen shot after a right fling was done:<a href=""http://img830.imageshack.us/i/textcut.png/"" rel=""nofollow"">http://img830.imageshack.us/i/textcut.png/</a></p><p>I kinda works right now but I have two questions:</p><ol><li>How do I control the scroll so that lines won't get ""cut-off"" (please refer to the picture above where the first line on the screen is a bit ""cuf-off"").</li><li>Why when I scroll the page up/down programmatically, the EditText is auto select-all (please refer to the picture above where the whole screen turns orange after scrolling)?</li><li>Why when I changed MyGestureDetector to detect fling on the Y-axis (vertical fling) and programmatically scroll the EditText, it doesnt' work? It wouldn't work even if I made the change in ScrollGestureDetector too. Does it have something to do with the behaviour of the ScrollView?</li></ol><p>Thank you!</p>","389358","","389358","","2010-07-19 07:33:36","2013-08-03 20:38:49","Scrolling EditText on ScrollView programmatically","<android><textview><scrollview>","3","0","","",""
"3279218","1","","","2010-07-19 07:42:15","0","2420","<p>Is there any way to get the instance of a launched activity(or any view in that activity )of a application in another application.</p><p>Thanks in advance.</p>","332158","","","","","2010-07-19 07:53:57","how to get instance of the launched activity","<android>","1","0","","",""
"3279518","1","3279613","","2010-07-19 08:37:12","2","1797","<p>In one Android Tutorial I saw the usage of this function. There he uses it for resuming the previous session of the application I think, but the problem is that I cannot ovveride this function in my class and both classes (mine &amp; his) extend from ListActivity.</p><pre><code>@Override    protected void onFreeze(Bundle outState) {        super.onFreeze(outState);        outState.putLong(""feed_id"", feed.feedId);        outState.putString(""title"", feed.title);        outState.putString(""url"", feed.url.toString());    }</code></pre><p>Also I had some problem with some of the function calls before that, like for manipulating ArrayLists he calls list.next() &amp; I don't have such function so I used list.MoveToNext().Could be this because of a different version of Android (I use 1.6) and what to use as a replace for this function?</p>","389398","","","","","2010-07-19 08:55:18","Why exactly is onFreeze() used for?","<android><function>","1","0","","",""
"3279548","1","","","2010-07-19 08:43:12","0","464","<p>I was tried to read XML file using SAXParser class, But it is displaying some special character such as [],&lt;&lt;..>>` etc. Can you help me to read XML with excluding special chars.</p>","395627","","243782","","2010-07-19 10:25:19","2010-09-12 18:44:12","To Read XML file in Android","<android>","1","1","","",""
"3279551","1","3280529","","2010-07-19 08:43:15","1","209","<p>I'm pretty sure this must be possible...</p><p>But is there a way to find the 'noise produced' by a currently playing sound (MediaPlayer)</p><p>-Like in many music editor software you import a song and it does a graphical layout of the song -like a graph with it higher up at louder bits.</p><p>Hard to explain.</p><p>But there must be a way to do this on android...</p><p>Does anyone know?</p><p>Thanks alot.</p><p>James</p><p>(Not the whole graph thing -just like, the noise/decibels currently playing or something...)</p>","321763","","","","","2010-07-19 11:11:50","Audio (MediaPlayer) On an Android Help","<android>","1","1","","",""
"3279578","1","","","2010-07-19 08:50:10","14","38747","<p>Please suggest how I may close my whole Android Application with one line code.</p>","395638","","701033","","2011-11-20 23:18:59","2013-09-13 18:58:30","Close Android Application","<android>","12","1","3","2013-08-03 20:17:19",""
"3279622","1","","","2010-07-19 08:57:00","1","2029","<p>i am trying to create a build.xml script that cleans, builds and creates a apk file of a Junit android test project that i have created.</p><p>the steps i want to achieve in my build file is this:</p><p>clean</p><p>build</p><p>create apk file</p><p>Sign apk file</p><p>launch emulator</p><p>install apk file</p><p>run instrumentalTest</p><p>Save the tests into an HTML Junit Report</p><p>Anyone know how to achieve this? so far my build file looks like this:..</p><pre><code>&lt;!-- WARNING: Eclipse auto-generated file.              Any modifications will be overwritten.              To include a user specific buildfile here, simply create one in the same              directory with the processing instruction &lt;?eclipse.ant.import?&gt;              as the first entry and export the buildfile again. --&gt;&lt;project basedir=""."" default=""build"" name=""Unity Agent SDK Test""&gt; &lt;property environment=""env"" /&gt; &lt;property name=""junit.output.dir"" value=""junit"" /&gt; &lt;property name=""debuglevel"" value=""source,lines,vars"" /&gt; &lt;property name=""target"" value=""1.6"" /&gt; &lt;property name=""source"" value=""1.6"" /&gt; &lt;property file=""build.properties"" /&gt; &lt;path id=""android1.6.userclasspath""&gt;  &lt;pathelement location=""lib/android.jar"" /&gt; &lt;/path&gt; &lt;path id=""Junit.userclasspath""&gt;  &lt;pathelement location=""lib/junit-4.8.2"" /&gt;  &lt;pathelement location=""lib/org.hamcrest.core_1.1.0.v20090501071000.jar"" /&gt; &lt;/path&gt; &lt;path id=""Unity Agent SDK Test.classpath""&gt;  &lt;pathelement location=""bin"" /&gt;  &lt;pathelement location=""lib/fb_connect-android-api.jar"" /&gt;  &lt;pathelement location=""lib/signpost-commonshttp4-1.2.jar"" /&gt;  &lt;pathelement location=""lib/signpost-core-1.2.jar"" /&gt;  &lt;pathelement location=""lib/UnityAgentSDK.jar"" /&gt;  &lt;path refid=""android1.6.userclasspath"" /&gt;  &lt;path refid=""Junit.userclasspath"" /&gt; &lt;/path&gt; &lt;path id=""android.antlibs""&gt;  &lt;pathelement path=""${android-sdk-path}/tools/lib/anttasks.jar"" /&gt;  &lt;pathelement path=""${android-sdk-path}/tools/lib/sdklib.jar"" /&gt;  &lt;pathelement path=""${android-sdk-path}/tools/lib/androidprefs.jar"" /&gt;  &lt;pathelement path=""${android-sdk-path}/tools/lib/apkbuilder.jar"" /&gt;  &lt;pathelement path=""${android-sdk-path}/tools/lib/jarutils.jar"" /&gt; &lt;/path&gt; &lt;path id=""run.Unity Agent SDK Test (1).classpath""&gt;  &lt;path refid=""Unity Agent SDK Test.classpath"" /&gt; &lt;/path&gt; &lt;path id=""run.Unity Agent SDK Test (1).bootclasspath"" /&gt; &lt;target name=""init""&gt;  &lt;echo message=""Initialize project"" /&gt;  &lt;mkdir dir=""bin"" /&gt;  &lt;copy includeemptydirs=""false"" todir=""bin""&gt;   &lt;fileset dir=""src""&gt;    &lt;exclude name=""**/*.launch"" /&gt;    &lt;exclude name=""**/*.java"" /&gt;   &lt;/fileset&gt;  &lt;/copy&gt;  &lt;copy includeemptydirs=""false"" todir=""bin""&gt;   &lt;fileset dir=""gen""&gt;    &lt;exclude name=""**/*.launch"" /&gt;    &lt;exclude name=""**/*.java"" /&gt;   &lt;/fileset&gt;  &lt;/copy&gt; &lt;/target&gt; &lt;target name=""clean""&gt;  &lt;echo message=""Cleaning project"" /&gt;  &lt;delete dir=""bin"" /&gt; &lt;/target&gt; &lt;target depends=""clean"" name=""cleanall"" /&gt; &lt;target depends=""build-subprojects,build-project"" name=""build"" /&gt; &lt;target name=""build-subprojects"" /&gt; &lt;target depends=""init"" name=""build-project""&gt;  &lt;echo message=""${ant.project.name}: ${ant.file}"" /&gt;  &lt;javac debug=""true"" debuglevel=""${debuglevel}"" destdir=""bin"" source=""${source}"" target=""${target}""&gt;   &lt;src path=""src"" /&gt;   &lt;classpath refid=""Unity Agent SDK Test.classpath"" /&gt;  &lt;/javac&gt;  &lt;javac debug=""true"" debuglevel=""${debuglevel}"" destdir=""bin"" source=""${source}"" target=""${target}""&gt;   &lt;src path=""gen"" /&gt;   &lt;classpath refid=""Unity Agent SDK Test.classpath"" /&gt;  &lt;/javac&gt; &lt;/target&gt; &lt;target description=""Build all projects which reference this project. Useful to propagate changes."" name=""build-refprojects"" /&gt; &lt;target description=""copy Eclipse compiler jars to ant lib directory"" name=""init-eclipse-compiler""&gt;  &lt;copy todir=""${ant.library.dir}""&gt;   &lt;fileset dir=""${ECLIPSE_HOME}/plugins"" includes=""org.eclipse.jdt.core_*.jar"" /&gt;  &lt;/copy&gt;  &lt;unzip dest=""${ant.library.dir}""&gt;   &lt;patternset includes=""jdtCompilerAdapter.jar"" /&gt;   &lt;fileset dir=""${ECLIPSE_HOME}/plugins"" includes=""org.eclipse.jdt.core_*.jar"" /&gt;  &lt;/unzip&gt; &lt;/target&gt; &lt;target description=""compile project with Eclipse compiler"" name=""build-eclipse-compiler""&gt;  &lt;property name=""build.compiler"" value=""org.eclipse.jdt.core.JDTCompilerAdapter"" /&gt;  &lt;antcall target=""build"" /&gt; &lt;/target&gt; &lt;target name=""Unity Agent SDK Test ""&gt;  &lt;mkdir dir=""${junit.output.dir}"" /&gt;  &lt;echo message=""making directory"" /&gt;  &lt;junit fork=""yes"" printsummary=""yes""&gt;   &lt;formatter type=""xml"" /&gt;   &lt;test name=""com.kc.AllTests"" todir=""${junit.output.dir}"" /&gt;   &lt;!--   &lt;test name=""com.kc.AllTests"" todir=""${junit.output.dir}"" /&gt;             &lt;test name=""com.kc.unity.agent.util.ActivityOneTestcase"" todir=""${junit.output.dir}"" /&gt;   &lt;test name=""com.kc.unity.agent.util.FaceBookRestManagerTestCase"" todir=""${junit.output.dir}"" /&gt;   &lt;test name=""com.kc.unity.agent.util.OAuthManagerTestCase"" todir=""${junit.output.dir}"" /&gt; --&gt;   &lt;classpath refid=""Unity Agent SDK Test.classpath"" /&gt;   &lt;bootclasspath&gt;    &lt;path refid=""run.Unity Agent SDK Test (1).bootclasspath"" /&gt;   &lt;/bootclasspath&gt;  &lt;/junit&gt;  &lt;echo message=""junit finished"" /&gt; &lt;/target&gt; &lt;target name=""junitreport""&gt;  &lt;junitreport todir=""${junit.output.dir}""&gt;   &lt;fileset dir=""${junit.output.dir}""&gt;    &lt;include name=""TEST-*.xml"" /&gt;   &lt;/fileset&gt;   &lt;report format=""frames"" todir=""${junit.output.dir}"" /&gt;  &lt;/junitreport&gt; &lt;/target&gt; &lt;!-- Build it and set it up for android --&gt; &lt;echo message=""Build it and set it up for android"" /&gt;  &lt;echo message=""${android-sdk-path}"" /&gt;  &lt;target name=""push_tests_to_device""  depends=""build""&gt;   &lt;exec executable=""${android-sdk-path}/tools/adb.exe""&gt;    &lt;arg value=""install""/&gt;    &lt;arg value=""${test_apk_path}""/&gt;   &lt;/exec&gt;  &lt;/target&gt;  &lt;target name=""run_tests""  depends=""push_tests_to_device""&gt;   &lt;exec executable=""${android-sdk-path}/tools/adb.exe""&gt;    &lt;arg value=""shell""/&gt;    &lt;arg value=""am""/&gt;    &lt;arg value=""instrument""/&gt;    &lt;arg value=""-w""/&gt;    &lt;arg value=""com.kc.tests/android.test.InstrumentationTestRunner""/&gt;   &lt;/exec&gt;  &lt;/target&gt;&lt;/project&gt;</code></pre><p>i can clean and build the project fine but dont know how to create the apk file, sign it, run the instrumentalTest and produce junit reports in html.</p><p>thanks in advance. this is the first time i have dived into this. i tried auto generating the build.xml using eclipse > project > export >ant build script and it doesnt add the apk building, running the instrumenatlTest and running the emulator stuff in it.</p>","357652","","","","","2010-07-19 08:57:00","ant scripts to build apk file and load it in a emulator?","<android><ant><scripting>","0","3","","",""
"3279656","1","3318558","","2010-07-19 09:02:48","1","1294","<p>I read an article from the web on SL4A (which is  also known as Android Scripting Environment).</p><p>The site from where i got an article is:<a href=""http://infoworld.com/d/developer-world/php-development-comes-google-android-652"" rel=""nofollow"">http://infoworld.com/d/developer-world/php-development-comes-google-android-652</a></p><p>But i got the theorical knowledge only for SL4A (ASE)....</p><p>Anybody having practical idea or practical example, pls suggest to me.</p><ol><li>Which are the scripting language supported by ASE? </li><li>How do i download script ? </li><li>How do i use script?</li></ol>","379693","","","","","2010-07-23 13:30:41","SL4A - Scripting Layer for Android","<android><scripting>","3","0","3","",""
"3279850","1","","","2010-07-19 09:32:37","1","1011","<p>Is it possible to connect the external GSM modem to the android emulator, so that the real RIL function can be observed? </p>","389525","","1448363","","2013-07-10 08:31:44","2013-07-10 08:31:44","Connecting external GSM modem with android emulator?","<android><android-emulator><ril>","1","0","","",""
"3279858","1","3279895","","2010-07-19 09:33:17","1","285","<p>I am doing Android programing with Eclipse (Helios), and I have some utility classes created. How do I set up Eclipse, so that if I use one of my utility classes it gets included when the project compiles?</p>","386680","","14343","","2010-07-21 11:57:19","2010-07-21 11:57:19","how to include utility classes in eclipse (android programming)","<android><eclipse><utility>","1","2","","",""
"3280051","1","3280126","","2010-07-19 10:00:57","70","67499","<p>While working on a simple program in Android, I mistakenly closed LogCat window and I want to know how to show it again.</p>","138030","","469983","","2012-10-23 07:53:32","2014-01-25 13:48:48","How to enable LogCat/Console in Eclipse for Android?","<android><eclipse><logcat>","5","0","5","",""
"3280137","1","3280492","","2010-07-19 10:12:27","4","1030","<p>I would like to create a barcode scanning applciation for iPhone &amp; Android . I have found for iPhone ""Red Laser"" <a href=""http://www.redlaser.com/SDK.aspx"" rel=""nofollow"">http://www.redlaser.com/SDK.aspx</a>.</p><p>I would like to know of any software people know about that has a shared license for both Android and iPhone devices.</p><p>Cheers.</p>","5055","","","","","2010-07-20 06:05:00","Is there a cross platform barcode scanner application with an SDK available for mobile devices?","<iphone><android><api><barcode-scanner>","2","0","","",""
"3280141","1","3281046","","2010-07-19 10:13:05","26","22707","<p>I have an issue with the following error in Android:</p><blockquote>  <p>CalledFromWrongThreadException;: Only  the original thread that created a  view hierarchy can touch its views</p></blockquote><p>It appears to happen when I try to update a Textview in my Activity, the call to update the TextView is from within my Activity but I still get the above error.</p><p>I have it like this:</p><p>onCreate()-sets up the buttons and the text view.</p><p>onStateChange() - a listener for notifications about state changes, when this gets notification if changes the TextView to say some different text.</p><p>When I get notification of a new text I try to change the TextView as so:</p><pre><code>((TextView)findViewById(R.id.title)).setText(""Some Text"");</code></pre><p>But I get the above Error.</p><p>From googling it, it appears I should use a handler to change the TextView or maybe use AsyncTask?</p><p>Could anyone explain which one would be better to use and why?</p><p><strong>EDIT: ADDED CODE SNIPPETS:</strong></p><hr><pre><code>     public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);              setContentView(R.layout.my);            getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.my_title);              ((TextView)findViewById(R.id.time)).setText(""Hello Text"");            findViewById(R.id.keyboardimage).setOnClickListener(new OnClickListener() {                public void onClick(View v) {                    Intent dialIntent = new Intent(Intent.ACTION_DIAL, Uri.parse(""tel:""));                    startActivity(dialIntent);                        dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.FLAG_SOFT_KEYBOARD));                        dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK));                       }        });     }</code></pre><hr><pre><code>//CallBacks from running Serviceprivate final ICallDialogActivity.Stub iCallDialogActivity = new ICallDialogActivity.Stub(){@Overridepublic void onStateChanged(int callState)                throws RemoteException {                switch(callState){            case GlobalData.CALL_STATUS_IDLE:                break;            case GlobalData.CALL_STATUS_DISCONNECTING:                byeSetup();                break;    } };</code></pre><hr><pre><code>public void byeSetup(){            ((TextView)findViewById(R.id.time)).setText(""Bye Text"");            findViewById(R.id.keyboardimage).setOnClickListener(new OnClickListener() {                public void onClick(View v) {                    //Void the Button                }});}</code></pre>","243999","","243999","","2010-07-19 11:07:33","2012-08-21 15:49:55","Android : CalledFromWrongThreadException;: Only the original thread that created a view hierarchy can touch its views","<android><handler><android-asynctask>","2","2","6","",""
"3280146","1","","","2010-07-19 10:14:14","2","2347","<p>I have written some code in eclipse and I want to run it on two separate Android emulators.</p><p>How do I do this when I click ""Run""?</p><p>I read online and it said I need to do AVD configuration.  What is  that and how do I do that?</p><p>Thanks</p>","395714","","","","","2010-07-19 10:18:54","Running two instances of Android emulator","<android><android-emulator>","2","2","","",""
"3280282","1","","","2010-07-19 10:36:38","1","775","<p>when i am trying to run the example of Maps as in <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a> , the menu button doesn't seem to work. I tried the default Maps app in the emulator and there it was working. Also i intend to add an item when a user presses that button , how can do it?</p>","238505","","","","","2010-07-19 17:02:22","Menu button not working on the emulator in a Maps Application","<android><android-emulator>","1","0","","",""
"3280328","1","3294667","","2010-07-19 10:44:24","1","3418","<p>I am working on the <code>Twitter Authentication</code>. The Basic Authentication will <a href=""http://www.countdowntooauth.com/"" rel=""nofollow"">expire</a> on August 16th onwards. So we have to use <code>OAuth</code> to use Twitter Authentication. But Its some Complicated to implement. <code>XAuth</code> is cuts off the two steps. But the Problem is i <a href=""http://twitter4j.org/en/index.html"" rel=""nofollow"">used</a> <code>Twitter4j</code> to authenticate.And also had bad documentation too. I want to use XAuth from 1.6 itself. Which package you suggest to use. and If any <code>example</code> or <code>tutorial</code> for specifiacally for Android to use <code>XAuth</code> Authentication.</p>","267269","","267269","","2010-07-22 11:31:13","2010-09-27 10:18:19","xAuth Authentication for Twitter Share in Android?","<java><android><twitter><xauth>","1","0","0","",""
"3280373","1","3280476","","2010-07-19 10:50:37","1","167","<p>Hey guys!When you are taking a picture on an and device, you can send it. There are apps, which are pushing their actions into these send-list (Like Twidroid, which adds a listitem called ""Send Tweet"" in that menu).</p><p>So, how is it possible to add such a menu point into that menu?For my app, I want to make it possible to take pictures from both (The App itself and via the real camera-send-list) and save them on the sdcard.</p>","381036","","","","","2010-07-19 11:04:01","Android Camera, internal Listoption?","<java><android><listview><camera><sd-card>","1","0","","",""
"3280515","1","3281040","","2010-07-19 11:09:06","2","520","<p>The first activity in my app is a splash screen with a Progress Dialog in which I load data from a Web Service.<br>When this is done I start the next activity and call finish() in the first activity's onPause(), in order for it to not appear again.<br>The next activity is my main menu and on from there I browse the application.<br>The problem is when I want to leave the application. I return to the main menu from whichever activity I have been to and press BACK or HOME.<br>If shortly after I launch the app again, my main menu immediately appears and I do not go through the splash screen where the data is brought over. Also, it seems that the data held prior to leaving was released. As a result, the activities I launch from the main menu (which depend on the data fetched during the splash screen) turn up empty.  </p><p>Does anyone have an idea how to go about this?<br>Thanks, Rob</p>","283630","","","","","2010-07-19 16:47:30","Android: Lifecycle problem - leaving the application","<android><exit><lifecycle>","2","0","","",""
"3280632","1","3280756","","2010-07-19 11:31:10","6","2730","<p>I have this piece of code that I would like to shorten...</p><pre><code>    PackageManager p = context.getPackageManager();    final List&lt;PackageInfo&gt; appinstall = p.getInstalledPackages(PackageManager.GET_PERMISSIONS);    PackageManager pro = context.getPackageManager();    final List&lt;PackageInfo&gt; apllprovides = pro.getInstalledPackages(PackageManager.GET_PROVIDERS);</code></pre><p>I am seriously irritated to do this again and again to add new flag permissions, and I need to do it a couple of times, is there a shorter method in which I could put all the flags on the same definition...???</p><p>Let me put it this way, can I do this...??? (of course this gives an error, but something similar..)</p><pre><code>    PackageManager p = context.getPackageManager();    final List&lt;PackageInfo&gt; appinstall = p.getInstalledPackages(PackageManager.GET_PERMISSIONS).addFlag(PackageManager.GET_PROVIDERS);</code></pre>","393459","","487390","","2012-07-23 05:07:54","2012-07-23 05:07:54","Java: Need some way to shorten this code","<java><android>","3","5","0","",""
"3280639","1","3280901","","2010-07-19 11:32:39","4","243","<p>Basically I'm asking about the Client Id - How do I contact someone without having them contact me first?</p>","178016","","","","","2010-07-19 12:11:06","Can I send a push notification to a phone which I only have its number?","<android>","1","2","1","",""
"3280681","1","3280804","","2010-07-19 11:38:46","3","749","<p>I'm writing a toy car-navigation app for Android, mostly to learn the Android SDK.</p><p>While testing my application, it worked fine for a few hours. Then, suddenly, it reported my position as being in a town 100km south of my real position, travelling at 300km/h. I was in fact travelling at approximately 120km/h.</p><p>I changed application to Google Maps, and it also showed the same erroneous position and approximate velocity. Since I was driving a car in dense traffic at high speed, for safety, I decided not to start fiddling with the phone any more, and just put it away. The next time I took it up (maybe 15 minutes later), the position and velocity was correct again.</p><p>I will add diagnostics to my program to show the reported accuracy of the GPS-fix.</p><p>I have a few questions:</p><ul><li>Is this a hardware/firmware problem in android phones? (I have a HTC Hero)</li><li>Is this a known failure mode of GPS-receivers?</li><li>What could make the GPS-receiver report such inaccurate positions?</li><li>I had another GPS receiver in the car (a Garmin car navigator). Could this receiver have interferred with the HTC Hero unit?</li></ul>","395763","","","","","2010-07-19 12:19:59","Wildly inaccurate GPS position and velocity","<android><geolocation><gps>","2","1","","",""
"3280776","1","","","2010-07-19 11:53:36","3","1122","<p>I want to ask about how to auto refresh the Google Maps?</p><p>So i have an activity with radio button inside that user can choose about the interval of the auto refresh. Then I create a class with a map view with class that extends the CountDownTimer. The problem is <code>MyCountDownTimer</code> has a constructor that display it own interface. Here is my CountDownTimer class.</p><pre>public class MyCountDownTimer extends CountDownTimer{       public MyCountDownTimer(long millisInFuture, long countDownInterval) {        super(millisInFuture, countDownInterval);        // TODO Auto-generated constructor stub    }    @Override    public void onFinish() {    //do something when finish    }    @Override    public void onTick(long millisUntilFinished) {    //do something when the interval is choosen        LocationManager.requestLocationUpdate(GPS_PROVIDER, userChoosenInterval, 0, LcoationListener)    }}</pre><p>how can i modify this class so my user can choose their own interval of auto refresh, or is there any other way around of how to auto-refresh the goole maps? thanks.</p><p>~Regards~</p>","393316","","","","","2011-08-11 19:03:37","Android: Auto Refresh Google Maps","<android><google-maps><timer><refresh><countdown>","1","2","1","",""
"3280779","1","","","2010-07-19 11:53:54","2","1382","<p>As the title, I create a ByteArray to store the file in blob like this: <br><code>byte[] red_buf = myCursor.getBlob(1);</code><br>And I wanna use FileOutputStream to open.<br>But I don't know how to do.<br>Can anyone give me a example or website please ??</p>","364979","","51382","","2010-07-19 12:23:52","2011-05-03 19:02:26","Open file stored in SQLite as blob","<android><sqlite><blob>","2","0","","",""
"3280932","1","3281138","","2010-07-19 12:15:13","0","97","<p>HI i developed application in android 1.5 and i make it for support screens in large and medium and small through coding if i release android 1.5 on market it will appear in all android version phone market (android 1.5 +) .am i get application in droid,small device market and it is work fine or not </p><p>Thanks in Advance</p><p>Aswan</p>","1746300","","","","","2010-07-19 12:51:09","version support in android","<android>","1","0","","",""
"3280944","1","","","2010-07-19 12:16:23","11","11580","<p>I made a custom alert dialog box to be displayed at the end of my game so that the player can enter its name to save it. The problem is when I call <code>show()</code> on the dialog appears but it's not vertically centered! It's a bit lower than it should and no matter what properties I set in the xml or when using <code>setGravity()</code>.</p><p>I think this is the same problem as <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/1ef21c4efc63f96b"">the one mentioned here</a>, but no one gave a proper answer.</p><p>Thanks for your help.</p><p>For more details, here is my code:</p><pre><code>    AlertDialog.Builder builder;    LayoutInflater inflater = (LayoutInflater)this.getSystemService(LAYOUT_INFLATER_SERVICE);    View layout = inflater.inflate(R.layout.newrecord,(ViewGroup)findViewById(R.layout.shoot));    builder = new AlertDialog.Builder(this);    builder.setView(layout);    newRecDialog = builder.create();</code></pre><p>And here is the code of the first element of the XML layout of <code>newrecord.xml</code>:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_height=""fill_parent""android:layout_width=""fill_parent""android:gravity=""center"" android:padding=""10dp""android:baselineAligned=""true""&gt;</code></pre><p>Here is the output screenshot:<img src=""http://the.niox.free.fr/divers/dialog_offset.png"" alt=""alt text""></p>","376373","","709202","","2011-08-10 19:44:04","2013-07-04 10:30:25","Custom Alert dialog not centered vertically on Android","<android><dialog><alert>","8","0","1","",""
"3280964","1","","","2010-07-19 12:19:32","0","426","<p>hi<br /><p>I have used LastKnownLoaction at the start-up Activity of my app to get the location ,if it returns null then  i register for a  Location Listener for both gps and network providers.After requesting for Listener to listen for any location change i switch over to main Activity page using startActivity.Further in the startup Actyivity's onLocation in both Listener i am trying to get location and if any values found then i try to store them in preference and remove updated from both listener   and notify the user about the location being updated.</p><br/>Is this logic is correct way of coding ,do the listener listen for location update when its no longer on the top of the stack ,hence i am using a emulator i couldn't test gps functionality,i required your suggestions on this<br/><br/>thanks</p>","286044","","","","","2010-07-19 12:58:21","doubt in using Location Listener","<android><gps>","1","0","","",""
"3281187","1","3281895","","2010-07-19 12:58:48","1","5413","<p>I know how to change the value of a <code>CheckBoxPreference</code>, but I can't get it to work for a <code>ListPreference</code>.</p><p>Here is how my preference screen is built:</p><ul><li>one <code>CheckBox</code> for the default</li><li>A <code>ListPreference</code> to select a color other than the default.</li></ul><p>The <code>ListPreference</code> is defined with the key ""titleColor"", as follows :  </p><pre><code>CharSequence[] entries = { ""Dark grey"", ""Light grey"", ""Light red"", ""Red"" };CharSequence[] entryValues = { ""#4c4c4c"", ""#b5b5b5"", ""#ab6a68"", ""#962622"" };final ListPreference color = (ListPreference) findPreference(""titleColor"");color.setEntries(entries);color.setEntryValues(entryValues);</code></pre><p>Now, when I select a color I do this:  </p><pre><code>color.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {        public boolean onPreferenceChange(Preference preference, Object newValue) {            System.out.println(""In the onClick method"");            System.out.println(""change title color"");            Editor editor2 = defaultColor.getEditor();            editor2.putBoolean(""defaultColor"", false);            editor2.commit();            return true;        }    });</code></pre><p>And this seems to work, though I'm not sure to do this properly.</p><p>Now I have been trying to do something similar when I select the default color, but I can't get the list to either uncheck everything OR check a color that would be the default.</p><p>Any idea?</p>","263521","","1711796","","2013-10-13 16:39:30","2013-10-13 16:39:30","How to edit a ListPreference value from java code in Android","<android><listpreference>","1","1","","",""
"3281242","1","","","2010-07-19 13:04:47","5","2907","<p>I'm making an application that is posting some information to your facebook wall using facebook sdk for android. This works, but I can't seem to get new lines on the posts. I have tried <code>\n</code> but it doesent work. Any suggestions?</p><p>Here is my code:</p><pre><code>Bundle parameters = new Bundle();String temp = """";for (int i = 0; i &lt; mArrayAdapter.getCount(); i++){            temp = temp + mArrayAdapter.getItem(i) + ""\n""; // Not working}parameters.putString(""message"", temp);mFacebook.dialog(this, ""stream.publish"", parameters, new DialogListener());  </code></pre><p>Thanks,</p><p>James Ford</p>","387543","","","","","2013-02-16 22:39:35","facebook sdk android wall post line break","<android><facebook>","5","0","1","",""
"3281245","1","","","2010-07-19 13:05:16","5","1629","<p>I'm trying to get the names of my folders in ""assets"". I can get the names of the files with an AssetManager by using the method assetManager.list(). But the problem is that it return only files' name and not folders' names. So I'm trying to use the listFiles() method but i can't access to the Assets directory; I've try the following :</p><pre><code>File dir = new File (""file:///android_asset/"");File[] files= dir.listFiles();</code></pre><p>But it doesn't work :( ... Is there a way to get the folders' names contained in the Assets directory ?</p>","395834","","","","","2010-07-19 13:18:02","Get folders name from Assets directory","<android>","1","1","","",""
"3281334","1","3281413","","2010-07-19 13:17:47","6","1431","<p>how can I implement algorithms such as Dijkstra or backtracking on Google Maps integrated in Android ? For example I want to compute a route from city A to city B such that I pay the lowest price for gas.</p>","392696","","265143","","2010-08-02 10:21:41","2011-07-26 23:31:45","Google Maps algorithm","<android><algorithm><google-maps>","2","0","4","",""
"3281345","1","3281861","","2010-07-19 13:18:33","1","2276","<p>I have been running into some troubles recently and I think I need your help :).I am currently trying to show a menu on top of a dialog, I know that it could be far easier to launch a new activity yet doing so would compell me to store/pass a lot of data.I managed to show an optionmenu by writing a custom dialog and rewriting the oncreateOptionMenu method. My problem is I can't get any listener to these button, I tried to rewrite the onoptionitemselectedmethod but nothing happens.Ps: my dialog is nearly full screen so i can't see the activity dialog (i didn't find any put on top method)</p><p>I would be glad to try any solution you could provide.</p><p>Thanks a lot</p><pre><code>public boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    menu.add(Menu.NONE,0,Menu.NONE,c.getString(R.string.home));    menu.add(Menu.NONE,4,Menu.NONE,c.getString(R.string.report));    return true;}public boolean onOptionsItemSelected(MenuItem item) {    super.onOptionsItemSelected(item);    if(item.getItemId()==0){        getOwnerActivity().startActivity(new Intent(c,Home.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));    }    else        if(l&gt;1)            getOwnerActivity().startActivity(new Intent(c,report.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));        else            dismiss();    return true;}</code></pre>","395843","","","","","2010-07-19 14:16:49","option item selection in Dialog menu","<android>","1","0","1","",""
"3281392","1","","","2010-07-19 13:22:44","1","2358","<p>How to Attach video file to my application , and how to show video in videoview ?have any idea about send sms with attached videofile means(mms) in android?if possible , any body give me the Sample code about it??</p>","1101841","","","","","2011-08-10 02:49:32","MMs code for android","<android>","2","0","","",""
"3281549","1","3286938","","2010-07-19 13:40:34","6","8872","<p>I need to record audio and video files to the 3gp/mp4 format in the same file and at the same time.When I run, my application file is created with <code>videofile.3gp</code> but the video does not record to the SD card on the emulator.  Does video record on the emulator?  If I  run this code on an android supported device will I see these errors?</p><p>Code and errors below:</p><pre><code>    package com.video;/* *  * @copy Rights * audio.java * sample code for Eminosoft Developerworks Article * Android developent Team * www.eminosoft.cm *  */import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import android.app.Activity;import android.content.ContentResolver;import android.content.ContentValues;import android.content.Context;import android.content.Intent;import android.media.MediaPlayer;import android.media.MediaRecorder;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.provider.MediaStore;import android.provider.Settings;import android.util.Log;import android.view.View;import android.widget.Button;public class video extends Activity {    public MediaRecorder mrec = null;    private Button startRecording = null;    private Button stopRecording = null;    private static final String TAG = ""SoundRecordingDemo"";    File audiofile;    File video;    private MediaPlayer mMediaPlayer;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mrec = new MediaRecorder();        mMediaPlayer = new MediaPlayer();        Log.i(TAG , ""Video starting"");        startRecording = (Button)findViewById(R.id.startrecording);        stopRecording = (Button)findViewById(R.id.stoprecording);        startRecording.setOnClickListener(new View.OnClickListener(){        public void onClick(View v) {           try           {                   mMediaPlayer=new MediaPlayer();               Context appContext = getApplicationContext();               startRecording.setEnabled(false);               stopRecording.setEnabled(true);               stopRecording.requestFocus();               startRecording();           }catch (Exception ee)           {               Log.e(TAG,""Caught io exception "" + ee.getMessage());           }          }        });        stopRecording.setOnClickListener(new View.OnClickListener(){        public void onClick(View v) {              startRecording.setEnabled(true);              stopRecording.setEnabled(false);              startRecording.requestFocus();              stopRecording();              processaudiofile();          }        });       stopRecording.setEnabled(false);       startRecording.setEnabled(true);    }    protected void processaudiofile() {        ContentValues values = new ContentValues(4);        long current = System.currentTimeMillis();        values.put(MediaStore.Video.Media.TITLE, ""video""+video.getName());        values.put(MediaStore.Video.Media.DATE_ADDED, (int)(current/1000));        values.put(MediaStore.Video.Media.MIME_TYPE, ""video/3gpp"");        values.put(MediaStore.Video.Media.DATA, video.getAbsolutePath());        ContentResolver contentResolver = getContentResolver();        Uri base=MediaStore.Video.Media.EXTERNAL_CONTENT_URI;        Uri newUri = contentResolver.insert(base, values);       // this does not always seem to work cleanly....        //sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,newUri ));      }    protected void startRecording() throws IOException     {        // Configure the input sources        mrec.setAudioSource(MediaRecorder.AudioSource.MIC);        mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA);        // Set the output format        mrec.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);        mrec.setVideoFrameRate(15);        // Specify the audio and video encoding                mrec.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);        mrec.setVideoEncoder(MediaRecorder.VideoEncoder.H264);        //mrec.setMaxDuration(20000); // length of video in MS        //mrec.setVideoSize(320, 240);        // Specify the output file        //mrec.setOutputFile(""/sdcard/myoutputfile.mp4"");        // Prepare to record        //mrec.prepare();        //mrec.start();      //mrec.setOutputFile(video.getPath());      //mrec.setOutputFile(/sdcard/yousuck2.3gp);     // mRecorder.setOutputFile(""/sdcard/yousuck2.3gp"");    if (video == null) {              File sampleDir = Environment.getExternalStorageDirectory();            try {                   video = File.createTempFile(""videofile"", "".3gp"", sampleDir);              }               catch (IOException e)              {                  Log.e(TAG,""sdcard access error"");                  return;              }      }     mrec.setOutputFile(video.getAbsolutePath());      mrec.prepare();      mrec.start();    }    protected void stopRecording() {        mrec.stop();        mrec.release();      }}</code></pre><p>I get the following errors.</p><pre><code>ERROR/AndroidRuntime(16055): ERROR: thread attach failedERROR/audio_input(31): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_valueERROR/audio_input(31): VerifyAndSetParameter failed ERROR/CameraInput(31): Unsupported parameter(x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value) ERROR/CameraInput(31): VerifiyAndSetParameter failed on parameter #0 ERROR/PVOMXEncNode(31): PVMFOMXEncNode-Audio_AMRNB::DoPrepare(): Got Component OMX.PV.amrencnb handle  ERROR/PVOMXEncNode(31): PVMFOMXEncNode-Video_AVC::DoPrepare(): Cannot get component OMX.PV.avcenc handle, try another component if available ERROR/MediaPlayerService(31):   error: -2 ERROR/MediaPlayer(31): Unable to to create media player ERROR/CameraService(31): Failed to load CameraService sounds. ERROR/MediaPlayerService(31):   error: -2    ERROR/MediaPlayer(31): Unable to to create media player ERROR/CameraService(31): Failed to load CameraService sounds.     ERROR/CameraInput(31): No surface is available for display. ERROR/AuthorDriver(31): Command 13 completed with error -1 ERROR/SoundRecordingDemo(15961): Caught io exception prepare failed.</code></pre>","365203","","20712","","2013-02-19 18:16:29","2013-02-19 18:16:29","audio and video recording errors in android","<android><video-capture><audio-recording>","2","0","1","",""
"3281591","1","","","2010-07-19 13:45:32","1","5279","<p>I have an application using ListView inside Tabs, and i'd like to switch to a separate View(data collection widget) on clicking an item in the List.I'm adding each List's row's children to a ViewFlipper and the items are added at runtime so there is no definite number of views. As such, i would want to navigate/switch to a particular View in the ViewFlipper.Any pointers?Thanks in advance.</p>","357442","","","","","2010-07-21 14:56:50","Android - Switching between Multiple Views in a ViewFlipper","<android><listview><views><viewflipper>","3","2","","",""
"3281730","1","3281836","","2010-07-19 14:02:31","0","1269","<p>i m really very fed up coding translate animation.actually my image is moving from one position to another but it is coming back to its actual position.</p><p>can any body here provide me the code to move image from one position to another position without coming back. plssssssssssssssssssssssss provide me the sollution.</p><p>thanks in ad=vance.</p>","383597","","","","","2010-07-19 14:13:57","Android animation","<android><animation>","2","1","1","",""
"3281758","1","","","2010-07-19 14:05:54","0","225","<p>Can the global Android <code>Application</code> object, which is obtained via <code>getApplication()</code>, implement an AIDL callback interface and communicate with remote services? Also, can it launch Activities and send intents?</p><p>From my understanding, the operations above are typically reserved for Android app components: activities, services, and content providers. Thus I am not sure if an <code>Application</code> object can perform these as well.</p>","440093","","","","","2010-07-19 14:14:00","Android: Can the Global Application Object Bind to Remote Services and Launch Activities?","<android>","1","0","","",""
"3281790","1","3282924","","2010-07-19 14:08:07","0","1088","<p>I am using following <a href=""http://getablogger.blogspot.com/2008/01/android-how-to-post-file-to-php-server.html"" rel=""nofollow"">tutorial</a> to upload image file to webserver.</p><p>and getting file not found exception here.</p><pre><code>try {         File uploadFile = new File(uriString); // file path i receive **content:/media/external/images/media/2**        FileInputStream fis =   this.openFileInput(uploadFile.getName()); // **ERRoR HERE**        HttpFileUploader htfu = new HttpFileUploader(""http://finditnear.sigmatec.com.pk/inbox/send_remote_reply"",""noparamshere"", uploadFile.getName());        htfu.doStart(fis);        }     catch (FileNotFoundException e) {        Toast.makeText(this, e.toString(), Toast.LENGTH_LONG).show();        e.printStackTrace();        return;        }</code></pre><p>image file exists there but still it giving me error.</p><p>Can any one guide me what is the solution?</p>","249991","","249991","","2010-07-19 16:21:19","2010-07-19 16:24:23","file not found exception while uploading file to web server?","<android>","2","0","","",""
"3281840","1","","","2010-07-19 14:14:13","1","341","<p>Am new to this Android SDK platform,so could you people help me out to solve my issue.so lets discuss brief about my issue, am developing small application in which am using sppiner to list all country states and zip codes so my question is when i select one country state in a list it should automatically populate and display its corresponding zip code </p><p><strong>below is my main.xml file</strong>                              <pre><code> android:layout_centerHorizontal=""true"" android:layout_marginTop=""2dp"" android:padding=""12dip"" android:layout_height=""40dip"" android:layout_marginRight=""20dip"" /&gt;</code></pre><p></p><p><strong>here is my Activity class</strong></p><p>import android.app.Activity;</p><p>import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Spinner;import android.widget.AdapterView.OnItemSelectedListener;</p><p>public class EriePremium extends Activity {    /** Called when the activity is first created. */</p><p>@SuppressWarnings(""unchecked"") @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code>    Spinner s = (Spinner) findViewById(R.id.spinner);     ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.States, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    s.setAdapter(adapter);Spinner s1 = (Spinner) findViewById(R.id.spinner1); ArrayAdapter adapter1 = ArrayAdapter.createFromResource(this, R.array.Zip, android.R.layout.simple_spinner_item);adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);s1.setAdapter(adapter1); }</code></pre><p>}</p><p><strong>and my array list array.xml file</strong></p><p>        Alabama        Alaska<br>        American Samoa<br>        Arizona<br>        Arkansas<br>        California<br>        Colorado<br>        Connecticut<br>        Delaware        District of Columbia<br>        Florida<br>        Georgia<br>        Guam<br>        Hawaii<br>        Idaho<br>        Illinois<br></p><p>        1001<br>        1002<br>        1003<br>        1004<br>        1005<br>        1006<br>        1007<br>        1008        1009<br>        1010<br>        1011<br>        1012<br>        1013<br>        1014<br>        1015<br>        1016<br></p><p>Awaiting for response</p><p>Thanks in advance,Madhu</p>","395895","","","","","2010-07-19 14:14:13","How to display the vaule(dependent value) when we select one item form the list of values in Android SDK?","<android>","0","0","","",""
"3281890","1","3281985","","2010-07-19 14:20:28","5","2455","<p>I have a background Service which must run permanently. The service just has to interact with my Activity. </p><ol><li><p>How to i check on activity resume if the service is still running? Is there a better possibility than a static variable in the service class?</p></li><li><p>Is it of advantage to use a remote service in a separate process(to extend service life time) so that when the activity process gets killed the service is still alive?</p></li></ol>","281535","","995926","","2012-05-05 13:38:33","2012-05-05 13:38:33","Local service or remote service?","<android><android-2.2-froyo>","3","1","5","",""
"3281988","1","3316599","","2010-07-19 14:28:50","0","1947","<p>(I'm Coming from a C# background writing iPhone apps with MonoTouch)</p><p>I have a simple app that needs to save button color. I have this code in a Settings class that is a singleton.  </p><p>Is this the way it 'should' be done? I usually like having a single Setting instance that is accessed around the app in my C# iPhone apps.</p><pre><code>private static Bundle bundle = new Bundle();public static int getButtonColor() {    return bundle.getInt(""buttonColor"", RED_BUTTON) ;}public static void setButtonColor(int SettingButtonColor) {    bundle.putInt(""buttonColor"", SettingButtonColor);}</code></pre>","172861","","","","","2010-07-23 08:40:40","Android Bundle in properties","<android><bundle>","2","0","","",""
"3282051","1","3282114","","2010-07-19 14:37:07","1","423","<p>I've found today that my recently published app on the Android Market,<br>is not showing up on this device Market: <a href=""http://www.samsung.com/uk/consumer/mobile-phones/mobile-phones/smartphone/GT-I5800DKAXEU/index.idx?pagetype=prd_detail&amp;tab=specification"" rel=""nofollow"">Samsung Apollo</a>.  </p><p>I've already followed this <a href=""http://developer.android.com/guide/practices/screens_support.html#strategies"" rel=""nofollow"">tutorial</a>  to make my app accesible to almost all devices configurations<br>and it still don't show on that device's Market.  </p><p>What am I doing wrong?</p>","243376","","119895","","2010-07-19 14:43:34","2010-07-19 17:31:31","My App doesn't show up on the market","<android><android-manifest><google-play>","2","1","","",""
"3282176","1","3282203","","2010-07-19 14:52:46","2","694","<p>I want to put the Android's Analog Clock in my app, is there a way?</p><p><strong>--update</strong></p><p>Studying <a href=""http://developer.android.com/guide/topics/appwidgets/index.html"" rel=""nofollow"">android developers</a> page. It says that </p><blockquote>  <p>""App Widgets are miniature application  views that can be embedded in other  applications (such as the Home  screen)""</p></blockquote><p>so, looks like there is a way.</p><p><strong>--update</strong></p><p>Still nothing, read all details of the above page, but found nothing about how to add a widget to my app.</p>","287316","","287316","","2010-07-27 18:27:09","2010-07-27 18:27:09","How to add an Android widget to my app?","<android><widget><android-widget>","1","0","0","",""
"3282185","1","3282248","","2010-07-19 14:54:28","2","596","<p><strong>any good framework I can use to listen for touch, swipes and pinch actions?</strong></p><hr><p>Ideas would be awesome! =)</p>","208827","","","","","2010-09-02 21:53:31","Framework for catching Android/iPhone touch actions? - Javascript","<javascript><iphone><android><touch><mobile-safari>","3","0","","",""
"3282191","1","3282221","","2010-07-19 14:55:09","0","1363","<p>I am trying to get a <strong>SharedPreferences</strong> object from the <strong>PreferenceManager</strong> but don't want to pass in the <strong>Context</strong> to the class.</p><p>Can I get a ""global"" context from inside my class?</p><pre><code>SharedPreferences pref =    PreferenceManager.getDefaultSharedPreferences(Some Global Context);</code></pre>","172861","","","","","2010-07-19 14:59:03","Android PreferenceManager without visual component?","<android><sharedpreferences>","1","0","","",""
"3282204","1","","","2010-07-19 14:57:13","5","2240","<p>Im writing a program that offers a quick reply dialog upon receipt of an SMS.</p><p>However, I am getting an unexpected result. When I receieve an SMS, the appropriate dialog activity comes up displaying the correct phone number and message, however there is a second activity behind it that is the 'default' activity in my program (it is what opens when i launch my application)</p><p>I do not want this second activity to come up. The quick reply activity should come up by itself over top of whatever the user was doing before.</p><p>The 'floating' activity:</p><pre><code>public class quickReply extends Activity {String mNumber, mMessage;TextView mMainText;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mMainText = (TextView)findViewById(R.id.mainText);    try{        Intent i = getIntent();        Bundle extras = i.getExtras();        mNumber = extras.getString(""theNumber"");        mMessage = extras.getString(""theMessage"");         this.setTitle(""Message From:"" + mNumber);         mMainText.setText(mMessage);    } catch(Exception e) {        mMainText.setText(e.getMessage());    }      }</code></pre><p>}</p><p>The call to the activity inside an onReceive()</p><pre><code>        Intent i = new Intent(context, quickReply.class);    i.putExtra(""theNumber"", mNumber);    i.putExtra(""theMessage"", mMessage);    i.setFlags(            Intent.FLAG_ACTIVITY_NEW_TASK);    context.startActivity(i);</code></pre><p>The Manifest:</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".quickReply""              android:label=""@string/app_name""              android:theme=""@android:style/Theme.Dialog""              &gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;       &lt;receiver android:name="".SmsReceiver""&gt;         &lt;intent-filter&gt;             &lt;action android:name=                ""android.provider.Telephony.SMS_RECEIVED"" /&gt;         &lt;/intent-filter&gt;     &lt;/receiver&gt;&lt;/application&gt;</code></pre><p></p>","391979","","","","","2013-08-08 23:31:53","android open dialogue activity without opening main activity behind it","<android><dialog><activity>","2","0","1","",""
"3282238","1","","","2010-07-19 15:00:45","1","1890","<p>I have an app which uses the Camera, sending the preview to a SurfaceHolder. Everything works fine on the HTC Desire that I have been developing on, but when I run it on a Samsung Galaxy S the image from the preview is rotated 90 degrees. </p><p>The code attempts to match the best Size returned from the parameters.getSupportedPreviewSizes(), with the width and height of the Surface (as passed into SurfaceChanged as width and height).</p><p>(the image is also rotated on the Galaxy when an image is taken from the app).</p><p>Has anyone else had problems with the preview on the Galaxy? Or better yet got around the problems?</p>","390483","","","","","2010-07-23 03:35:32","Camera Preview on Galaxy S","<android><camera>","1","0","2","",""
"3282291","1","","","2010-07-19 15:06:40","3","1214","<p>I have a camera app, in it's simplest state it's nothing more then the cameraPreview example with some 'takePicture' code. The link to the example online is for 2.0, and i'm developping against 1.5 (API lvl 3), but still, here it is: <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html</a></p><p>The biggest difference with the old version is the whole ""getOptimalPreviewSize"" thing.Everything is done landscape.</p><p>Now the problem is: i have a preview, but when i take the picture there is more information on that picture then there is on the preview. The top and bottom show stuff that wasn't visible on the preview.</p><p>Now i am going to put an overlay on top of the preview, to align the object in the picture with something. If the picture is taken, the whole thing gets squeezed a bit, and i'm all out of alignment :(.</p><p>The camera app on the system doesn't have this problem, so it must be possible to fix this. Any thoughts?</p><p>If i must manually set the preview and/or picture size, i'll have trouble with different handsets i guess, and because there are a lot of function only since API lvl 5 (e.g.: getOptimalPreviewSize), I can't use these.</p>","395937","","","","","2013-08-10 21:43:42","Android - picture taken different from preview","<android><image><camera><preview>","2","2","3","",""
"3282390","1","8780360","","2010-07-19 15:19:59","35","10802","<p>I'm trying to add a little space between lines to my TextViews using <code>android:lineSpacingMultiplier</code>from the <a href=""http://developer.android.com/reference/android/widget/TextView.html#attr_android%3alineSpacingMultiplier"">documentation</a>:</p><blockquote>  <p>Extra spacing between lines of text,  as a multiplier. </p>    <p>Must be a floating point value, such  as ""1.2"".</p></blockquote><p>As I'm using this in a few different TextViews I would like to add a global dimension/value to my resources, but I don't know which tag to use, if it even exists.I have tried all <a href=""http://developer.android.com/guide/topics/resources/available-resources.html"">resource types</a> that make sense to me, but none of them works.</p><p>What I would like to have would be something like this:</p><pre><code>&lt;resources&gt;    &lt;dimen name=""text_line_spacing""&gt;1.4&lt;/dimen&gt;&lt;/resources&gt;</code></pre><p>Edit: I'm aware of <code>android:lineSpacingExtra</code> (which needs a dimension with an appended unit), but I'd like to use <code>android:lineSpacingMultiplier</code> if possible. </p>","323715","","44390","","2012-06-15 15:48:01","2013-11-21 11:50:53","Add floating point value to android resources/values","<android><resources><floating-point>","5","0","7","",""
"3282401","1","","","2010-07-19 15:21:17","1","599","<p>I want to detect the correct rotations around X axis with Android sensors. After googling, I find this code:</p><pre><code>   public void onSensorChanged(SensorEvent event) {   Sensor sensor = event.sensor;   switch(sensor.getType()) {   case Sensor.TYPE_ACCELEROMETER:    mAcc = event.values.clone();    break;   case Sensor.TYPE_MAGNETIC_FIELD:    mMag = event.values.clone();    break;   }   if (mAcc == null || mMag == null) return;   float R[] = new float[9];   if (SensorManager.getRotationMatrix(R, null, mAcc, mMag)) {    SensorManager.getOrientation(R, mOrientation);   }  }</code></pre><p>mOrientation[1] represents the radians around the X axis. However, the value is very odd. </p><ol><li>When the phone lies flat top up on the table, it's 0.</li><li>When the head of the phone pointing to the ground, it's PI/2.</li><li>When the phone lies flat bottom up on the table, it's 0 again.</li><li>When the head of the phone pointing to the sky, it -PI/2.</li></ol><p>The states between 1,2 have the same rotation values of those between 2,3. How could I tell which state my phone is in?</p>","395952","","244296","","2010-07-19 15:22:35","2011-03-05 04:11:57","Question about the rotation of X axis on Android","<android><sensor>","1","0","","",""
"3282406","1","","","2010-07-19 15:22:11","1","158","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3282401/question-about-the-rotation-of-x-axis-on-android"">Question about the rotation of X axis on Android</a>  </p></blockquote><p>I want to detect the correct rotations around X axis with Android sensors. After googling, I find this code:</p><pre><code>public void onSensorChanged(SensorEvent event) {        Sensor sensor = event.sensor;        switch(sensor.getType()) {        case Sensor.TYPE_ACCELEROMETER:            mAcc = event.values.clone();            break;        case Sensor.TYPE_MAGNETIC_FIELD:            mMag = event.values.clone();            break;        }        if (mAcc == null || mMag == null) return;        float R[] = new float[9];        if (SensorManager.getRotationMatrix(R, null, mAcc, mMag)) {            SensorManager.getOrientation(R, mOrientation);        }    }</code></pre><p>mOrientation[1] represents the radians around the X axis. However, the value is very odd. </p><ol><li>When the phone lies flat top up on the table, it's 0.</li><li>When the head of the phone pointing to the ground, it's PI/2.</li><li>When the phone lies flat bottom up on the table, it's 0 again.</li><li>When the head of the phone pointing to the sky, it -PI/2.</li></ol><p>The states between 1,2 have the same rotation values of those between 2,3. How could I tell which state my phone is in?</p>","395952","","","","","2010-07-19 15:22:11","Question about the rotation of X axis on Android","<android><sensor>","0","0","","2010-07-20 04:37:51",""
"3282591","1","3318787","","2010-07-19 15:42:45","1","664","<p>Have another issue here.</p><p>Our app starts out with a tab activity. But, before the user can get into the tab activity to do work, we have to check to see if they're logged in.  This login is required for all activities within the tab activity.  So, instead of having this security check within all the activities, we created our own abstract ""activity"" and have the tab activities extending our custom activity.</p><p>Our ""security check"" (just see if they have a login key and login token in Preferences) is put within the onResume() of the Abstract activity.  If either of these checks come back false, we fire off the login activity and use dialog's within that screen.(We're doing this because we don't want the user to be able to see the data on the tabs if they're not logged in, so this login activity is a black background with dialogs for username/password).  The issue is, the onResume() of the abstract activity is being called numerous times, and starts the Login Activity multiple times. </p><p>We've tried setting the ""singleInstance"" and singleTask flags on the xml for the login activity, but the activity ends up calling onActivityResult before it is even displayed on the screen.</p>","385565","","","","","2010-07-23 13:57:49","Activity being fired off too many times","<android>","2","1","","",""
"3282596","1","3284490","","2010-07-19 15:43:07","0","230","<p>I'm attempting to call a method which is outside the class I'm working in from an openGL thread but I'm getting a <code>Can't create                  handler inside thread that has not called Looper.prepare()</code> runtime exception. Does anyone know of a way around this without putting the                  method in the same class?</p><p>Program breaks @ <code>Extract cam = new Extract();</code></p><pre><code>        public void onDrawFrame(GL10 gl) {    onDrawFrameCounter++;    gl.glEnable(GL10.GL_TEXTURE_2D);    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    bindCameraTexture(gl);    System.out.println(Global.bearing);    float bear = Global.bearing;    gl.glLoadIdentity();    gl.glNormal3f(0,0,1);    System.out.println(""ARRAY!: "" + GLCamTest.array.length);    p = 0;    gl.glRotatef(bear, 1, 0, 0);    int q = 0;    int e = 0;      if(q &lt; Global.cubes){                Extract cam = new Extract();                Bitmap image = cam.extractimage(q);                final int TILE_WIDTH = 512;                final int TILE_HEIGHT = 512;                final int TILE_SIZE = TILE_WIDTH * TILE_HEIGHT;                int[] pixels = new int[TILE_WIDTH];                short[] rgb_565 = new short[TILE_SIZE];                // Convert 8888 to 565, and swap red and green channel position:                int i = 0;                for (int y = 0; y &lt; TILE_HEIGHT; y++) {                    image.getPixels(pixels, 0, TILE_WIDTH, 0, y, TILE_WIDTH,        1);                    for (int x = 0; x &lt; TILE_WIDTH; x++) {                        int argb = pixels[x];                        int r = 0x1f &amp; (argb &gt;&gt; 19); // Take 5 bits from23..19                        int g = 0x3f &amp; (argb &gt;&gt; 10); // Take 6 bits from15..10                        int b = 0x1f &amp; (argb &gt;&gt; 3); // Take 5 bits from  7.. 3                        int rgb = (r &lt;&lt; 11) | (g &lt;&lt; 5) | b;                        rgb_565[i] = (short) rgb;                        ++i;                    }                }                ShortBuffer textureBuffer = ShortBuffer.wrap (rgb_565, 0,        TILE_SIZE);                gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGB, 48, 48, 0,                        GL10.GL_RGB, GL10.GL_UNSIGNED_SHORT_5_6_5,        textureBuffer);    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e + 4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e + 4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e + 4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e + 4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e + 4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e + 4;    q++;    }}</code></pre>","358438","","358438","","2010-07-19 15:59:33","2010-07-19 19:51:49","Calling external methods from within openGL class","<android>","1","2","","",""
"3282702","1","","","2010-07-19 15:53:53","16","4518","<p>Is there a way to run unit tests for Android from Eclipse in a way that will instrument the code and measure test code coverage? </p><p>I'm looking for a simple way to find out which parts of my application aren't tested yet, fix the test cases and see if that helped.</p>","3105","","","","","2014-04-05 19:36:14","Android test code coverage, Eclipse","<java><android><eclipse>","4","0","","",""
"3282789","1","3282947","","2010-07-19 16:06:26","0","948","<p>In the app I am making, I would like to take a Base64 image that is received from a server, and save it to a file for displaying later. My question is where should I store this file? It needs to be dynamic, and may be empty when the program launches. I am unsure how exactly the file system on Android works, such as how file paths look.</p><p>Ideally I would like to be able to write the data to the image file using a FileOutputStream, and then display that image somehow.</p><p>Thanks!</p>","395986","","","","","2010-07-19 16:27:39","File path for base64 image in Android","<android><path><base64>","1","0","","",""
"3282905","1","3284361","","2010-07-19 16:21:27","0","830","<p>i want to serialize an intent after i rcv it using <code>ObjectOutputStream</code>  , but i got this exiption </p><p><code>java.io.NotSerializableException: android.content.Intent</code></p><p>is there away so i could serialize the intent, thanks. </p>","302707","","","","","2010-07-19 19:32:45","Serialize an intent in Android?","<java><android>","1","3","","",""
"3282940","1","3514435","","2010-07-19 16:27:00","35","24598","<p>Is it possible to set the color of just span of text in a TextView?</p><p>I would like to do something similar to the Twitter app, in which a part of the text is blue. See image below:</p><p><img src=""http://img830.imageshack.us/img830/228/device.png"" alt=""alt text""></p>","143378","","2065587","","2013-12-04 12:11:56","2014-04-11 18:16:33","Set color of TextView span in Android","<android><text><formatting><android-textview>","6","0","17","",""
"3282988","1","","","2010-07-19 16:34:12","0","501","<p>I'm using a FrameLayout and have two buttons on it, button A and button B (in addition to some other widgets).  A is directly on top of B, overlapping completely.</p><p>In onCreate, I do a check and if A is not needed, I set it to invisible.  Later in the app it may become visible again so I don't want to remove it completely.</p><p>When button B is pressed, it doesn't respond.  I think button A is stopping the press even though it's invisible.  Other buttons do respond so this is why I think this.</p><p>Is there a common way to make it so B accepts touches?  Do I have to remove A?  I don't really want to remove A as I have a relative layout in the frame layout and other controls depend on A for positioning.</p>","386541","","","","","2010-07-19 18:21:43","FrameLayout buttons overlap, and can't be 'touched. - what's right way to access?","<android>","1","2","","",""
"3283337","1","","","2010-07-19 17:20:19","5","9666","<p>I've been trying to update my spinner in android dynamically but nothing I try has been working.</p><p>This is the following code I'm using to update the spinner. </p><pre><code>typeList = dbAdapter.getList(); //array list with the valuesadapter.notifyDataSetChanged();groupSpinner.postInvalidate();groupSpinner.setAdapter(adapter);</code></pre><p>The values of typeList are correct but they're not being updated in the Spinner.</p><p>Thanks</p>","306410","","","","","2014-02-25 17:34:13","How to update a spinner dynamically in Android?","<android><gui><spinner>","6","1","4","",""
"3283352","1","","","2010-07-19 17:22:22","1","894","<p>For some reason the camera feed in my program is sideways. If I hold my finger up to the camera from the bottom, it shows up as coming from the right in the surfaceview.</p><p>I have a pretty standard implementation</p><pre><code>    surfaceView = (SurfaceView)findViewById(R.id.surfaceView);    surfaceHolder = surfaceView.getHolder();    surfaceHolder.addCallback(surfaceCallback);    surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);</code></pre><p>I've looked around but I can't seem to find any information on this. My device is a nexus One.</p><p>EDIT: If I set the screen orientation to landscape then it works fine for some reason... Can't get it in portrait though.</p>","180470","","180470","","2010-07-19 18:36:48","2012-01-13 09:15:09","SurfaceView is displaying camera feed sideways","<java><android>","2","1","1","",""
"3283799","1","3284254","","2010-07-19 18:16:07","1","334","<p>I have 2 apps running, and I need to pass an image resource from the first app to the second.</p><p>The ImageView have a setImageURI(Uri) method, that I could use in the second app, but does not have a getUri() for me to use in the first.</p><p>Any idea how to do this?</p><p>-- update</p><p>looks like <a href=""http://developer.android.com/guide/topics/providers/content-providers.html"" rel=""nofollow"">Content Providers</a> can solve the problem. (studying)</p>","287316","","287316","","2010-07-19 20:45:19","2010-07-20 00:21:16","How pass an image resource from my app to another?","<android><resources>","2","0","1","",""
"3283819","1","3283976","","2010-07-19 18:19:17","3","12102","<p>What do I need to my code to make the dialog <code>dismiss()</code> after the webview is loaded?</p><pre><code>public void onCreate(Bundle savedInstanceState) {             super.onCreate(savedInstanceState);             setContentView(R.layout.main);             CookieSyncManager.createInstance(this);            CookieSyncManager.getInstance().startSync();            webview = (WebView) findViewById(R.id.webview);            webview.setWebViewClient(new homeClient());            webview.getSettings().setJavaScriptEnabled(true);            webview.getSettings().setPluginsEnabled(true);            webview.loadUrl(""http://google.com"");            ProgressDialog pd = ProgressDialog.show(Home.this, """",                     ""Loading. Please wait..."", true);        }</code></pre><p>I've tried</p><pre><code>public void onPageFinshed(WebView view, String url){        pd.dismiss();    }</code></pre><p>Didn't work.</p>","393373","","393373","","2010-07-19 19:13:45","2012-02-22 03:09:58","How do i make my progress dialog dismiss after webview is loaded?","<java><android><webview><progressdialog><dismiss>","4","2","2","",""
"3283828","1","3284217","","2010-07-19 18:19:53","1","811","<p>I have am having some issues with getting consistent results when checking if the network is available or not.</p><p>I use this code snippet inside a class AppPreferences to check the availability of a network.</p><pre><code>/**     * @return the networkAvailable     */    public boolean isNetworkAvailable() {        connectionManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);        networkAvailable = connectionManager.getActiveNetworkInfo() != null &amp;&amp; connectionManager.getActiveNetworkInfo().isConnected();        return networkAvailable;    }</code></pre><p>Before each run I set the context as below:</p><pre><code>timer.scheduleAtFixedRate(                new TimerTask() {                    public void run() {                        appPreferences.setContext(getBaseContext());                        if (appPreferences.isNetworkAvailable()){                            // perform task                        }                    }                },                0,                UPDATE_INTERVAL);</code></pre><p>I do know it is not tied to the background thread as I have a onReceive call doing the same logic and still this check fails. </p><p>It seems to predominantly happen when it moves between a cellular data connection and to wifi, or vice versa. The Context in which it was started seems to stay even though I update it.</p><p>Does anyone have any idea what could be the issue here?</p>","334064","","1228","","2013-09-06 20:26:37","2013-09-06 20:26:37","NetworkAvailability check returns false yet the phone is online","<android><networking><manager><connectivity>","1","3","1","",""
"3284055","1","3284135","","2010-07-19 18:52:50","4","1341","<p>I'm about to release an application in the Android Market. I need to generate a keystore to sign my application. The docs are a little spares on what I'm support to put into for the <code>-dname</code> param.</p><p>Here is the line I'm using:</p><pre><code>keytool -genkey -v -alias release -keyalg RSA -keysize 2048 -dname ""CN=mydomain.com"" -keystore my.keystore -validity 10000 </code></pre><p>What is required in the <code>-dname</code> (Distinguished Name) field? I found out that I can include the <code>CN</code> field. Are there other fields that I must put in before the Market will accept the app? Any good optional ones to put in?</p><p><strong>Updated</strong>I found out I can examine other apk's by using:</p><pre><code>jarsigner -verify -verbose -certs nameof.apk</code></pre><p>Here are some examples:</p><ul><li>from <a href=""http://slideme.org/"" rel=""nofollow"">http://slideme.org/</a>  <code>X.509, CN=SlideME, OU=SlideME, O=SlideME, L=Seattle, ST=WA, C=US</code></li><li>Opera Mini   <code>X.509, CN=Unknown, OU=Unknown, O=Opera Software ASA, L=Oslo, ST=Unknown, C=NO</code></li><li>Another random app,  <code>X.509, CN=Romeo Ordos, O=GHOR Corp., L=Donetsk, C=UA</code></li></ul>","62984","","62984","","2010-07-19 19:26:17","2013-09-03 13:26:23","What should I use for ""Distinguished Name"" in our Keystore for the Android Market","<android><google-play><keytool>","2","0","3","",""
"3284082","1","3284430","","2010-07-19 18:56:39","0","188","<p>I've made a customAdapter that accepts an ArrayList.  The ArrayList contains a title and then a link. </p><p>For example: [Title1, <a href=""http://mylink1.com/"" rel=""nofollow"">http://mylink1.com/</a>, Title2, -http://mylink2.com/-, Title3, -http://mylink3.com/- ...]  ** I've put hypens there because of the ""Stackoverflow"" Spam filter.</p><p>I'm wanting to display the title and then have the on click listener to have the link.  I'm having trouble however figuring out a way to do this.  Any help would be greatly appreciated! :)</p>","394241","","","","","2010-07-19 19:43:17","How to display every other string within View getView()?","<android><listview>","1","0","","",""
"3284083","1","4921024","","2010-07-19 18:56:41","9","4898","<p>Where should I start an <code>AnimationDrawable</code> that needs to animate when the activity is shown?</p><p>The developer guide <a href=""http://developer.android.com/guide/topics/graphics/2d-graphics.html#frame-animation"">recommends</a> using <code>onWindowFocusChanged</code>, but this isn't always called when the activity is part of a <code>TabHost</code>. </p><p>I quote:</p><blockquote>  <p>It's important to note that the  start() method called on the  AnimationDrawable cannot be called  during the onCreate() method of your  Activity, because the  AnimationDrawable is not yet fully  attached to the window. If you want to  play the animation immediately,  without requiring interaction, then  you might want to call it from the  onWindowFocusChanged() method in your  Activity, which will get called when  Android brings your window into focus.</p></blockquote>","143378","","143378","","2010-07-19 21:19:06","2014-03-03 19:27:33","Starting an AnimationDrawable in Android","<android><animation><android-tabhost><drawable>","4","0","2","",""
"3284407","1","","","2010-07-19 19:40:13","20","33179","<p>Encounter this problem when trying to Build Project getting such output in console:</p><pre><code>[2010-07-19 23:29:23 - myProject]trouble processing ""javax/net/SocketFactory.class"":[2010-07-19 23:29:23 - myProject] Attempt to include a core VM class in something other than a core library.It is likely that you have attempted to include the core library from a desktopvirtual machine into an application, which will most assuredly not work. Ifyou really intend to build a core library -- which is only appropriate aspart of creating a full virtual machine binary, as opposed to compiling anapplication -- then use the ""--core-library"" option to suppress this errormessage. If you go ahead and use ""--core-library"" but are in fact buildingan application, then please be aware that your build will still fail at somepoint; you will simply be denied the pleasure of reading this helpful errormessage.[2010-07-19 23:29:23 - myProject] 1 error; aborting[2010-07-19 23:29:23 - myProject] Conversion to Dalvik format failed with error 1</code></pre><p>I was looking for my project to use the package javax, not found, clean all also does not help. what I am doing wrong?</p><p><strong>Update</strong></p><p>Sorry guys, but I could not find good fix for that, I want to emphasize the fact, that i dont use <code>SocketFactory</code> class in my project at all! source code was not changed before this problem, and that's why i think that problem in eclipse or adt or something else, BUT if i use ant(generated by sdk) to build this project there is no problem!!!</p><p>I solve this problem by removing Eclipse, Android SDK, Eclipse workspace, and just reinstall them, after this all works fine for now.</p><p>Hope this will help someone.</p>","309955","","844882","","2012-03-18 06:49:20","2013-02-19 01:28:14","Conversion to Dalvik format failed with error 1 with javax/net/SocketFactory.class","<android><dalvik>","19","0","4","",""
"3284525","1","3284551","","2010-07-19 19:57:27","0","1488","<p>canvas.drawRect(left, top, right, bottom, paint);</p><p>Say I want to draw rectangle </p><p>x=30 to x=35of height y=50.What would be the values in above method. Thank you very much. </p>","357349","","","","","2011-03-23 12:12:30","Rectangle in Android","<android>","1","0","","",""
"3284583","1","3284666","","2010-07-19 20:04:53","5","19071","<p>I don't have an embedded camera in the lid of my notebook.  I'd be hooking up through an external USB camera.</p><p>The emulator runtime can pick this up right?  I'll get the image displayed inside the AVD skin's screen in real time?</p>","225626","","409251","","2012-10-21 02:46:55","2012-10-21 02:46:55","Camera on Android Eclipse emulator:","<android><android-emulator><android-camera>","4","0","4","",""
"3284604","1","17299528","","2010-07-19 20:07:30","0","698","<p>So I'm messing with <code>imageviews</code> and I am able to align a single <code>imageview</code> in the center horizontally with the following code:</p><pre><code>android:layout_centerHorizontal=""true""</code></pre><p>Now my main problem is that I have X <code>imageviews</code> and when I align them all like that and then use the <code>android:layout_toRightOf=""""</code>, they just start from the middle.</p><p>What to do?</p>","396182","","1618135","","2013-06-25 14:01:18","2013-06-25 14:06:52","android app: aligning imageviewS in center horizontally","<java><android><imageview>","2","0","","",""
"3284607","1","","","2010-07-19 20:07:44","1","1973","<p>I'm trying to replicate this class called MediaMetadataRetriever in my own android project. You can see the class here:<a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=media/java/android/media/MediaMetadataRetriever.java;h=681751b4d15115ffceb2c1d812b5d0f68b11a5ab;hb=HEAD"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=media/java/android/media/MediaMetadataRetriever.java;h=681751b4d15115ffceb2c1d812b5d0f68b11a5ab;hb=HEAD</a> </p><p>In line # 37 you can see: System.loadLibrary(""media_jni"");</p><p>How do I get that library. My logcat shows this:</p><p>Caused by: java.lang.UnsatisfiedLinkError: Library media_jni not found</p>","394675","","","","","2010-07-19 20:52:39","android Library media_jni not found","<android><media>","1","0","","",""
"3284693","1","3284726","","2010-07-19 20:16:49","2","1502","<p>I have the following broadcast receiver:</p><pre><code>public class MyRingModeReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        Logger.iLog(""In my Receiver"");    }}</code></pre><p>I then have a service that onCreate does the following:</p><pre><code>    IntentFilter filter = new IntentFilter();    filter.addAction(""android.media.RINGER_MODE_CHANGED"");    registerReceiver(new MyRingModeReceiver() , filter);</code></pre><p>When I place a call to the emulator and use the volume keys to modify (silence) the ringernothing happens. Any ideas of what it is that i am doing wrong?</p><p>Thanks.</p>","354607","","","","","2010-07-19 20:21:13","How to receive broadcasts of RINGER_MODE_CHANGED_ACTION","<android><broadcastreceiver>","1","0","","",""
"3284730","1","3284797","","2010-07-19 20:21:55","1","2706","<p>I created a small Tab-Layout. </p><p>Now how can i specify the color of the TabWidget depending on its state (focused,pressed..)</p><p>I built a new .xml, but i dont know how to set it to my Tabs:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;selector    android:id=""@+id/tabSelector""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item        android:state_focused=""false""        android:state_selected=""false""        android:state_pressed=""true""        android:background=""#32CD32""/&gt;  &lt;br /&gt;    &lt;item        android:state_focused=""false""        android:state_selected=""true""        android:state_pressed=""false""/&gt;    &lt;item        android:state_focused=""true""        android:state_selected=""false""        android:state_pressed=""false""/&gt;    &lt;item        android:state_focused=""true""        android:state_selected=""true""        android:state_pressed=""false""/&gt;&lt;/selector&gt;</code></pre>","395135","","488241","","2011-03-23 10:27:50","2011-03-23 10:27:50","Android - Where to set the color of pressed,focused... Tabs?","<android><colors><tabs><state>","2","0","2","",""
"3285017","1","","","2010-07-19 20:55:47","0","369","<p>Hey all,I'm using a UNIX socket to facilitate communication on and Android device between a system level daemon I've got running in C and an application I've got running in Java.  I'm much more of a C coder than a Java coder, so I'm having some issues when trying to read in data from the socket on the Java side.  Currently, my code is as follows:</p><pre><code>try{//Prepare to write the command and read the ACK  InputStream is = receiver.getInputStream();  OutputStream os = receiver.getOutputStream();  BufferedReader in = new BufferedReader(new InputStreamReader(is));  os.write(message.getBytes());  //FIX THIS!!  The following assumes that there is a newline-  //  terminated chunk of data waiting for us in the buffer.  If  //  that assumption is wrong, the code will hang.  Find some way  //  to determine if/how much data is waiting for us in the socket!  String str = in.readLine();  is.close();  os.close();  receiver.close();     return str; }catch(IOException ex){  Log.e(TAG,(ex.toString()+""\n""));  return null; }</code></pre><p>As my comment indicates, this implementation works(ish), but has the very bad design flaw of requiring that the server side socket code responds with a newline terminated string.  If that's not the case, the world ends.</p><p>What I'm trying to figure out is if there is a better means of accomplishing this task.  Is it possible to determine if there is any data waiting to be read in a buffered reader, and if so, what the size of that data is?  If not, is there a better way of reading in data over a UNIX socket on the Java side of Android that I'm not familiar with?</p><p>Thanks in advance!</p>","314163","","","","","2010-07-19 21:06:11","Determining LocalSocket read size","<java><android><sockets>","1","0","","",""
"3285273","1","","","2010-07-19 21:31:18","0","213","<p>I started using Rokon to create the graphical portion of my game but when it was finished I had a lot of trouble creating a menu system and doing alerts with it. Discouraged, I started over without the game engine and made a nice looking UI.  When the user clicks start game I want to run Rokon to load the graphics I made, but Ive tried everything I can think of and can't get it to not force close. I just did a basic call to make a new GameEngine since the GameEngine does everything else with the new view and the rest. Heres the code in my MainActivity(ignore the difficulty stuff, I just want to load the one difficulty for now):</p><p>protected void startGame(int difficulty) {  // TODO Auto-generated method stub  Context context = getApplicationContext();  int duration = Toast.LENGTH_SHORT;</p><p>Toast toast = Toast.makeText(context, ""Game Started!"" + ""\n"" + ""Difficulty set to: "" + difficulty, duration);  toast.show();</p><p>switch(difficulty){  case 1:  {   //Code to start Game on Easy   GameEngine easyGame = new GameEngine();   easyGame.onCreate();</p><p>Here is the Rokon GameEngine code I am trying to use, I made sure to add the library and other directories it was previously using...</p><p>import com.stickycoding.rokon.DrawPriority;import com.stickycoding.rokon.RokonActivity;</p><p>public class GameEngine extends RokonActivity {</p><pre><code>public static final float GAME_WIDTH = 320f;public static final float GAME_HEIGHT = 480f;private GameScene scene;public void onCreate() {    debugMode();    forceFullscreen();    forcePortrait();    setGameSize(GAME_WIDTH, GAME_HEIGHT);    setDrawPriority(DrawPriority.PRIORITY_VBO);    setGraphicsPath(""textures/"");    createEngine();}public void onLoadComplete() {    Textures.load();    setScene(scene = new GameScene());}</code></pre><p>}</p><p>Maybe they just aren't compatible with each other and I have to stick with using Rokon from the start, but there's gotta be a way to make this work... Thanks guys</p><p>Ive been playing around with the code and the debugger alot trying to figure out which part of the code wont work, and the error lies when I call createEngine(); if that helps at all... Some of the other code could be commented out to make it work, so Ive narrowed it down to that line.</p>","394991","","394991","","2010-07-19 23:51:13","2010-08-30 12:34:15","I created a UI without Rokon, but I'd like to start Rokon later to run my game, any way to do this?","<android><engine>","1","0","","",""
"3285306","1","3285841","","2010-07-19 21:37:39","3","1369","<p>Is there any way to disable my application from running on the background?I don't want my app to run in the background, i need to completely close it when the user a done</p>","242769","","12707","","2010-07-19 21:54:30","2010-07-19 23:12:17","disable application from running in background","<android><multitasking>","1","0","","",""
"3285371","1","3286072","","2010-07-19 21:48:08","5","1035","<p>Say that a user clicks on a Button. Is the resulting onClick() function invoked on the main UI thread of the activity?</p>","440093","","","","","2010-07-20 00:12:18","Android: is View.onClick() method invoked on main UI thread?","<android>","1","0","","",""
"3285376","1","","","2010-07-19 21:48:53","2","169","<p>I'm looking for an easy way to identify potential issues when porting a J2SE app to Android without having to go through line by line. Ideally I'd like a tool that would flag SE classes and members for which there is no Android equivalent, but if not, a crude library level flag would be sufficient.</p><p>If there's no tool, is there a J2SE library to Android library mapping somewhere?</p><p>Thanks</p>","146588","","143378","","2010-07-19 21:57:45","2010-07-19 21:57:45","Is there a tool to analyse a J2SE app's portability to Android?","<java><android><portability>","1","0","","",""
"3285404","1","","","2010-07-19 21:54:32","2","3277","<p>The below code works with HTTP(API version 7 and 8) and HTTPS (API version 7).For HTTPS (API version 8) I get error ""java.io.IOException: SSL handshake failure: Failure in SSL library, usually a protocol error"" </p><p>Any Idea why on version 8 alone ?</p><p>The code...</p><pre><code>            HttpURLConnection connection = null;            BufferedReader brd  = null;            String line = """" ;            StringBuilder sb = new StringBuilder();            try {                //Set up the initial connection                //connection = (HttpURLConnection) new URL(""http://MYSERVER.com"").openConnection(); //Works                connection = (HttpURLConnection) new URL(""https://MYSERVER.com"").openConnection(); //error                connection.connect();                    brd  = new BufferedReader(new InputStreamReader(connection.getInputStream()));                    sb = new StringBuilder();                    while ((line = brd.readLine()) != null)                        sb.append(line);                                  System.out.println(sb.toString());       } catch (IOException e) {                e.printStackTrace();            }  finally{                //close the connection, set all objects to null                connection.disconnect();                brd = null;                sb = null;                connection = null;            }</code></pre><p>The full error stack</p><p>WARN/System.err(267): java.io.IOException: SSL handshake failure: Failure in SSL library, usually a protocol errorWARN/System.err(267): error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message (external/openssl/ssl/s23_clnt.c:599 0xaf076ad8:0x00000000)at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeconnect(Native Method)at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:316)at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.getSecureSocket(HttpConnection.java:168)at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:399)at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:147)</p><p>Thanks,Narayanan</p>","396259","","995926","","2012-05-05 13:38:53","2012-05-05 13:38:53","Android - Only Version 8 (2.2 froyo) - ssl handshake failure","<android><ssl><android-2.2-froyo>","0","2","2","",""
"3285412","1","3285421","","2010-07-19 21:55:42","122","91663","<p>What's the best way to limit the text length of an <code>EditText</code> in Android?</p><p>Is there a way to do this via xml?</p>","143378","","","","","2014-03-09 10:33:37","Limit text length of EditText in Android","<android><edittext><maxlength>","8","0","18","",""
"3285466","1","3310489","","2010-07-19 22:04:48","4","421","<p>I'm confused about the concept of the <code>Context</code> class. I see that it's a base class of <code>Activity</code>, but the Android docs also mentions the Context storing global information about the app environment. So in my app which has 3 activities, does that mean I have 3 distinct Context objects, or do they actually refer to 1 entity?</p><p>Also, what is the lifetime of a Context object- does it live until the last component of this activity's process is garbage collected?</p>","440093","","","","","2010-07-22 15:19:15","Android: Does an app only have one Context object","<android>","1","0","1","",""
"3285580","1","","","2010-07-19 22:25:27","16","11963","<p>Hi this may sound as a stupid question.But I was unable to find any answers for this, thus posting here.</p><p>I am building an indoor application which continuously scans the bluetooth dongles located at different locations in a place like a mall or library.As I move in the mall with android phone in my hand I should be able to get the nearest dongle which I can connect to(Stupid Idea but I want to do something else with this).For this I should be able to continuously scan for the bluetooth devices.</p><p>Please can someone tell me how do I make android scan the available Bluetooth devices periodically.</p>","355833","","","","","2013-07-08 12:57:52","How to periodically scan for bluetooth devices on android","<android><bluetooth><discovery>","6","1","10","",""
"3285585","1","","","2010-07-19 22:26:20","3","1889","<p>Is it possible for a background thread to enqueue a message to the main UI thread's handler and block until that message has been serviced? </p><p>The context for this is that I would like my remote service to service each published operation off its main UI thread, instead of the threadpool thread from which it received the IPC request.</p>","440093","","","","","2011-05-28 01:01:57","Android: Possible for background thread to block until UI thread finishes operation?","<android>","1","0","","",""
"3285666","1","3287961","","2010-07-19 22:40:12","1","1271","<p>Jeff Sharkey in <a href=""http://jsharkey.org/blog/2008/09/11/quick-database-row-editor-in-android-09-sdk/"" rel=""nofollow"">this post</a> shows how to create save application preferences in database by hack on PreferenceActivity.</p><p>It said i can use a ContentProvider, too.</p><p>Can you give me an example on how to save preferences from PreferenceActivity to ContentProvider?</p><p>thanks</p>","251434","","1174526","","2012-03-19 06:32:45","2012-03-19 06:32:45","Use PreferenceActivity and save preferences in ContentProvider, how?","<android><sharedpreferences><android-contentprovider><android-preferences>","1","0","","",""
"3285698","1","3285744","","2010-07-19 22:45:47","1","683","<p>What i'm trying to do is just simply have the button load an image at random. However, the button doesn't seem to be working. When i first load the activity there it works fine and there is a random image....But when i press the button it's not loading another like i need it to. Any idea what i have wrong here? It looks fine to me :/    </p><pre><code>package com.my.package;import java.util.Random;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.ImageView;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.View.OnClickListener;public class Randomimage extends Activity implements OnClickListener{    private Integer [] mImageIds = {             R.drawable.one,             R.drawable.two,             R.drawable.three,             };    private static final Random rgenerator = new Random();    private ImageView iv;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Integer q = mImageIds[rgenerator.nextInt(mImageIds.length)];    iv = (ImageView) findViewById(R.id.imageviewyeah);    iv.setImageResource(q);    View nextButton = findViewById(R.id.next_image_button);    nextButton.setOnClickListener(this);}    @Override    public void onClick(View v) {    switch (v.getId()) {    case R.id.next_image_button:        iv.setImageResource(rgenerator.nextInt(mImageIds.length));        break;    }}    @Override    public boolean onCreateOptionsMenu (Menu menu) {        super.onCreateOptionsMenu(menu);        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.menu3, menu);        return true;    }@Overridepublic boolean onOptionsItemSelected (MenuItem item) {        switch (item.getItemId()) {        case R.id.menu:            startActivity(new Intent(this, Main.class));            return true;        case R.id.startnhie:            startActivity(new Intent(this, startnhie.class));            return true;}return false;    }}</code></pre>","393373","","","","","2010-07-19 22:54:04","Trouble loading random image on button press","<java><android><image><random>","1","0","","",""
"3285745","1","3359225","","2010-07-19 22:54:11","0","738","<p>I am using some tweaks that allow the user to change the UI of my application with ressources from their SDCard. That's really easy and nothing special, I just use the ""setImageDrawable"" or ""setImageBitmap"".</p><p><a href=""http://developer.android.com/reference/android/widget/ImageButton.html"" rel=""nofollow"">http://developer.android.com/reference/android/widget/ImageButton.html</a></p><p>That's really cool and all my users are happy to customize the UI.</p><p>But now, I would like to also change the pressed/focused ressource of the button!</p><p>Now, when they click on it, they cannot see anything and they click maybe 10 times. And more problematic, that's not really intuitive.</p><p>So i would like to change also the pressed/focused state programmatically...</p><p>Ani idea suggestion?</p>","327402","","","","","2010-07-29 03:07:25","Android: changing the pressed/focused ressource by code","<android><focus><selected><pressed>","1","0","2","",""
"3285828","1","","","2010-07-19 23:10:36","0","688","<p>I have been writing an android game, and I finally got everything done, and it ran perfectly fine on the emulator and on my phone, which is a rooted droid, but when I put in the marketplace I began getting reports of it force closing, I had my parents put it on their phone and it force closed when they tried to click the start button in the on screen menu, but my friends died when he tried to reopen it after playing it. I have his logcat, but I am not sure about my parents stuff yet. Here it is</p><pre><code>07-18 23:58:32.457: ERROR/AndroidRuntime(25513): FATAL EXCEPTION: main07-18 23:58:32.457: ERROR/AndroidRuntime(25513): java.lang.OutOfMemoryError: bitmap size exceeds VM budget07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.graphics.Bitmap.nativeCreate(Native Method)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.graphics.Bitmap.createBitmap(Bitmap.java:468)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.graphics.Bitmap.createBitmap(Bitmap.java:435)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:346)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:372)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at com.Waldev.cannontrial.CannonBlast$panel.&lt;init&gt;(CannonBlast.java:136)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at com.Waldev.cannontrial.CannonBlast.onCreate(CannonBlast.java:41)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.os.Handler.dispatchMessage(Handler.java:99)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.os.Looper.loop(Looper.java:123)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at java.lang.reflect.Method.invokeNative(Native Method)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at java.lang.reflect.Method.invoke(Method.java:521)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-18 23:58:32.457: ERROR/AndroidRuntime(25513):     at dalvik.system.NativeStart.main(Native Method)07-18 23:58:32.487: WARN/ActivityManager(85):   Force finishing activity com.Waldev.cannontrial/.CannonBlast</code></pre><p>I am not sure why it would do this, I thought that I had closed out the game cleanly, but thats not even the issue because my parents can't even get the game to open. Is there something that might have caused this to happen that is common? I added a few things to the manifest like finishOnTaskLaunch and stuff like that, but nothing seems to remedy the situation. Any ideas? And do you need anything else to see what might be going on, I will be around trying to fix this until it gets done, so I will comment pretty quickly. Thanks in advance</p>","390927","","263004","","2010-07-19 23:13:20","2011-02-07 00:11:34","outOfMemoryException in game Android","<java><android>","2","1","","",""
"3285884","1","","","2010-07-19 23:21:38","0","524","<p>Is there a standard native Android content provider that will return data listing all of the apps currently installed on the cellphone. Something like open()/readdir() on a Linux bin directory.</p><p>Given that you know an app is installed on an Android cellphone, and you know that apps name, how do you launch that app from a completely different and unrelated app. You might not know which Intents/Broadcasts/URIs the app you want to launch is listening for. And not all Android apps are written to respond to Intent/URI broadcasts or requests....</p>","","JohnM","","","","2010-07-19 23:55:34","Android programming question - fork/exec in Android?","<android>","1","0","","",""
"3286057","1","3286301","","2010-07-20 00:08:11","0","4032","<p>I would like to do an inner join on my database in my Android app.Is this even possible? What about a left join? I know cursor joiner exists but the documentation isn't clear at all.Can anyone provide any further insight? </p><p>Thanks</p>","306410","","","","","2012-04-03 18:24:50","How to do an inner join in Android?","<java><android><database><join>","2","0","","",""
"3286067","1","3286128","","2010-07-20 00:10:21","99","65289","<p>How do you encode an url in Android? I thought it was like this:</p><pre><code>final String encodedURL = URLEncoder.encode(urlAsString, ""UTF-8"");URL url = new URL(encodedURL);</code></pre><p>If I do the above, the <code>http://</code> in <code>urlAsString</code> is replaced by <code>http%3A%2F%2F</code> in <code>encodedURL</code> and then I get a  <code>java.net.MalformedURLException</code> when I use the url.</p><p>Thanks!</p>","143378","","143378","","2010-07-20 00:18:05","2014-01-24 11:57:44","Url encoding in Android","<android><url><urlencode>","4","0","28","",""
"3286229","1","3286252","","2010-07-20 00:55:04","0","781","<p>I'm not sure what's wrong here, all i want to do is randomly grab an item from my array. Which is just like a random sentence. Then generate another once the button is pressed. All my code looks good to me but it's causing a crash when i hit the button. any ideas?</p><pre><code>package com.my.package;import java.util.Random;import android.app.Activity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.view.View;import android.widget.TextView;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.View.OnClickListener;public class Randomsentence extends Activity implements OnClickListener{    private String[] myString;    private static final Random rgenerator = new Random();    private TextView tv;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Resources res = getResources();    myString = res.getStringArray(R.array.myArray);     String q = myString[rgenerator.nextInt(myString.length)];    TextView tv = (TextView) findViewById(R.id.text1);    tv.setText(q);    View nextButton = findViewById(R.id.next_button);    nextButton.setOnClickListener(this);}    @Override    public void onClick(View v) {    switch (v.getId()) {    case R.id.next_button:        tv.setText(myString[rgenerator.nextInt(myString.length)]);        break;    }}    @Override    public boolean onCreateOptionsMenu (Menu menu) {        super.onCreateOptionsMenu(menu);        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.menu3, menu);        return true;    }@Overridepublic boolean onOptionsItemSelected (MenuItem item) {        switch (item.getItemId()) {        case R.id.menu:            startActivity(new Intent(this, Main.class));            return true;        case R.id.startnhie:            startActivity(new Intent(this, startnhie.class));            return true;}return false;    }}</code></pre>","393373","","","","","2010-07-20 01:01:27","Generate random sentence on button press, code looks right but isnt working","<java><android><string><arrays><random>","1","3","","",""
"3286320","1","3297587","","2010-07-20 01:17:03","2","2738","<p>I have a listview that's using a custom adapter. I want to dynamically show/remove items from the listview. I've tried everything inside the getView() method in my view adapter. I've tried doing setVisiblity(View.GONE) on the view I'm returning. And it infact doesn't draw the view, but it allocates space for the view and it's just a blank black space.</p><p>Is this even possible to set items in listview invisible?</p>","375874","","","","","2010-07-21 08:49:50","Making a view in a listview invisible android","<android><listview><view>","2","2","","",""
"3286343","1","3296299","","2010-07-20 01:23:26","24","20978","<p>Does this exist? I need to make a TextView which is always uppercase.</p>","92259","","","","","2013-03-06 21:58:52","Text-transform:uppercase equivalent in Android?","<android>","7","0","2","",""
"3286535","1","7404012","","2010-07-20 02:21:21","0","331","<p>is anyone have an idea how to make tabs like the nexus one tabs from the weather/news app, and i mean the functionality which by flick the screen you could go to the next tab, Thanks </p><p>Video: <a href=""http://www.youtube.com/watch?v=hIu6kCnZVF0"" rel=""nofollow"">http://www.youtube.com/watch?v=hIu6kCnZVF0</a></p><p><img src=""http://www.gadget.pdamu.com/wp-content/uploads/2010/01/Google-Phone-Nexus-One-weather-apps.jpg"" alt=""alt text""></p>","302707","","","","","2011-09-13 15:05:09","How to make tabs like Nexus one weather/news App?","<java><android>","2","0","","",""
"3286544","1","3286764","","2010-07-20 02:23:40","0","264","<p>I would like to define the following layout (which is currently an xml file) dynamically in my code. </p><p>The end goal is to have the ability to conditionally include certain pages in my viewflipper.  </p><p>Thanks!</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.gtosoft.dash.MyViewFlipper    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/vFlipper""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;    &lt;!--  Page 01 --&gt;        &lt;include android:id=""@+id/flipperPage01"" layout=""@layout/page01"" /&gt;    &lt;!--  Page 02 --&gt;        &lt;include android:id=""@+id/flipperPage02"" layout=""@layout/page02"" /&gt;    &lt;!--  Page 03 --&gt;        &lt;include android:id=""@+id/flipperPage03"" layout=""@layout/page03"" /&gt;&lt;/com.gtosoft.dash.MyViewFlipper&gt;</code></pre>","268803","","","","","2010-07-20 03:18:48","How to dynamically do this in code rather than XML?","<android><xml><layout><viewflipper>","1","0","0","",""
"3286656","1","4155504","","2010-07-20 02:49:41","5","5555","<p>Geocoder getFromLocationName is not returning anything if I'm searching for business places. Here are my finding so far:</p><ul><li>grocery places, commercial buildings -> no result</li><li>schools -> finding results, but only returning Latitude and Longitude. I have to do reverse geocoding in order to get the address based on the coordinates, but the address wouldn't be accurate.</li><li>complete address -> same as school, only returning Latitude and Longitude</li><li>hospital and pharmacy -> returning Latitude and Longitude</li></ul><p>I've tested this on 1.6, 2.1 and 2.2 devices that has Google Maps. </p><p>I'm trying  to find if there's a limitation explained somewhere on the SDK, but there is none except:</p><blockquote>  <p>The amount of detail in a reverse  geocoded location description may  vary, for example one might contain  the full street address of the closest  building, while another might contain  only a city name and postal code. The  Geocoder class requires a backend  service that is not included in the  core android framework. The Geocoder  query methods will return an empty  list if there no backend service in  the platform   (http://developer.android.com/reference/android/location/Geocoder.html)</p></blockquote><p><strong>[update]</strong>So after nights of research, I can't seems to make it work - Google simply wont give me the result. Some discussion on android-developers points a fact that getFromBusinessName was omitted when Google Navigation came out. So I'm starting to assume that Google is pulling back some of their geocoding service. </p><p>I can always create a webpage that use Google Geocoder API, but its limited to 2500 api call - and I dont think it will be legal (lol). So what are my alternatives here? </p>","396388","","396388","","2010-07-20 18:45:51","2012-02-09 09:25:33","Geocoder getFromLocationName is not finding address","<android><google-maps><geocoding>","3","2","3","",""
"3286685","1","","","2010-07-20 02:55:20","1","2286","<p>I am trying to do what I think is a fairly simple task to authenticate a user on my server. I am using AsyncTask as a private subclass of my Activity, however when I try to populate the user object after authenticating it keeps setting it to null. Is there something strange in how the onPostExecute() method is called that is causing this? I originally had the AsyncTask as its own class but ran into the same problem, so I am try to solve this using a private subclass. Any help? Thanks.</p><p>Here is my code:</p><pre><code>public class Testing extends Activity {    private User user;    public User getUser() {        return this.user;    }    public void setUser(User value) {        this.user = value;    }    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final ImageView iconImage = (ImageView) this.findViewById(R.id.image);        final Button testButton = (Button) this.findViewById(R.id.testButton);        final TextView text = (TextView) this.findViewById(R.id.text);        iconImage.setImageResource(R.drawable.logo_real);        testButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                LoginTask loginTask = (LoginTask) new LoginTask().execute(new Void[0]);                text.setText(user.getFormattedFullName());            }        });    }    private class LoginTask extends AsyncTask&lt;Void, Void, User&gt; {        public LoginTask() {        }        protected User doInBackground(Void... params) {            User newUser = new User();            try {                System.out.println(""testing task"");                HttpClient client = new DefaultHttpClient();                HttpGet request = new HttpGet(""http://10.0.2.2:8080/Dugout/androidLogin?LOGIN_ID=test@gmail.com&amp;PASSWORD=password"");                HttpResponse response = client.execute(request);                HttpEntity entity = response.getEntity();                InputStream is = entity.getContent();                String message = """";                String inputLine = """";                BufferedReader bf = new BufferedReader(new InputStreamReader(is));                while ((inputLine = bf.readLine()) != null) message+=inputLine;                JSONObject returnedUser = new JSONObject(message);                int userId = returnedUser.getInt(""userId"");                boolean loginSuccess = returnedUser.getBoolean(""login_success"");                String firstName = returnedUser.getString(""firstName"");                String lastName = returnedUser.getString(""lastName"");                newUser.setId(userId);                newUser.setFirstName(firstName);                newUser.setLastName(lastName);                newUser.setLoginSuccess(loginSuccess);                return newUser;            } catch (Exception e) {                newUser.setLoginSuccess(false);                return newUser;            }        }        protected void onPostExecute(User user) {            setUser(user);        }    }}</code></pre>","396402","","244296","","2010-07-20 03:00:16","2010-07-20 13:53:11","Returning Data from AsyncTask Resulting in Null Pointer Error","<android><android-asynctask>","1","0","","",""
"3286782","1","3287819","","2010-07-20 03:26:21","1","1345","<p>So I cant figure out how to perform an onClick on my ListAdapter. Here is my code:</p><pre><code>private void fillData(){    Cursor constantsCursor = db.fetchAllGames();    ListAdapter adapter =        new SimpleCursorAdapter(this, R.layout.row,                 constantsCursor, new String[] { ""title"", ""console"" }, new int[] {                R.id.title, R.id.console });    setListAdapter(adapter);}</code></pre><p>I want to be able to click on an item from the database, then go into a view that only contains info for that item. My class currently extends ListActivity. I've tried OnItemClickListener, but I dont know what else to use to make it work.</p>","325400","","","","","2010-07-20 07:28:38","Android: How can I perform a click on a ListAdapter or SimpleCursorAdapter?","<android>","1","0","","",""
"3286815","1","","","2010-07-20 03:33:41","10","4487","<p>This seems like a basic question, but after searching for a while and playing with it, I've come to the point where some help would be appreciated.  I would like to have a SensorEventListener run in a separate thread from the UI, so that computations that need to occur when events come in won't slow down the UI.  </p><p>My latest attempt looks like:</p><pre><code>class SensorThread extends Thread {    SensorManager mSensorManager;    Sensor mSensor;    public void run() {        Log.d( ""RunTag"", Thread.currentThread().getName() ); // To display thread        mSensorManager = (SensorManager)getSystemService( SENSOR_SERVICE  );        mSensor = mSensorManager.getDefaultSensor( Sensor.TYPE_ACCELEROMETER );        MySensorListener msl = new MySensorListener();        mSensorManager.registerListener(msl, mSensor, SensorManager.SENSOR_DELAY_UI );    }    private class MySensorListener implements SensorEventListener {        public void onAccuracyChanged (Sensor sensor, int accuracy) {}        public void onSensorChanged(SensorEvent sensorEvent) {            Log.d( ""ListenerTag"", Thread.currentThread().getName() ); // To display thread        }    }</code></pre><p>In the activity's (or service's) onCreate(), I create a SensorThread object and call its start() method.  As you would expect, the debug log shows the ""RunTag"" entry in the new thread.  But onSensorChanged()'s ""ListenerTag"" is running in the main thread, even though its object is instantiated in the new thread.  How do I change that?  </p>","396413","","65977","","2010-07-20 06:50:27","2011-07-20 09:37:04","SensorEventListener in separate thread","<android><events>","2","1","2","",""
"3286974","1","","","2010-07-20 04:11:18","2","3971","<p>I am having a lot of problem getting Eclipse with Android plug-in to work on Windows 7 64K.  I am getting eclipse not responding a lot. It seem to happen pretty randomly. I know that Windows 7 is currently not support for Android SDK.  </p><p>However has anyone got this to work ?   </p><p>I am using the following:- Windows 7 64K - eclipse galileo (3.5.2)- JDK 1.6.0_21 64k</p>","396434","","114066","","2010-07-20 07:31:11","2012-02-05 08:00:20","Eclipse not responding on Windows 7 for Android Development","<windows><eclipse><android>","7","0","2","",""
"3286983","1","","","2010-07-20 04:14:13","4","1548","<p>I can draw overlay items onto google maps just fine, an image that looks like:</p><pre><code>______|    |______  \/</code></pre><p>Where the ""\/"" part is the ""pin"" that marks the lat/lon on the map and a picture in the middle of it.  My question is, is there any way to expand this when the user clicks on it?  I'll of course have to change this to some kind of dialog or layout and change it when it gets clicked.</p><p>I want to have it smaller like that with just an image when not clicked on, but when it is clicked on it expands over like a second to:</p><pre><code>--------------------------------------| &lt;image&gt;                  &lt;buttons&gt; ||                          &lt;buttons&gt; || &lt;some info here&gt;                   ||                                    |--------------------------------------                 \/</code></pre><p>Is this possible?</p>","387266","","","","","2010-12-18 23:43:53","Expanding Overlay Marker on Google Maps?","<android><google-maps><overlay>","2","1","2","",""
"3287009","1","","","2010-07-20 04:24:15","0","739","<p>Android 2 buttons are defined in xml</p><p>AbsoluteLayout.LayoutParams</p><p>Using the two buttons was placed overlapping each other.</p><p>param1 = new AbsoluteLayout.LayoutParams (LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT, 10, 20);</p><p>param2 = new AbsoluteLayout.LayoutParams (LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT, 10, 30);</p><p>btn1.setLayoutParams (param1);btn2.setLayoutParams (param2);</p><p>These buttons are overlapping each other.</p><p>Located under the button (btn1) and Back button Back to report abuse if it is in xml.</p><p>Btn1 dynamically from java code, but I want to raise up</p><p>What is hidden in the overlapping state btn2 to be able to climb up btn1?</p>","396406","","","","","2010-07-20 08:36:40","The overlapping of two buttons","<android>","1","0","","",""
"3287047","1","","","2010-07-20 04:35:18","1","393","<p>Please help me with finding sufficient documentation/explaination of <strong>Android</strong> WindowManagerService class?or in general Android Windowing System.</p>","396441","","8014","","2010-07-20 04:36:46","2013-01-17 06:44:16","Documentation/explanation of Android Windowing System/WindowManagerService class","<android>","1","0","","",""
"3287077","1","3287538","","2010-07-20 04:44:15","2","345","<p>i want to add some options when a user presses the menu button, i have tried the following but nothing seems to happen when i run the app and press the menu button:</p><p>the <strong>menu xml file</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;        &lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;         &lt;item android:id=""@+id/Map_view""         android:title=""@string/Map_view""         android:icon=""@drawable/satellite_view""&gt;     &lt;menu&gt;     &lt;group android:checkableBehavior=""single""            android:id=""@+id/menu_items""&gt;                      &lt;item android:id=""@+id/satellite_view""              android:icon=""@drawable/satellite_view""              android:title=""@string/satellite_view""/&gt;        &lt;item android:id=""@+id/street_view""              android:icon=""@drawable/street_view""              android:title=""@string/street_view""/&gt;      &lt;/group&gt;     &lt;/menu&gt;  &lt;/item&gt;              &lt;/menu&gt;</code></pre><p>the <strong>MapAcitivity class</strong></p><pre><code>    package com.example.MyMapActivity;    import java.util.List;    import android.graphics.drawable.Drawable;    import android.os.Bundle;    import android.view.Menu;    import android.view.MenuInflater;     import android.view.MenuItem;    import com.google.android.maps.GeoPoint;     import com.google.android.maps.MapActivity;     import com.google.android.maps.MapController;     import com.google.android.maps.MapView;      import com.google.android.maps.Overlay;     import com.google.android.maps.OverlayItem;     public class MyMapActivity extends MapActivity {    private MapView mapview;    private MapController mapcontroller;    private GeoPoint gp;    //creating a class to for OverLays    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        //setting the zoom controls        mapview = (MapView)findViewById(R.id.mapview);        mapview.setBuiltInZoomControls(true);        mapview.setSatellite(true);        List&lt;Overlay&gt;mapOverlays = mapview.getOverlays();        // pass the drawable to instance of the OVerlay class.        Drawable drawable = this.getResources().getDrawable(R.drawable.marker);        MyOverlay overlay = new MyOverlay(drawable,this);       //setting a GeoPoint        mapcontroller=mapview.getController();        String coordinates[] = {""23.68855"",""86.97455""};        double lat = Double.parseDouble(coordinates[0]);        double longi = Double.parseDouble(coordinates[1]);        gp = new GeoPoint((int)(lat*1E6), (int)(longi*1E6));        OverlayItem overlayitem = new OverlayItem(gp, ""Hello "", ""I'm in Asansol"");        GeoPoint point2 = new GeoPoint(35410000, 139460000);        OverlayItem overlayitem2 = new OverlayItem(point2, ""Sekai, konichiwa!"", ""I'm in Japan!"");        overlay.addOverlay(overlayitem); //  call this method for each overlayitem         overlay.addOverlay(overlayitem2);        mapOverlays.add(overlay);        }    // to inflate the menu defined in the map_menu xml file          public boolean OnCreateOptionsMenu(Menu menu)      {       MenuInflater  inflator = getMenuInflater();       inflator.inflate(R.menu.map_menu, menu);       return true;     }     public boolean OnOptionsItemSelected(MenuItem item)     {       switch(item.getItemId())       {       case R.id.satellite_view:           if(item.isChecked())           mapview.setSatellite(true);           return true;       case R.id.street_view:           if(item.isChecked())           mapview.setStreetView(true);               return true;        default:            return super.onOptionsItemSelected(item);       }     }    @Override    protected boolean isRouteDisplayed() {        // TODO Auto-generated method stub        // this method must return true if your app returns driving directions , else return false        return false;    }}</code></pre>","238505","","65977","","2010-07-20 06:30:09","2010-07-20 06:30:09","Menu button not working","<java><android><override>","1","0","","",""
"3287085","1","","","2010-07-20 04:47:46","2","442","<p>I am in my fourth activity and I want to come back to the first activity directly (without closing the second and third activity).How to change to the activity directly?</p>","366300","","23897","","2010-07-20 04:52:37","2010-07-20 20:06:39","Changing activity?","<android>","1","0","","",""
"3287093","1","3287218","","2010-07-20 04:50:31","0","2296","<p>I want to have a class ""Utils"", that will have several methods used all over my code. For example, I have a top bar with a textview and two ImageButtons that must display different texts and icons on different activities.</p><p>I find myself writing stuff like this on every activity</p><pre><code>(TextView) topBarText = (TextView) findViewById(R.id.topBarText);topBarText.setText(R.id.mytextForThisView);</code></pre><p>I'd like to findViewById once in my whole app, and call a method setupTopBar(String text, R.id.iconForImageButton1, R.id.iconForImageButton2), or even pass ""this activity""'s id and let the method figure out what to show in the text and images. </p><p>I created the class Util, but it doesn't extend Activity. The problem is that if it doesn't, findViewById isn't there, can't find stuff etc.</p><p>What's the pattern to do something like this in Android?</p><p>Thanksllappall</p>","284556","","","","","2013-02-21 10:02:38","Android: how do you get a view reference from a class that DOES NOT extend Activity?","<android><class><activity><extends>","2","0","","",""
"3287141","1","","","2010-07-20 05:03:44","1","2083","<p>Does anyone know of a simple example that uses the CursorAdapter?  Here's what I'm doing now and it's crashing with a RuntimeException.  I'm sure it something simple I'm missing given that I'm a newbie and can't find any simple examples of a ListView that uses a Cursor.  </p><p>Thanks,</p><hr><p>...</p><p>public final class MyListActivity extends ListActivity{    private class MyCursorAdapter extends CursorAdapter    {        public MyCursorAdapter(Context context, Cursor cursor)        {            super(context, cursor); // CRASH...</p><pre><code>protected void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    myDB_ = new MyDB(this);    myDB_.open();    Cursor cursor = myDB_.read();    startManagingCursor(cursor);    MyCursorAdapter adapter = new MyCursorAdapter(this, cursor);</code></pre><p>...</p>","329999","","","","","2010-07-23 21:32:47","ListActivity with Cursor","<android><listview><cursor><adapter>","2","0","","",""
"3287389","1","3651683","","2010-07-20 06:00:26","1","1316","<p>I added a gps status listener to my location manager in order see when I get the first fix.</p><p>When I receive the GPS_EVENT_FIRST_FIX I then loop through all the satellites, but why is none of them used in the fix? (<code>usedInFix()</code>).</p><p>My log says 'false' for all satellites?</p><pre><code>final class GpsStatusListener implements GpsStatus.Listener {    public void onGpsStatusChanged(int i) {        if (i==GpsStatus.GPS_EVENT_FIRST_FIX) {            Log.d(APP, ""gpsx.fixed."");            for (GpsSatellite sat:locationManager.getGpsStatus(null).getSatellites()) {                Log.d(APP, ""gpsx.GpsStatus.Sat.fixed: "" + sat.usedInFix());            }        }    }}</code></pre><p>Log:</p><pre><code>gpsx.fixed.gpsx.GpsStatus.Sat.fixed: falsegpsx.GpsStatus.Sat.fixed: falsegpsx.GpsStatus.Sat.fixed: false</code></pre>","241475","","","","","2012-03-30 05:49:50","GpsStatusListener: no satellites used in fix although status is GpsStatus.GPS_EVENT_FIRST_FIX","<android><gps>","1","2","0","",""
"3287505","1","","","2010-07-20 06:23:09","1","924","<p>Is there a way, either programmatic or with user gestures, to change the background of the launcher app?</p><p>It's a dismal black background.  I'd like a sunny yellow.   How to do this!?</p><p>Peter</p>","253661","","","","","2010-10-25 10:46:56","Changing background in Launcher","<android><wallpaper><launcher>","2","0","","",""
"3287563","1","","","2010-07-20 06:32:04","2","235","<p>I am trying  for the customized list view,</p><p>I am adding the list of objects using array list  and i send it to the class that extends base adapter and when i extends the base adapter class,it implements some methods such as getView etc.</p><p>and in the getView i am sending it to the class which assign the names(datas) to customized menu which is in XML</p><p>what i want to know is that ,suppose i have a collection of 5 objects and does the getView get called for 5 Objects?</p><p>Am i  making it clear to you.</p><p>Regards</p><p>Rakesh Shankar.P</p>","138030","","","","","2011-09-20 08:11:53","Doubts with base adapter class and its functionality","<android>","2","0","","",""
"3287606","1","","","2010-07-20 06:42:55","2","1332","<p>Is it possible to call listactivity through tab activity? Basically, I am developing an app with 3 tabs, for which I am using tabactivity. Furthermore, in one of the tabs I want a listview, so I have derived from listactivity.</p><p>Now I want the click event to be determined in the listview. Am i missing something?</p><pre><code>public class Tabissue extends TabActivity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    TabHost host    =   getTabHost();    host.addTab(host.newTabSpec(""Tab1"").setIndicator(""Tab1"").setContent(new Intent(this,Tab1.class)));    host.addTab(host.newTabSpec(""Tab2"").setIndicator(""Tab2"").setContent(new Intent(this,Tab2.class)));    host.setCurrentTab(1);}}</code></pre><p>Tab1 Class</p><pre><code>public class Tab2 extends ListActivity   {  ListView list;  @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);     setContentView(R.layout.tab2);        ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();    HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();    map.put(""Test1"",""####"");    map.put(""Test2"", ""India"");    map.put(""Time"", ""India time"");    mylist.add(map);    map = new HashMap&lt;String, String&gt;();    map.put(""Test1"", ""####"");    map.put(""Test2"", ""US"");    map.put(""Time"",""US time"");    mylist.add(map);    map = new HashMap&lt;String, String&gt;();    map.put(""Test1"", ""####"");    map.put(""Test2"", ""UK"");    map.put(""Time"", ""UK Time"");    mylist.add(map);    ListAdapter mSchedule = new SimpleAdapter(  this,            mylist,             R.layout.row,            new String[]             {                ""India"",                 ""US"",                 ""UK""            },             new int[]             {                R.id.TRAIN_CELL,                 R.id.FROM_CELL,                 R.id.TO_CELL,            }        );    list.setAdapter(mSchedule);    }</code></pre><p>}</p>","395563","","395563","","2010-07-20 09:29:40","2010-07-20 17:23:33","calling listactiviy from tabactivity in android","<android><listactivity><tabactivity>","1","4","","",""
"3287666","1","3287735","","2010-07-20 06:54:39","9","2958","<p>I am trying to achieve the following with Android :  </p><ul><li><p>when the app is in background, a thread polls a server every now and then to retrieve data and notifies the user if new data is available. I am using a Service for that, fine.</p></li><li><p>when the app is in ""active"" use, i.e. one of its activities is visible, the polling should stop as it might interfere with other user actions.</p></li></ul><p>I don't understand how to detect the transition between the ""active"" or ""background"" use of the app. The onResume() activity methods does not seem to help, as an activity can be hidden or visible during ""active"" use anyway. My understanding is that the app itself doesn't make the difference between the 2 states.<br>Can it be related when the HOME button is pressed ? Is there another way to do the distinction ?<br>I am thinking of an equivalent of iPhone's app delegate method <code>applicationDidEnterBackground</code>. Is it the right way to think with Android ? Or shall I use another approach ?</p><p>Thank you.</p>","244129","","","","","2013-10-21 19:17:27","Android : how to know when an app enters or the ""background"" mode?","<android><background>","1","1","3","",""
"3287726","1","3288511","","2010-07-20 07:06:19","1","1784","<p>Respected All,           I have to read XML file, for that I use SAXParser and DefaultHandler using method characters(char[] ch, int start, int length) but it gives output with some extra characters such as [] in place of '#13'. someone told me that if I read that string in UTF-8 format then it will remove that all the extra characters. Is it true that I have to read it in UTF-8 format if yes then how I can read it.                                                                       Thank You                                                                     (Vikram Kadam)         </p>","395627","","","","","2010-07-20 09:15:10","To Read XML file in UTF-8 format string using Android","<android>","1","0","2","",""
"3287795","1","6771234","","2010-07-20 07:22:04","8","11245","<p>Does anyone have a good example of using a service to download a file?</p><p>I am not sure whether to use remote or local and even if I was sure, I need a basic example to start with.</p><p>Basically, I want to start the service with the url of the file to downland and when the download is done end the service.</p><p>Google's example of services is filled with junk so I am not sure what is needed and what is not.</p><p>Your help is greatly appreciated.</p>","282475","","19750","","2010-07-22 13:36:13","2013-03-26 12:46:58","Android Download Service","<android><service>","2","2","6","",""
"3288058","1","3458690","","2010-07-20 08:08:11","3","26019","<p>I finally was able to build and debug the android platform with <a href=""http://source.android.com/source/download.html"" rel=""nofollow"">this tutorial</a>. I imported my project in eclipse, and afterwards installed <a href=""http://developer.android.com/sdk/eclipse-adt.html#installing"" rel=""nofollow"">ADT</a>. Then I converted my imported project to android project (<code>Android Tools -&gt; Convert To Android Project</code>). And now I'm having <code>Failed to load properties file for project 'droid-platform'</code> error. Session data:</p><pre><code>eclipse.buildId=M20100211-1343java.version=1.5.0_18java.vendor=Sun Microsystems Inc.BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=ru_UACommand-line arguments:  -os linux -ws gtk -arch x86</code></pre><p>Does anyone know, how do I deal with this?</p>","163423","","","","","2014-02-19 01:14:19","Failed to load properties file for android project","<android><eclipse><adt>","11","0","1","",""
"3288165","1","3288399","","2010-07-20 08:25:49","6","590","<p>I have a code that will prompt user to send a message by selecting the desired application, how can I detect if the user actually have chose from the options or instead pressed Back?</p><p>I tried to check if the intent returned something, but is running asyncronous so cannot be tracked. </p><p>Also I have tried to run the intent with <code>startActivityForResult</code>, what I noticed in onActivityResult that resultCode is always 0(<code>RESULT_CANCELED</code>) even if user selected, or not from the chooser.</p>","243782","","","","","2010-07-20 08:57:16","How can I detect if user selected from createChooser options?","<android>","1","0","","",""
"3288300","1","","","2010-07-20 08:44:24","4","697","<p>The full exception I get is:</p><pre><code>07-16 19:19:17.244: ERROR/DatabaseUtils(151): java.lang.NullPointerException07-16 19:19:17.244: ERROR/DatabaseUtils(151):     at com.android.providers.contacts.ContactsProvider2.insertData(ContactsProvider2.java:3069)07-16 19:19:17.244: ERROR/DatabaseUtils(151):     at com.android.providers.contacts.ContactsProvider2.insertInTransaction(ContactsProvider2.java:2930)07-16 19:19:17.244: ERROR/DatabaseUtils(151):     at com.android.providers.contacts.CContactsProvider2.insertInTransaction(CContactsProvider2.java:156)07-16 19:19:17.244: ERROR/DatabaseUtils(151):     at com.android.providers.contacts.HtcContactsProvider2.insertInTransaction(HtcContactsProvider2.java:1281)07-16 19:19:17.244: ERROR/DatabaseUtils(151):     at com.android.providers.contacts.SQLiteContentProvider.insert(SQLiteContentProvider.java:90)07-16 19:19:17.244: ERROR/DatabaseUtils(151):     at com.android.providers.contacts.ContactsProvider2.insert(ContactsProvider2.java:2737)07-16 19:19:17.244: ERROR/DatabaseUtils(151):     at android.content.ContentProvider$Transport.insert(ContentProvider.java:150)07-16 19:19:17.244: ERROR/DatabaseUtils(151):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:170)07-16 19:19:17.244: ERROR/DatabaseUtils(151):     at android.os.Binder.execTransact(Binder.java:287)07-16 19:19:17.244: ERROR/DatabaseUtils(151):     at dalvik.system.NativeStart.run(Native Method)</code></pre><p>The code I used is:</p><pre><code>public void saveFormality() {    ContentValues values = new ContentValues();    values.put(Data.DATA1, this.getFormality() ? ""1"" : ""0"");    saveDataWithMimeType(clsContacts.MIMETYPE_FORMALITY, values, this.getId());}private void saveDataWithMimeType(String mimetype, ContentValues values, String contactid) {    try {        int mod = ctx.getContentResolver().update(                Data.CONTENT_URI,                values,                ContactsContract.Data.RAW_CONTACT_ID + ""="" + contactid + "" AND "" + ContactsContract.Data.MIMETYPE + ""= '""                        + mimetype + ""'"", null);        if (mod == 0) {            values.put(Data.RAW_CONTACT_ID, contactid);            values.put(Data.MIMETYPE, mimetype);            // this is where exception occurs            Uri u=ctx.getContentResolver().insert(Data.CONTENT_URI, values);        }    } catch (Exception e) {        e.printStackTrace();    }}</code></pre><p>This happens on the phone only, and not in the emulator. All fields were checked and none of them are nulls. What could be the cause?</p>","243782","","","","","2011-04-02 09:39:02","How to track down which field is causing NullPointerException when inserting custom field into Contacts Data table?","<java><android>","2","8","","",""
"3288367","1","3288450","","2010-07-20 08:53:00","2","4169","<p>How do i create a file in phone memory instead of SD card.</p>","286831","","","","","2011-08-23 10:11:52","Android how to create file in Phone memory","<android>","1","0","1","",""
"3288502","1","3288605","","2010-07-20 09:13:23","1","1504","<p>is possible to upload a file on apache server using commons-fileuploader jar file in android .. if yes then please give any reference site if no then please guide me. </p>","304961","","","","","2010-07-20 09:27:43","Upload file on apache server","<android>","1","0","","",""
"3288513","1","3291776","","2010-07-20 09:15:30","3","2171","<p>I have multiple audio files in the assets directory of my application. When the user clicks a button I want to play those files in a certain order, one after the other. There shouldn't be any noticeable lag between the audio files. What is the best approach to achieve this?</p><p>I am thinking of using <code>MediaPlayer</code> objects and <code>OnCompletionListener</code>s. But, that would mean I have to create a lot of <code>OnCompletionListener</code>s because I need to know every time which audio file is next. Am I missing something or is there a better approach?</p>","292263","","","","","2012-03-23 12:25:59","How to play audio files one after the other","<android><audio>","2","0","1","",""
"3288619","1","3288727","","2010-07-20 09:29:41","1","3673","<p>when I try to attach a file to an email, I get a java.io.FileNotFoundException: No content provider logcat output. If anyone could tell me what I am doing wrong or what I should do instead, that would be great.Thank you.</p><p>This is how I add the files to the email..:</p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND);                sendIntent.putExtra(Intent.EXTRA_STREAM, uri);                sendIntent.setType(""video/3gp"");                sendIntent.setType(""video/mp4"");                startActivity(sendIntent);</code></pre><p>...and here is the entire logcat error output:</p><pre><code>07-20 09:15:58.364: ERROR/Mms/media(168): IOException caught while opening or reading stream07-20 09:15:58.364: ERROR/Mms/media(168): java.io.FileNotFoundException: No content provider: /sdcard/Video0006.mp407-20 09:15:58.364: ERROR/Mms/media(168):     at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:507)07-20 09:15:58.364: ERROR/Mms/media(168):     at android.content.ContentResolver.openInputStream(ContentResolver.java:345)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.mms.model.MediaModel.initMediaSize(MediaModel.java:268)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.mms.model.MediaModel.&lt;init&gt;(MediaModel.java:76)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.mms.model.RegionMediaModel.&lt;init&gt;(RegionMediaModel.java:40)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.mms.model.VideoModel.&lt;init&gt;(VideoModel.java:55)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.mms.model.VideoModel.&lt;init&gt;(VideoModel.java:48)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.mms.data.WorkingMessage.changeMedia(WorkingMessage.java:434)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.mms.data.WorkingMessage.setAttachment(WorkingMessage.java:343)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.mms.ui.ComposeMessageActivity.addVideo(ComposeMessageActivity.java:2472)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.mms.ui.ComposeMessageActivity.addAttachment(ComposeMessageActivity.java:2544)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.mms.ui.ComposeMessageActivity.handleSendIntent(ComposeMessageActivity.java:2521)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.mms.ui.ComposeMessageActivity.initialize(ComposeMessageActivity.java:1703)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.mms.ui.ComposeMessageActivity.onCreate(ComposeMessageActivity.java:1633)07-20 09:15:58.364: ERROR/Mms/media(168):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)07-20 09:15:58.364: ERROR/Mms/media(168):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)07-20 09:15:58.364: ERROR/Mms/media(168):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)07-20 09:15:58.364: ERROR/Mms/media(168):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)07-20 09:15:58.364: ERROR/Mms/media(168):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)07-20 09:15:58.364: ERROR/Mms/media(168):     at android.os.Handler.dispatchMessage(Handler.java:99)07-20 09:15:58.364: ERROR/Mms/media(168):     at android.os.Looper.loop(Looper.java:123)07-20 09:15:58.364: ERROR/Mms/media(168):     at android.app.ActivityThread.main(ActivityThread.java:4363)07-20 09:15:58.364: ERROR/Mms/media(168):     at java.lang.reflect.Method.invokeNative(Native Method)07-20 09:15:58.364: ERROR/Mms/media(168):     at java.lang.reflect.Method.invoke(Method.java:521)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)07-20 09:15:58.364: ERROR/Mms/media(168):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)07-20 09:15:58.364: ERROR/Mms/media(168):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","390782","","","","","2010-07-20 20:43:31","What to do when - java.io.FileNotFoundException: No content provider?","<android><email><attachment><android-contentprovider>","1","0","1","",""
"3288823","1","3291438","","2010-07-20 09:56:34","12","13699","<p>friends,</p><p>i am trying to upload file to php server using following tutorial<a href=""http://getablogger.blogspot.com/2008/01/android-how-to-post-file-to-php-server.html"">http://getablogger.blogspot.com/2008/01/android-how-to-post-file-to-php-server.html</a></p><p>i dont know how to add parameters like</p><p>userid=""12312"";sessionid=""234"" in it.</p><p>any one guide me how to achieve this?</p><p>any help would be appreciated.</p>","249991","","","","","2014-03-05 23:21:33","how to add parameters in android http post?","<android>","1","0","2","",""
"3289026","1","3528157","","2010-07-20 10:26:01","6","2865","<p>I just created a Panel Menu by mistake with the auto-completion of Eclipse and did not realise it before I read my code. As I wanted to have an option menu, I didn't see the slight difference in the display so does anyone know what the difference(s) is/are between these 2 menus? Is there any advantage or drawback for using one or the other?The only difference I saw was (I didn't go into details though):  </p><pre><code>public boolean onCreateOptionsMenu(Menu menu)</code></pre><p>or  </p><pre><code>public boolean onCreatePanelMenu(int featureId, Menu menu)</code></pre><p>thanks(Shouldn't this be a bounty?)</p>","263521","","","","","2010-08-20 04:15:46","What is the difference between Option Menu and Panel Menu in Android?","<android><optionmenu>","2","0","1","",""
"3289038","1","3389965","","2010-07-20 10:27:00","41","29648","<p>I have the following code:    </p><pre><code>    AssetFileDescriptor afd = getAssets().openFd(""AudioFile.mp3"");    player = new MediaPlayer();    player.setDataSource(afd.getFileDescriptor());    player.prepare();    player.start();</code></pre><p>The problem is that, when I run this code, it starts playing all the audio files in the assets directory, in alphabetical order instead of just playing the audio file I requested. What am I doing wrong? Is there a better way to play audio files from the assets directory?</p><p>Follow-up question: Is there a difference between keeping audio files in the assets directory and keeping them in the res/raw directory? Besides the fact that they don't get ids if they are in the assets directory. If I move the audio files to the res/raw folder then I have a problem with reusing <code>MediaPlayer</code>s because there is no id parameter for <code>setDataSource()</code>. I can't find a good guideline for handling this kind of problem.</p>","292263","","56285","","2013-12-07 19:41:37","2014-03-02 22:26:53","Play audio file from the assets directory","<android><audio><android-mediaplayer><assets><android-assets>","2","0","13","",""
"3289039","1","3290008","","2010-07-20 10:27:53","8","4531","<p>I have a mapview where I want to track the user's current location. GPS as well as 'use wireless networks' is activated in my phone settings.Nevertheless, since I'm indoor I don't get a GPS fix, therefore the location is determined via network; wifi spot is available.</p><p>I have the Google Maps app running as well as my application running.</p><p>Strangely, the current location differes between Google Maps and my application, where the Google Maps is very accurate while in my app the location is somehow off a few 100 meters.</p><p>In my application I basically do the following (for debugging purposes now):</p><p>1) initially place one marker on the map: geopoint retrieved via <code>locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);</code></p><p>2) initially place another marker on the map: geopoint retrieved via <code>locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);</code></p><p>This will put the last known locations of both providers onto the map (eventually last known from outside my app).</p><p>3) then for the regular updates (since I don't get a GPS fix anyway indoor here), I do:</p><pre><code>locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, baseLocationListener);</code></pre><p>You can see for the frequency and distance I pass the 0 param in both cases.</p><p>In the app manifest, the following permissions are granted:</p><pre><code>android.permission.ACCESS_COARSE_LOCATIONandroid.permission.ACCESS_FINE_LOCATIONandroid.permission.ACCESS_MOCK_LOCATION</code></pre><p>Actually my baseLocationListener does get called, which I see in the log, but the updated location is somehow the same as the last known current position (of LocationManager.NETWORK_PROVIDER), same lat/lng.</p><p><strong>I thought maybe I overlooked something or missed a parameter or setting, or my code has a bug. Therefore I installed some other (3 in total) LBS apps from the Android market that also show the current user's location. The current locations displayed in those apps are equals to the one in my application - and they're all some 100 meters off - but at least all the same.</strong></p><p>See the screenshot here:<img src=""http://img33.imageshack.us/img33/8679/mapproblem.png"" alt=""screenshot""></p><p><a href=""http://img33.imageshack.us/img33/8679/mapproblem.png"">http://img33.imageshack.us/img33/8679/mapproblem.png</a></p><p>Now I am wondering:</p><p><strong>1) as I understand, getLastKnowLocation is system-wide and not app-wide, why are there differences between the location in Google maps and all the other apps?</strong></p><p><strong>2) does Google Maps not update the lastKnownLocation of a provider?</strong></p><p><strong>3) does Google Maps use a different custom location provider (i.e. due to licensing reasons) other than GPS_PROVIDER or NETWORK_PROVIDER as they are in the SDK?</strong></p><p><strong>4) how do achieve the same accurate result with the NETWORK_PROVIDER like Google Maps does?</strong></p>","241475","","","","","2011-11-04 17:49:58","Google Maps & apps with mapview have different current positions","<android><google-maps><android-maps>","3","3","7","",""
"3289096","1","3489686","","2010-07-20 10:36:22","0","4516","<p>I have been having problems creating a relative layout in XML for a list item to be used for a series of items in a ListView. I have tried for hours and am tearing my hair out trying to get it to look how I want but cannot get everything to appear in the correct spot and not overlap or mis-align. I can get the first image and next two textviews in place but cannot get the last textview and imageview.</p><p>I have attached a wireframe style image of how I am trying for it to look and was wondering if someone could help me out?</p><p><img src=""http://i26.tinypic.com/6fz702.jpg"" alt=""alt text""></p><ul><li>The ImageView on the right is a set icon of the full height of the row with padding around it?</li><li>The two TextViews take up the majority of the width. The Address textview has the possibility of the text being long so it may need to get truncated if it runs out of space, or ideally have the font size shrink?</li><li>The next TextView will just hold a small string of max 5 characters.</li><li>The last ImageView is a small arrow to imply that this list item is clickable for more infomation. It needs to be centred like shown.</li><li>I would like if the icon, last textview, and last image always be in the same place/alignment down the list.</li></ul><p>If someone could offer some assistance on this I would be so grateful.</p><p>Cheers guys</p>","387317","","","","","2010-08-15 23:18:57","Android relative layout placement problems","<android><listview><textview><imageview><relativelayout>","2","0","1","",""
"3289101","1","5304616","","2010-07-20 10:36:47","3","963","<p>I'm using Twitter4j  in asynchronous mode. When I get response in Listener I want to be able to change some Views in my Activity but it results in <code>CalledFromWrongThreadException</code>.</p><p>I know that I can use <code>runOnUiThread</code> method, but what is the most elegant solution for this apart from inlining Runnable Classes?</p><p>Part of my Activity:</p><pre><code>    TwitterListener listener = new TwitterAdapter() {        @Override        public void gotUserDetail(User user) {            super.gotUserDetail(user);            fillInUserProfileDetails(user); </code></pre>","296427","","296427","","2010-09-05 19:43:13","2013-11-14 02:16:27","How to elegantly access Android Views from other thread?","<android><multithreading><asynchronous><twitter4j>","1","0","0","",""
"3289184","1","","","2010-07-20 10:49:32","2","1510","<p>I am sending an xml request to google checkout and getting the xml response too.</p><p>The request that i m sending is </p><pre><code>StringBuffer buf = new StringBuffer();buf.append(""&lt;?xml version=\""1.0\"" encoding=\""UTF-8\""?&gt;"");buf.append(""&lt;checkout-shopping-cart xmlns=\""http://checkout.google.com/schema/2\""&gt;"");buf.append(""&lt;shopping-cart&gt;"");buf.append(""&lt;items&gt;"");buf.append(""&lt;item&gt;"");buf.append(""&lt;item-name&gt;Ville&lt;/item-name&gt;"");buf.append(""&lt;item-description&gt;BabbleVille&lt;/item-description&gt;"");buf.append(""&lt;unit-price currency=\""USD\""&gt;12&lt;/unit-price&gt;"");buf.append(""&lt;quantity&gt;1&lt;/quantity&gt;"");buf.append(""&lt;/item&gt;"");buf.append(""&lt;/items&gt;"");buf.append(""&lt;/shopping-cart&gt;"");buf.append(""&lt;checkout-flow-support&gt;"");buf.append(""&lt;merchant-checkout-flow-support&gt;"");buf.append(""&lt;shipping-methods&gt;"");buf.append(""&lt;flat-rate-shipping name=\""SuperShip Ground\""&gt;"");buf.append(""&lt;price currency=\""USD\""&gt;9.99&lt;/price&gt;"");buf.append(""&lt;/flat-rate-shipping&gt;"");buf.append(""&lt;/shipping-methods&gt;"");buf.append(""&lt;/merchant-checkout-flow-support&gt;"");buf.append(""&lt;/checkout-flow-support&gt;"");buf.append(""&lt;/checkout-shopping-cart&gt;"");</code></pre><p>The response that I am getting is </p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;checkout-redirect xmlns=""http://checkout.google.com/schema/2"" serial-number=""4f6d85ac-0e83-41f1-81ef-60e86bd07b9d""&gt;&lt;redirect-url&gt;https://sandbox.google.com/checkout/view/buy?o=shoppingcart&amp;amp;shoppingcart=602624134680807&lt;/redirect-url&gt;&lt;/checkout-redirect&gt;</code></pre><p>Now, I dont know what to do with this response. I am very new to Google Checkout. The redirect url that i get if opened in browser then shows error. How will the buyer be redirected to enter his google account.</p><p>Can someone please let me know how to proceed with this response?</p><p>Regards</p><p>Sunil</p>","261566","","133802","","2010-07-20 10:51:32","2013-06-15 03:45:39","Google Checkout in Android","<android><checkout>","1","4","","",""
"3289388","1","","","2010-07-20 11:24:06","3","3155","<p>I am starting to go insane trying to figure this out. It seems like it should be very easy, I'm starting to wonder if it's possible.</p><p>What I am trying to do is create a home screen widget, that only contains an ImageButton.When it is pressed, the idea is to change some setting (like the wi-fi toggle) and then change the Buttons image.</p><p>I have the ImageButton declared like this in my main.xml</p><p></p><pre><code>&lt;ImageButton android:id=""@+id/buttonOne""        android:src=""@drawable/button_normal_ringer""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""center"" /&gt;</code></pre><p></p><p>my AppWidgetProvider class, named ButtonWidget</p><p><em>*</em> note that the RemoteViews class is a locally stored variable. this allowed me to get access to the RViews layout elements... or so I thought.</p><pre><code>@Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager,            int[] appWidgetIds) {    remoteViews = new RemoteViews(context.getPackageName(),            R.layout.main);    Intent active = new Intent(context, ButtonWidget.class);    active.setAction(VIBRATE_UPDATE);    active.putExtra(""msg"",""TESTING"");    PendingIntent actionPendingIntent = PendingIntent.getBroadcast(context,            0, active, 0);    remoteViews.setOnClickPendingIntent(R.id.buttonOne,            actionPendingIntent);    appWidgetManager.updateAppWidget(appWidgetIds, remoteViews);}@Overridepublic void onReceive(Context context, Intent intent) {    // v1.5 fix that doesn't call onDelete Action    final String action = intent.getAction();    Log.d(""onReceive"",action);    if (AppWidgetManager.ACTION_APPWIDGET_DELETED.equals(action)) {        final int appWidgetId = intent.getExtras().getInt(                AppWidgetManager.EXTRA_APPWIDGET_ID,                AppWidgetManager.INVALID_APPWIDGET_ID);        if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) {            this.onDeleted(context, new int[] { appWidgetId });        }    } else {        // check, if our Action was called        if (intent.getAction().equals(VIBRATE_UPDATE)) {            String msg = ""null"";            try {                msg = intent.getStringExtra(""msg"");            } catch (NullPointerException e) {                Log.e(""Error"", ""msg = null"");            }            Log.d(""onReceive"",msg);            if(remoteViews != null){                Log.d(""onReceive"",""""+remoteViews.getLayoutId());                remoteViews.setImageViewResource(R.id.buttonOne, R.drawable.button_pressed_ringer);                Log.d(""onReceive"", ""tried to switch"");            }            else{                Log.d(""F!"", ""--naughty language used here!!!--"");            }        }        super.onReceive(context, intent);    }}</code></pre><p>so, I've been testing this and the onReceive method works great, I'm able to send notifications and all sorts of stuff (removed from code for ease of reading)</p><p>the one thing I can't do is change any properties of the view elements.</p><p>To try and fix this, I made RemoteViews a local and static private variable. Using log's I was able to see that When multiple instances of the app are on screen, they all refer to the one instance of RemoteViews. perfect for what I'm trying to do</p><p>The trouble is in trying to change the image of the ImageButton.</p><p>I can do this from within the onUpdate method using this.</p><pre><code>remoteViews.setImageViewResource(R.id.buttonOne, R.drawable.button_pressed_ringer);</code></pre><p>that doesn't do me any good though once the widget is created. For some reason, even though its inside the same class, being inside the onReceive method makes that line not work. </p><p>That line used to throw a Null pointer as a matter of fact, until I changed the variable to static. now it passes the null test, refers to the same layoutId as it did at the start, reads the line, but it does nothing.</p><p>Its like the code isn't even there, just keeps chugging along.</p><p>SO......</p><p>Is there any way to modify layout elements from within a widget after the widget has been created!?I want to do this based on the environment, not with a configuration activity launch.</p><p>I've been looking at various questions and this seems to be an issue that really hasn't been solved, such as <a href=""http://stackoverflow.com/questions/2181588/whats-the-proper-way-to-implement-an-android-widget-with-dynamically-drawn-conte"">link text</a> and <a href=""http://stackoverflow.com/questions/1977017/changing-a-widgets-icon-from-onupdate"">link text</a></p><p>oh and for anyone who finds this and wants a good starting tutorial for widgets, this is easy to follow (though a bit old, it gets you comfortable with widgets) .pdf<a href=""http://www.helloandroid.com/files/xmaswidget/android_howto-hellowidget.pdf"" rel=""nofollow"">link text</a></p><p>hopefully someone can help here. I kinda have the feeling that this is illegal and there is a different way to go about this. I would LOVE to be told another approach!!!!</p><p>Thanks</p>","396684","","","","","2011-04-03 19:14:40","Accessing Layout Items from inside Widget AppWidgetProvider","<android><android-widget>","2","0","2","",""
"3289476","1","","","2010-07-20 11:36:46","0","587","<p>HI alll..</p><p>Today i again came,,:-(actually i m little bit confused in animation set?? i have more than two or three animations how can i put them in animation set?</p><p>and one more thing this is very important..that my image is moving from one place to another through translate animation.  but it is not showing the motion and looking like that the image was invisible there and after clicking its visible.. how can i show motion that image is moving from one place to another in translate animation.</p>","383597","","250260","","2010-07-20 14:26:18","2010-10-12 19:58:46","Android animation","<android><animation>","1","1","","",""
"3289503","1","3289523","","2010-07-20 11:39:30","0","740","<p>I have a table </p><pre><code>EntryLog(Name String, CheckIn Boolean)</code></pre><p>I want to count the number of checkins against each name. How do I write a query to get the result as a single resultset?</p>","177890","","20402","","2010-07-20 11:42:44","2010-07-20 11:52:00","SQL query to count records","<sql><mysql><android><sqlite><sqlite3>","3","1","","",""
"3289649","1","3289862","","2010-07-20 12:00:01","0","679","<p>First off - I haven't had much experience with Java yet, and I'm a beginner when it comes to the Android SDK.</p><p>I'm trying to write a music player app, which when started scans the entire SD card for mp3 files.</p><p>Currently this is how I'm doing that:</p><pre><code>// Recursively add songs in a directorypublic void addSongsInDirectory(File dir, String filter) {    File[] files = dir.listFiles();    if (files != null) {        for  (File f : files) {            if (f.isDirectory()) {                addSongsInDirectory(f, filter);            } else {                // Create new MimetypesFileTypeMap                MimetypesFileTypeMap mtfm = new MimetypesFileTypeMap();                // Add the mp3 mimetype                mtfm.addMimeTypes(""audio/mpeg mp3"");                // If current song is audio/mpeg, add it to the list                if (mtfm.getContentType(f).equals(filter)) {                    songs.add(f.getName());                }            }        }    }}</code></pre><p>Unfortunately, on my handset with many songs on it, this process takes about 30 seconds. How can I optimize this function so that it works faster (and possibly in the background)?</p>","284318","","","","","2010-07-20 13:56:42","Recursively add files in Java - speed issue","<java><android><optimization>","2","2","","",""
"3289658","1","","","2010-07-20 12:01:37","0","2553","<p>i would like to create a custom button like this:</p><p><a href=""http://i77.photobucket.com/albums/j74/bertyhell/button.png?t=1279626910"" rel=""nofollow"">http://i77.photobucket.com/albums/j74/bertyhell/button.png?t=1279626910</a></p><p>but that doesn't worki need to show the text on the buttons with absolute positioning relative to the buttons originall strings need to be changeable at runtime</p><p>but the button below can be a regular button</p><p>how can i do this?</p><p>if i create a button by inheriting from android.widget.button i have to draw the whole button myself?</p><p>is there an easier way?</p><p><strong>EDIT</strong></p><p>ok i tried the inherit from relative layout</p><p>like this:</p><pre><code>    package be.smarttelecom.datacheck.views;    import android.content.Context;    import android.util.Log;    import android.widget.RelativeLayout;    import android.widget.TextView;    public class AlertButton extends RelativeLayout {        private TextView roomNumber;        public AlertButton(Context context, String roomNumber) {            super(context);            try{            this.alertId = alertId;            // TODO Auto-generated constructor stub            this.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,                    LayoutParams.WRAP_CONTENT));            TextView room = new TextView(context);            room.setFocusable(false);            room.setText(R.string.room);            room.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,                    LayoutParams.WRAP_CONTENT));            this.roomNumber = new TextView(context);            this.roomNumber.setFocusable(false);            this.roomNumber.setId(R.id.roomNumber);            this.roomNumber.setTextSize(26);            this.roomNumber.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,                    LayoutParams.WRAP_CONTENT));            this.roomNumber.setText(roomNumber);            }catch(Exception ex){                Log.i(""test"", ""problem during construction of alert button: "" + ex.getMessage());            }        }        public void setRoomNumber(String number){            roomNumber.setText(number);        }        public void setDescription(String description){            this.description.setText(description);        }    }</code></pre><p>when i add it like this:</p><pre><code>        TableRow row2 = new TableRow(this);        AlertButton alert = new AlertButton(this, ""1"",""14"",""wc"",""krist"");        row2.addView(alert);        container.addView(row2, 0);</code></pre><p>i get an empty page and no errors at all</p><p>any idea what i did wrong?</p><p>how do i put the textfields on certain positions?put them inside an absolute layout and add x an y coordinates?(absolute layout is depricated, alternative?)</p>","373207","","373207","","2010-07-20 14:42:18","2011-01-11 23:18:16","android custom button","<java><android><string><button>","1","2","","",""
"3289710","1","","","2010-07-20 12:08:53","6","596","<p>I released an app on the Android market that I've since had to take down because approximately half of the comments were people complaining of damaged SD cards. I've gone over the code a few times and can't find anything that could damage an SD card. All that happens that involves external storage is the saving of streams as images, which then get read into ImageView's.</p><p>This is what is called in the root activity to create the folders. The directory paths are stored in public static variables.</p><pre><code>//Get the SD Card directory    String external = Environment.getExternalStorageDirectory().getAbsolutePath() + ""/appfolder/"";    CACHE_DIRECTORY = external + "".cache/"";    SAVED_DIRECTORY = external + ""saved/"";    File cache = new File(CACHE_DIRECTORY);    File saved = new File(SAVED_DIRECTORY);    cache.mkdirs();    saved.mkdirs();</code></pre><p>And the following is the code for downloading images and copying them (for when they are being moved to the saved directory).</p><pre><code>public static void saveImage(File file, URL url) throws IOException {    BufferedInputStream bis = new BufferedInputStream(url.openStream());    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));    int bytes;    while ((bytes = bis.read()) != -1) {        bos.write(bytes);    }    bos.close();    bis.close();}public static void copy(File fileIn, File fileOut) throws IOException {    BufferedInputStream bin = new BufferedInputStream(new FileInputStream(fileIn));    BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(fileOut));    int bytes;    while ((bytes = bin.read()) != -1) {        bout.write(bytes);    }    bin.close();    bout.close();}</code></pre><p>And this is a background thread for network I/O</p><pre><code>public void run() {    for (String url : thumbnails) {        if (url != null) {            String[] urlParts = url.split(""/"");            String imageName = urlParts[urlParts.length - 1];            File file = new File(Main.CACHE_DIRECTORY + imageName);            if (!file.exists() || file.length() == 0) {                try {                    Image.saveImage(file, new URL(url));                } catch (IOException e) {}            }        actx.runOnUiThread(reload);        }    }}</code></pre><p>Where reload is a runnable to update an adapter, thumbnails is an array of string urls and image name is a unique 10-11 digit number with an image extension (.jpeg, .png, .gif specifically).</p><p>And this is similar code run in the background of an asynctask.</p><pre><code>String imageUrl = (String)params[0];    String[] imageUrlParts = imageUrl.split(""/"");    String imageName = imageUrlParts[imageUrlParts.length - 1];    URL fullImageUrl;    try {        fullImageUrl = new URL(imageUrl);    } catch (MalformedURLException me) {        cancel(true);        return null;    }    File file = new File(Main.CACHE_DIRECTORY + imageName);    try {        URLConnection ucon = fullImageUrl.openConnection();        int requestedSize = ucon.getContentLength();        long fileSize = file.length();        //Either the file does not exist, or it exists but was cancelled early due to        //User or IOException, so it needs to be redownloaded        if (!file.exists() || ((file.exists()) &amp;&amp; fileSize &lt; (requestedSize * 0.8))) {            mLoad.setMax(requestedSize);            BufferedInputStream bis = new BufferedInputStream(ucon.getInputStream());            BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(file));            int bytes;            int count = 0;            while ((bytes = bis.read()) != -1) {                bout.write(bytes);                count++;                //Updates in increments of 2kb                if (count % 2048 == 0) {                    publishProgress(count);                }            }            bis.close();            bout.close();        }        if (save) {            File saveFile = new File(Main.SAVED_DIRECTORY + imageName);            copy(file, saveFile);        }    } catch (IOException e) {        cancel(true);        return null;    } catch (OutOfMemoryError e) {        cancel(true);        return null;    }</code></pre><p>The only instance I could find of damaged SD cards is <a href=""http://code.google.com/p/android/issues/detail?id=2500"">http://code.google.com/p/android/issues/detail?id=2500</a></p><p>The app is built on Android 1.6 and the bug isn't recreatable via emulator or personal testing on 2.1update1 with HTC Desire.</p><p>EDIT: I've looked at some other questions and could the problems be arising from me not flushing the buffered output streams? Is that a big deal?</p>","384071","","","","","2013-04-22 23:54:44","My Android app is damaging SD Cards","<android>","2","6","1","",""
"3289720","1","3408067","","2010-07-20 12:09:32","0","2351","<p>I am bashing around with android localization and already figured out how to receive NMEA data. Unfortunately, the results seem to be very chaotic. I do only need the GPRMC sentence but get GPGGA, GPVTG etc. returned. Is there any way to control the onNmeaReceived() function?</p><pre><code>public class TrackingService extends Service {private Intent broadcastIntent = new Intent(""com.example.locationlogger.TestBroadcastReceiver"");private LocationManager lm;private LocationListener ll = new LocationListener(){       //sample listener...};GpsStatus.NmeaListener nl = new GpsStatus.NmeaListener() {   @Override   public void onNmeaReceived(long timestamp, String nmea) {      /*       * Broadcast a message..       */      broadcastIntent.putExtra(""TESTVAR"", ""Received some nmea strings: "" + nmea);      sendBroadcast(broadcastIntent);   }};@Overridepublic void onCreate() {   lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);}@Overridepublic void onStart(Intent intent, int startId) {      lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, interval * 1000, 0, ll);   lm.addNmeaListener(nl);}</code></pre><p>}</p>","396767","","","","","2011-01-12 10:30:24","Android location: Chaotic results from onNmeaReceived()","<android>","3","0","1","",""
"3289755","1","3290295","","2010-07-20 12:13:58","0","844","<p>I'm installing Android in a mobile without touch screen. I wonder if is there a way of turn of the screen lock, or unlock it some other way then slide the screen?</p><p>Any help will be appreciated.</p>","287316","","","","","2010-07-20 13:16:56","How to get rid of the need of slide to unlock the screen?","<android>","1","0","1","",""
"3289768","1","3289954","","2010-07-20 12:15:16","0","3838","<p>I am getting this following error during run time.</p><pre><code>ERROR: thread attach failed</code></pre><p>My project contains two classes in src as fallowing:</p><ol><li>Activity class</li><li>video_thread class</li></ol><p>I've created an object for this video_thread class in Activity class, made it Daemon and started it like this:</p><pre><code>video_thread v=new video_thread();video_thraed.setDaemon(true);video_thread.start();</code></pre><p>During execution i am finding this error in the logcat.</p>","365184","","119895","","2010-07-20 12:21:28","2010-07-20 12:46:06","ERROR: thread attach failed","<java><android><multithreading>","1","1","","",""
"3289998","1","3290074","","2010-07-20 12:43:42","1","133","<p>I need help explaing the following example below (c) CommonsWare.I know it makes a subclass of Arraydapter to produce custom listviews.</p><p>However I don't understand these rows:</p><pre><code>    IconicAdapter() {        super(DynamicDemo.this, R.layout.row, items);    }</code></pre><p>What does super() do? And what will the arguments be good for? Why do I need pass  ""items"" as an argument but not the other array that is called ""rating"" ?</p><p>Full code:</p><pre><code>public class DynamicDemo extends ListActivity {    private String[] items = { ""lorem"", ""ipsum"", ""dolor"", ""sit"", ""amet"",            ""consectetuer"", ""adipiscing"", ""elit"", ""morbi"", ""vel"", ""ligula"",            ""vitae"", ""arcu"", ""aliquet"", ""mollis"", ""etiam"", ""vel"", ""erat"",            ""placerat"", ""ante"", ""porttitor"", ""sodales"", ""pellentesque"",            ""augue"", ""purus"" };    private String[] rating = { ""25%"", ""65%"", ""95%"", ""55%"", ""15%"", ""25%r"",            ""25%"", ""25%"", ""25%"", ""25%"", ""25%"", ""25%"", ""25%"", ""25%"", ""25%"",            ""25%"", ""25%"", ""25%"", ""25%"", ""25%"", ""25%"", ""25%"", ""25%"", ""25%"",            ""25%"" };    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.main);        setListAdapter(new IconicAdapter());    }    public void onListItemClick(ListView parent, View v, int position, long id) {        selection.setText(items[position]);    }    class IconicAdapter extends ArrayAdapter&lt;String&gt; {        IconicAdapter() {            super(DynamicDemo.this, R.layout.row, items);        }        public View getView(int position, View convertView, ViewGroup parent) {            LayoutInflater inflater = getLayoutInflater();            View row = inflater.inflate(R.layout.row, parent, false);            TextView label = (TextView) row.findViewById(R.id.label);            TextView label2 = (TextView) row.findViewById(R.id.label2);            label.setText(items[position]);            label2.setText(rating[position]);            return (row);        }    }}</code></pre>","215088","","","","","2010-07-20 12:57:23","Understanding Arraydapter example","<java><android>","2","0","","",""
"3290051","1","3331891","","2010-07-20 12:49:33","0","449","<p>I've got 2 classes <code>GLLayer</code> and <code>GLCamTest</code>. I'm attempting to run a method located in <code>GLCamTest</code>...</p><pre><code>        public Bitmap extractimage(int pos){    LocationData tweets;    tweets = new LocationData(this);    SQLiteDatabase db = tweets.getWritableDatabase();    //select the data    String query = ""SELECT * FROM tweets;"";    Cursor mcursor = db.rawQuery(query, null);    //Move to Position specified.    mcursor.moveToPosition(pos);    //get it as a ByteArray    byte[] imageByteArray=mcursor.getBlob(7);    //the cursor is not needed anymore    mcursor.close();    //convert it back to an image    ByteArrayInputStream imageStream = new ByteArrayInputStream(imageByteArray);    Bitmap theImage = BitmapFactory.decodeStream(imageStream);    return theImage;    }</code></pre><p>I'm looking to run in on a thread from <code>GLLayer</code> but from what I understand I need a Handler.. </p><pre><code>            public void run() {    GLCamTest cam = new GLCamTest();    image = cam.extractimage(q);}</code></pre><p>I'm starting the Thread from within <code>public void onDrawFrame(GL10 gl) {</code> my question is how would I implement said handler? I've read <a href=""http://developer.android.com/reference/android/os/Handler.html"" rel=""nofollow"">http://developer.android.com/reference/android/os/Handler.html</a> but I still don't really understand how I'd implement it. could someone help me out?</p>","358438","","","","","2010-07-26 02:32:24","How would I implement a handler here?","<android><handler>","1","0","1","",""
"3290083","1","","","2010-07-20 12:52:40","0","1254","<p>I craeted application whic has both GUI part and Widget. How can I show/hide Widget from GUI part?</p>","332311","","","","","2011-01-28 10:23:09","android show widget programmatically","<android><widget>","1","2","","",""
"3290121","1","","","2010-07-20 12:56:35","0","143","<p>HI,</p><p>i'm programming an android application using the StartActivityForResult() - Method.But, i want to get as result an own class, not a string or something like that.how can i tell the intent to use the class i wrote to give back?</p>","396818","","","","","2010-07-20 13:14:36","Transport own class with Intent between objects","<android>","1","0","1","",""
"3290169","1","8868987","","2010-07-20 13:02:02","2","3822","<p>I am new to working on Android technology. I have to read XML files in which there are HTML tags such as &lt;b&gt; so I have to remove these tags before I display them on screen. If you know any way to remove these before display please help me.</p>","395627","","23897","","2011-09-05 03:59:22","2012-01-15 10:26:15","Remove HTML tags while reading XML data on Android","<android>","2","1","0","",""
"3290227","1","3290673","","2010-07-20 13:08:29","3","825","<p>Does the Droid SDK support sliding your finger across the screen to go back to the previous screen, instead of using the back key?  </p>","396827","","379693","","2010-10-30 08:50:43","2010-10-30 08:50:43","Android SDK ""Slide"" Capability","<android><android-animation>","2","0","1","",""
"3290290","1","3292305","","2010-07-20 13:16:09","1","2109","<p>Sorry for the very loud title, but when I try to code a frame-by-frame animation in Eclipse, It gives me a bug. I found something on the internet that says they screwed up in the sdk tutorial documentation but I cannot help but wonder what <i>android:id=""selected""</i> means or what should be put in the quotations instead. (I am new to this if you couldn't already tell. :( Sorry.) </p><p>Here's the link (delete the space between the h and the t):</p><p>h ttp://code.google.com/p/android/issues/detail?id=79</p><p>Also, can somebody explain the last part of the frame animation tutorial to me? <a href=""http://developer.android.com/guide/topics/resources/animation-resource.html#Frame"" rel=""nofollow"">http://developer.android.com/guide/topics/resources/animation-resource.html#Frame</a>Do you put another code in the <i>filename</i>.Java, and if so, where do you put it?I cannot understand where to put the second code that is not XML... And I think I need to know what the code below is and where it should go...</p><pre><code>ImageView fileimage = (ImageView) findViewById  (R.id.file_image);fileimage.setBackgroundResource(R.drawable.file_image2);fileAnimation = (AnimationDrawable) fileimage.getBackground();fileAnimation.start();</code></pre><p>But here is the XML code I used anyway:</p><pre><code> &lt;animation-list android:id=""selected"" android:oneshot=""false""&gt; &lt;item android:drawable=""@drawable/filename"" android:duration=""200"" /&gt; &lt;item android:drawable=""@drawable/filename2"" android:duration=""200"" /&gt; &lt;/animation-list&gt;</code></pre><p>Should anything be removed or added from that? I don't know what else to do, because I need to start the animation and have  the code for that (1st one) but I don't know where it goes, or if I need another code along with it! Please help?</p>","394842","","394842","","2010-07-20 15:20:24","2011-12-23 11:14:40","Please Help me with Frame Animaions! Android Question","<android><eclipse><animation><sdk><frame>","1","2","","",""
"3290331","1","","","2010-07-20 13:20:47","-1","492","<p>How can I make text scroll?</p><p>I want an effect similar to ad rotators in .net.</p>","335429","","2598","","2010-08-18 13:20:01","2010-08-18 13:20:01","Add rotator in android","<android><advertising>","2","0","1","",""
"3290743","1","3290775","","2010-07-20 14:03:41","0","1476","<p>When I type <i>ImageView</i> or <i>AnimationDrawable</i> I get a string of errors proclaiming:</p><p>AnimationDrawable cannot be resolved to a type.</p><p>line 14 Java Problem</p><p>I don't understand, do I need to create another class? Or do the AnimationDrawables just not go in the <i>filename</i>.java?  </p><p>And if I do need to create another class, can you show me how?</p>","394842","","244296","","2010-07-20 14:16:40","2013-10-09 03:40:12","Eclipse doesn't recocnize ImageView or AnimationDrawable","<android><eclipse><sdk>","2","0","","",""
"3290936","1","7239840","","2010-07-20 14:22:50","31","16783","<p>HiI'm trying to develop an app that prevents a user from getting to a specified app without a password. The scenario is...</p><ol><li>user clicks on ""Email"" app (for example)</li><li>my app detects launch of an app</li><li>my app confirms it is the ""Email"" app</li><li>my app opens a view over the top, asking for a password</li><li>user enters a password, if correct, my app disappears, leaving the ""Email"" app on top</li></ol><p>I'm ok doing the rest of it, just part 2 is puzzling me, and after many days reading up on Broadcast Intents etc and trying to listen for ""android.intent.action.MAIN"" etc in my trial projects I can't seem to detect when an app other than mine is started.</p><p>Can anyone help? Am I going about it the right way, in looking for new apps broadcasting an intent to start, or should I be reading the system log for new intents, or doing something in native code? </p><p>Any pointers would help, even if you can't answer it fully I'll be able to do some more research. Thanks a lot. Ian</p>","355549","","15825","","2010-10-11 08:26:47","2014-03-10 14:48:59","Android, Detect when other apps are launched","<android><android-intent><broadcastreceiver>","7","0","33","",""
"3291141","1","","","2010-07-20 14:43:36","6","1522","<p>Is there any way to display the empty message and the listview header at the same time?  It seems that when i set the empty view and the list is empty, the header will not be displayed.</p><p>thxBen</p>","372405","","","","","2012-01-30 13:22:32","android listview empty message with header","<android><listview><header>","3","0","1","",""
"3291247","1","3623277","","2010-07-20 14:52:24","1","1056","<p>Can I access android MediaProvider (Images &amp; Videos) databases directly from my code rather then through a content provider ?</p><p>I'm planning to have my own Cursor implementation so inside it I want to access the media databases directly, possible or android does not allow it ?</p>","394675","","","","","2012-01-24 09:32:14","Android Media database direct access from code","<android><database><cursor><media>","2","0","","",""
"3291255","1","3296304","","2010-07-20 14:53:10","1","5339","<p>I'm developing for the Android platform.My app creates a temp file with a simple call to:</p><pre><code>FileOutputStream fos = openFileOutput(""MY_TEMP.TXT"",Mode);</code></pre><p>It works fine because I can write to it and read it normally.</p><p>The problem is that when I exit from the app I want to delete this file. I used:</p><pre><code>File f = new File(System.getProperty(""user.dir""),""MY_TEMP.TXT"");f.delete()</code></pre><p>But it always returns false and the file is not deleted.I have tried </p><pre><code>File f = new File(""MY_TEMP.TXT"");f.delete();</code></pre><p>And it does not work either.Please advise!</p>","396933","","","","","2013-07-27 17:56:33","Deleting files created with FileOutputStream","<java><android><file><delete><fileoutputstream>","5","0","1","",""
"3291336","1","","","2010-07-20 15:00:30","1","1564","<p>I have an android app that stores data to the local storage.  This is done just like in the tutorial on Google's site:</p><pre><code>String FILENAME = ""data.xml"";String string = ""some content"";FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);fos.write(string.getBytes());fos.close();</code></pre><p>However, whenever the device is powered off, then powered back on, these files are removed.  How can I get them to stay?</p>","396936","","","","","2010-11-01 21:48:43","Android Local Storage files getting erased on reboot","<android><file>","1","0","","",""
"3291490","1","3291713","","2010-07-20 15:16:11","25","13811","<p>I have a common class say for eg Class A which extends <code>AsyncTask</code> and has all the methods implemented i.e. <code>onPreExecute</code>, <code>doinbackground</code> and <code>onPostExecute</code>.</p><p>Now, there are other classes which want to use Class A object.</p><p>Say Class B uses class A in the below manner</p><pre><code>A a = new A(context)a.execute(url)</code></pre><p>Then i fetch the result in get method. But get method is not the proper way of using AsyncTask. I will like to get the result in <code>onPostExecute</code>. For that i tried using a boolean parameter which will get true only in <code>onpostexecute</code>. The class B will check till it gets true and when it gets true it will fetch the result.</p><p>But this is somehow blocking the application.</p><p>I have placed the code for asynctask below.</p><p>'</p><pre><code>import java.io.IOException;import org.apache.http.client.ClientProtocolException;import org.apache.http.client.HttpClient;import org.apache.http.client.ResponseHandler;import org.apache.http.client.methods.HttpGet;import org.apache.http.impl.client.BasicResponseHandler;import org.apache.http.impl.client.DefaultHttpClient;import android.app.ProgressDialog;import android.content.Context;import android.os.AsyncTask;public class A extends AsyncTask&lt;String, Void, String&gt; {private Context context = null;private final HttpClient httpClient = new DefaultHttpClient();private String content = null;//private String error = null;private String finalResult = null;private static boolean isResult = false;private ProgressDialog progressDialog = null; public BabbleVilleSyncTask(Context context){    this.context = context;     progressDialog = new ProgressDialog(this.context);}protected void onPreExecute() {    progressDialog.setMessage(""Please Wait...."");    progressDialog.show();}protected String doInBackground(String... urls) {    try     {        //urls[0] = URLEncoder.encode(urls[0], ""UTF-8"");        HttpGet httpget = new HttpGet(urls[0]);        ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();        content = httpClient.execute(httpget, responseHandler);    }    /*catch(UnsupportedEncodingException ue)    {        error = ue.getMessage();    }*/    catch (ClientProtocolException e)     {        //error = e.getMessage();        cancel(true);    }    catch (IOException e)     {        //error = e.getMessage();        cancel(true);    }    httpClient.getConnectionManager().shutdown();    return content;}protected void onPostExecute(String result) {    finalResult = result;    progressDialog.dismiss();    System.out.println(""on Post execute called"");    isResult = true;}  public boolean getIsResult(){    return isResult;}public void setIsResult(boolean flag){    isResult = flag;}public String getResult(){    return finalResult;}}</code></pre><p>'</p><p>Can someone let me know what the issue may be?</p><p>Regards</p><p>Sunil</p>","261566","","51382","","2010-07-20 15:27:17","2013-05-29 15:46:14","Common class for AsyncTask in Android?","<android><android-asynctask>","3","0","42","",""
"3291515","1","3293615","","2010-07-20 15:18:27","0","564","<p>I'm coding on the android right now, and I have an Activity which starts and stops a Service. However, related to this whole application will be a non-android java application which runs in the background alongside this app. I need this separate activity to be able to launch a notification, but I don't know how to do this. I cannot create a static method in either my Activity or my Service since then I wouldn't be able to get the context. Is there a way to do this?</p><p>Thanks!NS</p>","777890","","777890","","2012-06-12 15:44:15","2012-06-12 15:44:15","Android - Launch notification from anywhere?","<java><android><android-service>","1","2","","",""
"3291631","1","3291917","","2010-07-20 15:30:09","0","2285","<p>How can I setup an method to be called whenever Intent.ACTION_BATTERY_CHANGED is raised? Do I have to subclass BroadcastReciever? Or can I use a method to hook up the action to a method.</p>","200477","","","","","2010-07-20 15:58:10","Respond to Intent.ACTION_BATTERY_CHANGED","<java><android><android-intent><broadcastreceiver>","1","0","","",""
"3291655","1","3291822","","2010-07-20 15:32:48","16","21678","<p>How can I get battery level and state (plugged in, discharging, charging, etc)? I researched the developer docs and I found a BatteryManager class. But it doesn't contain any methods, just constants. How do I even use it?</p>","200477","","","","","2014-01-21 00:30:02","Get battery level and state in Android","<java><android><battery>","3","0","1","",""
"3292010","1","3292072","","2010-07-20 16:09:03","0","986","<p>I'm adding tab icon via selector like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:drawable=""@drawable/tab_cart_selected"" android:state_selected=""true"" /&gt;    &lt;item android:drawable=""@drawable/tab_cart"" /&gt;&lt;/selector&gt;</code></pre><p><a href=""http://img844.imageshack.us/img844/2535/questionn.jpg"" rel=""nofollow"">http://img844.imageshack.us/img844/2535/questionn.jpg</a></p><p>All is fine, but my icon is smaller then tab itself and I want to set background color same as icon color. But I cant seem to figure out hot to do that.</p><p>Any suggestions?</p>","385219","","","","","2010-07-20 16:23:21","Problem setting Android tab background color","<android><colors><background><tabwidget>","1","0","","",""
"3292055","1","12389629","","2010-07-20 16:13:59","0","27","<p>So I have created an android app and things are working alright.</p><p>In my main class I do a </p><pre><code>new Game();</code></pre><p>Now from the constructor of the game object I try and manipulate the screen, but it does not seem to do anything. Is it even possible?</p><pre><code>public class Game extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        this.setContentView(R.layout.board);    }}</code></pre>","396182","","45664","","2010-07-20 17:01:38","2012-09-12 13:44:32","manipulating the screen from subclass","<java><android>","1","3","","",""
"3292228","1","3292286","","2010-07-20 16:34:55","3","2564","<p>Hii everybody ,</p><p>I am noob at android and need some help...</p><p>I am developing an app which requires me to write to an SQLiteDatabase in one activity and access it from another activity . I am facing a problem implementing this. Any suggestions/ideas as to how we can share the database across multiple activities ...?</p>","397049","","","","","2012-01-05 06:52:23","SQLite Database in android","<android>","3","0","2","",""
"3292337","1","3294588","","2010-07-20 16:49:17","1","1005","<p>So I've got this code (updated for solution).</p><pre><code>    @Override    public View getView(int position, View convertView, ViewGroup parent) {        ...        final Direction d = directions.get(position);        if (d != null) {            TextView direction = (TextView) row.getTag(R.id.directionTextView);            TextView departure1 = (TextView) row.getTag(R.id.departure1);            TextView departure2 = (TextView) row.getTag(R.id.departure2);            TextView departure3 = (TextView) row.getTag(R.id.departure3);            direction.setText(d.getName());            if (d.getTimeStamps().size() == 0) {                departure1.setText(R.string.nodepartures);                departure1.setTextColor(R.color.grey);            } else {                for (int i = 0; i &lt; d.getTimeStamps().size(); i++) {                    switch (i) {                    case 0:                        departure1.setText(d.getTimeStamps().get(i));                        break;                    case 1:                        departure2.setText(d.getTimeStamps().get(i));                        break;                    case 2:                        departure3.setText(d.getTimeStamps().get(i));                        break;                    default:                        break;                    }                }            }        }        return row;    }}</code></pre><p>The problem I was having was that one of the TextViews would turn grey when it wasn't supposed to. I tried fixing it by always setting the text to black again, but that turned every single one of them grey. Until I tried:</p><pre><code>setTextColor(context.getResources().getColor(R.color.black));</code></pre><p>instead of just</p><pre><code>setTextColor(R.color.black);</code></pre><p>Don't know why the latter works when setting text grey, but there it is. I guess I'm just a little retarded. :)</p>","397060","","397060","","2010-07-30 17:26:58","2010-07-30 17:26:58","Entering both if AND else statement?","<java><android><android-emulator>","7","13","0","",""
"3292526","1","","","2010-07-20 17:14:27","3","2616","<p>I would like to implement google walking/cycle directions into an Android app im creating but I'm struggling to get my head around how to do this. I've recognised that the most accepted way is to query google via http to retrieve a kml file, which is translated back into the android app. owever since I've been java/android programming for about a day Im just struggling abit! Is there anyone out there who can point me to a pretty comprehensive tutorial of how to achieve a simple A to B navigation app or even better send me a simple project for me to review, breakdown and adapt! </p><p>Any help is much appreciated. </p><p>Regards </p>","397085","","","","","2012-06-14 07:24:34","Struggling to implement google directions api in Android App","<android><google-maps><driving-directions><map-directions>","1","1","","",""
"3292788","1","","","2010-07-20 17:45:39","6","1424","<p>On Android 2.2 Emulator, the ""geo fix"" command seems not to be working properly.  The emulator responds ""OK"", and <code>onLocationChanged()</code> is properly called in my program.  However, the <code>Location</code> object seems not to be complete - it registers latitude and longitude just fine, but it does not contain an altitude reading: <code>hasAltitude()</code> returns <code>false</code>.  </p><p>Any ideas why?</p><p>Example emulator commands:</p><pre><code>geo fix -74 40.75 500geo fix -77 39 400.0</code></pre><p>Code snippet:</p><pre><code>public void onLocationChanged(Location loc) {    System.out.println(""onLocationChanged Called"");    if (loc.hasAltitude()) {        double newalt = loc.getAltitude();        System.out.println(""new altitude: "" + newalt);        gps[ALTITUDE] = newalt;    } else {        System.out.println(""No altitude fix"");    }    gps[LONG] = loc.getLongitude();    System.out.println(gps[LONG]);    gps[LAT] = loc.getLatitude();    System.out.println(gps[LAT]);}</code></pre><p>Sample Output:</p><pre><code>onLocationChanged CalledNo altitude fix-74.01233333333333333340.756666666666666667onLocationChanged CalledNo altitude fix-77.01283333333333333539.006499999999999996</code></pre>","328511","","256196","","2013-09-25 13:31:40","2013-10-16 12:43:58","Geo Fix command does not pass altitude","<android><android-emulator><android-2.2-froyo>","1","1","0","",""
"3292818","1","3292918","","2010-07-20 17:49:27","12","9005","<p>Is there a way to directly inspect an SQLite3 database in Android via Eclipse or do I have to do this via the shell?</p>","25282","","135152","","2011-05-25 03:13:05","2013-07-23 06:14:33","Inspecting android sql database from Eclipse","<android><eclipse><sqlite><sqlite3>","3","0","","",""
"3292892","1","3906535","","2010-07-20 17:59:30","1","251","<p>i am using Linkify with a custom TransformFilter.  Is it possible to tell linkify to only match the first occurence of my pattern?</p>","372405","","","","","2010-10-11 13:16:53","android Linkify first occurence only","<android><linkify>","1","0","1","",""
"3293020","1","3293088","","2010-07-20 18:17:29","53","11914","<p>How do you add an Enum object to an Android Bundle?</p>","440093","","","","","2014-03-05 03:11:04","Android: How to put an Enum in a Bundle?","<android>","5","5","10","",""
"3293132","1","","","2010-07-20 18:31:44","2","1762","<p>I want to prevent ""sms sending""/texting on android.</p><p>There are some applications doing that but i don't know how?</p><p>eg.:</p><ul><li><a href=""http://www.textecution.com/"" rel=""nofollow"">Textecution</a></li><li><a href=""http://www.androidpit.de/de/android/market/apps/app/com.drunkapp2/Stop-Drunk-Texts-2-0/"" rel=""nofollow"">Stop Drunk Text 2.0</a></li></ul>","247690","","","","","2011-06-19 21:37:29","How to prevent ""sms sending""/texting on android?","<android><sms>","2","0","0","",""
"3293153","1","3293491","","2010-07-20 18:33:41","1","400","<p>In Android, is it possible to unicast an <code>Intent</code> to an <code>Activity</code>? The only options I see for sending intents is either to start an activity or issue a broadcast, but I only want a specific target to receive my Intent. </p>","440093","","","","","2012-03-21 05:18:13","Android: possible to unicast an intent?","<android>","4","0","2","",""
"3293243","1","3293536","","2010-07-20 18:44:17","8","14655","<p>How do I get data within an Android Service that was passed from an invoking Activity?</p>","155726","","889688","","2013-04-09 10:42:13","2013-04-09 10:56:55","Android: Pass data from Activity to Service using an Intent","<android><android-intent><service><data><activity>","2","0","3","",""
"3293253","1","3293636","","2010-07-20 18:45:38","2","718","<p>My first application will just be a kind of launcher that I would like to improve.This launcher will launch a custom Home that the user has installed.</p><p>That's like the application ""Home Switcher, but I would like to do that myself.</p><p>So my first goal is to get all ""Home"" applications list: that's really easy and the code is there:</p><pre><code>    Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);     pm=getBaseContext().getPackageManager();    mainIntent.addCategory(Intent.CATEGORY_HOME);     List&lt;ResolveInfo&gt; list = pm.queryIntentActivities(mainIntent,0); </code></pre><p>Now I would like to do that in a listview. My first problem is to get the Icon: I failed, but that's not my main problem ( if you can help me I would be happy)</p><p>I succeed to make a listview with all the names of the installed Home: </p><pre><code>for(...){    map = new HashMap&lt;String, String&gt;();     map.put(""titre"",info.activityInfo.applicationInfo.loadLabel( pm ).toString());    map.put(""pck"",info.activityInfo.packageName);    listItem.add(map);}    SimpleAdapter homeAdapter = new SimpleAdapter (this.getBaseContext(), listItem, R.layout.row,    new String[] {""img"", ""titre""}, new int[] {R.id.img, R.id.titre});    myListView.setAdapter(homeAdapter);</code></pre><p>And now when I click on a home, I would like to lauch the Home, so what I did is:</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); HashMap&lt;String, String&gt; map = (HashMap&lt;String, String&gt;) myListView.getItemAtPosition(position); Intent myIntent = new Intent(); myIntent.setPackage(map.get(""pck"")); startActivity(myIntent);  }</code></pre><p>So, there is a box that that appear and ask me:</p><p>Complete action using:   LauncherPro - or Sense - or ADW   Wallaper Gallery</p><p>I think I am close to what I would like to do.</p><p>So if you can tell me what I miss or give me an example of a Launcher that would be a few linecode, I would be really thankfull.</p><p>Thanks</p>","327402","","327402","","2010-07-20 19:23:33","2010-07-20 19:32:05","Getting list of installed app's: Easy... But How to launch one of them?","<android><home><android-intent><launcher>","1","0","1","",""
"3293365","1","","","2010-07-20 19:01:45","3","2493","<p>I'm new to development for Android and I am curious if it is even possible to request and accurate location of another android device?  For example, If I wanted to find where a friend is located and show it on my device in google maps.  </p>","397170","","","","","2011-08-19 14:39:08","Is it possible to find the location of another android phone?","<android><geolocation><gps>","2","0","","",""
"3293469","1","3296247","","2010-07-20 19:13:26","0","462","<p>In my app, I get the name of the person calling from the contacts database and read it out. A user contacted me about a number in the format 123-456-7890 which doesn't work. I've tested this myself and can't see why it wouldn't work.</p><p>The full code I'm using is available <a href=""http://code.google.com/p/android-tts-notifier-widget/source/browse/trunk/PhoneVoice/src/com/zer0day/android/phonevoice/NotifyService.java#206"" rel=""nofollow"">here</a>, but the relevant part is below:</p><pre><code>Cursor c = getContentResolver().query(Contacts.Phones.CONTENT_URI,                             new String[] {Contacts.Phones.DISPLAY_NAME},                             selection,                             args, null);</code></pre>","240251","","","","","2010-07-21 04:07:02","Finding name of Android contact from number","<android><cursor><contacts>","2","0","1","",""
"3293517","1","","","2010-07-20 19:18:40","6","13260","<p>The following XML code doesn't work to center an ImageView in a LinearLayout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;ImageView        android:id=""@+id/myimg""         android:layout_width=""36dip""        android:layout_height=""36dip""        android:scaleType=""fitXY""        android:layout_gravity=""center_horizontal""        android:background=""@drawable/my_background""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>And this is RelativeLayout code which surprisingly works:</p><pre><code> &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""      android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;ImageView        android:id=""@+id/myimg""         android:layout_width=""36dip""        android:layout_height=""36dip""        android:scaleType=""fitXY""        android:layout_centerHorizontal=""true""        android:background=""@drawable/my_background""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Can someone tell me why? Thanks!</p>","256239","","1325901","","2012-10-11 09:28:29","2013-05-21 19:13:48","How to center an ImageView in a LinearLayout?","<android>","3","4","1","",""
"3293581","1","","","2010-07-20 19:24:51","6","1855","<p>I would like to recreate the same type of app as Gallery3D but simpler: without the 3D animations and basically only keep GridView and Gallery widgets. I would also like to enable multi-touch zooming-dragging-scolling on the selected image and that's where I am struggling. I looked online for simple tutorials and I also looked at the Gallery3D source code but couldn't find a proper solution.</p><p>The closest I could get was using the custom ImageView below in my Gallery Adapter.</p><p>It works, I can pinch-and-zoom and drag except that the image goes off the screen and I can't scroll to the next image in the gallery. Also pinch-and-zoom is not perfect because it only scales the image and does not recenter it properly. Should I be adding an onTouchEvent on the Gallery instead ?</p><pre><code>import android.content.Context;import android.graphics.Canvas;import android.graphics.drawable.BitmapDrawable;import android.util.AttributeSet;import android.util.Log;import android.view.MotionEvent;import android.view.ScaleGestureDetector;import android.view.View;public class MyImageView extends View {private static final int INVALID_POINTER_ID = -1;    private BitmapDrawable mImage;    private float mPosX;    private float mPosY;    private float mLastTouchX;    private float mLastTouchY;    private int mActivePointerId = INVALID_POINTER_ID;    private ScaleGestureDetector mScaleDetector;    private float mScaleFactor = 1.f;    public MyImageView(Context context, BitmapDrawable bd) {        this(context, null, 0);     mImage = bd;        mImage.setBounds(0, 0, mImage.getIntrinsicWidth(), mImage.getIntrinsicHeight());    }    public MyImageView(Context context, AttributeSet attrs) {        this(context, attrs, 0);    }    public MyImageView(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());    }    @Override    public boolean onTouchEvent(MotionEvent ev) {        // Let the ScaleGestureDetector inspect all events.        mScaleDetector.onTouchEvent(ev);        final int action = ev.getAction();        switch (action & MotionEvent.ACTION_MASK) {        case MotionEvent.ACTION_DOWN: {            final float x = ev.getX();            final float y = ev.getY();            mLastTouchX = x;            mLastTouchY = y;            mActivePointerId = ev.getPointerId(0);            break;        }        case MotionEvent.ACTION_MOVE: {            final int pointerIndex = ev.findPointerIndex(mActivePointerId);            final float x = ev.getX(pointerIndex);            final float y = ev.getY(pointerIndex);            // Only move if the ScaleGestureDetector isn't processing a gesture.            if (!mScaleDetector.isInProgress()) {                final float dx = x - mLastTouchX;                final float dy = y - mLastTouchY;                mPosX += dx;                mPosY += dy;                invalidate();            }            mLastTouchX = x;            mLastTouchY = y;            break;        }        case MotionEvent.ACTION_UP: {            mActivePointerId = INVALID_POINTER_ID;            break;        }        case MotionEvent.ACTION_CANCEL: {            mActivePointerId = INVALID_POINTER_ID;            break;        }        case MotionEvent.ACTION_POINTER_UP: {            final int pointerIndex = (ev.getAction() & MotionEvent.ACTION_POINTER_INDEX_MASK)                     >> MotionEvent.ACTION_POINTER_INDEX_SHIFT;            final int pointerId = ev.getPointerId(pointerIndex);            if (pointerId == mActivePointerId) {                // This was our active pointer going up. Choose a new                // active pointer and adjust accordingly.                final int newPointerIndex = pointerIndex == 0 ? 1 : 0;                mLastTouchX = ev.getX(newPointerIndex);                mLastTouchY = ev.getY(newPointerIndex);                mActivePointerId = ev.getPointerId(newPointerIndex);            }            break;        }        }        return true;    }    @Override    public void onDraw(Canvas canvas) {        super.onDraw(canvas);        canvas.save();        Log.d(""DEBUG"", ""X: ""+mPosX+"" Y: ""+mPosY);        canvas.translate(mPosX, mPosY);        canvas.scale(mScaleFactor, mScaleFactor);        mImage.draw(canvas);        canvas.restore();    }    private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {        @Override        public boolean onScale(ScaleGestureDetector detector) {            mScaleFactor *= detector.getScaleFactor();            // Don't let the object get too small or too large.            mScaleFactor = Math.max(0.1f, Math.min(mScaleFactor, 10.0f));            invalidate();            return true;        }    }}</code></pre><p>Thanks</p>","358898","","","","","2011-07-10 13:40:56","Android Gallery Adapter with MultiTouch? Custom Gallery or Custom ImageView?","<android><android-widget>","1","0","4","",""
"3293659","1","3298141","","2010-07-20 19:34:36","7","16357","<p>I have android code that uses a background process to routinely (e.g. hourly) connect to a content source on the web to check for updated content. As new users download the app and run it for the first time, it seems (and this is just a ""seems at the moment) that in this first-run situation, because the DNS for our servers are not cached already on the device, those first series of connections fail with dreaded UnknownHostException: Host is unresolved. And of course, the application tries again later and (again, ""it seems like"") it is all working -- perhaps because the OS has had time to actually resolve the address.</p><p>So, my question(s) are: (1) Do other Android developers see this behavior with their deployed applications as well? First time, a series of ""host unresolved"" issues that work themselves out later. (2) Does anyone have a better strategy for ""warming up the DNS"" so-to-speak so that the first real connections work? or perhaps do you just re-try with some back-off looping when you encounter this exception? I was contemplating having a separate thread that tries to fetch a small text file from our server and have it just loop until it gets it and maybe (not sure about this part) block the other outgoing network connections until it succeeds.</p><p>In any event, I have read through a chunk of the answers to various similarly worded questions here on Stack Overflow and I just to assure everyone that</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p>is set in my Manifest file :)</p>","349423","","","","","2011-07-27 09:43:46","Android java.net.UnknownHostException: Host is unresolved (strategy question)","<java><android>","1","1","3","",""
"3293765","1","5843099","","2010-07-20 19:46:28","18","9970","<p>The default animation when the <code>Back</code> button is pressed is a slide from left to right. I'd like to replace that with a custom animation. I'm currently thinking that some combination of <code>onBackPressed()</code> and <code>overridePendingTransition</code> will do the trick, but I haven't been able to get it working.</p>","382252","","","","","2011-04-30 16:24:52","Custom Back Button Animation","<android>","2","1","7","",""
"3293819","1","3293929","","2010-07-20 19:54:35","0","573","<p>I have some java code that I want to share with some classmates however I do not want to share the source with them.  </p><p>What is the standard method to provide someone with a Java executable that they can use but they cannot see the source.  </p><p>Not sure if this is relevant but the code that I will be giving them will be run on android.  </p>","251589","","177800","","2010-07-20 20:11:41","2010-07-20 20:14:33","How to distribute an Android application (so that people cannot see the source)","<android><executable>","3","2","","",""
"3293871","1","5081104","","2010-07-20 20:00:27","0","543","<p>I managed to implement a GalleryView, create a custom Adapter that returns a ListView for each item of the gallery but now the the problem:</p><p>I while I can scroll the listview vertially, I can no longer scroll the GalleryView horizontally. </p><p>What I am aiming at is a UI similar to the Google Weather/News application. While you can click a 'tab-like' gallery item on the top, you can also horizontally scroll the list views that represent the news items.</p><p>How can I implement this? </p>","320938","","","","","2011-02-22 16:43:47","Android GalleryView that contains scrollable views, e.g. ListView","<android><listview><galleryview>","1","1","","",""
"3293950","1","3295035","","2010-07-20 20:10:45","1","105","<p>So, largely for debugging purposes, I want to be able to write an image at arbitrary points in my code, and look at it later. I figured this would be easiest if I just wrote a my bitmap to a file and read it back later, but I cannot seem to figure out where to find the file after I write it, or how to open an image that is not in res/drawable with a corresponding handle in R.</p>","391837","","391837","","2010-07-20 20:23:53","2010-07-20 22:54:28","read an image I just wrote in android","<android><image><file-io>","1","0","","",""
"3293972","1","3295636","","2010-07-20 20:14:02","0","2991","<p>I'm a noob... but no matter where I look in the res directory there is only main.xml and I am supposed to have res/anim/mainanim.xml and I don't.</p><p>My code is here:<a href=""http://stackoverflow.com/questions/3290290/please-help-me-with-frame-animaions-android-question"">http://stackoverflow.com/questions/3290290/please-help-me-with-frame-animaions-android-question</a></p><p>Thanks to Cameron. </p><p>I also keep getting in the java document, ""id and anim cannot be resolved or is not a field"" error. Can you guys help me? </p>","394842","","","","","2010-07-21 01:21:50","Android - I don't seem to have the ANIM folder or the MAINANIM.xml document... why is this?","<android><xml><eclipse><sdk>","1","1","","",""
"3294002","1","3294051","","2010-07-20 20:17:20","2","136","<p>Is this code instantiating a SectionedAdapter object and overriding getHeaderView in one line?</p><pre><code>SectionedAdapter tagSectionedAdapter=new SectionedAdapter() {    protected View getHeaderView(String caption, int index,                                    View convertView,                                    ViewGroup parent) {        TextView result=(TextView)convertView;        if (convertView==null) {            result=(TextView)getLayoutInflater()            .inflate(R.layout.tag_listview_header, null);        }        result.setText(caption);        return(result);    }};</code></pre>","291981","","","","","2010-07-20 20:23:06","java syntax question","<java><android>","2","0","","",""
"3294049","1","3295400","","2010-07-20 20:23:04","0","386","<p>I am trying to show a list of files using an ArrayAdapter into a ListView. As best as I can tell, the following should work but it is just leaving the ListView empty. I am not using a ListActivity.</p><p>Java</p><pre><code>setContentView(R.layout.files);findViewById(R.id.folder_use).setOnClickListener(this);ListView view = (ListView)findViewById(R.id.files);File[] files = Environment.getExternalStorageDirectory().listFiles();Log.d(TAG, files.toString());view.setAdapter(new ArrayAdapter&lt;File&gt;(this, R.layout.file_row, files));</code></pre><p>layout.files</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;    &lt;TextView android:id=""@+id/local_instructions"" android:text=""@string/local_instructions""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:layout_weight=""1"" /&gt;    &lt;ListView android:id=""@+id/files"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_below=""@id/local_instructions""        android:background=""#ffffff"" /&gt;    &lt;Button android:id=""@+id/folder_use"" android:text=""@string/folder_use"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_weight=""1"" android:layout_alignParentBottom=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>layout.file_row</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" /&gt;</code></pre><p>Am I missing something obvious?</p><p>Thanks</p>","302649","","","","","2010-07-21 00:16:22","Why won't my listview display?","<android><listview><android-arrayadapter>","1","0","","",""
"3294214","1","3294252","","2010-07-20 20:44:02","0","555","<p>How big is the motorola android's screen, in pixels? I want to know what size I need to make my graphic without it being too disorted by the fill_parent.</p><p>EDIT: I don't think you guys understood this... I know android is the operating system. Let me explain:If phone A was 400 by 300 pixels, hypothetically, and phone B was 450 by 350 pixels, I would know to make the graphic at least 400 by 300 pixels without the graphic being as stretched as if it were 300 by 200 pixels. Perhaps a better question would be, how big is the smallest droid's screen?</p>","394842","","341201","","2011-08-17 10:11:11","2011-08-17 10:11:11","How big is an android phone's screen?","<android><motorola-droid>","3","3","","",""
"3294305","1","3295803","","2010-07-20 20:58:20","0","167","<p>im trying to implement a listAdapter that supports integer Arraylists by extending the baseAdapter, when initialize the activity my app crashes. Since im new to android i was wondering if anybody could spot something wrong with my implementation</p><pre><code>package com.test.testapp;import java.util.ArrayList;import com.test.testapp.R;import android.content.Context;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.TextView;public class myListAdapterIntegers extends BaseAdapter {    ArrayList&lt;Integer&gt; arrayIntList = new ArrayList&lt;Integer&gt;();    Context context;    myListAdapterIntegers(Context c, ArrayList&lt;Integer&gt; myListAdapterIntegers) {        this.arrayIntList = myListAdapterIntegers;        this.context = c;    }    @Override    public int getCount() {        return arrayIntList.size();    }    @Override    public Object getItem(int location) {        return arrayIntList.get(location);    }    @Override    public long getItemId(int position) {        return position;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        View v = View.inflate(context, R.layout.entry_row_int, null);        int value = arrayIntList.get(position);        TextView monthTextView = (TextView) v.findViewById(R.id.text_row_int);        monthTextView.setText(value);        return v;    }}</code></pre>","267822","","","","","2010-07-21 02:02:13","Making a listadapter that supports integers","<android>","1","2","","",""
"3294318","1","","","2010-07-20 20:59:57","0","868","<p>I was following <a href=""http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog"" rel=""nofollow"">this guide</a> to make a custom AlertDialog.  I want to make a dialog with buttons and a title like an AlertDialog, but also with an EditText box, which a regular AlertDialog can't use.  So I made the following custom layout containing the EditText box in a file called add_player_dialog.xml in res/layout, which will be called by AlertDialog.Builder's setView():</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""   android:id=""@+id/add_player_dialog_layout""   android:orientation=""vertical""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   android:padding=""10dp""   &gt;  &lt;EditText     android:id=""@+id/player_name""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:background=""@android:drawable/editbox_background""     android:textSize=""20sp""     /&gt;&lt;/LinearLayout&gt;</code></pre><p>Then in the activity (not the root activity, btw) that starts the dialog, I have the following in a switch in onCreateDialog():</p><pre><code>    Context mContext = getApplicationContext();    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);    View layout = inflater.inflate(R.layout.add_player_dialog,                   (ViewGroup) findViewById(R.id.add_player_dialog_layout));    AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder.setTitle(""Enter player's name"")    .setPositiveButton(""OK"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int id) {            Toast.makeText(getApplicationContext(), ""yes"", Toast.LENGTH_SHORT).show();        }        })    .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int id) {            dialog.cancel();        }        })    .setView(layout);    AlertDialog alert = builder.create();</code></pre><p>The problem is that the activity that is first used when the application is launched uses add_player_dialog.xml for its layout, not main.xml.  How do I avoid this?</p><p>=================</p><p>EDIT: I have found a programmatic way to accomplish this, if anyone is interested:</p><pre><code>import android.R.drawable;EditText et = new EditText(this);et.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));et.setBackgroundResource(drawable.editbox_background);et.setTextSize(20);</code></pre><p>=================</p><p>If you're interested, here is main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout   xmlns:android=""http://schemas.android.com/apk/res/android""   android:orientation=""horizontal""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   android:padding=""40dip""   &gt;  &lt;LinearLayout     android:orientation=""vertical""     android:layout_height=""wrap_content""     android:layout_width=""fill_parent""     android:layout_gravity=""center""     &gt;    &lt;Button       android:id=""@+id/new_game_button""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:layout_gravity=""center""       android:text=""@string/new_game_button""       /&gt;    &lt;Button       android:id=""@+id/continue_button""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:layout_gravity=""center""       android:text=""@string/continue_button""       /&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","397286","","397286","","2010-07-28 01:07:46","2012-01-31 04:05:03","Android problem: Custom dialog layout is used instead of main.xml for root activity","<android><customdialog>","2","0","","",""
"3294574","1","","","2010-07-20 21:37:12","1","857","<p>I am trying to toggle the microphone of Android mobile. App. freezes if I run the mute and unmute in a loop, With a delay of say 500ms. Is there a specific reason mobile behaves this way? (Motorola Droid is not even able to mute the phone) however all other mobiles are able to do it. </p><p>This runs in a loop for 20 times</p><pre><code>audioService.setMicrophoneMute(true);try {    Thread.sleep(500, 40);} catch (InterruptedException e) {    // TODO Auto-generated catch block    e.printStackTrace();} audioService.setMicrophoneMute(false);</code></pre>","357349","","244296","","2010-07-20 21:40:21","2010-07-20 21:40:21","Muting the microphone android","<android>","0","2","1","",""
"3294590","1","3295056","","2010-07-20 21:40:20","62","73260","<p>Is it possible to set the absolute position of a view in android? (I know that there is an AbsoluteLayout, but it's deprecated...)Lets say I have a screen 240x320px, and I want to put an ImageView which is 20x20px with its center at the position (100,100).What do I have to do?Thanks for the help, this is driving me crazy.</p>","263521","","","","","2012-11-14 08:57:11","set the absolute position of a view in Android","<android><view><css-position>","3","2","42","",""
"3294805","1","3295650","","2010-07-20 22:08:51","1","1491","<p>Can someone tell me, what is the best way to deal with situations when there is no GPS signal or from some reason fix cannot be acquired?</p><p>The thing is that I thought that it would be sufficient just to use onStatusChanged method from LocationListener, but when there is no GPS signal it never calls this method. Why is that?</p><p>Thanks </p>","366156","","","","","2010-07-21 01:24:04","Android LocationManager and it's updates","<android><gps><locationmanager>","1","0","","",""
"3294957","1","3300919","","2010-07-20 22:40:43","0","346","<p>Ok so I have an rss reader that links to articles.  One of the sites it links to doesn't have a mobile view.  I was wondering if anyone knew if it was possible to set the ""zoom"" and position of the view once the page is loaded?  So for instance if the following link were my article... <a href=""http://www.neworleanssaints.com/news-and-events/article-1/Saints-agree-to-terms-with-7th-round-pick-Sean-Canfield/cce6a9ca-eaee-4878-ad40-0b98609f7fe7"" rel=""nofollow"">http://www.neworleanssaints.com/news-and-events/article-1/Saints-agree-to-terms-with-7th-round-pick-Sean-Canfield/cce6a9ca-eaee-4878-ad40-0b98609f7fe7</a></p><p>Then how could I have the view focus on the article without the user having to zoom in and scroll the the top of the article.  Thanks.</p>","394241","","","","","2010-07-21 15:22:12","How to set webview area upon loading a link?","<java><android><rss><webview>","1","0","","",""
"3294978","1","5519049","","2010-07-20 22:44:38","1","885","<p>What is the difference between vcalendar and icalendar? Is it only the VERSION difference as  1.0 and 2.0 respectively?</p><p>For sending a Meeting Request with iCalendar and vcalendar, I specify the MIME type as text/calendar.</p><p>The email sent with iCalendar appears as a Meeting Request while the one with vCalendar appears as an attachment. When I double click the attachment, it opens up as an Appointment.</p>","302969","","302969","","2011-04-01 21:24:30","2011-04-01 21:25:37","vcalendar vs icalendar","<android><calendar>","1","0","","",""
"3295163","1","3295259","","2010-07-20 23:20:50","4","736","<p>I'm building a small Android application, but this is more of a Java question than an android question. Looking through the tutorials there are lines that look like:</p><pre><code>startService(new Intent(this, MyService.class));</code></pre><p>what exactly does the ""MyService.class"" field represent?  Is that just a reference to the class for a template?</p><p>Thanks.</p>","84128","","","","","2010-07-21 03:42:01","In Java, what does a reference to Class.class do?","<java><android>","4","0","","",""
"3295200","1","3295409","","2010-07-20 23:27:05","5","4185","<p>Using the following code snippets, I'm trying to get the text value which has been typed in to the <code>EditText</code>s.</p><pre><code>LayoutInflater factory = LayoutInflater.from(this);final View loginView = factory.inflate(R.layout.login, null);b.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        Dialog d = new AlertDialog.Builder(NewOrder.this)            .setIcon(R.drawable.icon)            .setTitle(""Log In"")            .setView(loginView)            .setPositiveButton(""Log In"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int whichButton) {                    mSpinner = ProgressDialog.show(mContext, """", ""Authenticating User..."");                    new LoginTask().execute();                }            })            .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int whichButton) {                    /* User clicked cancel so do some stuff */                }            })            .create();        d.show();    }});</code></pre><p>My <strong>login.xml</strong> is pretty standard and straight forward:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""&gt;    &lt;TextView        android:id=""@+id/username_view""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_marginLeft=""20dip""        android:layout_marginRight=""20dip""        android:text=""Email Address""        android:gravity=""left""        android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;    &lt;EditText        android:id=""@+id/username""        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""        android:layout_marginLeft=""20dip""        android:layout_marginRight=""20dip""        android:scrollHorizontally=""true""        android:autoText=""false""        android:capitalize=""none""        android:gravity=""fill_horizontal""        android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;    &lt;TextView        android:id=""@+id/password_view""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_marginLeft=""20dip""        android:layout_marginRight=""20dip""        android:text=""Password""        android:gravity=""left""        android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;    &lt;EditText        android:id=""@+id/password""        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""        android:layout_marginLeft=""20dip""        android:layout_marginRight=""20dip""        android:scrollHorizontally=""true""        android:autoText=""false""        android:capitalize=""none""        android:gravity=""fill_horizontal""        android:password=""true""        android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>When someone clicks the <code>PositiveButton</code>, how do I get the value of the <code>EditText</code> fields?</p>","202064","","1454806","","2013-04-22 20:58:38","2013-04-22 21:00:27","Retrieving value of EditTexts in AlertDialog builder using Layout","<android><alertdialog>","1","0","3","",""
"3295207","1","","","2010-07-20 23:29:06","1","1944","<p>I'd like to allow my Android app to upload a spreadsheet document to Google Docs. Using a simple Uri request:</p><pre><code>Uri uri = Uri.parse(""http://docs.google.com/DocAction?action=updoc&amp;hl=en"");Intent intent = new Intent(Intent.ACTION_VIEW, uri);startActivity(intent);</code></pre><p>and this page appears as blank on a phone (must use code not compatible with phones).</p><p>I've looked into the Google Docs procedures for uploading from a Web Service. They require first authenticating the user and retrieving an AuthSub authorization to be used in a following POST request (including the AuthSub token) to actually upload the doc. This is easy from a Web Service that can guarantee a URL to return the AuthSub to, but how about on a mobile phone? </p><p>Currently thinking that I'll use UrlConnection, use getHeader(String) to grab the AuthSub, then build the entire document dynamically like this:</p><pre><code>POST /feeds/default/private/full HTTP/1.1Host: docs.google.comGData-Version: 3.0Authorization: &lt;your authorization header here&gt;Content-Length: 73612Slug: test.xlsContent-Type: application/vnd.ms-excel&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;Worksheet ss:Name=""Sheet1""&gt;&lt;Table ss:ExpandedColumnCount=""4"" ss:ExpandedRowCount=""4"" x:FullColumns=""1"" x:FullRows=""1""&gt;&lt;Row&gt;&lt;Cell&gt;&lt;Data ss:Type=""String""&gt;IN&lt;/Data&gt;&lt;/Cell&gt;&lt;Cell&gt;&lt;Data ss:Type=""String""&gt;OUT&lt;/Data&gt;&lt;/Cell&gt;&lt;Cell&gt;&lt;Data ss:Type=""String""&gt;TIME&lt;/Data&gt;&lt;/Cell&gt;&lt;Cell&gt;&lt;Data ss:Type=""String""&gt;SUBTOTAL&lt;/Data&gt;&lt;/Cell&gt;&lt;/Row&gt;&lt;Row&gt;&lt;Cell&gt;&lt;Data ss:Type=""String""&gt;Value&lt;/Data&gt;&lt;/Cell&gt;&lt;Cell&gt;&lt;Data ss:Type=""Number""&gt;123&lt;/Data&gt;&lt;/Cell&gt;&lt;Cell&gt;&lt;Data ss:Type=""String""&gt;Example&lt;/Data&gt;&lt;/Cell&gt;&lt;Cell&gt;&lt;Data ss:Type=""String""&gt;Example&lt;/Data&gt;&lt;/Cell&gt;&lt;/Row&gt;&lt;/Table&gt;&lt;/Worksheet&gt;</code></pre><p>Anyone with any experience or suggestions - would love to hear a comment.</p><p>Thanks,</p><p>Rusty</p>","397376","","397376","","2010-07-21 01:00:07","2011-03-22 15:19:07","Want to upload a spreadsheet from an Android app to Google Docs - what is the best solution?","<android><google-docs>","1","0","","",""
"3295381","1","3295535","","2010-07-21 00:12:52","4","6122","<p>I would like to add an HTML resource to my Android project with references to other resources (mainly drawables). </p><p>Where should I put it and how do I reference other resources from it?</p><p>Is there a particular way to pass the HTML resource to a <code>WebView</code>?</p><p>Thanks!</p>","143378","","143378","","2010-07-21 00:36:51","2013-04-17 13:36:38","Android HTML resource with references to other resources","<html><android><resources><embedded-resource><drawable>","2","1","1","",""
"3295598","1","3427206","","2010-07-21 01:11:10","7","1809","<p>How do you instruct users to report a bug in Android? Any advice or tips?</p><p>I'd like to get send detailed instructions to my users to get the most of their bug report. I know there are various apps that send bug reports from the device and I was wondering how other Android developers deal with this.</p>","143378","","143378","","2010-07-21 01:17:40","2014-02-20 20:23:31","How to instruct users to report a bug in Android","<android><user><bug-reporting>","5","4","2","",""
"3295672","1","3295913","","2010-07-21 01:29:14","24","26641","<p>Is there a way to make the screen scroll to allow the text field to be seen?</p>","207795","","72668","","2012-05-31 13:34:41","2014-02-14 17:52:22","Android soft keyboard covers edittext field","<android><edittext><softkeys>","5","0","13","",""
"3295735","1","3295771","","2010-07-21 01:42:56","1","3171","<p>This is a basic question. I was going through an official video by google regarding android. In it they used Viewholder class as </p><p>static class Viewholder{    ImageView image;    Textview text;} </p><p>Would it be right to declare this class as static or view holder is used as static inner class. </p><p>I think suppose if its top level class then compiler will throw error while using static keyword with top level class. </p>","218665","","","","","2010-07-21 01:50:22","View holder Class in Android","<android>","1","0","","",""
"3295829","1","","","2010-07-21 02:10:27","0","1461","<p>Hello I am currently new to android development I been working on the examples in the Dev Guide in the android website. I want to get a stream from a server I have to play in the emulator when I insert the url it doesn't seam to want to play. My question is there a way to get the emulator to play audio or is it all enabled also does <code>MediaPlayer</code> require a special kind of format like mp3 or ogg ? This is the code i am running on my 'onCreate()' method.</p><pre><code>MediaPlayer mp - new MediaPlayer();mp.setDataSource(MY_URL_);mp.prepare();mp.start();</code></pre><p>Hope you guys can help my out.</p>","52619","","","","","2012-06-07 00:36:14","Getting streaming audio to play with MediaPlayer class on Android?","<android><android-emulator>","2","0","","",""
"3295847","1","","","2010-07-21 02:17:09","8","1189","<p>Suppose my activity ui-thread spawns a separate thread at some point. Is it safe for that new thread to fire off an Intent for launching a new activity?</p><p>Thanks</p>","397449","","","","","2012-11-14 11:25:42","Is it safe to launch and activity from a non-ui thread?","<android>","3","0","2","",""
"3295871","1","3295920","","2010-07-21 02:27:31","0","922","<p>I created an application which is currently on Android market. The key used to sign the application was made using jarsigner. How do I sign using the .key file originally generated?</p>","300972","","","","","2010-07-21 02:41:47","How do I sign an apk using .key file?","<java><android><jarsigner>","1","0","","",""
"3296047","1","3296091","","2010-07-21 03:18:05","17","88499","<p>I keep getting this error. Should I just make <code>id</code> a field?</p><p>My code is:</p><pre><code>public void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    ImageView mainimage = (ImageView) findViewById(R.id.mainanim);    mainimage.setBackgroundResource(R.anim.mainanim);    mainanimation = (AnimationDrawable) mainimage.getBackground();}</code></pre><p>How exactly do you fix this?</p>","394842","","1031264","","2012-09-11 17:06:46","2012-11-13 16:11:42","""id cannot be resolved or is not a field"" error?","<android><eclipse><sdk>","13","1","5","",""
"3296111","1","3299142","","2010-07-21 03:32:42","2","497","<p>I am studying android's sample Wiktonary in how to create a widget for android.</p><p>My questions is why it puts</p><pre><code>&lt;appwidget-provider xmlns:android=""http://schemas.android.com/apk/res/android""    android:minWidth=""146dip""    android:minHeight=""72dip""    android:updatePeriodMillis=""86400000""    android:initialLayout=""@layout/widget_message"" /&gt;</code></pre><p>in a file called wdiget_word.xml under res/xml? Instead of putting it under AndroidManifest file?</p>","125440","","","","","2010-07-21 12:26:23","How to put appwidget-provider declaration for android widget","<android>","1","0","","",""
"3296119","1","","","2010-07-21 03:34:03","0","1002","<p>The app AndroidVNC defines the following activity filter in its manifest:</p><pre><code>        &lt;activity android:screenOrientation=""landscape"" android:configChanges=""orientation|keyboardHidden"" android:name=""VncCanvasActivity""&gt;           &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.item/vnd.vnc.config"" /&gt;           &lt;/intent-filter&gt;         &lt;/activity&gt;</code></pre><p>If it is possible to invoke this activity, you need a URI for the vendor specific MIME type vnd.vnc.config. Something to replace <em>FOO</em> in the following code is needed:</p><p>Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(""<em>FOO</em>""));startActivity(intent);</p><p>So what string is needed for Uri.parse() to match a vendor specific MIME type like vnd.vnc.config? Given a vendor specific MIME type like vnd.vnc.config, in general how do you determine what string to pass into Uri.parse() to match such a MIME type?</p><p>===========================================</p><p>I've appended AndroidVNC's entire AndroidManifest.xml file at the bottom of this question.Can a completely separate Android app invoke any or all of the activities specifiedin this AndroidManifest.xml file? If so, what specific version of the following code would that separate app use to match and invoke each activity in the AndroidManifest.xml file?Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(""<em>FOO</em>""));startActivity(intent);</p><p>    </p><pre><code>    &lt;provider android:name=""Provider""        android:authorities=""android.androidVNC.Provider"" /&gt;            &lt;activity android:screenOrientation=""landscape"" android:configChanges=""orientation|keyboardHidden"" android:name=""VncCanvasActivity""&gt;                    &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.item/vnd.vnc.config"" /&gt;                    &lt;/intent-filter&gt;            &lt;/activity&gt;        &lt;activity android:name="".gui.ListVncSettingsActivity"" android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".gui.InsertVncSettingsActivity""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.INSERT"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.dir/vnd.vnc.config"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".gui.EditVncSettingsActivity""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.EDIT"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.item/vnd.vnc.config"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".gui.DeleteVncSettingsActivity""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.DELETE"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.item/vnd.vnc.config"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;/application&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;</code></pre><p></p>","","JohnM","","","","2010-07-21 12:34:03","Intent filter with vendor specific MIME type","<android>","1","0","0","",""
"3296227","1","","","2010-07-21 04:01:22","2","4264","<p>Given an image, I want to be able to scale only a part of that image. Say, I want to expand half of the image so that, that half takes up the whole space.</p><p>How is this possible?</p><p>Will ImageView fitXY work because I thought it'll work only for the whole original image.</p><pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout linearLayout = new LinearLayout(this);            Bitmap bitmap = BitmapFactory.decodeResource(getResources(),       R.drawable.icon);               int width = bitmap.getWidth();                int height = bitmap.getHeight();               int newWidth = 640;               int newHeight = 480;                float scaleWidth = ((float) newWidth) / width;               float scaleHeight = ((float) newHeight) / height;               Matrix matrix = new Matrix();               matrix.postScale(scaleWidth, scaleHeight);                // create the new Bitmap object                Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 50, 50, width,                        height, matrix, true);                BitmapDrawable bmd = new BitmapDrawable(resizedBitmap);                ImageView imageView = new ImageView(this);                imageView.setImageDrawable(bmd);                imageView.setScaleType(ScaleType.CENTER);                linearLayout.addView(imageView, new LinearLayout.LayoutParams(                        LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));                setContentView(linearLayout);     } } </code></pre><p>This works only if in createBitmap, the X and Y coordinates of the first pixels in the source are 0. meaning, I'm not able to take a subset of the image. Only able to scale the whole image. But createBitmap is meant to subset an image.</p><p>In the log, when the parameters are not 0, I get the following exception: java.lang.IllegalArgumentException: x + width must be &lt;= bitmap.width()</p><p>Please help</p>","381699","","975292","","2011-12-19 13:56:59","2012-08-12 07:00:41","Android: Resizing and scaling a part of the image","<android><image><matrix><bitmap><imageview>","2","0","1","",""
"3296381","1","","","2010-07-21 04:50:17","1","922","<p>I've just started to learn development for the android.</p><p>I set up a test app with a basic textview that when you clicked on it, changed text. that worked fine. So I decided I wanted to do something interesting with google maps using mapview.</p><p>I've followed the instructions in the documentation, and looked around at the demomaps demo app, but when I launch my app in a AVD (pointed to the correct source, google APIs lvl3) I get ""the application has stopped unexpectedly. please try again"", when I launch in debug mode, the only error I get is ""source not found"" </p><p>Here are some excerpts from my code:</p><p>views</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;com.google.android.maps.MapView        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:enabled=""true""        android:clickable=""true""        android:apiKey=""[ommitted for safety - i have an apikey though]""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>manifest</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""leblanc.test.HelloCora""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".hello""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;    &lt;uses-library android:name=""com.google.android.maps"" /&gt;&lt;/manifest&gt; </code></pre><p>my source .java is basically default</p><p>I am developing in eclipse using the ADT, on a linux machine</p><p>let me know if there is any other info you need</p><p>Thanks!</p><p><b> EDIT: </b> More information on the error I am getting.</p><pre><code>TestApp [Android Application]  DalvikVM [localhost:8619]    Thread [ &lt;3&gt; Main ] (Suspended (exception RuntimeException))       ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord) line: 2268          ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord) line: 2284           ActivityThread.access$1800(ActivityThread, ActivityThread$ActivityRecord) line: 112         ActivityThread$H.handleMessage(Message) line: 1692          ActivityThread$H(Handler).dispatchMessage(Message) line: 99         Looper.loop() line: 123         ActivityThread.main(String[]) line: 3948        Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]          Method.invoke(Object, Object...) line: 521          ZygoteInit$MethodAndArgsCaller.run() line: 782          ZygoteInit.main(String[]) line: 540         NativeStart.main(String[]) line: not available [native method]   </code></pre><p>Also, the interesting thing is that the demomaps demo application in the android SDK does not crash (though the map data never loads, even though it has internet access permission)</p>","380486","","380486","","2010-07-21 21:03:56","2010-11-04 05:29:29","android maps view crashes app","<android><google-maps>","2","0","","",""
"3296408","1","3296737","","2010-07-21 04:57:14","0","470","<p>I am using fb-connect for android app problem is when keyboards gets open layout distorted ?? </p><p>I think they are opening facebook login page in browser any quick fix to add done button and layout disordering after keyboard get open</p><p><img src=""http://www.freeimagehosting.net/uploads/2493f17000.jpg"" alt=""alt text""></p>","216431","","","","","2010-07-21 06:19:35","android fb-connect layout disordering issue","<android><fbconnect>","2","0","","",""
"3296629","1","3296825","","2010-07-21 05:54:42","1","872","<p>I came across the following two lines in AndroidMenifest.xml file of my android application:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""&gt;</code></pre><ol><li>Why we have write ""encoding"" in <code>&lt;xml&gt;</code> tag, what is the purpose of it?</li><li>What is the purpose of writing 2nd line ?</li></ol><p>if anybody know this, may share their knowledge to let me clear regarding this 2 lines</p><p>Thanx - paresh</p>","379693","","","","","2010-07-21 06:38:31","AndroidManifest.xml","<android><file><android-manifest>","2","0","1","",""
"3296639","1","3304329","","2010-07-21 05:56:42","7","3203","<p>I have an IntentService that downloads some files.  The problem is that I create a Toast inside the IntentService like this</p><pre><code>Toast.makeText(getApplicationContext(), ""some message"", Toast.LENGTH_SHORT).show();</code></pre><p>The Toast will never disappear event if I exit the app.  The only way to destroy it is to kill the process.</p><p>What am I doing wrong?</p>","248521","","","","","2013-08-13 16:48:49","Toast created in an IntentService never goes away","<android>","5","2","","",""
"3296850","1","3296950","","2010-07-21 06:42:28","20","24416","<p>How can I save an images to the SD card that I retrieve from the image's URL?</p>","367407","","403455","","2012-08-10 20:20:57","2012-11-27 13:55:15","How do I transfer an image from its URL to the SD card?","<android><image><file-download><android-sdcard>","2","1","12","",""
"3296857","1","3452331","","2010-07-21 06:44:47","4","725","<p>Will Titanium work properly on all android sdk versions (1.5, 1.6, 2.0, 2.1, 2.2).....</p>","304961","","231716","","2011-12-16 20:03:00","2012-04-16 08:03:01","Titanium compatibility with Android","<android><titanium>","7","0","2","",""
"3296881","1","3300762","","2010-07-21 06:48:43","0","2602","<p>i want to remove the default orange focus color from GridView and from the EditText.     I have tried the android:focusable=""false"" but it is not working.Can any one help me  if you have gone through this problem before?????</p><p>Thanks in advance.</p>","307585","","307585","","2010-07-21 12:33:07","2010-07-21 15:07:11","Remove default focus color from GridLayout and EditBox in android","<android><gridview><edittext>","1","0","","",""
"3296902","1","","","2010-07-21 06:54:16","3","439","<p>It walks like a bug, it chirps like a bug.... I need someone to confirm that it's a bug.</p><p>I was trying to get phone numbers from the address book with this code:</p><pre><code>public JSONObject getAllPhones() throws JSONException{ String mPhoneNumberProjection[] = new String[] {        Contacts.Phones.NAME, Contacts.Phones.NUMBER, Contacts.Phones.TYPE};Uri phoneNumbersUri = Contacts.Phones.CONTENT_URI;JSONObject result = new JSONObject(); JSONArray phones = new JSONArray();Cursor myCursor = mApp.managedQuery(phoneNumbersUri, mPhoneNumberProjection, null, null, null);mApp.startManagingCursor(myCursor);if (!myCursor.isAfterLast()){    myCursor.moveToFirst();    do{        JSONObject aRow = new JSONObject();        for (int i = 0; i &lt; myCursor.getColumnCount(); i++){            Log.d(LOG_TAG, myCursor.getColumnName(i) + "" -&gt; "" + myCursor.getString(i));            aRow.put(myCursor.getColumnName(i), myCursor.getString(i));        }        phones.put(aRow);    } while (myCursor.moveToNext());}result.put(""phones"", phones);result.put(""phoneTypes"", getPhoneTypes());return result;}</code></pre><p>But when there are no contacts, and !myCursor.isAfterLast() evaluates as ""false"", program steps into ""for"" loop. So it enters ""if"" block, skips several methods and lands in ""for"" loop... </p><p>When I extract this loop into a separate function, everything works ok.</p><p>I'm doing this in Eclipse Helios on 32-bit Vista. I tried cleaning the project, erasing Java cache, restarting computer, creating new AVD... I used Android 1.6 and Android 2.2, but the error stays on...</p><p>Can someone explain what's going on?</p>","133648","","133648","","2010-07-21 07:18:49","2010-08-03 03:47:07","Weird behavior in Android's ""if"" block","<java><android>","5","3","0","",""
"3297018","1","","","2010-07-21 07:16:17","0","57","<p>Hi i want to know how the handle events ,such as selected item in the Custom List,</p><p>How To get the position ,name of selected item in customList</p><p>RegardsRakesh shankar.P</p><pre><code>public class Adapter extends BaseAdapter{ int count=0;   Context ctx;List&lt;InfoObject&gt;    obs;Adapter(Context ct,List&lt;InfoObject&gt; cols){    ctx=ct;    obs=cols;}@Overridepublic int getCount() {    // TODO Auto-generated method stub    return obs.size();}@Overridepublic Object getItem(int position) {    // TODO Auto-generated method stub    return position;}@Overridepublic long getItemId(int position) {    // TODO Auto-generated method stub    return position;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    // TODO Auto-generated method stub    count++;    Log.v(""Count"", String.valueOf(count));    InfoObject obj=obs.get(position);    return new ObjectAssigner(ctx,obj);}</code></pre><p>}</p>","138030","","138030","","2010-07-21 09:54:30","2010-07-21 09:54:30","Events Handling For CustomListView","<android>","0","4","","",""
"3297027","1","3297348","","2010-07-21 07:17:48","1","12753","<p>When I create a Button,</p><pre><code>Button myButton = new Button(this);myButton.setText(""Click Me!"");</code></pre><p>it creates a button, that on click, turns ""Orange"" to indicate the click.</p><p>To the button when I add, </p><pre><code>button.setBackgroundColor(Color.BLUE);</code></pre><p>It creates a blue rectangle, and on click does not have a hightlight effect.</p><p>I don't mind the rectangle part, I want to get the orange highlight effect though.</p><p>Cannot use XML, need to do this in code. </p><p>Thanks</p>","321927","","12707","","2010-07-21 07:20:12","2013-04-05 14:48:06","Button setBackgroundColor no highlight effect","<android><button><colors><background><highlight>","2","0","1","",""
"3297204","1","3297235","","2010-07-21 07:48:32","18","12935","<p>We have a Service that continuously collects sensor data on the phone. This service should run ""forever"", e.g. as long as the user wants, and not be killed by the system.</p><p>For clarification, this service is <strong>not</strong> intended for an app to be released in the market to the general public, it is written for a scientific study. So the people running the app are fully aware that their battery will sucked empty faster than usual, this is no problem.</p><p>Anyways, my problem is that the service gets killed after a while of running. Sometimes after an hour, sometimes only after like 7 oder 10 hours.</p><p>The Log-Entries when the service gets killed look like this. It just says ""<em>no longer want</em>"", sometimes without even calling onDestroy(), as far as I can tell.</p><pre><code>07-20 17:07:11.593 I/ActivityManager(   85): No longer want my.project.datalogging (pid 23918): hidden #1607-20 17:07:11.593 I/WindowManager(   85): WIN DEATH: Window{44c61570 my.project.datalogging/my.project.datalogging.DataLoggingApp paused=false}07-20 17:07:11.603 I/BackgroundService(23925): onDestroy()</code></pre><p>Or later (after I manually restarted it): </p><pre><code>07-20 19:00:49.677 I/ActivityManager(   85): No longer want my.project.datalogging:BackgroundService (pid 24421): hidden #1707-20 19:00:49.677 I/ActivityManager(   85): No longer want my.project.datalogging (pid 24415): hidden #1807-20 19:00:49.807    85 10707 I WindowManager: WIN DEATH: Window{44f1ea58 my.project.datalogging/my.project.datalogging.DataLoggingApp paused=false}</code></pre><p>I often see other services being killed with ""<em>no longer want</em>"" and then immediately restarted with ""<em>Scheduling restart of crashed service</em>"". For example here with runkeeper: </p><pre><code>07-20 17:30:45.503 I/ActivityManager(   85): No longer want com.fitnesskeeper.runkeeper (pid 24090): hidden #1607-20 17:30:45.603 W/ActivityManager(   85): Scheduling restart of crashed service com.fitnesskeeper.runkeeper/.services.RunKeeperService in 5000ms07-20 17:33:52.989 I/ActivityManager(   85): Start proc com.fitnesskeeper.runkeeper for service com.fitnesskeeper.runkeeper/.services.RunKeeperService: pid=24292 uid=10099 gids={3003, 1015}</code></pre><p>The logs show no record of low memory. Testing is done on (several) Nexus One with 2.2 (Froyo FRF91).</p><p>Is there any way I can achieve this behaviour with my app? Automatic restarting after being killed?</p><p>Or this this something totally different that just looks similar in logcat?</p><p>If you need any more information, just ask and I'll try to provide it :-)</p>","367197","","","","","2012-10-22 13:31:29","Android-Service killed with ""no longer want"" - how to restart it?","<android><service>","2","0","11","",""
"3297305","1","3299048","","2010-07-21 08:04:52","1","4175","<p>I try to record audio using android ndk. people say I can use ""frameworks/base/media/libmedia/AudioRecord.cpp"". but it is in kernel. how can I access and use it?</p>","289212","","","","","2012-03-23 09:12:50","Audio Record using Android NDK","<android><android-ndk>","3","0","1","",""
"3297437","1","3297562","","2010-07-21 08:26:57","45","53992","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2486936/android-shadow-on-text"">Android - shadow on text?</a>  </p></blockquote><p>How can i make shadow effect text in a <code>TextView</code>.</p><p>Any Idea?</p>","267269","","119895","","2011-11-08 16:03:34","2012-06-04 10:06:12","Shadow Effect for a Text in Android?","<android><textview><shadow>","3","0","25","2012-10-20 21:34:40",""
"3297557","1","","","2010-07-21 08:46:30","2","1248","<p>Is there any way we can integrate Google Checkout in Android?</p><p>I am able to post the order request and in response I get the checkout redirect url where the user is redirected. But then how to proceed with it. How will the android application come to know when the payment is done.</p><p>The redirect url is called in Webview and then there is no connection between the mobile app and google checkout. How can the mobile application get the response from Google checkout?</p><p>Regards</p><p>Sunil</p>","261566","","","","","2011-08-15 23:32:23","Integrating google checkout in Android?","<android><integration><checkout>","2","0","","",""
"3297607","1","","","2010-07-21 08:53:07","1","5097","<p>placeSpinner.getSelectedItem().toString();</p><p>so I'm using this coding lines to get the text from my spinner and pass it on to another java file. But the application keeps giving me a force close whenever I do this.</p><p>Hwo can I resolve this error?</p><p>Thank you so much.</p>","397704","","","","","2014-04-13 10:13:35","Getting text from spinner","<android><spinner>","2","2","","",""
"3297818","1","","","2010-07-21 09:22:50","1","771","<p>I just create a application that will download the ics files from the mail attachment.I use the Android 1.5 Emulator.It downloads the ics file and i can able to open that by using my application.But in the 2.1 simulator when i try to download the ics file The browser displays the ics file contents .I need to open that ics file by using my application only.</p>","389404","","389404","","2010-07-22 04:36:44","2011-04-20 21:22:55","how to open .ics file in Android 2.1 version?","<android>","1","0","","",""
"3297835","1","3298102","","2010-07-21 09:24:55","9","12385","<p>I have created an application that creates notifications, using the following code:</p><pre><code>// notificationNotification notification = new Notification(R.drawable.notification_icon, title, System.currentTimeMillis());notification.flags |= Notification.FLAG_AUTO_CANCEL;// parametersString ringtone = prefs.getString(context.getString(R.string.key_notifications_ringtone), """");if (ringtone.length() &gt; 0) {    notification.sound = Uri.parse(ringtone);    notification.audioStreamType = AudioManager.STREAM_NOTIFICATION;}boolean useVibrator = prefs.getBoolean(context.getString(R.string.key_notifications_use_vibrator), false);if (useVibrator) {    notification.defaults |= Notification.DEFAULT_VIBRATE;}boolean useLed = prefs.getBoolean(context.getString(R.string.key_notifications_use_led), false);if (useLed) {    notification.defaults |= Notification.DEFAULT_LIGHTS;    notification.flags |= Notification.FLAG_SHOW_LIGHTS;}// alertRemoteViews contentView = new RemoteViews(context.getPackageName(), R.layout.notification);contentView.setImageViewResource(R.id.notification_icon, R.drawable.icon);contentView.setTextViewText(R.id.notification_title, title);contentView.setTextViewText(R.id.notification_text, text);notification.contentView = contentView;Intent notificationIntent = new Intent(context, MyActivity.class);PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);notification.contentIntent = contentIntent;notificationManager.notify(1, notification);</code></pre><p>The notification works, and the correct ringtone is used.</p><p>However, even though the preferences are correctly activated and notification flags are correctly set (I checked by debugging), the notification never vibrates and never cause the lights to be activated.</p><p>I would have blamed my phone's settings, but every other app using notifications, like messaging, gmail, and others correctly use all these features.</p><p>May someone know what I did wrong ? (my phone is a HTC Hero with Android 2.1)</p>","393701","","","","","2012-12-25 07:16:29","How can I enable vibration and lights using the Android notifications api?","<android><notifications>","2","5","6","",""
"3297988","1","3298145","","2010-07-21 09:46:11","11","8955","<p>Referring <a href=""http://code.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html"">http://code.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html</a>. Can any body provide source/links which implements such a design?</p>","393792","","382920","","2011-08-28 06:10:59","2014-04-10 15:59:52","Developing Android REST client applications","<android><rest>","6","0","10","2014-04-10 16:30:58",""
"3298088","1","","","2010-07-21 10:03:36","4","1327","<p>I am developing an Android application for 1.6 and above that sends and receives SMS messages through a port. To send the SMS I am using the method:</p><p><strong>SmsManager.sendDataMessage(String destinationAddress, String scAddress, short destinationPort, byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent)</strong></p><p>but have discovered that the byte[] data should contain only the message body. There seems to be no method available to send multi-part data messages and no way of modifying the SMS header (UDH) to specify that the messages is, say, 1 of 3.</p><p>I'm having a similar problem on the receiving end when trying to extract the message count information from the SMS I have received through the specified port. I am using SMSMessage.getPdu() to extract a byte[] containing the message header and message body but have no way of extracting the specific information from the header data. Does anyone know the format the Android platform uses for SMS headers?</p><p>Any help would be very much appreciated.</p>","397789","","","","","2011-02-03 22:12:23","Is it possilbe to read and/or modify the SMS header on Android?","<android><sms>","1","0","1","",""
"3298154","1","","","2010-07-21 10:14:10","0","809","<p>i have to create a dynamic graph in android .... picture is given below..</p><p><img src=""http://medicineworld.org/images/blogs/heart-rhythm-5580.jpg"" alt=""alt text""></p><p>Please guide me.....</p>","304961","","","","","2010-07-21 16:03:22","How can i create dynamic rhythm graph in android","<android>","2","0","","",""
"3298199","1","3332618","","2010-07-21 10:21:03","3","3967","<p>Currently Iam using backport.android.bluetooth2.jar file for bluetooth programming with Android 1.5.Whenever device pairing fails it populates alert dialog for passKey and if i give passkey then in my log iam getting below error</p><pre><code>07-21 12:25:52.419: WARN/BluetoothDeviceService(948): setPin(00:0E:6D:BA:89:F3) called but no native data available, ignoring. Maybe the PasskeyAgent Request was cancelled by the remote device or by bluez.</code></pre><p>For successfully pair my BT device I always rebooting my tablet and manually pair the device with Settings options.So at last i realised to give this passKey programmatically but i haven't found any method for this.But in google opensource i found one method that is commented with @hide <code>setPassKey(String Address,int passKey)</code> in <code>BluetoothDevice.java</code> of <code>backport.android.bluetooth2.jar</code> .This will n't appear in my jar file.If any way is there for pairing the unbounded device please give reply ASAP?</p>","362544","","","","","2010-10-04 08:42:52","Is it possible to pair BluetoothDevice programmatically android?","<android><bluetooth>","1","1","1","",""
"3298256","1","","","2010-07-21 10:28:35","0","1180","<p>I'm trying to add buttons above a tab-widget but they are always displayed under the tab-widget's tabs. The buttons are displayed on front layer so that they appear on each tab.</p><p>Does anybody have an idea is it possible at all to display any widgets above the tab-widget? </p><p>Here's an example layout to give some idea on the placement of the widgets. Note: this layout is not functional.</p><p></p><p>    </p><pre><code>&lt;ImageButton    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:src=""@android:drawable/sym_action_chat"" /&gt;  &lt;ImageButton    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:src=""@android:drawable/sym_action_email"" /&gt;</code></pre><p></p><p><br></p><pre><code>&lt;TextView android:id=""@+id/view1""    android:background=""@drawable/blue""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""@string/tabs_1_tab_1""/&gt;&lt;TextView android:id=""@+id/view2""    android:background=""@drawable/red""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""@string/tabs_1_tab_2""/&gt;&lt;TextView android:id=""@+id/view3""    android:background=""@drawable/green""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""@string/tabs_1_tab_3""/&gt;</code></pre><p>      </p><p></p>","397782","","","","","2010-07-21 10:44:30","How to display buttons above tab widget on Android?","<android><layout><tabwidget><tabactivity>","1","0","","",""
"3298267","1","3338754","","2010-07-21 10:30:31","1","1495","<p>I'm developing Twitter application with xAuth support using twitter4j jar file.</p><p>I want to place my consumer key/secret in twitter4j.properties file. </p><p>Where should I put this file in directory structure?</p>","296427","","","","","2010-07-26 20:32:59","Where to place twitter4j.properties in android project?","<android><properties><twitter4j><xauth>","1","0","","",""
"3298330","1","7067583","","2010-07-21 10:40:44","13","24515","<p>I want to do a very simple alpha animation but I cannot find a valid way.</p><p>The idea is to perform this animation over a view:</p><ol><li>alpha from 0 to 1 of 1 second</li><li>hold alpha at 1 for 5 seconds</li><li>alpha from 1 to 0 of 1 second</li><li>hold alpha at 0 for 5 seconds.</li><li>start again on 1.</li></ol><p>I've tried to implement that with an AnimationSet as:</p><pre><code>AnimationSet animationSet = new AnimationSet(true);Animation animation1 = new AnimationUtils.loadAnimation(this, android.R.anim.fade_in);animation1.setDuration(1000);Animation animation2 = new AnimationUtils.loadAnimation(this, android.R.anim.fade_out);animation2.setDuration(1000);animation2.setStartOffset(5000);Animation animation3 = new AlphaAnimation(0.0f, 0.0f);animation3.setDuration(4000)animation3.setStartOffset(6000);animationSet.add(animatino1);animationSet.add(animation2);animationSet.add(animation3);</code></pre><p>etc..</p><p>but it seams that the third animation do a mess with all the alpha animations, I supose that this cause an internal incoherence in the way that Android manage this type of animation.</p><p>Any idea?</p><p>Thank you.</p>","245638","","","","","2013-12-03 08:45:20","Android alpha animation fadein fadeout with delays","<android><animation><alpha><fadein><fadeout>","1","1","4","",""
"3298388","1","","","2010-07-21 10:50:16","3","2412","<p>I create a proximity alert in this way</p><pre><code>    private void setProximityAlert(float radius, double lat, double lng, String place){    long expiration = -1;    LocationManager locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);    Intent intent = new Intent(TREASURE_PROXIMITY_ALERT);    intent.putExtra(""lat"", lat);    intent.putExtra(""lng"", lng);    intent.putExtra(""place"", place);    PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), -1, intent, 0);       locManager.addProximityAlert(lat, lng, radius, expiration, pendingIntent);}</code></pre><p>and on my activity I registered the receiver in this way</p><pre><code>    IntentFilter intentFilter = new IntentFilter(TREASURE_PROXIMITY_ALERT);    registerReceiver(new ProximityIntentReceiver(), intentFilter);    setProximityAlert(10, 45.150344, 9.999815, ""POINT1"");</code></pre><p>and my broadcast receiver is correctly called.So now, I want to add another proximity alert, is it possible? I want that the same boadcast receiver is called by 2 proximity alert.I made this:</p><pre><code>    IntentFilter intentFilter1 = new IntentFilter(TREASURE_PROXIMITY_ALERT1);    registerReceiver(new ProximityIntentReceiver(), intentFilter1);            setProximityAlert(200f, 45.143848, 10.039741, ""POINT2"");</code></pre><p>but it does not work, nothing happen. I'm really now on it and I was wondering if it is the right way. My intent is trigger 2 alerts, one when GPS get the position POINT1 and another one at the position POINT2.Any helps are welcome.</p>","386823","","","","","2010-07-21 11:17:36","set 2 proximity alerts with the same broadcast","<android><gps><alert><broadcastreceiver>","1","0","3","",""
"3298597","1","","","2010-07-21 11:14:22","16","16208","<p>I want to get a return value from Javascript in Android. I can do it with iPhone, but I can't with Android. I used loadUrl, but it returned void instead of an object. Can anybody help me? Thanks.</p>","397849","","981282","","2012-04-05 05:03:20","2013-12-17 16:12:14","How to get return value from javascript in webview of android?","<android><return>","4","0","15","",""
"3298898","1","","","2010-07-21 11:55:04","-2","1949","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4721732/sqlite-example-program-in-android"">sqlite example program in android</a>  </p></blockquote><p>can anybody give example how to connect sqlite with android?</p><p>Thanks in advance</p>","386430","","379693","","2010-11-03 11:42:40","2011-04-14 16:23:49","android with sqlite","<android><database><sqlite><android-sdk-2.2>","5","1","","2011-12-17 23:04:04",""
"3298908","1","3331194","","2010-07-21 11:56:42","3","2719","<p>Below is My code to create a shortcut to a selected application. I have really no problem and the application work quite well.</p><p>The problem is that I am able to create a shortcut with a ressource from my application:</p><pre><code>    intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(this, R.drawable.icon));</code></pre><p>But I really would like with a custom drawable. ( Drawable myDrawable=.....)</p><p>How can I do?</p><pre><code>   ResolveInfo launchable=adapter.getItem(position);   final Intent shortcutIntent = new Intent();    ActivityInfo activity=launchable.activityInfo;    ComponentName name=new ComponentName(activity.applicationInfo.packageName,activity.name);           shortcutIntent.setComponent(name);    shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);    final Intent intent = new Intent();    intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);    // Sets the custom shortcut's title    intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, launchable.loadLabel(pm));    // Set the custom shortcut icon    intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(this, R.drawable.icon));    // add the shortcut    intent.setAction(""com.android.launcher.action.INSTALL_SHORTCUT"");    sendBroadcast(intent);    finish();</code></pre><p>Thank a lot for any clue</p>","327402","","","","","2012-06-01 12:53:11","Creating a shortcut: how can I work with a drawable as Icon?","<android><icons><android-intent><shortcut><drawable>","2","1","4","",""
"3298939","1","3299812","","2010-07-21 12:01:08","0","911","<p>can anyone help me with changing the background color of a list view?. I am new to android and I really need to know this. Any help will be appreciated.</p><p>Thanks!</p>","397901","","309224","","2011-02-13 16:00:57","2011-02-13 16:00:57","changing background color of a list view","<android>","2","1","","",""
"3298956","1","","","2010-07-21 12:03:39","2","1570","<p>I am new to android applications,I am using Ksoap2 to access .Net webservice and The call is executed just fine without parameters. But with parameters I am getting Empty.I followed all the steps provided in sites. I tried everything possible but no luck so far. I hope someone can help, </p><pre><code> private static final String SOAP_ACTION = ""http://www.agilelearning.com/GetProvincelist1"";  private static final String METHOD_NAME = ""GetProvincelist1 "";  private static final String NAMESPACE = ""http://www.agilelearning.com"" ;  private static final String URL = ""http://192.168.1.24/Service.asmx"";//Method executed when Province is selected private OnItemSelectedListener selectListener = new OnItemSelectedListener()     {         public void onItemSelected(AdapterView parent, View v, int position, long id)         {             try             { ArrayList&lt;String&gt; districts=new ArrayList&lt;String&gt;();                int Provinceid=position+1;//parent.getItemAtPosition(position).toString();                          SoapObject request1 = new SoapObject(NAMESPACE, METHOD_NAME1);                                              request1.addProperty(""Provincename"",""East Province"");                SoapSerializationEnvelope envelope1 = new SoapSerializationEnvelope(SoapEnvelope.VER11);                 envelope1.dotNet = true;                 envelope1.setOutputSoapObject(request1);                 HttpTransportSE at = new HttpTransportSE(URL);                 at.debug = true;                at.setXmlVersionTag(""&lt;?xml version=\""1.0\"" encoding=\""UTF-8\""?&gt;"");                at.call(SOAP_ACTION1, envelope1);                               SoapObject rs = (SoapObject)envelope1.getResponse();                int count=rs.getPropertyCount();                for(int i=0;i&lt;count;i++)                {                    districts.add(rs.getProperty(i).toString());                }                ArrayAdapter&lt;String&gt; aa;                         aa = new ArrayAdapter&lt;String&gt;(home1.this, android.R.layout.simple_spinner_item, districts);                 aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);                sd.setAdapter(aa);              }             catch(Exception ex)             {                 MessageBox(""No Districts found"");             }         }</code></pre>","397905","","241518","","2011-03-30 08:45:02","2013-01-01 11:05:29","passing paramters using ksoap2 to .net web service, always passes nulls (empty) values","<android>","3","1","1","",""
"3298969","1","3301446","","2010-07-21 12:06:18","2","3053","<p>wondering here if there <strong>is a way I could <em>trigger</em> an event, so that any library listening for these events</strong> (e.g. jQTouch, Sencha touch, iUI, ... ).</p><p>If I could extend or use jQuery for such task e.g. $(...).trigger('event') that would be great to know.</p><hr><p><strong>Usage example:</strong></p><p>I need to debug a few web apps by simulating multi touch with my mouse. This seems a little complicated, so if I could trigger the multi-touch events using Javascript I could therefore test the app more efficiently.</p><hr><p>Any ideas guys? =D</p>","208827","","208827","","2010-07-21 13:03:10","2010-07-21 16:14:56","Triggering swipe and touch events on a mobile web app? - iPhone/Android","<javascript><jquery><iphone><android><javascript-events>","2","3","1","",""
"3299006","1","4510883","","2010-07-21 12:11:49","12","13939","<p>I'm trying to run unit tests on the android platform in accordance with <a href=""http://developer.android.com/guide/topics/testing/testing_android.html"">tutorial</a>. Say, for example, I want to run tests for Email application. I open <code>/apps/Email/tests/AndroidManifest.xml</code> file, look for the <code>&lt;manifest&gt;</code> element, and look at the <code>package</code> attribute, which is <code>com.android.email.tests</code>, and in the <code>&lt;instrumentation&gt;</code> element I look at the <code>android:name</code> attribute, which is <code>android.test.InstrumentationTestRunner</code>. Now I open the console, and run</p><pre><code>$ . build/envsetup.sh$ lunch 1$ adb shell am instrument -w com.android.email.tests/android.test.InstrumentationTestRunner</code></pre><p>But that fails:</p><pre><code>INSTRUMENTATION_STATUS: id=ActivityManagerServiceandroid.util.AndroidException: INSTRUMENTATION_FAILED: com.android.email.tests/android.test.InstrumentationTestRunnerINSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{com.android.email.tests/android.test.InstrumentationTestRunner}</code></pre><p>So.. What am I doing wrong?</p>","163423","","","","","2014-03-06 18:58:59","Running android unit tests from the command line?","<android><unit-testing><shell>","6","0","6","",""
"3299015","1","3299064","","2010-07-21 12:12:40","0","276","<p>I am trying to find a way to goto a database located on the web perform 1 query and close the connection. I have not had any luck with finding an answer, and I really don't know how to solve this. </p><p>Internet connection is not an issue, nor is any security issues. Also this cannot be solved with an internal database and this must go across the web.</p><p>If you have any hints or ideas please let me know!</p><p>Thanks</p>","379968","","","","","2010-07-21 12:18:17","Perform single SQL query over internet Android","<sql><android>","1","0","","",""
"3299078","1","","","2010-07-21 12:19:24","3","2839","<p>I just installed the Android SDK on my machine.  I am running Fedora 13 (64 bit) and the Android kit is r06 for Linux.  I am running Eclipse Helios.  I get this error when I try to link to the sdk inside Eclipse:</p><p>[2010-07-21 07:10:23 - adb]Failed to get the adb version: Cannot run program ""/home/jmneedham/android-sdk-linux/tools/adb"": java.io.IOException: error=2, No such file or directory</p><p>I have checked directory permissions and those seem to be fine, but I am not sure if the SDK is just not compatible with 64 bit Linux or what to do to fix this.</p><p>Help is appreciated.</p>","332084","","","","","2011-03-31 16:49:57","Problem with Android SDK on Linux with Eclipse Helios","<android><eclipse>","3","2","","",""
"3299264","1","","","2010-07-21 12:38:46","2","463","<p>I need to add a option to my app after select,copy,copy all, paste of menu items of edit text. I have to add intent action in that menu so that when user click the option it will trigger to my application</p><p>Thanks in advance :)</p>","286831","","750987","","2011-06-17 00:03:34","2011-06-17 00:03:34","Android add my application intent to edittext menu options","<android><android-intent>","1","0","","",""
"3299359","1","3300507","","2010-07-21 12:48:27","0","10039","<p>So I'm trying to add an imageview to my current xml design - and its working decently. Now my main problem is that I cant seem to find a way to set the attributes for the image like where it needs to be displayed etc.</p><pre><code>RelativeLayout mRelativeLayout = (RelativeLayout) findViewById(R.id.board);ImageView i = new ImageView(this);i.setImageResource(R.drawable.blue_1);i.setAdjustViewBounds(true);mRelativeLayout.addView(i);setContentView(mRelativeLayout);</code></pre><p>I tried messing around with setlayoutparams but got absolutely no clue what to do with it.</p>","396182","","1306012","","2012-11-19 13:03:48","2012-11-19 13:03:48","Setting relative layout parameters","<android><image><layout>","1","0","","",""
"3299392","1","3299423","","2010-07-21 12:52:56","6","37044","<p>Can any one post sample code for a simple date picker in Android.</p><p>If date picker is not possible in Android, an option to choose a date is needed.</p>","397969","","73488","","2011-05-26 08:07:48","2014-01-18 06:44:01","Date picker in Android","<android><date><picker>","4","0","7","",""
"3299815","1","","","2010-07-21 13:38:59","0","147","<p>I have a folder with pictures and I'd like to make a search function to be able to find pictures that correspond to their key words.I'd like to know how you'd do this ?</p><p>I thought making a *.txt file with the name of the pictures and their corresponding key words, and then search in this text file the key words asked.</p><p>Is there a simpler way ? A better FileType (for instance *.ini) ?</p><p>Could you give me an advise. Thanks.</p>","398020","","","","","2010-07-21 14:10:28","search function advise","<android>","2","0","","",""
"3299817","1","","","2010-07-21 13:39:09","0","377","<p>I have a ListView with number of items. I'd like to place the item being clicked in the top of the screen. i am trying to use <strong>requestChildRectangleOnScreen</strong> of <strong>ListView</strong> that seems to do the job, however I cannot figure out how to properly specify the rectangle param. Any suggestion and/or code sample will be really helpful</p><p>Thanks a lot</p>","367677","","","","","2011-08-16 16:01:05","How to position item of ListView?","<android><android-widget>","1","2","","",""
"3299845","1","3300118","","2010-07-21 13:41:10","11","10485","<p>In a <a href=""http://developer.android.com/reference/android/widget/TabHost.html"">TabHost</a> widget, I can create a new tab with its content (Intent) using <a href=""http://developer.android.com/reference/android/widget/TabHost.html#addTab%28android.widget.TabHost.TabSpec%29"">TabHost.addTab(TabHost.TabSpec tabSpec)</a>.</p><p>We can remove all tabs we created by calling <a href=""http://developer.android.com/reference/android/widget/TabHost.html#clearAllTabs%28%29"">clearAllTabs()</a>, but I can't figure out how to remove the tab or just replace the content (Intent) inside the tab with new Intent.</p><p>so what I need something like <code>removeTab(int index)</code></p>","101139","","","","","2014-02-28 10:31:42","How to remove tab from TabHost","<android><android-widget>","2","0","3","",""
"3300089","1","3301233","","2010-07-21 14:05:27","0","310","<p>I am curious whether the AIDL only serves for inter-process communication between several Android apps on the same device, or AIDL provides much wider functionality. Let's say I have a Java application running on some server, is it possible to remotely call methods on that server through AIDL from an Android phone?</p><p>If yes, do I need some extra libraries on the server-side Java application?</p>","395744","","","","","2010-07-21 15:52:59","Is it possible to remotely call methods on another computer through AIDL (Android Interface Definition Language)?","<android><call><aidl>","1","0","0","",""
"3300137","1","3309940","","2010-07-21 14:11:12","27","19441","<p>This started out as a general user question on Android forums. However it's become, by necessity, a  programming question. Here's my problem. </p><p>Android has a service - MediaScanner - which runs in the background any time (I believe) the SD card is un-mounted and re-mounted. This service collects data on all the media files on the card, and provides a SQLite DB which can be queried by music applications. Most music applications use this service as it saves on battery-drain associated with scanning the SD card. </p><p>Since I started using android, I've consistently had a problem whereby M3U playlists synchronised to the device remain in this SQLite DB even after being deleted from the SD Card. It's gotten to the point where I now have a collection of about 40 playlists showing up in any music app I use, despite there only being around 10 m3u files on the card. The remaining playlists do not play, and are empty. I can remove them manually by deleting them from the music app, but I'm sick of doing this. There has to be a better way to remove these ghost playlists. </p><p>There are two apps on the Android Market - SDRescan and Music Scanner, which supposedly do exactly this but neither of them work. </p><p>I set about writing my own app to refresh or delete the MediaStore database and start from scratch, but I'm not getting very far. I've got an android app which runs the following code :</p><pre><code>sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,         Uri.parse(""file://"" + Environment.getExternalStorageDirectory()))); </code></pre><p>I've found a few examples of this code online as a way to scan the SD Card but I'm not having any luck with it whatsoever. Any tips? </p><p>FULL CODE:</p><pre><code>package com.roryok.MediaRescan;import android.app.Activity;import android.content.Intent;import android.content.IntentFilter;import android.net.Uri;import android.os.Bundle;import android.os.Environment;public class MediaRescan extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,                 Uri.parse(""file://"" + Environment.getExternalStorageDirectory())));         setContentView(R.layout.main);    }    //Rescan the sdcard after copy the file    private void rescanSdcard() throws Exception{           Intent scanIntent = new Intent(Intent.ACTION_MEDIA_MOUNTED,                 Uri.parse(""file://"" + Environment.getExternalStorageDirectory()));         IntentFilter intentFilter = new IntentFilter(Intent.ACTION_MEDIA_SCANNER_STARTED);      intentFilter.addDataScheme(""file"");           sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,                 Uri.parse(""file://"" + Environment.getExternalStorageDirectory())));        }}</code></pre>","352867","","","","","2014-03-04 10:43:27","How can I refresh MediaStore on Android?","<android><mediastore>","3","2","19","",""
"3300176","1","3300259","","2010-07-21 14:14:25","1","2280","<p>Respected All             I have to add TabBar in my application, but i don't know how to add tab bar to application or activity. Can you help me for that.</p><p>Thank YouVikram Kadam  </p>","395627","","297762","","2010-07-21 14:15:11","2010-07-21 14:23:03","How to add TabBar In Android","<android>","1","0","0","",""
"3300225","1","3329729","","2010-07-21 14:19:47","0","91","<p>I have a simple app which needs to display 1 of many text files (DB is no an option currently)</p><p>Where is the best place to put this collection of text files? I am guessing ""Assets"", but am unsure.</p>","172861","","172861","","2010-07-21 15:34:43","2011-03-14 22:14:28","Android correct location for hierarchical file list","<android>","1","2","","",""
"3300565","1","","","2010-07-21 14:51:51","3","5938","<p>I am trying to change the color on a specific row depending on different states. This is the code i have at the moment.</p><pre><code> public View getView(int position, View convertView, ViewGroup parent) {  View row=convertView;     if (row==null) {                                                             LayoutInflater inflater=getLayoutInflater();         row=inflater.inflate(R.layout.doit, parent, false);     }     TextView label = (TextView) row.findViewById(R.id.mess);     label.setText(ArrayAdapter.getItem(position));     switch(mState){     case STATE1:      label.setTextColor(Color.WHITE);      break;     case STATE2:      label.setTextColor(Color.BLACK);      break;     case STATE3:      label.setTextColor(Color.YELLOW);      break;     }     return(row); }</code></pre><p>}</p><p>The code kinda works..but it changes all the rows. Any ideas?</p>","398036","","","","","2010-11-10 20:52:20","Change a specific row in a ArrayAdapter ListView Android","<android><listview><android-arrayadapter>","3","2","0","",""
"3300695","1","3301533","","2010-07-21 15:01:50","0","7216","<p>I am getting some glitches while making a tab enabled application.<br>I want to share data, between two tabs of my application.How can I achieve the same?</p><p>RgdsRobert</p>","395563","","52444","","2012-08-17 08:31:48","2012-08-17 08:31:48","Sharing data between tabs","<android>","2","0","5","",""
"3300728","1","3300782","","2010-07-21 15:04:50","9","597","<p>I would like to know what is the right way to handle internationalization for statements with runtime data added to it. For example 1) Your input ""xyz"" is excellent! 2) You were ""4 years"" old when you switched from ""Barney and Freinds"" to ""Spongebob"" shows.</p><p>The double quoted values are user data obtained or calculated at run time. My platforms are primarily Java/Android. A right solution for Western languages are preferred over weaker universal one. </p>","349161","","","","","2013-04-17 11:27:20","How do you handle internationalization for ""Your input 'xyz' is excellent!""","<java><android><internationalization>","3","0","2","",""
"3300853","1","3366075","","2010-07-21 15:16:10","0","437","<p>I am trying to write an Android app to connect to an existing web service. I'm pretty new to web services in general, other than what I've done with this first web services (written with JSPs, Struts 1.x, and JAVA).</p><p>This web service is connected to a document storage database. The user would first login to the service, then using search parameters (document title, type, etc.) the user would be displayed a list of possibly relevant documents. The user would choose a specific document from that list, and the service would then stream the entire document (pdf file) to the user for viewing.</p><p>What methods are available to Android where I can make a request given some specific parameters, and be able to parse a response?</p><p>The only thing I know of is HTTP, but my project leader (I'm a summer intern) is hinting that there are others available. I'm not sure where to start looking.</p><p>Thank you.</p>","336520","","336520","","2010-07-21 15:22:41","2010-07-29 19:06:35","Ways that Android can connect with a remote service","<java><android><web-services>","4","0","1","",""
"3300897","1","3301565","","2010-07-21 15:20:56","4","3293","<p>Android documentation says that AsyncTask <code>postExecute()</code> is called on the UI thread. I was under the impression that <code>postExecute()</code> was called from the Thread where <code>execute()</code> was called : I have been using an AsyncTask in a background Service with its own thread, and postExecute() was called in the service thread, not the main thread.<br>However, I recently had an issue with the postExecute() not being called at all, while an exception was thrown : "" sending a message to a Handler on a dead thread"".  </p><p>How is it exactly :<br>- shall AsyncTask be used ONLY from the main thread ?<br>- if not, in which thread <code>postExecute()</code> is supposed to be called : always the UI thread, or the <code>execute()</code> calling thread ?</p><p>Thank you</p>","244129","","","","","2014-02-14 10:34:54","Android : can AsyncTask return in another thread than UI thread?","<android><multithreading><android-asynctask>","2","1","1","",""
"3300998","1","3368360","","2010-07-21 15:29:33","5","1872","<p>I have a very large image and I only want to display a section the size of the display (no scaling), and the section should just be the center of the image. Because the image is very large I cannot read the entire image into memory and then crop it. This is what I have so far but it will give OutOfMemory for large images. Also I don't think inSampleSize applies because I want to crop the image, not lower the resolution.</p><pre><code>Uri data = getIntent().getData();InputStream is = getContentResolver().openInputStream(data);Bitmap bitmap = BitmapFactory.decodeStream(is, null, null);</code></pre><p>Any help would be great?</p>","396106","","","","","2012-03-17 10:58:12","Crop Bitmap without reading entire Bitmap first","<java><android><bitmap><crop>","3","2","3","",""
"3301121","1","3309155","","2010-07-21 15:41:54","2","2627","<p>I am trying to port some code from a regular java program into the android platform. Unfortunately, a significant part of the program involves manipulating images, and java's awt was taken away from me. I am trying to replace awt.BufferedImage with a Bitmap, and was hoping that the only differences between the two classes would be their interfaces. I read some of the documentation, and it looked like that is true, but after wrapping all of the image stuff into a nice little class and testing almost-the-same code on both my development machine and an actual phone, one program works, and the other does not. So:</p><p>The encoding for color does not change- right? it is still 0xAARRGGBB- right?</p><p>The images themselves are not changed- right? When I put an image into res/drawable, it is exactly the same image. Most notably- they don't alter the resolution in any way-right?</p><p>Accessing the pixels is essentially the same-right? I essentially replaced all of my get/setRGB(x,y,RGB) with get/setPixel(x,y,color). There are no changes to the method of indexing into the grid- is there?</p>","391837","","","","","2011-09-16 18:18:43","Differences between Bitmaps and BufferedImages","<android><image><bitmap><bufferedimage>","1","0","2","",""
"3301374","1","3436172","","2010-07-21 16:08:22","7","3065","<p>I am trying to detect when a user has finished scrolling a web page using javascript on Android. The script I have is working on iPhone and seems correct to me that it should work on Android. Anyway, a snippet:</p><pre><code>previous = pageYOffset;interval = setInterval(function() {    //Has scrolling stopped?    if(previous == pageYOffset) {        clearInterval(interval);        //DO SOMETHING AFTER SCROLL COMPLETE    } else {        previous = pageYOffset;    }}, 200);</code></pre><p>The basic idea, poll the pageYOffset every 200ms, if there had been no change then there is no scrolling happening. Otherwise, keep looking.</p><p>As I said, this works on iPhone, so I am assuming it is something to do with Android possibly not updating pageYOffset during a scroll?</p><p>Any help is greatly appreciated!</p><p>Note: I went for this route as I could not find a isScrolling property or scrollStop type event. If I have overlooked one, please do tell me :)</p><p>Thanks</p><hr><blockquote>  <p>Update: Just tried to use the 'scroll'  event to detect this. Mixed results  here. On the Android emulator it was  working almost correctly, but was very  intermittent on an actual phone (2.1  Sense Hero GSM), i.e. only 1 in 10  scrolls were detected.</p>    <p>Even when it was 'working' on the  emulator it was not firing the scroll  event when you scroll 'up' when you  are at the top of the page (i.e. to  push up to see the address bar). This  is a problem as the page has actually  been scrolled (changed position) but I  am not recieving the event.</p>    <p>Note, the iPhone does seem to fire and  detect the event correctly (at least  in the emulator, no access to device  at the moment).</p>    <p>Any ideas guys?</p></blockquote><hr><blockquote>  <p>Update 2: The new 'scroll' event seems  to work (to the same extent as the  emulator (1.6 and 2.1)) on SOME  Android devices. Will continue to  investigate to try to narrow this  down.</p>    <p>Still the issue of 'scroll' not being  fired when you scroll up to the  address bar. Might have to have some  kind of hybrid solution of 'scroll'  event detection and movement polling  after a touch.</p></blockquote>","219750","","219750","","2010-07-22 10:09:36","2010-08-13 03:11:24","Detect if currently scrolling a web page on Android","<javascript><android><javascript-events><mobile><webkit>","3","0","","",""
"3301608","1","3304979","","2010-07-21 16:33:08","4","7046","<p><br>Is it possible to update WebKit behind the Android 1.5/1.6/etc (prior to 2.2) browser?<br>I know latest nightly WebKit builds has great HTML5 support.<br>So, my intention is to provide html5 video streaming (and other features) support on all those droids.<br>Previously I was able to update WebKit engine on different devices with older Safari to meet my requirements (on any mac os x distros it's easy as updating WebKit.framework).</p><p>Thanx.</p>","398233","","","","","2013-06-20 16:37:59","How to manually update android browser with latest (nightly) webkit?","<android><html5><webkit><video-streaming>","1","0","1","",""
"3301963","1","","","2010-07-21 17:15:45","0","127","<p>Suppose my application P started Activity A, and A started Activity B, then the activity stack contained A and B, with B at the top.</p><p>After that, I opened other apps by pressing Home button. Suppose after a while, the process of application P is killed by the OS. Then, I press Home button to select application P. At this time, which activity will be brought to the front, Activity A or Activity B?</p><p>Thanks.</p>","256239","","","","","2010-09-20 15:53:13","Which activity will on the front if the process was re-started?","<android>","1","0","","",""
"3301974","1","5481973","","2010-07-21 17:16:31","1","2234","<p>I have an activity that I would like to occur in a dialog.  Is there anyway to do this from code, instead of in the manifest?  I tried to do this, but it seemed to have no effect.</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setTheme(R.style.Theme_Dialog);}</code></pre><p>Also, the activity contains a webview and when it starts out as a dialog it's got a small amount of content and the dialog is only like 100px tall.  When content fills in it scrolls inside a tiny 100px tall window in the dialog.  How do I make the dialog take up more vertical space?</p>","62076","","","","","2012-02-02 22:25:10","Apply the Android ""Dialog"" theme and sizing it properly","<android><activity>","3","0","","",""
"3302016","1","","","2010-07-21 17:22:05","1","232","<p>I set a toggle breakpoint at line 36 of the main class, of APIDemos 8, the debug begins at the OnCreate but never processes another line in the class.  Why is that?</p><p>Here's the code starting a line 36.</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Intent intent = getIntent();        String path = intent.getStringExtra(""com.example.android.apis.Path"");        if (path == null) {            path = """";        }</code></pre><p>etc...</p>","398275","","102937","","2012-07-11 17:21:55","2012-07-11 17:21:55","APIDemos 8 Debug, setting a debug breakpoint at the first line never runs through code in the class","<android><eclipse><debugging>","1","0","","2012-07-11 17:22:01",""
"3302124","1","","","2010-07-21 17:36:15","0","197","<p>I am trying to toggle the microphone of Android mobile. App. freezes if I run the mute and unmute in a loop, With a delay of say 500ms. Is there a specific reason mobile behaves this way? (Motorola Droid is not even able to mute the phone) however all other mobiles are able to do it.</p><p>This runs in a loop for 20 times</p><p>audioService.setMicrophoneMute(true);</p><pre><code>    if(audioService.isMicrophoneMute())                {             Toast.makeText(getBaseContext(), ""MUTED"", 1).show();}     try {        Thread.sleep(1000,90);         }         catch (InterruptedException e)         {           // TODO Auto-generated catch block           e.printStackTrace();        }     audioService.setMicrophoneMute(false);    if(!audioService.isMicrophoneMute()){ Toast.makeText(getBaseContext(), ""Un MUTED"", 1).show();</code></pre>","357349","","286204","","2010-07-21 17:39:56","2010-08-09 04:07:27","App freezes while muting the phone","<android><audio><freeze><microphone><mute>","1","0","","",""
"3302171","1","3303023","","2010-07-21 17:43:42","0","326","<p>When you do a <code>Thread.currentThread().getId()</code>, is the resulting thread id scoped per process or scoped to the current Activity/Service?</p>","440093","","","","","2010-07-21 19:28:12","Are Android thread id's global per process?","<android>","1","0","","",""
"3302177","1","3303512","","2010-07-21 17:44:30","31","14832","<p>I understand that Android <code>Activities</code> have specific lifecycles and that <code>onCreate</code> should be overridden and used for initialization, but what exactly happens in the constructor? Are there any cases when you could/should override the <code>Activity</code> constructor as well, or should you never touch it?</p><p>I'm assuming that the constructor should never be used because references to <code>Activities</code> aren't cleaned up entirely (thus hampering the garbage collector) and that <code>onDestroy</code> is there for that purpose. Is this correct?</p>","2359478","user370382","2359478","","","2013-07-19 21:46:55","Android - Activity Constructor vs onCreate","<java><android><garbage-collection><activity><oncreate>","4","0","9","",""
"3302188","1","","","2010-07-21 17:45:34","3","284","<p>Is root activity the current first activity in the stack or the activity specified as launch activity in manifest?</p><p>Support application P starts activity A at launch. Then A starts B and finish itself, and then B starts C. Now the stack contains B and C, with B the first in the stack.</p><p>Can I say B is the root activity, or A is still the root activity.</p><p>I want to make clear of it because I am trying to understanding the definition of clearTaskOnLaunch:</p><p>android:clearTaskOnLaunch    Whether or not all activities will be removed from the task, except for the root activity,   whenever it is re-launched from the home screen — ""true"" if the task is always stripped down to its root activity, and ""false"" if not.</p>","256239","","256239","","2010-07-21 19:59:56","2011-08-18 14:28:35","Is root activity the current first activity in the stack or the activity specified as launch activity in manifest?","<android>","1","0","","",""
"3302210","1","3304373","","2010-07-21 17:48:13","0","888","<p>I created an abstract Activity which extends the android.app.Activity. Then I created an activity extending my abstract one. [1]</p><p>Everything is fine with ant, but eclipse showed an error in the manifest saying that my activiy did not exists, so I regenerate the class files and the error in the manifest is gone. But now eclipse shows an error at the root of my project and don't want to compile.</p><p>I precise that the activity is working fine in a device builded with ant. I tried to ""Fix Project Properties"" as well. I can't declare the abstract activity because of it's abstract.</p><p>Anybody already saw this bug ?</p><p>Thanks</p><p>[1] Here is a little schematic</p><p>android.app.Activity ->  abstract ActivityNet -> MyActivity</p>","319454","","","","","2010-07-21 22:23:44","Android: Extending a custom abstract Activity","<android><activity><abstract-class>","1","1","","",""
"3302554","1","","","2010-07-21 18:33:25","0","44","<p>In the class PersistentState.java the prefs variable gets the saved/typed text from prior sessions here, on line 106 into restoredText.  Where does the getString method get the saved/typed text?</p><pre><code>protected void onResume() {    super.onResume();...    SharedPreferences prefs = getPreferences(0);     String restoredText = prefs.getString(""text"", null);</code></pre>","398275","","1131435","","2013-04-13 00:19:08","2013-04-13 00:19:08","APIDemos 8 PersistenceState, where is the persistent text ""saved?""","<android><persistent>","1","0","","",""
"3302623","1","3302742","","2010-07-21 18:40:43","1","212","<p>I am working on an Android application that is required to connect to a REST WebService. There are a number of requests that the application needs to make and the request format is XML. What I have done presently is create a Request template per XML request using StringBuilder class and substitute a placeholder String for different values that need to be passed at Runtime.</p><p>For instance:</p><pre><code>StringBuilder TEMPLATE = new StringBuilder(""&lt;GetStatusReq&gt;&lt;item&gt;@itemid@&lt;/item&gt;&lt;/GetStatusReq&gt;"");</code></pre><p>The request XMLs contain about 20-30 nodes with some of them containing attributes. So you can imagine the complexity.</p><p>Is this the correct way to handle such a case? Or Should I be using XMLSerializer(need a link to good tutorial)? </p><p>What is the <em>ideal</em> way to handle such cases?</p><p>Please help.</p><p>Thanks.</p>","236128","","","","","2010-07-21 18:56:43","Better way to create XMLs at Runtime","<android><xml><xml-serialization>","1","0","","",""
"3302863","1","3302927","","2010-07-21 19:10:14","8","1478","<p>I'm about ready to market my first Android App (from a US Google Checkout/Merchant account with US bank account etc.), and I would like to have the user at least agree to some kind of simple liability disclaimer before he/she can install the app.</p><p>To your knowledge, is it possible, and if so, what would be the best way to do this?</p><p>Your help and tips are greatly appreciated.</p>","349169","","244296","","2010-07-21 19:11:51","2010-07-24 12:32:55","Can I make the user agree to a legal disclaimer before installing an Android App?","<android><legal><disclaimer>","2","0","2","",""
"3302993","1","3303757","","2010-07-21 19:24:18","3","1908","<p>I have 40 MB file in server and i am downloading my file using </p><pre><code>HttpURLConnection c = (HttpURLConnection) u.openConnection(); c.setRequestMethod(""GET""); c.setDoOutput(true); c.connect(); FileOutputStream f = new FileOutputStream(new File(""trips.xml"")); InputStream in = c.getInputStream(); byte[] buffer = new byte[1024]; int len1 = 0; while ( (len1 = in.read(buffer)) != -1 ) {  f.write(buffer,0, len1);</code></pre><p>this code seems working fine but it is taking too long. is their any way I can make this process faster.</p><p>/minhaz</p>","366489","","","","","2010-07-22 04:00:56","Speed Up download time","<android><io><filereader>","3","1","2","",""
"3303013","1","3303035","","2010-07-21 19:27:07","0","3110","<p>How the directories are disposed? Where do I copy my musics and pictures in my virtual device to test my apps?</p><p><strong>update:</strong> trying with mTools....<br><strong>update:</strong> mtools fails... cant download it to virtual device..</p><p><strong>update:</strong> I entered the internet on the Android's virtual device, tried to save an image, and it says that ""An SD card is required"". I thought I've read in the android.developers.com that the device has a SD card by default.. Anyway, I'll look for how to create it..</p>","287316","","287316","","2010-07-22 13:53:21","2010-07-22 15:33:17","How's the android directory structure?","<android>","3","3","","",""
"3303027","1","3303921","","2010-07-21 19:28:19","0","825","<p>I'm interested in accessing this class:<a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=media/java/android/media/MediaMetadataRetriever.java;h=681751b4d15115ffceb2c1d812b5d0f68b11a5ab;hb=HEAD"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=media/java/android/media/MediaMetadataRetriever.java;h=681751b4d15115ffceb2c1d812b5d0f68b11a5ab;hb=HEAD</a></p><p>It is android unpublished API but is it a problem if I access it through reflection or it could lead to issues ?</p>","394675","","","","","2010-07-21 21:14:41","MediaMetadataRetriever.java on android unpublished API through Reflection","<android><api><media>","1","0","0","",""
"3303140","1","","","2010-07-21 19:40:43","0","552","<p>We are trying to convert one of our J2ee web application to android application.The idea is that android device will be kind of view layer of spring mvc. Basically the andoird application will invoke the controller on the server and the controller will respond with JSON to the android application. Kind of RESTfull way of doing it.Question1)Any suggestions on how to maintain sessions in this situation.Or if you guys can suggest better way of doing the conversion. Example facebook app of android manages sessions and login/logout and communicate with its servers. I am wondering how to do that. </p><p>Regards.</p>","398402","","","","","2010-07-21 21:13:19","android as view layer of spring mvc","<android><model-view-controller><facebook>","1","0","","",""
"3303306","1","3306808","","2010-07-21 19:58:44","0","1652","<p>So I created my build.xml from scratch using the android utility:</p><pre><code>$ /opt/android-sdk-linux_86/tools/android create project --target android-6 --name Dash --path . --activity Main --package com.gtosoft.dash</code></pre><p>Then I try to kick off a compile, but it fails! </p><pre><code>$ ant releaseBuildfile: build.xml    [setup] Android SDK Tools Revision 6    [setup] Project Target: Android 2.0.1    [setup] API level: 6    [setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (5) is lower than the project target API level (6)    [setup] Importing rules file: platforms/android-6/templates/android_rules.xml-dirs:     [echo] Creating output directories if needed...-resource-src:     [echo] Generating R.java / Manifest.java from the resources...-aidl:     [echo] Compiling aidl files into Java classes...compile:    [javac] Compiling 1 source file to /home/brad/Desktop/android/eclipse/Dash/bin/classes-dex:     [echo] Converting compiled files and external libraries into /home/brad/Desktop/android/eclipse/Dash/bin/classes.dex...     [echo]          -package-resources:     [echo] Packaging resources [aaptexec] Creating full resource package...-package-no-sign:[apkbuilder] Creating Dash-unsigned.apk for release...BUILD FAILED/opt/android-sdk-linux_86/platforms/android-6/templates/android_rules.xml:286: The following error occurred while executing this line:/opt/android-sdk-linux_86/platforms/android-6/templates/android_rules.xml:152: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilderTotal time: 16 seconds</code></pre><p>I'm at a loss for why it's complaining about <code>com.android.jarutils.SignedJarBuilder</code></p><p>EDIT: After re-installing the SDK I have the same problem :(</p><p>$ ant -v release: </p><pre><code>BUILD FAILED/opt/android-sdk-linux_86/platforms/android-7/ant/ant_rules_r2.xml:301: The following error occurred while executing this line:/opt/android-sdk-linux_86/platforms/android-7/ant/ant_rules_r2.xml:156: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder   at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ant-1.7.1.jar.so)   at org.apache.tools.ant.taskdefs.MacroInstance.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)   at java.lang.reflect.Method.invoke(libgcj.so.9)   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)   at org.apache.tools.ant.Target.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.Target.performTasks(ant-1.7.1.jar.so)   at org.apache.tools.ant.Project.executeSortedTargets(ant-1.7.1.jar.so)   at org.apache.tools.ant.Project.executeTarget(ant-1.7.1.jar.so)   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(ant-1.7.1.jar.so)   at org.apache.tools.ant.Project.executeTargets(ant-1.7.1.jar.so)   at org.apache.tools.ant.Main.runBuild(ant-1.7.1.jar.so)   at org.apache.tools.ant.Main.startAnt(ant-1.7.1.jar.so)   at org.apache.tools.ant.launch.Launcher.run(ant-launcher-1.7.1.jar.so)   at org.apache.tools.ant.launch.Launcher.main(ant-launcher-1.7.1.jar.so)Caused by: /opt/android-sdk-linux_86/platforms/android-7/ant/ant_rules_r2.xml:156: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)   at org.apache.tools.ant.taskdefs.Sequential.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)   at java.lang.reflect.Method.invoke(libgcj.so.9)   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)   ...15 moreCaused by: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder   at java.lang.Class.initializeClass(libgcj.so.9)   at com.android.apkbuilder.internal.ApkBuilderImpl.createPackage(ApkBuilderImpl.java:397)   at com.android.ant.ApkBuilderTask.createApk(ApkBuilderTask.java:342)   at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:238)   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)   at java.lang.reflect.Method.invoke(libgcj.so.9)   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)   ...21 moreCaused by: java.lang.ClassNotFoundException: sun.security.x509.AlgorithmId   at org.apache.tools.ant.AntClassLoader.findClassInComponents(ant-1.7.1.jar.so)   at org.apache.tools.ant.AntClassLoader.findClass(ant-1.7.1.jar.so)   at org.apache.tools.ant.AntClassLoader.loadClass(ant-1.7.1.jar.so)   at java.lang.ClassLoader.loadClass(libgcj.so.9)   at java.lang.Class.initializeClass(libgcj.so.9)   ...27 more--- Nested Exception ---/opt/android-sdk-linux_86/platforms/android-7/ant/ant_rules_r2.xml:156: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)   at org.apache.tools.ant.taskdefs.Sequential.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)   at java.lang.reflect.Method.invoke(libgcj.so.9)   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)   at org.apache.tools.ant.taskdefs.MacroInstance.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)   at java.lang.reflect.Method.invoke(libgcj.so.9)   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)   at org.apache.tools.ant.Target.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.Target.performTasks(ant-1.7.1.jar.so)   at org.apache.tools.ant.Project.executeSortedTargets(ant-1.7.1.jar.so)   at org.apache.tools.ant.Project.executeTarget(ant-1.7.1.jar.so)   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(ant-1.7.1.jar.so)   at org.apache.tools.ant.Project.executeTargets(ant-1.7.1.jar.so)   at org.apache.tools.ant.Main.runBuild(ant-1.7.1.jar.so)   at org.apache.tools.ant.Main.startAnt(ant-1.7.1.jar.so)   at org.apache.tools.ant.launch.Launcher.run(ant-launcher-1.7.1.jar.so)   at org.apache.tools.ant.launch.Launcher.main(ant-launcher-1.7.1.jar.so)Caused by: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder   at java.lang.Class.initializeClass(libgcj.so.9)   at com.android.apkbuilder.internal.ApkBuilderImpl.createPackage(ApkBuilderImpl.java:397)   at com.android.ant.ApkBuilderTask.createApk(ApkBuilderTask.java:342)   at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:238)   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)   at java.lang.reflect.Method.invoke(libgcj.so.9)   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)   ...21 moreCaused by: java.lang.ClassNotFoundException: sun.security.x509.AlgorithmId   at org.apache.tools.ant.AntClassLoader.findClassInComponents(ant-1.7.1.jar.so)   at org.apache.tools.ant.AntClassLoader.findClass(ant-1.7.1.jar.so)   at org.apache.tools.ant.AntClassLoader.loadClass(ant-1.7.1.jar.so)   at java.lang.ClassLoader.loadClass(libgcj.so.9)   at java.lang.Class.initializeClass(libgcj.so.9)   ...27 more--- Nested Exception ---java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder   at java.lang.Class.initializeClass(libgcj.so.9)   at com.android.apkbuilder.internal.ApkBuilderImpl.createPackage(ApkBuilderImpl.java:397)   at com.android.ant.ApkBuilderTask.createApk(ApkBuilderTask.java:342)   at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:238)   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)   at java.lang.reflect.Method.invoke(libgcj.so.9)   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)   at org.apache.tools.ant.taskdefs.Sequential.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)   at java.lang.reflect.Method.invoke(libgcj.so.9)   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)   at org.apache.tools.ant.taskdefs.MacroInstance.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)   at java.lang.reflect.Method.invoke(libgcj.so.9)   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)   at org.apache.tools.ant.Target.execute(ant-1.7.1.jar.so)   at org.apache.tools.ant.Target.performTasks(ant-1.7.1.jar.so)   at org.apache.tools.ant.Project.executeSortedTargets(ant-1.7.1.jar.so)   at org.apache.tools.ant.Project.executeTarget(ant-1.7.1.jar.so)   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(ant-1.7.1.jar.so)   at org.apache.tools.ant.Project.executeTargets(ant-1.7.1.jar.so)   at org.apache.tools.ant.Main.runBuild(ant-1.7.1.jar.so)   at org.apache.tools.ant.Main.startAnt(ant-1.7.1.jar.so)   at org.apache.tools.ant.launch.Launcher.run(ant-launcher-1.7.1.jar.so)   at org.apache.tools.ant.launch.Launcher.main(ant-launcher-1.7.1.jar.so)Caused by: java.lang.ClassNotFoundException: sun.security.x509.AlgorithmId   at org.apache.tools.ant.AntClassLoader.findClassInComponents(ant-1.7.1.jar.so)   at org.apache.tools.ant.AntClassLoader.findClass(ant-1.7.1.jar.so)   at org.apache.tools.ant.AntClassLoader.loadClass(ant-1.7.1.jar.so)   at java.lang.ClassLoader.loadClass(libgcj.so.9)   at java.lang.Class.initializeClass(libgcj.so.9)   ...27 more</code></pre>","268803","","268803","","2010-07-23 12:15:53","2010-07-23 13:53:21","Android ant compile fails: java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder","<java><android><ant><compiler-errors>","1","0","","",""
"3303548","1","3303601","","2010-07-21 20:30:50","3","835","<p>I want to add tabs to the layout of my activity, but I don't want the activity to extend TabActivity. The example in <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a> only gave example of subclass of TabActivity.</p><p>Is there any way I can make it without extending TabActivity?</p><p>Thanks.</p>","256239","","256239","","2010-07-21 21:00:08","2012-10-09 16:32:44","Is there any way to add tab layout without letting the activity to extend TabActivity?","<android>","1","0","3","",""
"3303655","1","","","2010-07-21 20:43:46","0","198","<p>I would like to write an application/service that shows a modal notification window (Like how Handcent does the Quick Reply SMS window) instead of putting an icon into the notification tray.</p><p>How would one implement this?</p>","289182","","","","","2010-07-21 20:43:46","How to do a modal notification window from launcher?","<android>","0","3","","",""
"3303805","1","3399902","","2010-07-21 20:58:16","4","8751","<p>I have been trying to write an app that periodically parses the contents of gmail messages. I have been through the JavaMail FAQ and I have looked at a number of examples in the JavaMail download package but have been unable to get this to work. The code below currently causes the following gmail error: </p><blockquote>  <p>Host is unresolved: imaps.gmail.com:993</p></blockquote><p>I have also tried imap.gmail.com:143 but get: </p><blockquote>  <p>Host is unresolved: imap.gmail.com:143</p></blockquote><p>Any help or advice would be greatly appreciated. GMailReader is the class I am using to try and return gmail imap messages: </p><pre><code>public class GMailReader extends javax.mail.Authenticator {     private String mailhost = ""imaps.gmail.com"";     private String user;     private String password;     private Session session;     public GMailReader(String user, String password) {         this.user = user;         this.password = password;         Properties props = new Properties();         props.setProperty(""mail.transport.protocol"", ""imaps"");         props.setProperty(""mail.imaps.host"", mailhost);         props.put(""mail.imaps.auth"", ""true"");         props.put(""mail.imaps.port"", ""993"");         props.put(""mail.imaps.socketFactory.port"", ""993"");         props.put(""mail.imaps.socketFactory.class"",                   ""javax.net.ssl.SSLSocketFactory"");         props.put(""mail.imaps.socketFactory.fallback"", ""false"");         props.setProperty(""mail.imaps.quitwait"", ""false"");         session = Session.getDefaultInstance(props, this);     }     public synchronized Message[] readMail() throws Exception {         try {             Store store = session.getStore(""imaps"");             store.connect(""imaps.gmail.com"", user, password);             Folder folder = store.getFolder(""INBOX"");             folder.open(Folder.READ_ONLY);             Message[] msgs = folder.getMessages(1, 10);             FetchProfile fp = new FetchProfile();             fp.add(FetchProfile.Item.ENVELOPE);             folder.fetch(msgs, fp);             return msgs;         } catch (Exception e) {             Log.e(""readMail"", e.getMessage(), e);             return null;         }     } }</code></pre>","398460","","398460","","2010-08-02 13:02:41","2013-04-22 00:44:28","Are there any good short code examples that simply read a new gmail message?","<android><gmail><imap><javamail>","4","0","1","",""
"3303985","1","3304137","","2010-07-21 21:23:25","2","247","<p>So I have made a little piece of code that will insert and manipulate a few images. Now my main problem is that this is very ugly and long, I was wondering if anything could be done to make it prettier.</p><pre><code>    RelativeLayout mRelativeLayout = (RelativeLayout) findViewById(R.id.board);    ImageView i = new ImageView(this);    i.setImageResource(R.drawable.blue_1);    i.setId(400);    ImageView j = new ImageView(this);    j.setImageResource(R.drawable.red_1);    j.setId(401);    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(40,62);    params.addRule(mRelativeLayout.ALIGN_PARENT_BOTTOM);    RelativeLayout.LayoutParams params1 = new RelativeLayout.LayoutParams(40,62);    params1.addRule(mRelativeLayout.ALIGN_PARENT_BOTTOM);    params1.addRule(mRelativeLayout.RIGHT_OF, 400);        mRelativeLayout.addView(i, params);    mRelativeLayout.addView(j, params1);    setContentView(mRelativeLayout);</code></pre><p>For example I have tried with just one layoutparams, but it seem to affect both pictures even if I make changes to it after the first picture is added.</p><p>Also I have a function that can return a string such as blue_1 o red_1 as a string to help me print my images, but it wont allow me to put strings into the i.setImageResource to get the picture :(</p><p>What can i do?</p>","396182","","","","","2010-07-21 21:43:54","Making code stuff pretty (layout)","<android><relativelayout>","1","2","","",""
"3304046","1","","","2010-07-21 21:33:54","2","968","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/5803914/can-i-open-camera-in-webview"">Can I open camera in webview?</a>  </p></blockquote><p>I'm having difficulty setting up the webview so that there can be javascript callbacks to access the android camera.  Has anyone done this before, or have any advice?  </p>","398498","","114066","","2010-07-23 07:35:07","2011-04-27 12:22:02","Android: Connecting webview with camera","<android><camera><webview>","1","0","","2012-10-22 12:47:37",""
"3304062","1","3304085","","2010-07-21 21:35:12","0","129","<p>Sorry I'm really new to this, but I can't find anything in the docs.</p><p>I have 3 .class files that I'm attempting to use in an android 2.2 project, but I don't know where to put them so that I can import them, for some reason Eclipse won't allow me to put them in the android 2.2 folder (it seems to be unwriteable) So where can I put these class files? Can I put them in the src folder?</p>","242934","","244296","","2010-07-21 21:36:59","2010-07-21 21:37:54","Simple android 2.2 programming question","<android>","1","0","","",""
"3304111","1","","","2010-07-21 21:41:06","1","552","<p>How much space does a TextView take?</p><p>When I declare a TextView, is it possible to calculate how much space (height and width) it is going to take when actually rendered on the phone?</p><p>I have noticed that based on the different screen sizes of phones (or density), the TextView is rendered accordingly. I want to be able to calculate the exact height and width rendered. </p>","398505","","1140748","","2012-05-06 16:47:14","2012-05-06 16:47:14","How much space does a TextView take","<android><textview>","1","0","","",""
"3304304","1","3304374","","2010-07-21 22:10:13","9","7817","<p>Is there a way for an <code>Activity</code> to find out who (i.e. class name) has sent an <code>Intent</code>? I'm looking for a generic way for my <code>Activity</code> to respond to a received intent by sending one back to the sender, whoever that may be.</p>","440093","","438992","","2013-04-28 20:24:51","2013-06-17 16:50:04","How to get the sender of an Intent?","<android>","3","0","2","",""
"3304342","1","","","2010-07-21 22:18:30","2","823","<p>I want to let users input a postal code to my app.  The common use case is the US zip code, which are composed solely of numbers, so I'd like to display the numeric keyboard initially in the soft input.  However, not all postal codes are solely digits, so I still need users to be able to enter other characters.</p><p>I've been trying to do this with <a href=""http://developer.android.com/reference/android/widget/TextView.html#attr_android%3ainputType"" rel=""nofollow""><code>android:inputType</code></a>, but by setting the ""number"" flag, it automatically blocks any input except for number-based stuff.  Is there a way to just accept general text, but get the soft keyboard to initially display a more number-based keyboard?</p>","60261","","","","","2011-02-12 18:23:11","How can you configure an EditText's soft keyboard to use numbers initially, but still allow text?","<android>","1","0","1","",""
"3304368","1","3304552","","2010-07-21 22:22:54","0","832","<p>Suppose I have the following layout</p><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/TableLayout""&gt;    &lt;TableRow android:id=""@+id/TableRow01"" &gt;        &lt;Button android:text=""1"" android:id=""@+id/button01""/&gt;        &lt;Button android:text=""2"" android:id=""@+id/button02""/&gt;        &lt;Button android:text=""3"" android:id=""@+id/button03""/&gt;        &lt;Button android:text=""4"" android:id=""@+id/button04""/&gt;    &lt;/TableRow&gt;    &lt;TableRow android:id=""@+id/TableRow01"" &gt;        &lt;Button android:text=""5"" android:id=""@+id/button05""/&gt;        &lt;Button android:text=""6"" android:id=""@+id/button06""/&gt;        &lt;Button android:text=""7"" android:id=""@+id/button07""/&gt;        &lt;Button android:text=""8"" android:id=""@+id/button08""/&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>How could I swap position of <code>button01</code> with <code>button02</code>? And would it work also for swapping <code>button01</code> with <code>button05</code>?</p><p>Before asking what I have tried so far, I don't even know where to start. I googled but the only answer I could find was about <code>AbsoluteLayout</code>, which is not what I need.</p>","133203","","","","","2011-04-15 21:58:47","Swap two buttons positions in TableLayout","<android><tablelayout>","1","0","","",""
"3304412","1","","","2010-07-21 22:32:41","3","539","<p>I am currently writing the backend for a service which has 3 clients: browser, android native and iphone native. I am having a little trouble with coming up with an authentication system since I don't know what can really be done on the clients.</p><p>I am using django + twisted for the backend.</p><p>Basically, I am going to be writing RestfulAPIs to open up for the clients on both phones to call. </p><p>Now the real question is, how should I come up with an authentication system?</p><p>I have thought about using sessionids, this works very well with the browser and I can use django's integrated app for that.</p><p>However, I don't know if it's possible for both the iphone and android to obtain a unique sessionid on the handset. Should I write an API call to distribute unique sessionids?</p><p>if that's the case, is it possible for me to still use django's authentication system since a lot of the stuff here are customized? ( I am not even using a rdbms - I am sticking with mongodb, so I was on the verge of dropping django's authentication app ftm).</p><p>I have looked at foursquare's API and their basic auth method requires you to pass in user:password in every http request header. That adds 1 additional authentication each call which can kind of seem excessive.</p><p>Please provide any kind of advise that you could give.</p>","392017","","","","","2010-07-21 23:33:53","Writing authentication system","<iphone><android><django><authentication>","1","0","1","",""
"3304543","1","","","2010-07-21 22:58:14","4","257","<p>4 major OS versions: 1.5, 1.6, 2.1 and 2.2 (I guess we can safely ignore 1.0 and 2.0 now)</p><p>3 screen densities: ldpi, mdpi, hdpi</p><p>3 screen sizes: small, normal, large</p><p>Lots of system testing scenarios.</p><p>Is there are way to optimize the testing effort for an app that has to target all Android devices? What's the minimum number of emulators that are needed to cover the most cases?</p><p>Dealing with this lately and I'm very interested to know how others are doing their Android system testing.</p>","143378","","","","","2010-09-12 23:23:59","Optimizing Android testing effort","<android><testing><system-testing>","2","0","1","",""
"3304658","1","3305449","","2010-07-21 23:21:19","0","697","<p><strong>First Question</strong></p><p>I use <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012"">http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012</a> to load images in a ListView and a GridView.  It works but the images are loaded form bpttom to top. How to fix that?</p><p><strong>Bonus Question</strong></p><p>Can I use a loading animation in a image view while the real image is loaded?  Right now it's just a default image.</p>","389080","","74815","","2010-07-21 23:24:16","2010-07-22 03:14:40","Reverse image load order?","<android>","1","0","","",""
"3304678","1","","","2010-07-21 23:27:12","2","2533","<p>I wrote an app with webview which displays m.youtube.com. It works in other android versions. However, in Android 2.2,  shouldOverrideUrlLoading is not even called when a link like ""rtsp://vx.cache.youtube.com/..."" is clicked. Does anyone have the same problem?</p>","278528","","","","","2012-09-10 16:07:01","android 2.2 WebView and WebViewClient RTSP problem","<android><uiwebview>","2","0","0","",""
"3304685","1","","","2010-07-21 23:29:23","8","3361","<p>I am working on an app which needs the information of the apps running at the system up to now. Is there an API/method to retrieve that kind of information?</p>","368778","","29995","","2011-11-11 12:56:46","2014-03-19 10:53:32","How to get the list of running applications?","<android>","2","0","0","",""
"3304689","1","","","2010-07-21 23:30:04","1","1332","<p>I am writing a program to study Android Camera functions.Now, I have some problems about Camera preview operation:</p><p>My program will create a surfaceview object in the main activity (ActivityMain)'s onCreate() function and then set it to the content. </p><pre><code>    super.onCreate(savedInstanceState);    m_surface = new MyCameraSurface(this);            // remove title bar    requestWindowFeature(Window.FEATURE_NO_TITLE);            setContentView(m_surface);</code></pre><p>Then startPreview() will be called when surfaceChanged() is running.</p><pre><code>public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {    Log.d(TAG, ""*** surfaceChanged &gt;&gt;&gt;&gt;&gt; ***"");    Log.d(TAG, ""format="" + format + "", width="" + width + "", height="" + height);    if(m_control.IsCameraClosed() == false) {        if(m_control.IsPreviewRun() == false) {                         m_control.startPreview();        }    }    Log.d(TAG, ""*** surfaceChanged &lt;&lt;&lt;&lt;&lt; ***"");}</code></pre><p>My problem is: at the beginning my program always receives ""GetNextPreviewFrame Error/1 frame:0x0, buffer:0x0"" error:</p><pre><code>07-22 06:47:46.727: DEBUG/MyCameraSurface(2313): *** surfaceChanged &lt;&lt;&lt;&lt;&lt; ***07-22 06:47:46.735: DEBUG/SurfaceFlinger(1276): commiting overlay changes07-22 06:47:46.735: INFO/TIOverlay(1276): Nothing to do!07-22 06:47:46.735: INFO/ActivityManager(1276): Displayed activity com.hykwok.CameraEffect/.ActivityMain: 7866 ms (total 7866 ms)07-22 06:47:47.792: ERROR/CameraHal(1052): GetNextPreviewFrame Error/1 frame:0x0, buffer:0x007-22 06:47:48.477: DEBUG/dalvikvm(1276): GC freed 2299 objects / 119216 bytes in 143ms07-22 06:47:48.793: ERROR/CameraHal(1052): GetNextPreviewFrame Error/1 frame:0x0, buffer:0x007-22 06:47:49.794: ERROR/CameraHal(1052): GetNextPreviewFrame Error/1 frame:0x0, buffer:0x007-22 06:47:50.794: ERROR/CameraHal(1052): GetNextPreviewFrame Error/1 frame:0x0, buffer:0x0</code></pre><p>However, when I switch to another activity (ActivityCameraSetting) and then go back to the main activity, the output becomes normal.</p><p>Could anyone give some suggestion to me to fix it? </p><p>I am using Motorola Milestone. Firmware version is 2.1-update1 and build number is SHOLS_U2.02.36.0.</p><p>I am not sure other Android phones whether have this problem or not.</p><p>Another question is:Is it possible to get preview frame data by the preview callback function without set surfaceview holder?</p><p>Thank you for your help.</p><p>Source codes can be downloaded from here: </p><p><a href=""http://code.google.com/p/android-simple-camera-effect/downloads/list"" rel=""nofollow"">Source codes link</a></p>","398548","","398548","","2010-07-23 15:09:17","2012-06-08 15:41:03","Android Camera Preview question","<android><camera>","1","1","1","",""
"3304701","1","3304738","","2010-07-21 23:33:55","2","2229","<p>I am working on a little side project (program for Android platform)and I don't exactly have a problem, but I don't really know where to start.The project I am working on has to do with getting the info and manipulating a pixel's RGB values inside an image. I know this is a very basic program (not going to disclose all the information about the project), but I am a beginning android programmer. </p><p>I've already developed my algorithm, now I just need to be pushed/""knudged"" in the right direction. Could anyone please help me? Any tutorials on this kind of thing or related topics? </p><p>Thanks in advance!</p>","399004","","","","","2011-01-20 11:37:20","How to obtain pixel's rgb values in an image in android","<android><image><pixel>","1","0","2","",""
"3304825","1","","","2010-07-22 00:04:18","0","205","<p>I specified a selector drawable for the background of a layout as below, so when user clicks on the layout, the layout will have a different background. But, I didn't specify color selector for the TextViews in the layout, because there are many TextViews with different colors and I am too lazy to define color selector for them. So the text color keeps the same when the layout is clicked. My questions is, is there an automatic way to specify that the text color is highlighted/changed when the layout is clicked, so I don't have to define color selector for each of the TextViews in a layout? Thanks.</p><pre><code>&lt;RelativeLayout android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""    android:background=""@drawable/background_selector""    &gt;    &lt;TextView android:id=""@+id/text1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:textColor=""@color/my_green""        android:layout_alignParentLeft=""true""        android:layout_alignParentTop=""true""        /&gt;    &lt;TextView android:id=""@+id/text2""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:textColor=""@color/my_blue""        android:layout_alignParentLeft=""true""        android:layout_below=""@id/text1""        /&gt;      &lt;/RelativeLayout&gt;</code></pre>","256239","","","","","2010-10-09 19:03:32","Is there any easy or automatic way to specify text color selector for click event?","<android>","1","0","","",""
"3304951","1","","","2010-07-22 00:32:35","3","995","<p>I'm trying to build android system ;enviroment: ubuntu 10.04, gcc-4.4 jdk 1.6-0-20get source code follows <a href=""http://source.android.com/source/download.html"" rel=""nofollow"">http://source.android.com/source/download.html</a></p><p>$ . build/envsetup.sh</p><p>$ choosecombo</p><p>$ make</p><p>then compiler error occurs: </p><p>frameworks/base/opengl/libagl/egl.cpp:1955:   instantiated from hereframeworks/base/opengl/libagl/egl.cpp:72: warning: comparison between signed and unsigned integer expressionsframeworks/base/opengl/libagl/egl.cpp:74: warning: comparison between signed and unsigned integer expressions</p><p><strong>frameworks/base/opengl/libagl/egl.cpp: In member function ‘virtual EGLBoolean android::egl_window_surface_v2_t::swapBuffers()’:frameworks/base/opengl/libagl/egl.cpp:554: internal compiler error: in add_phi_arg, at tree-phinodes.c:391</strong></p><p>in line 554: the code below:const Region copyBack(Region::subtract(oldDirtyRegion, dirtyRegion));</p><p>Any one know the solution ? roll back to gcc4.3 may not a nice solution</p>","398602","","398602","","2010-07-22 00:54:58","2011-06-30 11:30:16","build android system on ubuntu 10.04 x86-64 occrur internal compiler error","<android>","1","0","1","",""
"3304971","1","3305191","","2010-07-22 00:40:51","2","2300","<p>Is it possible to programmatically disable and enable the led indicator light on an Android device? I am not referring to just turning it on and off as in a notification. I did not see anything in the api that would do so. I am guessing this is hardware specific if it is possible at all.</p>","312443","","741249","","2012-05-02 12:31:23","2013-03-14 12:50:39","Disable/enable notification led","<android><led>","2","0","","",""
"3305088","1","3305258","","2010-07-22 01:14:18","20","14941","<p>What i have here is a simple webview activity that when loaded it auto displays an ongoing notification. The idea is that people can navigate away from this activity and quickly access it again from any screen they want by pulling down the drop down menu and selecting it. Then when they want they can just close the notification by hitting the menu button and hitting exit and then the notification clears. This all works fine. However, when the notification is pressed it starts a new instance of the activity. What would i have to change to make it see if the activity has not already been destroyed and i can just call that instance back(resume it) and therefore not needing to load it again and won't need to add another activity to my stack. Any ideas? Any help would be greatly appreciated.</p><pre><code>package com.my.app;    import com.flurry.android.FlurryAgent;    import android.app.Activity;    import android.app.Notification;    import android.app.NotificationManager;    import android.app.PendingIntent;    import android.app.ProgressDialog;    import android.content.Context;    import android.content.Intent;    import android.os.Bundle;    import android.util.Log;    import android.view.KeyEvent;     import android.view.Menu;    import android.view.MenuInflater;    import android.view.MenuItem;    import android.webkit.CookieSyncManager;    import android.webkit.WebView;    import android.webkit.WebViewClient;    import android.widget.Toast;    public class Chat extends Activity {         private ProgressDialog progressBar;        public WebView webview;        private static final String TAG = ""Main"";        private NotificationManager mNotificationManager;        private int SIMPLE_NOTFICATION_ID;            @Override            public void onStart()            {               super.onStart();               CookieSyncManager.getInstance().sync();               FlurryAgent.onStartSession(this, ""H9QGMRC46IPXB43GYWU1"");            }        public void onCreate(Bundle savedInstanceState) {             super.onCreate(savedInstanceState);            setContentView(R.layout.chat);            mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);            final Notification notifyDetails = new Notification(R.drawable.chat_notification,""Chat Started"",System.currentTimeMillis());            notifyDetails.flags |= Notification.FLAG_ONGOING_EVENT;            Context context = getApplicationContext();            CharSequence contentTitle = ""Chat"";            CharSequence contentText = ""Press to return to chat"";            Intent notifyIntent = new Intent(context, Chat.class);            PendingIntent intent =            PendingIntent.getActivity(Chat.this, 0,            notifyIntent, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);            notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);            mNotificationManager.notify(SIMPLE_NOTFICATION_ID, notifyDetails);            CookieSyncManager.createInstance(this);            CookieSyncManager.getInstance().startSync();            webview = (WebView) findViewById(R.id.webviewchat);            webview.setWebViewClient(new chatClient());            webview.getSettings().setJavaScriptEnabled(true);            webview.getSettings().setPluginsEnabled(true);            webview.loadUrl(""http://google.com"");            progressBar = ProgressDialog.show(Chat.this, """", ""Loading Chat..."");        }        private class chatClient extends WebViewClient {             @Override             public boolean shouldOverrideUrlLoading(WebView view, String url) {                Log.i(TAG, ""Processing webview url click..."");                view.loadUrl(url);                return true;            }            public void onPageFinished(WebView view, String url) {                Log.i(TAG, ""Finished loading URL: "" +url);                if (progressBar.isShowing()) {                    progressBar.dismiss();                }            }        }            public boolean onKeyDown(int keyCode, KeyEvent event) {                 if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {                     webview.goBack();                     return true;                 }                 return super.onKeyDown(keyCode, event);             }             @Override            public boolean onCreateOptionsMenu (Menu menu) {                super.onCreateOptionsMenu(menu);                MenuInflater inflater = getMenuInflater();                inflater.inflate(R.menu.chatmenu, menu);                return true;            }        @Override        public boolean onOptionsItemSelected (MenuItem item) {                switch (item.getItemId()) {                case R.id.home:                    Intent a = new Intent(this, Home.class);                    startActivity(a);                    return true;                case R.id.closechat:                    mNotificationManager.cancel(SIMPLE_NOTFICATION_ID);                    Intent v = new Intent(this, Home.class);                    startActivity(v);                    return true;        }        return false;            }        public void onStop()        {           super.onStop();           CookieSyncManager.getInstance().sync();           FlurryAgent.onEndSession(this);        }         } </code></pre><p>@Commonsware</p><p>Just to be sure i have it correct, is this what you were suggesting?</p><p>I was a little worried about this line, </p><pre><code>PendingIntent.getActivity(Chat.this, 0, notifyIntent, SIMPLE_NOTFICATION_ID);public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);        setContentView(R.layout.chat);        mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);        final Notification notifyDetails = new Notification(R.drawable.chat_notification,""Chat Started"",System.currentTimeMillis());        notifyDetails.flags |= Notification.FLAG_ONGOING_EVENT;        Context context = getApplicationContext();        CharSequence contentTitle = ""Chat"";        CharSequence contentText = ""Press to return to chat"";        Intent notifyIntent = new Intent(context, Chat.class);        PendingIntent intent =        PendingIntent.getActivity(Chat.this, 0, notifyIntent, SIMPLE_NOTFICATION_ID);        notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);        notifyIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);        mNotificationManager.notify(SIMPLE_NOTFICATION_ID, notifyDetails);        CookieSyncManager.createInstance(this);        CookieSyncManager.getInstance().startSync();        webview = (WebView) findViewById(R.id.webviewchat);        webview.setWebViewClient(new chatClient());        webview.getSettings().setJavaScriptEnabled(true);        webview.getSettings().setPluginsEnabled(true);        webview.loadUrl(""http://google.com"");        progressBar = ProgressDialog.show(Chat.this, """", ""Loading Chat..."");    }</code></pre>","393373","","393373","","2010-07-22 03:21:42","2013-06-19 23:00:11","How to make notification intent resume rather than making a new intent?","<android><activity><android-intent><notifications><resume>","2","0","5","",""
"3305104","1","3329732","","2010-07-22 01:18:32","1","135","<p>In my Android project, I put several folders with unicode names in the assets folder. Eg ""????????"" and ""??(??)""</p><p>When I do so, I can not built the app. I get this error. However, when I rename the folders to simple ASCII it works.</p><pre><code>[2010-07-21 21:12:58 - Ridvan Library] ------------------------------[2010-07-21 21:12:58 - Ridvan Library] Android Launch![2010-07-21 21:12:58 - Ridvan Library] adb is running normally.[2010-07-21 21:12:58 - Ridvan Library] Could not find Ridvan Library.apk!</code></pre>","172861","","4249","","2010-07-22 01:24:07","2010-07-25 15:20:49","Eclipse Android Unicode Folder Names causing bad build","<java><android><eclipse>","1","4","","",""
"3305116","1","3305142","","2010-07-22 01:22:23","1","930","<p>here is what i do </p><pre><code>FileOutputStream out = new FileOutputStream(                        ""/sdcard/Deltio1.jpg"");                Bitmap e = BitmapFactory.decodeByteArray(imageData, 0,                        imageData.length);                e.compress(Bitmap.CompressFormat.JPEG, 65, out);                out.close();</code></pre><p>and to retrieve it </p><pre><code>FileInputStream fin = new FileInputStream(""/sdcard/Deltio1.jpg"");            ObjectInputStream in = new ObjectInputStream(fin);            Bitmap bitmap;              bitmap = (Bitmap) in.readObject();              ImageView photo = (ImageView) findViewById(R.id.katagelia_photo);              photo.setImageBitmap(bitmap);</code></pre><p>It throws java.io.StreamCorruptedException </p>","348058","","","","","2010-07-22 01:30:20","android why i can't retrieve a compressed bitmap?","<android><bitmap>","1","0","1","",""
"3305165","1","3305251","","2010-07-22 01:36:35","3","821","<p>I'm trying to structure a URI that accesses my data by id.</p><p>Currently my URIs are query based like so:</p><pre><code>.../content?parentList=15&amp;type=note</code></pre><p>How could I structure a similar URI so that I could query for notes in multiple lists?</p><p>Essentially combining the results of the next two URIs.</p><pre><code>.../content?parentList=15&amp;type=note.../content?parentList=16&amp;type=note</code></pre><p>Is there a standard way to do this?</p>","131871","","","","","2010-07-31 23:39:00","How to structure URI query for multiple values for same key?","<android><database><rest><uri>","2","0","","",""
"3305281","1","","","2010-07-22 02:07:27","1","2635","<p>Can somebody give me a tutorial on how to make an analog speedometer with Android? I have currently the speed (get by GPS), but I don't know how to do the graphic part.</p>","346665","","2633423","","2013-10-05 12:15:43","2013-10-05 12:15:43","Analog speedometer","<android><graphics>","2","1","1","",""
"3305307","1","","","2010-07-22 02:12:35","2","1833","<p>How do remove center-locked horizontally scrolling in the gallery images?</p>","398639","","","","","2011-10-11 14:12:44","Gallery center-locked horizontally scrolling","<android><image-gallery>","1","1","","",""
"3305314","1","3305492","","2010-07-22 02:14:43","0","204","<p>Can somebody please show me resources that would let me make REST calls from my Android Phone to Amazon? </p><p>I need to get Item details for that Item.</p><p>I tried to look for documentation but I really couldn't find it.  I am sorry if this has been answered before but I couldn't find the answer. </p><p>Thank you.</p>","82368","","","","","2010-07-22 03:01:28","How do I make REST calls for a particular Item Amazon.com?","<java><android><http><rest><web-services>","1","2","","",""
"3305320","1","","","2010-07-22 02:16:34","3","773","<p>Does Android OS store info on Apps like last run time, or how many times an app was run?</p>","398643","","","","","2010-07-22 03:29:30","How to get info Last Run Time, or How Many Times and App has been Executed or Run?","<android>","2","0","","",""
"3305352","1","3305858","","2010-07-22 02:26:41","-1","775","<p>Below are the important stuff. The problem is: I have the camera take a picture when I tap on the surface and store the image to the <a href=""http://en.wikipedia.org/wiki/Secure_Digital"" rel=""nofollow"">SD card</a>. If I click two or more times before the camera stores the picture, the camera freezes and the phone need a restart. I think I have all the release stuff correct. I even implemented a boolean <code>onProgress</code> to take some action, but it seems it doesn't work.</p><pre><code>public void onClick() {    if(!onProgress)    mCamera.takePicture(null, mPictureCallback, mPictureCallback);}Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() {    public void onPictureTaken(byte[] imageData, Camera c) {        onProgress=true;        if (imageData != null) {            Intent mIntent = new Intent();            try {                FileOutputStream out = new FileOutputStream(                        ""/sdcard/Deltio1.jpg"");                Bitmap e = BitmapFactory.decodeByteArray(imageData, 0,                        imageData.length);                e.compress(Bitmap.CompressFormat.JPEG, 65, out);                out.close();                Intent i = new Intent(ACT, MediaSend.class);                ACT.startActivity(i);            }            catch (Exception e) {                Toast                .makeText(                        CON,                        ""???ß??µa st?? ap????e?s?.?eßa???e?te ?t? ??ete sdcard e??atest?µ???"",                        Toast.LENGTH_LONG).show();                ACT.finish();            }            // FileUtilities.StoreByteImage(mContext, imageData,            // 50, ""ImageName"");            SystemClock.sleep(2000);            mCamera.startPreview();            onProgress=false;            // setResult(FOTO_MODE,mIntent);            // finish();        }    }};</code></pre><p>You can refer to <a href=""http://www.copypastecode.com/33005/"" rel=""nofollow"">the entire code</a>.</p>","348058","","63550","","2012-08-17 16:57:25","2012-08-17 16:57:25","Android - Camera with double click","<android><camera>","1","0","","",""
"3305459","1","3367780","","2010-07-22 02:52:12","0","357","<p>I want to create a stub of one of my Activities, but I want to keep it in the test project so not to have it in the actual apk. I don't seem to be able to find a way to do it though. I get this:</p><blockquote>java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.example.test.StubActivity }</blockquote><p>I did find if I put it in the main project and put it in the manifest accordingly (IntentFilter:(Action:Main, Category:Default)) it will work, well it actually crashed, but I am not bothered by that. Something to fix later on.</p><p>I did think about putting everything in the same main project and just have a test package, but that would then involve messing the manifest, I think. It seems better to keep them separate. It's just cleaner.</p>","398640","","","","","2010-07-29 23:34:22","Can I create a Stub of an Activity in Testing Project?","<android><unit-testing><testing><tdd>","1","0","","",""
"3305598","1","","","2010-07-22 03:30:21","10","12737","<p>Ok so I have a frequency generator which uses AudioTrack to send PCM data to the hardware.  Here's the code I'm using for that:</p><pre><code>private class playSoundTask extends AsyncTask&lt;Void, Void, Void&gt; {  float frequency;  float increment;  float angle = 0;  short samples[] = new short[1024];  @Override  protected void onPreExecute() {   int minSize = AudioTrack.getMinBufferSize( 44100, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT );           track = new AudioTrack( AudioManager.STREAM_MUSIC, 44100,      AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT,      minSize, AudioTrack.MODE_STREAM);   track.play();  }  @Override  protected Void doInBackground(Void... params) {   while( Main.this.isPlaying)   {    for( int i = 0; i &lt; samples.length; i++ )    {     frequency = (float)Main.this.slider.getProgress();     increment = (float)(2*Math.PI) * frequency / 44100;     samples[i] = (short)((float)Math.sin( angle )*Short.MAX_VALUE);     angle += increment;    }    track.write(samples, 0, samples.length);   }   return null;  } }</code></pre><p>The frequency is tied to a slide bar, and the correct value is being reported in the sample generation loop.  Everything is fine and dandy when I start the app.  When you drag your finger along the slide bar you get a nice sweeping sound.  But after around 10 seconds of playing around with it, the audio starts to get jumpy.  Instead of a smooth sweep, it's staggered, and only changes tone around every 1000 Hz or so.  Any ideas on what could be causing this?</p><p>Here's all the code in case the problem lies somewhere else:</p><pre><code>    public class Main extends Activity implements OnClickListener, OnSeekBarChangeListener { AudioTrack track; SeekBar slider; ImageButton playButton; TextView display;  boolean isPlaying=false; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  display = (TextView) findViewById(R.id.display);  display.setText(""5000 Hz"");  slider = (SeekBar) findViewById(R.id.slider);  slider.setMax(20000);  slider.setProgress(5000);  slider.setOnSeekBarChangeListener(this);  playButton = (ImageButton) findViewById(R.id.play);  playButton.setOnClickListener(this); } private class playSoundTask extends AsyncTask&lt;Void, Void, Void&gt; {  float frequency;  float increment;  float angle = 0;  short samples[] = new short[1024];  @Override  protected void onPreExecute() {   int minSize = AudioTrack.getMinBufferSize( 44100, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT );           track = new AudioTrack( AudioManager.STREAM_MUSIC, 44100,      AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT,      minSize, AudioTrack.MODE_STREAM);   track.play();  }  @Override  protected Void doInBackground(Void... params) {   while( Main.this.isPlaying)   {    for( int i = 0; i &lt; samples.length; i++ )    {     frequency = (float)Main.this.slider.getProgress();     increment = (float)(2*Math.PI) * frequency / 44100;     samples[i] = (short)((float)Math.sin( angle )*Short.MAX_VALUE);     angle += increment;    }    track.write(samples, 0, samples.length);   }   return null;  } } @Override public void onProgressChanged(SeekBar seekBar, int progress,   boolean fromUser) {  display.setText(""""+progress+"" Hz""); } public void onClick(View v) {  if (isPlaying) {   stop();  } else {   start();  } } public void stop() {  isPlaying=false;  playButton.setImageResource(R.drawable.play); } public void start() {  isPlaying=true;  playButton.setImageResource(R.drawable.stop);  new playSoundTask().execute(); } @Override protected void onResume() {  super.onResume(); } @Override protected void onStop() {  super.onStop();  //Store state  stop(); } @Override public void onStartTrackingTouch(SeekBar seekBar) {  // TODO Auto-generated method stub } @Override public void onStopTrackingTouch(SeekBar seekBar) {  // TODO Auto-generated method stub }}</code></pre>","394417","","","","","2013-05-09 12:45:16","Android AudioTrack buffering problems","<android><audio><buffer>","3","2","9","",""
"3305677","1","","","2010-07-22 03:53:38","0","220","<p>I want to make the view move around the screen. Is that possible? </p><p>in other words, I want panning to be possible and I think that has something to do with the view.</p><p>How do you do Panning a video preview?</p>","381699","","381699","","2010-07-26 09:18:58","2010-07-26 09:18:58","Panning video in runtime","<android><video>","1","0","","",""
"3305941","1","3370444","","2010-07-22 05:12:01","7","1630","<p>The problem I am having is that when I run a FWVGA or WVGA sized emulator it sometimes runs at a MDPI size instead of HDPI. Here is an example with pictures</p><p><a href=""http://wonton-games.blogspot.com/2010/06/emulator-problems.html"" rel=""nofollow"">http://wonton-games.blogspot.com/2010/06/emulator-problems.html</a></p><p>I create the AVD with the proper hw.lcd.density setting and screen size and it randomly does this. There doesn't seem to be a pattern. I used to be able to just delete the AVD and create it over again and it would fix itself for a while but now it's getting worse. </p><p>Does anyone have any ideas cause I posted on the Android Developer forum but all I got was other people saying they get the same problem.</p>","394093","","","","","2010-07-31 08:24:54","Android Eclipse emulator problem: Runs WVGA(hdpi) as a mdpi screen","<android><eclipse><emulator>","1","0","1","",""
"3305945","1","","","2010-07-22 05:13:10","0","36","<p>I just created a ListView, the itemclickevent works fine with it. But when i add a combox box to the list view, the focus goes within the selected object list in the object only, but cannot get the click event, but i can check or uncheck the checkBox.</p><p>Any Ideas how to use this?I want the click event for selected object as well as the check box</p>","138030","","114066","","2012-01-27 08:49:23","2012-01-27 08:49:23","Doubts in Using CustomListView","<android><android-listview>","1","0","","",""
"3305978","1","3306340","","2010-07-22 05:21:15","1","1029","<p>I've done this before...not sure what i'm doing wrong now I know it's the simplest thing in the world but i just want to make the text of my settings page black and the background white. Any ideas of what i'm doing wrong? my code does nothing.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;PreferenceScreen      xmlns:android=""http://schemas.android.com/apk/res/android""      android:background=""#FFFFFF""&gt;    &lt;CheckBoxPreference     android:summary=""summary goes here""     android:title=""Preference 1""    android:defaultValue=""false""     android:key=""one""    android:textColor=""#000000""&gt;    &lt;/CheckBoxPreference&gt;    &lt;/PreferenceScreen&gt;</code></pre><p>FYI, I've tried #AARRGGBB it doesn't change anything. If i use the exact same android:background=""#FFFFFF"" in any layout file it works great. I just don't know why it's not working here :/</p>","393373","","","","","2010-07-22 06:37:54","Settings.xml won’t let me change background color?","<java><android><xml><background><settings>","1","0","1","",""
"3305994","1","","","2010-07-22 05:25:42","3","2679","<p>I have a question regarding the  tag. Actually I am new to the Android Programming and I want to use the Concept of Reusability in my Application at several places. I get to know that it is possible by the  tag but I don't know how to use that. I have refered some of it's examples from the net but didn't found them quite satisfactory.</p><p>Can anybody please make me understand it with a Clear and appearant example!</p><p>Thanksjohn</p>","384176","","","","","2013-05-23 16:00:27","include tag in xml file of Android Programming","<android><xml>","1","0","3","",""
"3306301","1","","","2010-07-22 06:29:39","3","4712","<p>I'm testing out a web page on the Android 2.0 and 2.2 emulators, and the jQuery.ajax() requests that the app makes have slightly different behaviors regarding HTTP Authentication Headers.</p><p>The server I'm making requests to requires basic authentication, and the ajax requests in 2.2 send the proper auth header. In 2.0, I am debugging with Fiddler, and it seems that the requests do not include the auth header, and the server rejects the request with a 401.2 error. I don't think it matters, but the server is running IIS 7.</p><p>One interesting thing I noticed while debugging the web requests is that Android 2.2 makes two requests for each resource, whether or not it's an XHR. One does not contain the Auth header, and the second one does. In 2.0, it seems to make 2 requests for everything but XHR's: </p><p>Here is the 2.2 header for the first XHR:</p><pre><code>GET http://192.168.1.111/sonar/mobileweb/sonar/views/week/init.ejs HTTP/1.1Host: 192.168.1.111Accept-Encoding: gzipReferer: http://192.168.1.111/sonar/mobileweb/sonar/sonar.htmlAccept-Language: en-USUser-Agent: Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1Accept: text/plain, */*X-Requested-With: XMLHttpRequestAccept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7</code></pre><p>The 2.2 header for the second XHR:</p><pre><code>GET http://192.168.1.111/sonar/mobileweb/sonar/views/week/init.ejs HTTP/1.1Host: 192.168.1.111Accept-Encoding: gzipReferer: http://192.168.1.111/sonar/mobileweb/sonar/sonar.htmlAccept-Language: en-USUser-Agent: Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1Authorization: Basic cGFyaXZlZGFcZGF2aWQubW9ycmlzOjIzbkx2ZWxsbGw=Accept: text/plain, */*X-Requested-With: XMLHttpRequestAccept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7</code></pre><p>And the 2.0 header:</p><pre><code>GET http://192.168.1.111/app/views/week/init.ejs HTTP/1.1Host: 192.168.1.111Accept-Encoding: gzipReferer: http://192.168.1.111/app/app.htmlAccept-Language: en-USUser-Agent: Mozilla/5.0 (Linux; U; Android 2.0; en-us; sdk Build/ECLAIR) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17Accept: text/plain, */*X-Requested-With: XMLHttpRequestAccept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7</code></pre><p>Has anyone experienced this behavior before? It is basically causing my app to not work at all in version 2.0. Version 2.1 seems to act the same as 2.0.</p><p>Let me know if you have any ideas, thanks for your help,</p><p>Dave</p>","255311","","","","","2014-03-25 17:55:17","How AJAX requests work on Android 2.0 vs. Android 2.2","<jquery><android><ajax>","1","1","1","",""
"3306380","1","3306441","","2010-07-22 06:44:56","0","260","<p>I m developing a card game in android.i need to show three cards out of 52 cards by button click through  animation which should be random cards.</p><p>so how can i do that?</p>","383597","","114066","","2010-07-22 06:47:45","2010-07-22 06:53:09","Android random object","<java><android>","1","0","","",""
"3306390","1","","","2010-07-22 06:46:42","8","1332","<p>I want to know about how to send email with attachment using GmailSender in android.</p>","398782","","","","","2011-06-16 16:43:14","How to send email with attachment using GmailSender in android","<android>","2","1","1","",""
"3306472","1","","","2010-07-22 06:59:09","1","341","<p>I have one weird issue. I have developed application (Android 1.5) which does not recreates itself on changing screen orientation (android:configChanges=""orientation|keyboardHidden"") and do nothing on configChange method (just to forbid recreating activity), but some of my special views lost possibility to handle onClick events, futhermore they are still available for focus and for activating them via Enter key pressing, but not for clicks. And one more, onclick functionality is being restored when I change orientation back. You can easyly reproduce this issue on Quattro banner (http://www.quattrowireless.com/about_quattro/press_releases_detail/quattro_launches_new_android_ad_kit/%20).</p>","398798","","398798","","2010-07-22 07:57:23","2010-07-22 07:57:23","View does not handle click events after changing screen orientation","<android><onclick><screen><orientation><handle>","0","3","","",""
"3306501","1","","","2010-07-22 07:04:27","7","2301","<p>I put a webview in my application to visit a webpage which includes some javascript functions, my purpose is when users click a link in the webpage, it will start a new activity in the application. I've written ""webSettings.setJavaScriptEnabled(true);"" in my source codes.</p><p>It works well in most of the time, however sometimes it doesn't work, there is no response when users click, and I don't know why because the environment is not changed at all. Has anybody know why?</p>","390159","","","","","2013-01-21 20:37:08","JavaScript sometimes doesn't work in android's webview","<javascript><android><webview>","2","0","","",""
"3306507","1","3306645","","2010-07-22 07:05:07","2","654","<p>My immediate need is to take a peek at the source for EditTextPreference and see what I need to do to implement support for preferences with more structure. Can I run Git or repo under cygwin perhaps? Is there an easier way?</p>","267257","","","","","2012-05-14 14:05:18","Easy way for Windows-based developer to view Android framework source code?","<android><windows><open-source><frameworks>","5","0","","",""
"3306639","1","6157686","","2010-07-22 07:28:16","13","4028","<p>I am developing a set of apps that are distinguished only in certain brandings (think different sports teams); however, I am running into a problem where I am using one Library project for all of the specifically branded apps and want to use the same ContentProvider for all of them. When I created the ContentProvider I declared the AUTHORITY as a constant in the class (per the dev example code) and I am using the same authority in every specific app in the manifest files. It looks like I can't use the same authority across every app as I get this error when trying to install a second app (I install one branded one just fine but the second install):</p><pre><code>WARN/PackageManager(66): Can't install because provider name com.xxx.Provider (in package com.xxx) is already used by com.zzz</code></pre><p>I've tried several approaches but none of them seem to work. One idea that I haven't done yet, was to create a library jar and just omit the Provider class I have and customize it in each specific app. Any ideas on how to get around this problem without resorting to that?</p>","398811","","","","","2014-01-12 00:41:42","Multiple Apps use same content provider","<android><android-contentprovider>","2","1","5","",""
"3306828","1","3465790","","2010-07-22 07:59:53","2","809","<p>In it's simplest explanation, I'm making a really small ""interactive movie"" app on Android.  </p><p>In a nut shell, when the app is loaded, it will play a short movie (maybe a few seconds at most @ 12-24fps).  I will then have 2 buttons displayed on the screen, and depending on what button is pressed, it I will play another short movie (5-10 seconds).  While waiting for the user to make a decision, the movie will be looping.</p><p>The movie source is stop-motion photography so it's already chopped up into frames.</p><p>My question here is if I should use a Frame Animation technique, or if I should use a Movie player for this.  All in all perhaps there's less than 100 still frames that make up the stop-motion.  I was going to go the Frame Animation route, but I wasn't sure if having so many individual frames would kill the app so I thought I'd post here to see if anyone had any insight.</p><p>Thanks!</p>","107459","","","","","2010-08-12 08:05:38","Frame Animation or Movie file for short interactive ""movie"" Android Application","<android><animation><frame><movieplayer>","1","0","1","",""
"3306950","1","","","2010-07-22 08:16:49","2","651","<p>I created a custom map in Google Maps ""My Maps"". Now I want to show that map on an android device, but not just opening it as a web page but showing it using MapView or smth similar. I want to be able to center on a place I have marked on the map etc. My custom map is a map containing the location of all gas stations in a city.</p><p>Can someone please point me to the right direction or to an article describing this (I couldn't find anything).</p>","398852","","1108213","","2012-03-08 12:04:04","2012-03-08 12:04:04","Show Google my maps on android device","<android>","1","0","1","",""
"3306984","1","3307780","","2010-07-22 08:22:52","6","4772","<p>I have started my GPS programmatically byIntent myIntent = new intent(Settings.ACTION_SECURITY_SETTINGS);mContext.startActivity(myIntent);</p><p>How i will turn Off GPS when i exit from my program...</p>","362088","","243782","","2010-07-22 09:52:52","2012-07-31 00:10:43","Turn off GPS programmatically when i exit my program","<android><gps>","1","0","2","",""
"3306987","1","6780820","","2010-07-22 08:23:11","5","97","<p>I searching a way how to disable the opening and closing animation of notification bar (status bar). The behavior and animation is hardcoded in <code>StatusBarService</code>. The documentation says that the StatusBarService is ""semi-public"". What does ""semi-public service"" mean?</p>","121968","","","","","2011-07-21 18:25:54","What does ""semi-public service"" mean in Android?","<java><android><service>","1","0","0","",""
"3307011","1","3307169","","2010-07-22 08:25:57","0","1665","<p>I'm new in Android development and I've a problem when I create my new activity.</p><p>I want to use my activity before start it. For example, I have try it:</p><pre><code>MyActivity menu = new MyActivity();menu.setXmppreception(reception);Intent intent = new Intent(Screen.this,MyActivity.class);Screen.this.startActivity(intent);</code></pre><p>But, my ""menu"" and ""MyActivity.class"" aren't the same instance. Consequently I have try it:</p><pre><code>MyActivity menu = new MyActivity();menu.setXmppreception(reception);Intent intent = new Intent(Screen.this,menu);Screen.this.startActivity(intent);</code></pre><p>But it doesn't work...Have you a solution for help me?</p><p>Thanks for help and sorry for the bad english.</p>","398849","","","","","2010-07-22 08:50:15","Action before startActivity()","<java><android><activity><android-intent>","2","0","","",""
"3307039","1","","","2010-07-22 08:30:35","6","25606","<p>I have a radio button group in Android which looks something like:</p><p>Choose Color:</p><ul><li>Red</li><li>Blue</li><li>Orange</li><li>Green</li></ul><p>I need to get selected radio button and also its value. </p><p>I have 4 radiobuttons in this manner within radiogroup <code>rg</code></p><pre><code>rb1a=(RadioButton)findViewById(R.id.rb1a);rb1b=(RadioButton)findViewById(R.id.rb1b);rb1c=(RadioButton)findViewById(R.id.rb1c);rb1d=(RadioButton)findViewById(R.id.rb1d);tv1=(TextView)findViewById(R.id.tv1);next1=(Button)findViewById(R.id.next1);rg=(RadioGroup)findViewById(R.id.rg);// I have error after this line.please helprg.setOnCheckedChangeListener(new OnCheckedChangeListener(){    public void onCheckedChanged(RadioGroup group, int checkedId)    {    }    @Override    public void onCheckedChanged(CompoundButton arg0, boolean arg1) {        // TODO Auto-generated method stub    }});</code></pre>","397969","","133203","","2010-07-22 09:51:47","2012-08-16 15:40:46","Android Radio Button","<android><radio-button>","2","2","0","",""
"3307090","1","3307132","","2010-07-22 08:39:28","29","76898","<p>using theme or ImageView ?</p>","281887","","","","","2013-09-01 11:58:42","how to add background image to activity?","<android><image><background>","3","0","1","",""
"3307196","1","","","2010-07-22 08:53:52","0","69","<p>In your answer</p><p><a href=""http://stackoverflow.com/questions/1617524/writing-a-portable-java-application-using-jogl-and-android-opengl/1627609#1627609"">http://stackoverflow.com/questions/1617524/writing-a-portable-java-application-using-jogl-and-android-opengl/1627609#1627609</a></p><p>can you please tell me how to automatically work out which platform you are running on.</p><p>Thank you very much</p>","398872","","","","","2010-07-22 09:33:07","portable java application","<java><android>","1","1","","",""
"3307213","1","3328334","","2010-07-22 08:56:50","10","9319","<p>I've tried to find the NumericUpDown button in Android, but failed. Do you know what the controller is called in Android - please let me know!</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;!--  main.xml  7/22 2010 --&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" &gt; &lt;GridView   android:id=""@+id/GridView""   android:layout_width=""fill_parent""    android:layout_height=""fill_parent""  android:numColumns=""3""  android:verticalSpacing=""10dp""  android:horizontalSpacing=""10dp""  android:columnWidth=""90dp""  android:stretchMode=""columnWidth""  android:gravity=""center""  android:background=""@color/white""  &gt; &lt;/GridView&gt; &lt;ButtonUpDown&gt;  &lt;!-- The real name is??? --&gt; &lt;/ButtonUpDown&gt;&lt;/LinearLayout&gt;</code></pre><p>Thanx for your time<strong>Edit:</strong> </p><p>The controller looks like this:<img src=""http://www.skogberg.eu/img/numUpDown.png"" alt=""Numeric up down""></p>","286244","","286244","","2010-07-22 15:36:18","2012-12-07 15:59:47","Android having NumericUpDown Button?","<android><layout><numericupdown>","5","0","1","",""
"3307237","1","3307565","","2010-07-22 09:00:07","21","18696","<p>I have a Service that is downloading a file from a server. I warn the user to only download the file over Wireless LAN before the download starts. </p><p>My problem is that my download gets stuck if I loose the network connection. Is there a way to listen for changes in network connection or if it is lost entirely?</p>","114066","","","","","2012-11-09 05:21:39","How can I monitor the network connection status in Android?","<android><networking>","1","0","22","",""
"3307263","1","","","2010-07-22 09:03:22","1","1134","<p>I am working on a project that uses the Bluetooth HID profile. I understand that the BlueZ stack in android has the HID support but its not extended to app layer by Android Framework.</p><p>My main concern is to understand the driver level flow for a Bluetooth HID device.I would like to add a new HID device driver that can handle the key events from bluetooth HID device and pass it on to the Input subsystem.</p><p>Any help would be appriciated!!</p><p>thanks </p>","398880","","","","","2011-10-20 15:31:46","[BT][HID] How is a Bluetooth HID connection handled in Ubuntu or android","<android><bluetooth><hid>","1","0","1","",""
"3307267","1","3310376","","2010-07-22 09:03:54","27","27434","<p>I am displaying some data in a ScrollView. On activity startup (method onCreate) I fill the ScrollView with data and want to scroll to the bottom.</p><p>I tried to use <code>getScrollView().fullScroll(ScrollView.FOCUS_DOWN)</code>. This works when I make it as an action on button click but it doesn't work in the onCreate method.</p><p>Is there any way how to scroll the ScrollView to the bottom on activity startup? That means the view is already scrolled to the bottom when first time displayed.</p>","285174","","","","","2013-10-31 10:02:33","How to scroll to bottom in a ScrollView on activity startup","<android><scroll>","5","1","7","",""
"3307390","1","9200288","","2010-07-22 09:25:03","10","1316","<p>I have a custom view subclassed from GridView that I use in order to display some custom 3D animation/effect. The way I do this is by overriding <code>dispatchDraw()</code>.</p><p>Ideally, I'd want to know the current speed of the scrolling when doing the draw. Currently, I use <code>GestureDetector.OnGestureListener</code> and capture <code>onScroll</code> events and this works very well, except that it doesn't also detect flings as scrolling events.</p><p>One idea that comes to mind would be to capture <code>onFling</code> events and then do future processing on my own in order to detect the speed at a later time.</p><p>Is there any better way to achieve this? Any simple way to query the current scrolling speed of a GridView?</p><p>Thanks.</p>","208706","","","","","2012-02-10 22:24:43","Detect GridView scrolling speed - Android","<android>","1","1","2","",""
"3307470","1","","","2010-07-22 09:36:14","-1","214","<p>I have two EditTexts within a LinearLayout.</p><p>I want these to take half of the screen width each.  I have been playing with layout weight but and layout width to wrap content but the fields resize based on their inputs length.</p><p>Any ideas?</p>","398915","","1228","","2010-07-22 13:13:59","2010-07-22 14:39:14","Give two linea input fields the same fixed width, 50% of screen","<android><gui>","1","2","","",""
"3307621","1","3307685","","2010-07-22 09:57:02","4","17793","<p>I am working on an application specifically for Samsung Galaxy S(I am not the one making decision here) and they want its layout to be pixel-precise accurate.Can I just use normal 2.1 AVD?</p><p>So I tried creating WQVGA432 but it looks like this. I'm not sure why the LinearLayout does not fill up the screen but only use up to the large images with Korean (which I can't scale down, but that's different question).</p><p><img src=""http://i137.photobucket.com/albums/q219/RobGThai/wqvga432.png"" alt=""WQVGA432""></p><p>This is main.xml:</p><blockquote>  <p>  <pre><code>&lt;RelativeLayout     android:id=""@+id/ui_navBar""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:background=""#FF333333""    &lt;!-- This is navigation panel at the top of the page --&gt;    &lt;!-- Top-Left Button, aka Back button --&gt;    &lt;FrameLayout android:id=""@+id/ui_topLeftBox""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentLeft=""true""        android:layout_centerVertical=""true""&gt;    &lt;/FrameLayout&gt;</code></pre></blockquote><pre><code>    &lt;!-- Screen name --&gt;    &lt;FrameLayout android:id=""@+id/ui_topBox""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_centerHorizontal=""true""        android:layout_centerVertical=""true""&gt;    &lt;/FrameLayout&gt;    &lt;!-- Top-Right Button, aka Forward button --&gt;    &lt;FrameLayout android:id=""@+id/ui_topRightBox""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentRight=""true""        android:layout_centerVertical=""true""&gt;    &lt;/FrameLayout&gt;&lt;/RelativeLayout&gt;&lt;FrameLayout    android:id=""@+id/ui_contentView""    android:layout_width=""fill_parent""     android:layout_height=""0dip""    android:paddingTop=""0px""     android:layout_weight=""1""&gt;    &lt;!-- Main View --&gt;     &lt;RelativeLayout        android:id=""@+id/mainView""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;RelativeLayout             android:id=""@+id/topBanner""            android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_alignParentTop=""true""            android:background=""#FFFFCC00""            &gt;            &lt;TextView android:textSize=""20sp""                 android:textColor=""#FF000000""                android:text=""EUR/USD""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_alignParentLeft=""true""                android:layout_centerVertical=""true""            /&gt;        &lt;/RelativeLayout&gt;        &lt;RelativeLayout            android:id=""@+id/view1""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_below=""@+id/topBanner""            android:background=""#FF444444""&gt;            &lt;CheckBox android:id=""@+id/cbx1""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_centerVertical=""true""                android:layout_alignParentLeft=""true""            /&gt;            &lt;com.vg.library.NumericInput                 android:id=""@+id/val1Nip""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_centerVertical=""true""                android:layout_toRightOf=""@+id/cbx1""                 /&gt;        &lt;/RelativeLayout&gt;        &lt;com.vg.library.NumericInput             android:id=""@+id/val2Nip""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_below=""@+id/view1"" /&gt;        &lt;TextView android:layout_width=""wrap_content""            android:layout_height=""wrap_content""             android:text=""Screen01""            android:layout_below=""@+id/val2Nip""            android:layout_alignParentLeft=""true"" /&gt;    &lt;/RelativeLayout&gt;&lt;/FrameLayout&gt;&lt;!-- ExpandBar --&gt;&lt;RelativeLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    &gt;    &lt;ImageView         android:id=""@+id/ui_expandBar""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:src=""@drawable/bar""        android:background=""#0000""    /&gt;    &lt;FrameLayout        android:id=""@+id/ui_drawerView""        android:visibility=""gone""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:paddingTop=""0px""         android:layout_weight=""1""        android:layout_below=""@+id/ui_expandBar""&gt;        &lt;RelativeLayout            android:id=""@+id/ui_drawerContent""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:background=""#FF550000"" &gt;            &lt;RelativeLayout            android:id=""@+id/m1""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:background=""#FF550000"" &gt;            &lt;CheckBox android:id=""@+id/cbxB""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_centerVertical=""true""                android:layout_alignParentLeft=""true""            /&gt;            &lt;com.vg.library.NumericInput                 android:id=""@+id/valBNip""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_centerVertical=""true""                android:layout_toRightOf=""@+id/cbxB""                 /&gt;            &lt;/RelativeLayout&gt;        &lt;/RelativeLayout&gt;    &lt;/FrameLayout&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout     android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:background=""#FF333333""    android:layout_weight=""0""    android:layout_gravity=""bottom""    &gt;    &lt;!-- This is menu panel at the bottom of the page --&gt;    &lt;com.vg.library.MenuBar         android:id=""@+id/ui_menuBar""        android:orientation=""horizontal""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_centerHorizontal=""true""        android:layout_centerVertical=""true""        android:background=""#FFAAAA00""        &gt;        &lt;!-- All menu item should go here --&gt;    &lt;/com.vg.library.MenuBar&gt;&lt;/RelativeLayout&gt;</code></pre><p></p>","271736","","271736","","2010-07-22 11:08:20","2012-12-04 16:55:05","How to create AVD that represent Samsung Galaxy S in Eclipse emulator?","<android>","3","0","2","",""
"3307826","1","3308606","","2010-07-22 10:22:41","2","2583","<p>In my android application, I create shortcuts by code to some activities within my application. I do this feature by using the broadcast:</p><pre><code>    intent.setAction(""com.android.launcher.action.INSTALL_SHORTCUT"");    sendBroadcast(intent);</code></pre><p>and that's cool, that really work!</p><p>Now I would like to do something different: I have seen that some actions can ""register"" somewhere to be added in the Android menu, when you long press on the Home like this one:</p><p><a href=""http://www.androidtapp.com/wp-content/uploads/2010/02/UltimateFaves-Add-Home-Screen-Shortcut.jpg"" rel=""nofollow"">http://www.androidtapp.com/wp-content/uploads/2010/02/UltimateFaves-Add-Home-Screen-Shortcut.jpg</a></p><p>So my main question is the next one:</p><p>How is that possible to register for this menu. I guess there is some line to add in the manifest, but cannot see where to do that!</p><p>Thank a lot for any help!</p><p>BTW, there is a secondary question: once i will have succeed doing that, may I add a different number of shortcuts in my menu ( imagine That I would like to do that for a multi-account twitter client, I would like to see a different for each twitter account in this list.) So the number of shortcut is programmaticaly computed.</p>","327402","","","","","2011-01-17 07:42:08","Adding his application to the ""add to Home screen""/""Shortcut"" section","<android><manifest><shortcuts>","2","0","1","",""
"3307921","1","","","2010-07-22 10:39:40","0","972","<p>I have been working on an app, which basically consists of imagebuttons.</p><p>I want to achieve the push button effect with imagebutton.</p><p>Is it possible to achieve..</p>","395563","","","","","2010-07-22 10:46:05","Push button effect with Imagebutton","<android>","1","0","","",""
"3307926","1","","","2010-07-22 10:40:07","2","2100","<p>I am using the AVD manager in eclipse.  Is there a setting that I can use to stop the on screen keyboard appearing when an input field has focus?</p><p>I tried has hardware keyboard = true, but then the emulator doesn't seem to start at all :-S</p>","398971","","","","","2012-08-06 13:43:19","Stop on screen keyboard appearing for Android Emulator?","<android><android-emulator><avd>","1","0","1","",""
"3308010","1","3308059","","2010-07-22 10:50:20","13","9675","<p>I am new to Android and am using the <code>Ical4j</code> library for parsing ICS (Outlook calendar) files.</p><p>However, when I build my application in Eclipse, the following warning appears many times in the console:</p><blockquote>  <p>[2010-07-22 15:58:31 - Google Calendar Upload] warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)</p></blockquote><p>Which implications does this have? How can I resolve this?</p>","398981","","154306","","2013-05-03 15:49:05","2013-05-03 15:49:05","What is the ""Ignoring InnerClasses attribute"" waning outputted during compilation?","<android><compiler-warnings>","2","0","2","",""
"3308336","1","","","2010-07-22 11:32:14","3","8786","<p>I am a newbie in Android development. I try to write something to a file.I am using the code:</p><pre><code>try {                    FileOutputStream fOut = openFileOutput(                            ""out.txt"", MODE_WORLD_READABLE);                    OutputStreamWriter osw = new OutputStreamWriter(fOut);                    osw.write(""something"");                    osw.flush();                    osw.close();                    fOut.close();                } catch (MalformedURLException e) {                    Log.e(""FILE WRITE ERROR"", e.getMessage());                } catch (IOException e) {                    Log.e(""FILE WRITE ERROR"", e.getMessage());                }</code></pre><p>Everything it's ok but I can't find the file in DDMS FIle Explorer. Could you help me and tell me where Android saves the file? It isn't in ""/data/data/my_project_package"".Thank you.</p>","387647","","","","","2012-12-06 12:17:29","Android write to file - can't find file","<android>","3","0","","",""
"3308503","1","3308564","","2010-07-22 11:53:02","1","919","<p>Is there a method (like onDestroy() or onPause() for example) that is only called if I press the Home Button on my device?</p>","","anon","15825","","2010-10-11 08:20:07","2010-10-11 08:20:38","Which methods are called only if I press the Home Button?","<android>","1","0","","",""
"3308516","1","3308525","","2010-07-22 11:54:55","3","812","<p>Actually I have 52 images which r basically cards.images names are from 1 to 52.</p><p>when I put all the 52 images in my drawable folder then it is showing an error in <code>R.java</code> file which is:</p><blockquote>  <p>Syntax error on token ""image name(any  between between 1 to 52)"", invalid  VariableDeclaratorId</p></blockquote><p>what is the problem?</p><hr><p>thanks for replying.</p><p>i think u didnt get my problem.</p><p>i have given name to my cards from 1 to 52 because i need to randomly select one card from it.</p>","383597","","1288","","2011-08-30 03:26:18","2011-08-30 03:26:18","android Image problem","<android><image>","3","0","1","",""
"3308587","1","","","2010-07-22 12:03:27","1","512","<p>Am working on screen capture in android mobile..As of now am able to capture my application screen..But my requirement is my application should run in background and should capture the main menu screen and home screen and etc..</p>","399046","","399046","","2010-07-23 10:22:44","2011-11-11 12:23:30","screen shot in android","<android>","1","2","1","",""
"3308716","1","5074162","","2010-07-22 12:18:46","4","911","<p>my app has a <code>styles.xml</code> file with various visual constants defined.</p><p>I'd like my users to be able to switch the entire app to an alternative visual theme. I'd like to provide an alternative <code>styles2.xml</code> file and switch at runtime (via the Settings).</p><p>Is this possible, and how? I suspect the style names' appearance in the generated R class does not bode well.</p><p>If it's not possible, what's my next best option?</p>","82515","","","","","2012-05-22 16:20:36","Switch a whole application to alternative ""styles.xml"" files at run time?","<android>","4","1","2","",""
"3308799","1","3308894","","2010-07-22 12:28:15","1","599","<p>I am working on an application thats captures all the keys that are being pressed.As of now I can capture the keys in application.But how can I capture the keys while the application is running in android.I am aware of services concept, but am unable to capture the keys while application in running in background.</p>","399046","","244296","","2010-07-22 12:33:26","2010-07-22 12:38:18","key capture in android","<android>","1","0","","",""
"3308930","1","3308988","","2010-07-22 12:43:42","1","942","<p>Let's say I have 2 files on Desktop: (Note that I have another file than .apk application.)</p><ul><li>.apk file</li><li>.zip file (wich contains a large of data that .apk must unizp and do some work with it).</li></ul><p>I want to plug an Android device and <strong>programmatically</strong> copy these both files to Android. </p><p>The application must be visible to user and the .zip file must be ""visible"" to the application, wich will unzip it and do some work with it.</p><p>With PalmOS, I use HotSync API. With WinMobile I use ActiveSync (rapi) API. How to do it on Android?</p>","112670","","213269","","2010-07-22 12:46:40","2011-04-18 06:24:08","How to programmatically ""install"" files on Android device","<android>","1","0","","",""
"3308975","1","3309066","","2010-07-22 12:49:55","17","8552","<p>Is it possible to have a button in a Toast?  </p><p>In theory, yes because you can build a custom Toast from a layout in XML, but I tried to put a button in it and couldn't get it to register the click.Did anyone manage to do something like that?</p>","263521","","56285","","2014-02-20 13:03:21","2014-02-24 21:15:30","Button in custom Android Toast?","<android><button><android-button><toast>","4","0","1","",""
"3309043","1","","","2010-07-22 12:57:41","0","447","<p>I have a doubt, I don't know how to retrieve the key from the shared preference?</p>","399080","","366898","","2012-07-17 10:48:25","2012-07-17 10:48:25","How to retrieve the key from the shared preference","<android><sharedpreferences>","1","0","1","",""
"3309184","1","","","2010-07-22 13:12:53","1","746","<p>I have used the Java Sax parser, but am trying to implement Android's with this XML.</p><pre><code>&lt;?xml version=""1.0""  encoding=""utf-8""?&gt;&lt;adc_database xmlns=""http://www.weather.com""&gt;    &lt;units&gt;        &lt;temp&gt;F&lt;/temp&gt;        &lt;dist&gt;MI&lt;/dist&gt;        &lt;speed&gt;MPH&lt;/speed&gt;        &lt;pres&gt;IN&lt;/pres&gt;        &lt;prec&gt;IN&lt;/prec&gt;    &lt;/units&gt;&lt;local&gt;&lt;city&gt;State College&lt;/city&gt; &lt;adminArea&gt;Pennsylvania&lt;/adminArea&gt;     &lt;country code=""US""&gt;United States&lt;/country&gt;&lt;lat&gt;40.803&lt;/lat&gt; &lt;lon&gt;-77.894&lt;/lon&gt; &lt;time&gt;14:35&lt;/time&gt; &lt;timeZone&gt;-5&lt;/timeZone&gt;&lt;obsDaylight&gt;1&lt;/obsDaylight&gt;  &lt;/local&gt;            &lt;watchwarnareas zone=""PAZ019"" county=""PAC027"" isactive=""1""&gt;                    &lt;warningtype&gt;SEVERE THUNDERSTORM WATCH&lt;/warningtype&gt;                &lt;url&gt;http://www.weather.com/watches-warnings.asp&lt;/url&gt;            &lt;/watchwarnareas&gt;    &lt;currentconditions daylight=""True""&gt;            &lt;url&gt;http://www.weather.com&lt;/url&gt;            &lt;observationtime&gt;2:35 PM&lt;/observationtime&gt;            &lt;temperature&gt;84&lt;/temperature&gt;            &lt;realfeel&gt;90&lt;/realfeel&gt;            &lt;humidity&gt;61%&lt;/humidity&gt;            &lt;weathericon&gt;07&lt;/weathericon&gt;            &lt;windgusts&gt;16&lt;/windgusts&gt;            &lt;windspeed&gt;8&lt;/windspeed&gt;            &lt;winddirection&gt;WNW&lt;/winddirection&gt;            &lt;visibility&gt;10&lt;/visibility&gt;    &lt;/currentconditions&gt;        &lt;mapSpace&gt;        &lt;image resolution=""480x480"" url=""http://vortex.png""/&gt;        &lt;/mapSpace&gt;        &lt;forecast&gt;                &lt;url&gt;http://www.weather.com/forecast.asp&lt;/url&gt;                &lt;day number=""1""&gt;                        &lt;url&gt;http://www.weather.com/&lt;/url&gt;                &lt;obsdate&gt;7/21/2010&lt;/obsdate&gt;                &lt;daycode&gt;Wednesday&lt;/daycode&gt;                    &lt;sunrise&gt;5:59 AM&lt;/sunrise&gt;                    &lt;sunset&gt;8:37 PM&lt;/sunset&gt;                &lt;daytime&gt;                        &lt;weathericon&gt;17&lt;/weathericon&gt;                        &lt;hightemperature&gt;85&lt;/hightemperature&gt;                        &lt;lowtemperature&gt;63&lt;/lowtemperature&gt;                        &lt;realfeelhigh&gt;93&lt;/realfeelhigh&gt;                        &lt;realfeellow&gt;65&lt;/realfeellow&gt;                        &lt;windspeed&gt;8&lt;/windspeed&gt;                        &lt;winddirection&gt;W&lt;/winddirection&gt;                        &lt;windgust&gt;32&lt;/windgust&gt;                        &lt;rainamount&gt;0.01&lt;/rainamount&gt;                        &lt;snowamount&gt;0.0&lt;/snowamount&gt;                        &lt;iceamount&gt;0.00&lt;/iceamount&gt;                        &lt;tstormprob&gt;91&lt;/tstormprob&gt;                &lt;/daytime&gt;                &lt;nighttime&gt;                        &lt;weathericon&gt;35&lt;/weathericon&gt;                        &lt;hightemperature&gt;85&lt;/hightemperature&gt;                        &lt;lowtemperature&gt;63&lt;/lowtemperature&gt;                        &lt;realfeelhigh&gt;93&lt;/realfeelhigh&gt;                        &lt;realfeellow&gt;65&lt;/realfeellow&gt;                        &lt;windspeed&gt;4&lt;/windspeed&gt;                        &lt;winddirection&gt;W&lt;/winddirection&gt;                        &lt;windgust&gt;10&lt;/windgust&gt;                        &lt;rainamount&gt;0.20&lt;/rainamount&gt;                        &lt;snowamount&gt;0.0&lt;/snowamount&gt;                        &lt;iceamount&gt;0.00&lt;/iceamount&gt;                        &lt;tstormprob&gt;24&lt;/tstormprob&gt;                &lt;/nighttime&gt;            &lt;/day&gt;            &lt;day number=""2""&gt;                        &lt;url&gt;http://www.weather.com&amp;amp;fday=2&lt;/url&gt;                &lt;obsdate&gt;7/22/2010&lt;/obsdate&gt;                &lt;daycode&gt;Thursday&lt;/daycode&gt;                    &lt;sunrise&gt;6:00 AM&lt;/sunrise&gt;                    &lt;sunset&gt;8:37 PM&lt;/sunset&gt;                &lt;daytime&gt;                        &lt;weathericon&gt;02&lt;/weathericon&gt;                        &lt;hightemperature&gt;86&lt;/hightemperature&gt;                        &lt;lowtemperature&gt;63&lt;/lowtemperature&gt;                        &lt;realfeelhigh&gt;87&lt;/realfeelhigh&gt;                        &lt;realfeellow&gt;65&lt;/realfeellow&gt;                        &lt;windspeed&gt;8&lt;/windspeed&gt;                        &lt;winddirection&gt;W&lt;/winddirection&gt;                        &lt;windgust&gt;19&lt;/windgust&gt;                        &lt;rainamount&gt;0.00&lt;/rainamount&gt;                        &lt;snowamount&gt;0.0&lt;/snowamount&gt;                        &lt;iceamount&gt;0.00&lt;/iceamount&gt;                        &lt;tstormprob&gt;0&lt;/tstormprob&gt;                &lt;/daytime&gt;                &lt;nighttime&gt;                        &lt;weathericon&gt;42&lt;/weathericon&gt;                        &lt;hightemperature&gt;86&lt;/hightemperature&gt;                        &lt;lowtemperature&gt;63&lt;/lowtemperature&gt;                        &lt;realfeelhigh&gt;87&lt;/realfeelhigh&gt;                        &lt;realfeellow&gt;65&lt;/realfeellow&gt;                        &lt;windspeed&gt;2&lt;/windspeed&gt;                        &lt;winddirection&gt;N&lt;/winddirection&gt;                        &lt;windgust&gt;8&lt;/windgust&gt;                        &lt;rainamount&gt;0.00&lt;/rainamount&gt;                        &lt;snowamount&gt;0.0&lt;/snowamount&gt;                        &lt;iceamount&gt;0.00&lt;/iceamount&gt;                        &lt;tstormprob&gt;40&lt;/tstormprob&gt;                &lt;/nighttime&gt;            &lt;/day&gt;</code></pre><p>I am going off of the example at this URL (<a href=""http://www.ibm.com/developerworks/opensource/library/x-android/index.html%29"" rel=""nofollow"">http://www.ibm.com/developerworks/opensource/library/x-android/index.html</a></p><p>I am not sure how I grab different levels within the XML.  I have a WeatherData class that stores all the info that I need:</p><pre><code>public class WeatherData {//instance data@SuppressWarnings(""unused"")private final String DEB_TAG = ""WeatherData.java"";public Location location;public Current current;public List&lt;Forecast&gt; forecast;public WeatherData(){    location    = new Location();    current     = new Current();    forecast    = new ArrayList&lt;Forecast&gt;();}public class Location {    public String time;    public String city;    public String state;    public Location(){    }    public Location(String time, String city, String state){        this.time   = time;        this.city   = city;        this.state  = state;    }    public String getTime() {        return time;    }    public void setTime(String time) {        this.time = time;    }    public String getCity() {        return city;    }    public void setCity(String city) {        this.city = city;    }    public String getState() {        return state;    }    public void setState(String state) {        this.state = state;    }}public class Current {    public String temp;    public String realfeel;    public String humidity;    public String icon;    public String getTemp() {        return temp;    }    public void setTemp(String temp) {        this.temp = temp;    }    public String getRealfeel() {        return realfeel;    }    public void setRealfeel(String realfeel) {        this.realfeel = realfeel;    }    public String getHumidity() {        return humidity;    }    public void setHumidity(String humidity) {        this.humidity = humidity;    }    public String getIcon() {        return icon;    }    public void setIcon(String icon) {        this.icon = icon;    }    public Current(){    }    public Current(String temp, String realfeel, String humidity, String icon){        this.temp       = temp;        this.realfeel   = realfeel;        this.humidity   = humidity;        this.icon       = icon;        Log.d(""DEB_TAG"", ""Value of temp inside Current is "" + temp);    }}public class Forecast{    // Forecast member variables    public String day_d;    public String icon_d;    public String high_d;    public String low_d;    public String obsDate_d;    public String getDay_d() {        return day_d;    }    public void setDay_d(String dayD) {        day_d = dayD;    }    public String getIcon_d() {        return icon_d;    }    public void setIcon_d(String iconD) {        icon_d = iconD;    }    public String getHigh_d() {        return high_d;    }    public void setHigh_d(String highD) {        high_d = highD;    }    public String getLow_d() {        return low_d;    }    public void setLow_d(String lowD) {        low_d = lowD;    }    public String getObsDate_d() {        return obsDate_d;    }    public void setObsDate_d(String obsDateD) {        obsDate_d = obsDateD;    }}public Forecast createForecast(){    return new Forecast();}</code></pre><p>}</p><p>What I am not understanding is how to step into the different levels of my XML.  I have my root tag adc_database that contains my opening and closings of LOCAL, CURRENTCONDITIONS, and FORECAST, where FORECAST has multiple daily forecasts. Here is my code so far...</p><pre><code>public class AndroidSaxFeedParser extends BaseFeedParser {    public AndroidSaxFeedParser(String feedUrl) {        super(feedUrl);    }    public List&lt;WeatherData&gt; parse() {        final WeatherData currentData       = new WeatherData();        RootElement root                    = new RootElement(""rss"");        final List&lt;WeatherData&gt; conditions  = new ArrayList&lt;WeatherData&gt;();        Element adc_database                = root.getChild(""adc_database"");        Element item                        =  adc_database.getChild(LOCAL);        item.setEndElementListener(new EndElementListener(){            public void end() {                conditions.add(currentData.copy());            }        });        item.getChild(CITY).setEndTextElementListener(new EndTextElementListener(){            public void end(String body) {                currentData.location.setCity(body);            }        });        item.getChild(ADMINAREA).setEndTextElementListener(new EndTextElementListener(){            public void end(String body) {                currentData.location.setState(body);            }        });        try {            Xml.parse(this.getInputStream(), Xml.Encoding.UTF_8, root.getContentHandler());        } catch (Exception e) {            throw new RuntimeException(e);        }        return conditions;    }}</code></pre><p>If anyone can help explain the SAX code and how I would go into the different levels or could point me to another example that goes deeper than one level would be great!</p>","2186261","","244296","","2010-07-22 13:16:28","2011-12-15 16:21:31","Trying to Understand Android's Sax Parser","<android><sax>","1","0","1","",""
"3309382","1","3309480","","2010-07-22 13:32:51","0","3751","<p>If I don't import R, I get ""id cannot be resolved or is not a field""     </p><pre><code>(R.id.mainanim);</code></pre><p>And if I import R, the id error is gone, but I get ""main and mainanim cannot be resolved or is not a field"". They're my xml files! :0Can you help me?</p><p>Also here is ALL my code... maybe there is an error I didn't see? </p><p>JAVA:</p><pre><code> package com.example.carrottest2; import android.app.Activity; import android.graphics.drawable.AnimationDrawable; import android.os.Bundle; import android.widget.ImageView; import android.R;public class Carrottest2 extends Activity {/** Called when the activity is first created. */AnimationDrawable mainanimation; public void onCreate(Bundle icicle) {       super.onCreate(icicle);       setContentView(R.layout.main);      ImageView mainimage = (ImageView) findViewById(R.id.mainanim);      mainimage.setBackgroundResource(R.anim.mainanim);      mainanimation = (AnimationDrawable) mainimage.getBackground(); </code></pre><p>Main.XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;  &lt;TextView  android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""@string/hello""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Mainanim.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;animation-list xmlns:android=""http://schemas.android.com/apk/res/android""     android:oneshot=""false""&gt; &lt;item android:drawable=""@drawable/carrotsmile"" android:duration=""2000"" /&gt; &lt;item android:drawable=""@drawable/carrotblink"" android:duration=""2000"" /&gt; &lt;/animation-list&gt;    </code></pre><p>Please help. :(</p>","394842","","172261","","2010-07-22 14:19:10","2010-07-22 14:52:32","Android - Error if I don't import R and another error if I do?","<java><android><eclipse><sdk>","2","1","","",""
"3309567","1","3309621","","2010-07-22 13:52:49","0","80","<p>I want to make a loop that in my main.xml creates a button for each item in the list. But I cant see a way to loop in the xml file and create more buttons that way.</p>","399161","","","","","2010-07-22 13:58:41","How do I make a list be printed as buttons in the xml file? (Android)","<java><android><xml>","2","0","","",""
"3310066","1","3310108","","2010-07-22 14:42:12","43","23556","<p>In my application,there are some application specific settings, which should be available to me , next time when my application starts up.</p><p>In other words i want the data to be available across the sessions of an application cycle.</p><p>Can this be achieved without using database(sqlite).</p>","395563","","114066","","2010-07-22 14:46:28","2013-11-13 20:57:06","Making data persistent in android","<android><persistence>","2","1","35","",""
"3310264","1","3310343","","2010-07-22 14:58:01","6","4009","<p>I want a widget showing a countdown for a user initiated tracking of a bus departure. I want to update the widget every minute or so, from when the user initiates the tracking to when the bus has departed (i.e. the time runs out).</p><p>This widget needs to be updated more frequently than what <code>updatePeriodMillis</code> allows, which is every 30 seconds. I reckon about once a minute.</p><p>Being new to Android programming, I can think of a few ways to do this, but I would probably end up doing it in a way that consumes way too much battery etc, so I'm looking for some insights from more experienced Android developers.</p><p>How do I start the timer? How can I access the widget instance from my applications run-time? And so on.</p>","26051","","","","","2010-07-22 15:04:59","Frequently updating widgets (more frequently than what updatePeriodMillis allows)","<android><android-widget>","1","1","8","",""
"3310324","1","3856882","","2010-07-22 15:03:11","0","1295","<p>Is it possible to record an audio (not a phone call) using the bluetooth input and not the device microphone?I am able to playback whatever am saying through device's mic but not able to figure out how to use the bluetooth mic instead.Any assistance would be greatly appreciated.</p><p>(Edited)I got it working by using following two lines of codestartBluetoothSco();setBluetoothScoOn(true);</p>","373566","","373566","","2010-07-29 15:33:58","2013-08-23 05:10:58","Routing input to Bluetooth headset in android","<android>","1","0","","",""
"3310385","1","3313513","","2010-07-22 15:08:38","0","578","<p>I have this element in my layout XML:</p><pre><code>&lt;FrameLayout android:id=""@+id/FrameLayout01"" android:layout_width=""320sp"" android:layout_height=""380sp"" android:layout_gravity=""center"" android:background=""#99CC33""&gt;&lt;/FrameLayout&gt;</code></pre><p>And I want to get its position on the screen with <code>getTop()</code>, <code>getBottom()</code>,... but I want to do it only once.I was trying to do it on the onCreate(), but those methods return all 0 as response.</p><p>Any tips?</p>","327217","","","","","2010-07-22 21:09:24","Can't get layout info when creating activity","<android>","1","0","","",""
"3310412","1","3321545","","2010-07-22 15:10:48","4","2067","<p><img src=""http://img252.imageshack.us/img252/643/snakesonadialog.png"" alt=""alt text""></p><p>Hi folks,</p><p>So I'm putting the finishing touches on an application and there's still one outstanding issue with the application as a whole.</p><p>I display loading indicators in the form of ProgressDialogs while pulling data down from the web. For some reason or another, my ProgressDialogs are appearing to be nested inside of another blank dialog box. The result is tacky.</p><p>My layout code looks like this:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""style=""@style/Theme.MyTheme.EpisodeList""&gt;    &lt;ImageView android:src=""@drawable/featured""        android:layout_width=""fill_parent""        android:layout_height=""50sp""        android:layout_gravity=""top""        android:shadowRadius=""0""        android:shadowColor=""#FFFFFF""        android:id=""@+id/header_image""     /&gt;   &lt;ListView android:id=""@+id/android:list""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""   /&gt;&lt;/LinearLayout&gt;</code></pre><p>The code I use to display the ProgressDialog is the following:</p><pre><code>// In my class definitionprivate ProgressDialog p;// in my onCreate methodp = new ProgressDialog(EpisodeActivity.this, ProgressDialog.STYLE_SPINNER);p.setMessage(""Loading..."");p.show();</code></pre><p>From the looks if it, there's nothing that seems amiss. I'm also attaching a photo to illustrate the problem.</p><p>Any help is appreciated!</p>","366467","","366467","","2010-07-22 16:27:25","2011-06-23 07:09:07","ProgressDialog nesting inside of another blank dialog","<android><progressdialog>","2","0","2","",""
"3310603","1","3333785","","2010-07-22 15:32:33","3","12335","<p>I am reading in some data from a REST api and need to generate some buttons based on the information the app receives.</p><p>Because I need the same buttons in many Activity screens I have extended Button to make a RachelButton and I set it up in the constructor.</p><pre><code>public RachelButton(Context context, Info info) {    super(context);    this.info= info;    setText(info.getTime());    setTypeface(Typeface.DEFAULT, Typeface.BOLD);    int identifier = 0;    if(info.isAvailable()){        identifier = getContext().getResources().getIdentifier(""drawable/info_button_""+info.getType(), null, getContext().getPackageName());    }else{        identifier = R.drawable.info_button_unavailable;    }    if(identifier == 0){        Log.e(""INFO_BUTTON"", ""no button for ""+info.getType());    }    setBackgroundResource(identifier);    setTextColor(R.color.info_button_text_color);    setOnClickListener(new View.OnClickListener(){        public void onClick(View view) {            //do stuff        }    });}</code></pre><p>Then an example of the resource I am using to generate a colored button is this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:state_pressed=""true"" &gt;    &lt;shape&gt;        &lt;gradient            android:startColor=""@color/button_pressed""            android:endColor=""@color/button_pressed""            android:angle=""270"" /&gt;        &lt;stroke            android:width=""3dp""            android:color=""@color/button_pressed"" /&gt;        &lt;corners            android:radius=""3dp"" /&gt;        &lt;padding            android:left=""5dp""            android:top=""5dp""            android:right=""5dp""            android:bottom=""5dp"" /&gt;    &lt;/shape&gt;&lt;/item&gt;&lt;item android:state_focused=""true"" &gt;    &lt;shape&gt;        &lt;gradient            android:endColor=""@color/info_normal""            android:startColor=""@color/info_normal""            android:angle=""270"" /&gt;        &lt;stroke            android:width=""3dp""            android:color=""@color/info_normal"" /&gt;        &lt;corners            android:radius=""3dp"" /&gt;        &lt;padding            android:left=""5dp""            android:top=""5dp""            android:right=""5dp""            android:bottom=""5dp"" /&gt;    &lt;/shape&gt;&lt;/item&gt;&lt;item&gt;    &lt;shape&gt;        &lt;gradient            android:endColor=""@color/info_normal""            android:startColor=""@color/info_normal""            android:angle=""270"" /&gt;        &lt;stroke            android:width=""3dp""            android:color=""@color/info_normal"" /&gt;        &lt;corners            android:radius=""3dp"" /&gt;        &lt;padding            android:left=""5dp""            android:top=""5dp""            android:right=""5dp""            android:bottom=""5dp"" /&gt;    &lt;/shape&gt;&lt;/item&gt;&lt;/selector&gt;</code></pre><p>As you can see in the code I am setting the text color and I'm sure that this color exists as a resource (thank you IntelliJ).</p><p>But setting the text color like this has no effect at all, the text color on the button seems to be a darker shade of the button's background color.</p><p>If anyone could give me some advice as to what to try next I would be most appreciative.</p>","134340","","134340","","2010-07-23 11:31:37","2013-08-12 11:19:47","Android - How to programmatically set button color","<android>","2","2","1","",""
"3310636","1","3459603","","2010-07-22 15:37:38","3","634","<p>In my app, I have different activities with listviews. The datas come from a server with a REST method, and it's only done once, when I start the application.  </p><p>The pattern that I'd like to set is to precharge all the listviews with the JSONs that I already have in local, and in parallel, launch a thread that get the new JSONs files with my REST methods, and then update the listviews.  </p><p>For now, when I start the app, I parse my JSONs files, and build all the lists of objects. I access them later in a static way, from my lists adapters.</p><p>So I would like to know the best way to launch this REST thread, and update the listview. Should I use AsyncTask ? A service ? and then, when I update my local JSONs, I have to re-parse them, updates the lists of object, and call in my adapters NotifyDataChanged ?  </p><p>Thanks</p>","386745","","","","","2010-08-11 14:48:52","REST and listviews refresh","<android><rest>","2","0","","",""
"3310819","1","","","2010-07-22 15:57:36","1","499","<p>I heard that vendors do not all have 64 bt libs, so am wanting to only install 32 bit Eclipse, and 32 bit Java. However, I have run into IDE issues so wondered if it is all because I did not install 64 bit?</p><p>issues<a href=""http://stackoverflow.com/questions/3302797/cannot-connect-subclipse-to-visualsvn-on-windows-7"">http://stackoverflow.com/questions/3302797/cannot-connect-subclipse-to-visualsvn-on-windows-7</a>http://groups.google.com/group/android-beginners/browse_thread/thread/66d6cbe47c9722b1</p>","398348","","","","","2011-02-28 16:38:31","On Windows 7 (64 bit), do you have to install only 64 bit Java, and 64 bit Eclipse?","<java><eclipse><android>","5","0","","",""
"3310822","1","3318528","","2010-07-22 15:58:00","2","351","<p>I'm able to get a list of installed packages using the package manager, but this includes various system packages . Are there any filters i can apply on this list to only show the apps that would show up when bringing up the application list from the home screen?</p>","399311","","","","","2013-10-29 14:25:02","Get list of Non System Applications","<java><android>","3","0","","",""
"3310905","1","3312910","","2010-07-22 16:07:44","1","1187","<p>I have a game object that I save like this in OnPause()</p><pre><code>try {   final ObjectOutputStream os = new ObjectOutputStream(openFileOutput(gameName + "".sav"", 0));   os.writeObject(gameObject);   os.reset();  } catch (final Exception e) {   e.printStackTrace();</code></pre><p>}</p><p>This works fine except on some of the older or slower phones it can sometimes take too long to complete. I end up getting a ANR (Activity Not Responding) error. I would like to move this to a thread to prevent blocking the UI. However when I try this I run into multiple problems.</p><p>First openFileOutput is only available in my activity. I worked around this by passing the ObjectOutputStream to the thread. After that I could save the object but later when I tried to reload I get a java.io.EOFExeception. </p><p>Does anyone have a good pattern for writing objects to a file from a thread?</p>","399310","","","","","2010-07-22 20:02:08","Writing Objects from a thread in Android","<android><file-io><multithreading>","1","0","1","",""
"3310917","1","","","2010-07-22 16:09:44","2","1001","<p>I have an in-memory representation of a basic tree structure. I want to dynamically generate a representation of this tree structure in the UI and allow users to click on nodes to reveal (text-based) details about the node. The UI would conist of icons for node types linked via branches. How would you suggest I approach this? All the UI elements I have worked with are statically defined in XML res files so I'm not sure where to begin..</p><p>thanks</p>","146588","","","","","2012-04-09 12:58:04","How can I dynamically generate/draw a UI in Android?","<android><user-interface>","1","0","","",""
"3310982","1","","","2010-07-22 16:18:31","0","5869","<p>I'd like to know how to specify the height of a particular item of a ListView from java code ?Thanks</p>","399334","","","","","2010-07-22 18:29:19","ListView item height","<android>","1","0","","",""
"3310990","1","","","2010-07-22 16:18:50","9","7815","<p>I'm fighting from some time with taking a screenshot of Android OpenGL.</p><p>The code I found is as follows:</p><pre><code>nt size = width * height;    ByteBuffer buf = ByteBuffer.allocateDirect(size * 4);    buf.order(ByteOrder.nativeOrder());    glContext.glReadPixels(0, 0, width, height, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, buf);    int data[] = new int[size];    buf.asIntBuffer().get(data);    buf = null;    Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);    bitmap.setPixels(data, size-width, -width, 0, 0, width, height);    data = null;    short sdata[] = new short[size];    ShortBuffer sbuf = ShortBuffer.wrap(sdata);    bitmap.copyPixelsToBuffer(sbuf);    for (int i = 0; i &lt; size; ++i) {        //BGR-565 to RGB-565        short v = sdata[i];        sdata[i] = (short) (((v&amp;0x1f) &lt;&lt; 11) | (v&amp;0x7e0) | ((v&amp;0xf800) &gt;&gt; 11));    }    sbuf.rewind();    bitmap.copyPixelsFromBuffer(sbuf);    try {        FileOutputStream fos = new FileOutputStream(""/sdcard/screeshot.png"");        bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);        fos.flush();        fos.close();    } catch (Exception e) {        // handle    }</code></pre><p>I tried also a code from that site<a href=""http://www.anddev.org/how_to_get_opengl_screenshot__useful_programing_hint-t829.html"">link text</a></p><p>In each case the result is a png file which is completely black.I found there is some problem with glReadPixels method but I don't know how to bypass it.Any guidance will very helpfull.</p><p>Thank You in advance,Gordon</p>","399320","","399320","","2010-07-23 08:37:25","2013-08-12 08:48:51","Taking screenshot of Android OpenGL","<android><opengl-es><screenshot><take>","3","0","7","",""
"3311008","1","","","2010-07-22 16:20:49","0","244","<p>Are there any best practices for an app to get the same geo location as the Google Maps app?</p><p>For example, my app lists nearby Sprockets based on a user's geolocation. Often the geolocation I come up with is different than what the Google Maps app comes up with (which is often more accurate). </p><p>We can kind of do this if we have a MapActivity and use MyOverlay - this should give us the same location google maps would show - but we always need to display a map to use this. I'm almost considering just hosting a hidden map on my activity in order to use MyOverlay and grab better location updates! Any more sane way of doing this?</p><p>Thanks</p>","291701","","","","","2010-07-22 18:51:24","Getting the same geolocation Google Maps provides for a user?","<android>","2","2","","",""
"3311165","1","3311855","","2010-07-22 16:36:11","4","2484","<p>I'm writing an application that is compatible with Android 1.6, but I would like to give users running Android 2.2 the option of moving the application installation to their sd card. </p><p>How can I compile my application for 1.6, but still allow 2.2 users to install it to their sd?</p>","118241","","244296","","2010-07-22 16:37:41","2010-11-27 13:37:32","Set install location for Android 1.6?","<android><sd-card><android-1.6-donut>","2","0","3","",""
"3311228","1","3312777","","2010-07-22 16:46:33","0","486","<p>im trying to implement a custom listadapter that is set to display only distinct values for each row via the sql query. In each row i want to implement a list of textview values that displays data from another sql query. How can i implement an adapter like this ?</p>","267822","","131871","","2010-07-22 18:06:42","2010-07-22 19:45:41","Custom listview with multiple values in a row","<android><listview>","1","0","","",""
"3311300","1","3312283","","2010-07-22 16:53:40","1","329","<p>How do I get a list of all images in my android device?</p><p><strong>update:</strong> Maybe there is a <a href=""http://developer.android.com/guide/topics/providers/content-providers.html"" rel=""nofollow"">Content Provicer</a> for all the images on the device.. (studying)</p><p><strong>update:</strong> Getting hot, <a href=""http://developer.android.com/reference/android/provider/MediaStore.Images.html"" rel=""nofollow"">MediaStore.Images</a> have the information.. now looking for how to get it..</p>","287316","","287316","","2010-07-22 17:44:41","2010-07-22 18:49:49","How to list all imagens on the device?","<android><file><file-io>","1","0","1","",""
"3311371","1","","","2010-07-22 17:00:56","0","770","<p>I recently decided to make another application for the Android but I am having severe Eclipse issues. I'm running Windows 7 Ultimate 64 bit edition and my Eclipse keeps force closing whenever I try to do random things (such as saving, opening a file, building, etc). It does it randomly, I can sometimes save / run my application fine but other times whenever I save a file it just force closes. I've tried 32bit (because 64 bit was having this problem) but 32bit had even worse problems. I don't receive any errors at all, it just force closes. Sometimes it will lock up and say Java SE Binary has stopped responding.</p><p>Edit: After I just got done typing this I went into Eclipse and tried typgin android:padding and it force closed...</p>","397531","","","","","2010-10-09 05:35:41","Android Development 64 bit - Eclipse issues","<android><eclipse>","1","4","","",""
"3311474","1","3321396","","2010-07-22 17:12:38","31","21530","<p>My apologies if this is a stupid newbie question...</p><p>I'm using Eclipse (Helios release) and have the Android SDK all configured as per the developer.android.com recommendations. I can create and run new projects without any problem but I can't import archived project code samples (found on the web etc.) using Import > Existing Projects Into Workspace. </p><p>Importing a zip creates a project but it doesn't create it as an Android project and the console displays the error: ""Project has no default.properties file! Edit the project properties to set one.""</p><p>I've tried going into the project Properties but as soon as I click on 'Android' in the properties tree a pop-up appears saying ""Could Not Accept Changes: The currently displayed page contains invalid values""</p><p>See: <a href=""http://screencast.com/t/ZmY3ZWQ4"">http://screencast.com/t/ZmY3ZWQ4</a></p><p>But if I do this on one of my own projects I have no such error, and I'm able to change things such as the Android Platform/API level. I'm also able to archive my own projects (using export) and import them again without any problems... nut not other people's archives! Am I being really stupid? </p><p>Any help would be really appreciated!</p>","234548","","","","","2012-09-28 16:22:15","Problem importing Android project archives into Eclipse","<android><eclipse><import><archive>","7","1","2","",""
"3311671","1","3314496","","2010-07-22 17:35:50","1","1170","<p>I am trying to create a map application and I need to do something similar to what Google Maps does.I want to open show a list of locations and when user taps on them I want to show a dialog.</p><p>I was able to do it till here. But now when the user clicks on the dialog that opened I want to show another acttivity with the details of that item that they clicked on.</p><p>I tried to start a new intent but it gives me an error.</p><p>Here is what I am doing</p><pre><code>private void drawPopupWindow(Canvas canvas,int index, MapView mapView, boolean shadow) {        OverlayItem item = mOverlays.get(index);        GeoPoint geoPoint = item.getPoint();        LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        LinearLayout dialogLayout = (LinearLayout)inflater.inflate(R.layout.location_dialog, null);        LayoutParams mapDialogParams = new LayoutParams(                ViewGroup.LayoutParams.WRAP_CONTENT,                 ViewGroup.LayoutParams.WRAP_CONTENT,                 geoPoint, -1, -22,                 LayoutParams.BOTTOM_CENTER);        mapView.addView(dialogLayout, mapDialogParams);        dialogLayout.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                Intent detailIntent = new Intent(mContext, ItemDetailView.class);                mContext.startActivity(detailIntent); // I passed the context from mapActivity            }        });         }</code></pre><p>Here is the stack trace</p><pre><code>&gt; E/AndroidRuntime( 4985):&gt; java.lang.RuntimeException: Unable to&gt; start activity&gt; ComponentInfo{com.achie.test.mapssample/com.achie.test.mapssample.ItemDetailView}:&gt; android.view.InflateException: Binary&gt; XML file line #2: Error inflating&gt; class &lt;unknown&gt; E/AndroidRuntime(&gt; 4985):    at&gt; android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)&gt; E/AndroidRuntime( 4985):  at&gt; android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)&gt; E/AndroidRuntime( 4985):  at&gt; android.app.ActivityThread.access$2200(ActivityThread.java:119)&gt; E/AndroidRuntime( 4985):  at&gt; android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)&gt; E/AndroidRuntime( 4985):  at&gt; android.os.Handler.dispatchMessage(Handler.java:99)&gt; E/AndroidRuntime( 4985):  at&gt; android.os.Looper.loop(Looper.java:123)&gt; E/AndroidRuntime( 4985):  at&gt; android.app.ActivityThread.main(ActivityThread.java:4363)&gt; E/AndroidRuntime( 4985):  at&gt; java.lang.reflect.Method.invokeNative(Native&gt; Method) E/AndroidRuntime( 4985):  at&gt; java.lang.reflect.Method.invoke(Method.java:521)&gt; E/AndroidRuntime( 4985):  at&gt; com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)&gt; E/AndroidRuntime( 4985):  at&gt; com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)&gt; E/AndroidRuntime( 4985):  at&gt; dalvik.system.NativeStart.main(Native&gt; Method) E/AndroidRuntime( 4985):&gt; Caused by:&gt; android.view.InflateException: Binary&gt; XML file line #2: Error inflating&gt; class &lt;unknown&gt; E/AndroidRuntime(&gt; 4985):    at&gt; android.view.LayoutInflater.createView(LayoutInflater.java:513)&gt; E/AndroidRuntime( 4985):  at&gt; android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)&gt; E/AndroidRuntime( 4985):  at&gt; android.view.LayoutInflater.inflate(LayoutInflater.java:385)&gt; E/AndroidRuntime( 4985):  at&gt; android.view.LayoutInflater.inflate(LayoutInflater.java:320)&gt; E/AndroidRuntime( 4985):  at&gt; android.view.LayoutInflater.inflate(LayoutInflater.java:276)&gt; E/AndroidRuntime( 4985):  at&gt; com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)&gt; E/AndroidRuntime( 4985):  at&gt; android.app.Activity.setContentView(Activity.java:1622)&gt; E/AndroidRuntime( 4985):  at&gt; com.achie.test.mapssample.ItemDetailView.onCreate(ItemDetailView.java:11)&gt; E/AndroidRuntime( 4985):  at&gt; android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)&gt; E/AndroidRuntime( 4985):  at&gt; android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)&gt; E/AndroidRuntime( 4985):  ... 11 more&gt; E/AndroidRuntime( 4985): Caused by:&gt; java.lang.reflect.InvocationTargetException&gt; E/AndroidRuntime( 4985):  at&gt; com.google.android.maps.MapView.&lt;init&gt;(MapView.java:238)&gt; E/AndroidRuntime( 4985):  at&gt; java.lang.reflect.Constructor.constructNative(Native&gt; Method) E/AndroidRuntime( 4985):  at&gt; java.lang.reflect.Constructor.newInstance(Constructor.java:446)&gt; E/AndroidRuntime( 4985):  at&gt; android.view.LayoutInflater.createView(LayoutInflater.java:500)&gt; E/AndroidRuntime( 4985):  ... 20 more&gt; E/AndroidRuntime( 4985): Caused by:&gt; java.lang.IllegalArgumentException:&gt; MapViews can only be created inside&gt; instances of MapActivity.&gt; E/AndroidRuntime( 4985):  at&gt; com.google.android.maps.MapView.&lt;init&gt;(MapView.java:282)&gt; E/AndroidRuntime( 4985):  at&gt; com.google.android.maps.MapView.&lt;init&gt;(MapView.java:255)&gt; E/AndroidRuntime( 4985):  ... 24 more</code></pre><p>Why am I getting this error and how can I resolve this and open a new activity?</p><p>Also where can I find the source code for the google maps on android?</p><p>Thank you.</p>","229266","","1839241","","2012-11-30 13:39:11","2012-11-30 13:39:11","opening another activity from the map overlay dialogs","<android><android-maps>","1","0","","",""
"3311678","1","","","2010-07-22 17:37:19","5","4681","<p>I am trying to read system logs in my code to generate something like an error report.Similar to adb logcat, but in a programming way.</p><p>How can I achieve this?</p>","368778","","488657","","2012-11-01 21:05:07","2013-11-12 00:23:54","How to read system log file in Android?","<android>","2","0","3","",""
"3311681","1","3312369","","2010-07-22 17:37:38","1","11536","<p>I have a <code>Windows web server</code> already set up with a website (<code>unlimited application pools</code>) and I want to be able to access a <code>database</code> on that server via the <code>Android app</code> I'm developing. How can I do this? Can someone point me to a tutorial or give code example of how this cross-platform (<code>Android/Java</code> to <code>ASP.NET/C#</code>) communication can be done?</p><p>(I'm trying to create a leader board or global scoreboard for my <code>Android</code> game on my server.)</p><p>Thanks.</p>","272302","","1215724","","2013-07-22 11:33:55","2013-07-22 11:34:55","Android -- How to access data in an ASP.NET database via app?","<c#><java><asp.net><android><http>","3","1","8","",""
"3311735","1","3311771","","2010-07-22 17:43:58","0","3894","<p>I'm attempting to remove certain files from the SD image mounted on the emulator.</p><pre><code>NDUNN-PC ~$ adb devicesList of devices attachedemulator-5554   deviceNDUNN-PC ~$ adb shell rm -f /sdcard/maps/*rm failed for -f, Read-only file systemNDUNN-PC ~$ adb remountremount succeededNDUNN-PC ~$ adb shell rm -f /sdcard/maps/*rm failed for -f, Read-only file system</code></pre><p>From all the docs I've read, remount is supposed to toggle between read-write/read-only permissions.  But that doesn't seem to work in this case.  Any idea what's wrong?  Using Windows XP, emulator is running Android SDK 1.6 (with Google Maps APIs).</p>","155392","","","","","2013-11-16 03:08:31","How to get adb remount to work?","<android><android-emulator>","2","0","","",""
"3312001","1","3312113","","2010-07-22 18:18:25","7","6009","<p>Is there a way to include the small circular degrees symbol to a TextView? This would be for temperature readings, as in degrees celsius or farenheight.I'm finding this an awkward question to Google, and wondering if anyone has done this programatically before.</p>","259645","","","","","2014-04-07 15:55:41","Degrees symbol (as in Degrees Celsius/Farenheight) in a TextView","<android><textview>","1","0","1","",""
"3312065","1","3312260","","2010-07-22 18:24:02","2","1681","<p>I have developed an App that target version is 4 (Android 1.6) upto 7 (Android 2.1). I tested this app on the dev phone 2 (Google-Io-Device 1.6 version). I am doing some xml parsing stuff through Internet. i set the <code>&lt;uses-permission&gt;</code> on my Manifest. it works fine in WI-FI Network. But its not working in the Motorola Droid 2.1 with 3G Network. Is there any more specific stuff to do for 3G network? Any Idea? </p><p>Thanks in advance.</p><p>Edit:</p><p>My App works over WiFi Network. But not over 3G Network. Any Guesses?</p>","267269","","267269","","2010-07-24 11:47:51","2013-04-03 01:31:57","My App works over WiFi. But not over 3G in android? Any Guesses?","<android><wifi><3g><xml-parsing>","1","0","","",""
"3312438","1","4330400","","2010-07-22 19:07:25","19","10796","<p>I want to setup a part of my application that allows users to send a quick email to another user.  It's not very hard to set this up:</p><pre><code>Intent intent = new Intent(Intent.ACTION_SEND);intent.setType(""text/plain"");intent.putExtra(Intent.EXTRA_SUBJECT, subject);intent.putExtra(Intent.EXTRA_TEXT, message);Intent mailer = Intent.createChooser(intent, null);startActivity(mailer);</code></pre><p>However, the problem is that the ACTION_SEND is accepted by more than just email programs - for example, on my phone the Facebook app, Twitter, reddit is fun, and even Bluetooth come up as viable alternatives for sending this message.  The message is entirely too long for some of these (especially Twitter).</p><p>Is there a way to limit the chooser to just applications that support long messages (such as email)?  Or is there a way to detect the app that the user has chosen and adjust the message appropriately?</p>","60261","","","","","2013-05-19 18:37:54","How to open Email program via Intents (but only an Email program)","<android>","6","3","10","",""
"3312538","1","","","2010-07-22 19:19:42","0","2691","<p>when I send an SMS on my Android emulator, it goes to the content provider:</p><pre><code>content://sms/sent</code></pre><p>right?</p><p>So I wanted to get the last sent SMS from the content provider. So I used this Uri as you can see above, and, I used the method query, with the Content Resolver Object. And I got the cursor, and used the movetofirst() method, so I would have the last sent SMS. Check the code below. I hope it helps.</p><pre><code>package com.sys;import android.app.Activity;  import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.net.Uri;import android.database.Cursor;    public class SMS extends Activity {Button btnVerSms;EditText txtFinal;final Uri CONTENT_URI = Uri.parse(""content://sms/sent"");        /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    btnVerSms= (Button)findViewById(R.id.btnVerSms);    txtFinal =   (EditText)findViewById(R.id.txtFinal);       btnVerSms.setOnClickListener(new View.OnClickListener() {    @Override    public void onClick(View v) {        // TODO Auto-generated method stub        Cursor cursor = getContentResolver().query(CONTENT_URI, null, null, null,  null);                                           String body = null;            if(cursor.moveToFirst()){            body = cursor.getString(cursor.getColumnIndexOrThrow(""body"")).toString();                       }        txtFinal.setText(body);    }});}}</code></pre>","399459","","399459","","2010-07-30 03:57:27","2011-03-24 03:48:35","How to query the last sent SMS from content provider?[RESOLVED]","<android><listview><sms><android-contentprovider>","1","0","1","",""
"3312599","1","3312694","","2010-07-22 19:25:36","2","317","<p>I have two ImageButtons, and I am trying to stack one on top of the other. I essentially want to make a screen with two big buttons that each take up 50% of the available space. The code is below. Here is a capture of the layout it yields <a href=""http://imgur.com/cQT0W.png"" rel=""nofollow"">http://imgur.com/cQT0W.png</a> I have played around with layout_gravity and gravity on the parent. Setting both chidren with layout_height=fill_parent doesn't work nor does setting the parent's gravity to fill_vertical.</p><pre><code>        &lt;!-- Notes tab --&gt;        &lt;LinearLayout android:id=""@+id/tabNotes""              android:layout_width=""fill_parent""             android:layout_height=""fill_parent""                         android:padding=""6dp""            android:orientation=""vertical""&gt;                                                             &lt;ImageButton android:src=""@drawable/ic_btn_speak_now"" android:id=""@+id/imgSpeakNow""                                         android:background=""#FFFF00""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                /&gt;                              &lt;ImageButton android:src=""@drawable/ic_btn_compose"" android:id=""@+id/imgCompose""                 android:background=""#FF00FF""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                                                    /&gt;        &lt;/LinearLayout&gt;</code></pre>","395265","","","","","2010-07-22 19:37:12","Stacking Two ImageButtons","<android><layout><imageview><imagebutton><android-linearlayout>","1","0","","",""
"3312643","1","3313266","","2010-07-22 19:31:08","15","7741","<p>I have a webview and am trying to load simple UTF-8 text into it.</p><pre><code>mWebView.loadData(""?????????????"", ""text/html"", ""UTF-8"");</code></pre><p>But the WebView displays ANSI/ASCII garbage.</p><p>Obviously an encoding issue, but what am I missing in telling the webview to display the Unicode text?</p><p>This is a HelloWorld app.</p>","172861","","","","","2013-07-02 14:55:52","Android WebView UTF-8 not showing","<android><unicode><webview>","2","1","5","",""
"3312699","1","3345767","","2010-07-22 19:37:23","11","2338","<p>Trying to play animated GIFs on Android here (see <a href=""http://stackoverflow.com/questions/809878/android-how-do-a-display-a-large-animated-gif-given-a-url"">http://stackoverflow.com/questions/809878/android-how-do-a-display-a-large-animated-gif-given-a-url</a>). It's anything but smooth. On Android 1.5, the Movie.decodeStream()/decodeFile() returns a null. On Android 1.6, with the GIF files I've got, it returns a zero-sized movie with zero duration - clearly not adequate.</p><p>The referenced question suggests splitting the GIF into frames (and then rendering these). How exactly do i accomplish that, please?</p><p>EDIT: tried opening one of my GIFs with GNU giflib in Windows. It choked on the very first frame. The GIF itself is all right, all browsers (save Android's) display and animate it fine.</p><p>EDIT2: worked with giflib 4.1.4. Not sure what was broken in 4.1.6, but there you go. Next step: build giflib for Android via NDK, somehow integrate with the Bitmap class.</p><p>EDIT3: giflib it is. In conjuction with Bitmap.copyPixelsFromBuffer. The colors are all askew right now, but the basic design seems workable.</p>","219159","","219159","","2010-07-26 22:25:06","2014-04-01 19:16:51","Split GIF into frames","<android>","1","0","4","",""
"3312720","1","3313542","","2010-07-22 19:40:07","2","6615","<p>I based my game off of the lunar lander demo, although heavily modified, and I can get around 40-50fps but the problem is it fluctuates between 40-50fps so much that it causes the moving graphics to jitter! Its very annoying and makes my game look really shitty when in fact its running at a good frame rate.</p><p>I tried setting the thread priority higher but that just made it worse... now it will fluctuate between 40-60fps...</p><p>I was thinking of limiting the FPS to about 30 so that it will be constant. Is this a good idea and does anyone else have experience or a different solution?</p><p>Thanks!</p><p>This is my run loop</p><pre><code>@Override    public void run() {        while (mRun) {            Canvas c = null;            try {                c = mSurfaceHolder.lockCanvas(null);                synchronized (mSurfaceHolder) {                    if(mMode == STATE_RUNNING){                        updatePhysics();                    }                    doDraw(c);                }            } finally {                // do this in a finally so that if an exception is thrown                // during the above, we don't leave the Surface in an                // inconsistent state                if (c != null) {                    mSurfaceHolder.unlockCanvasAndPost(c);                }            }        }        }private void updatePhysics() {        now = android.os.SystemClock.uptimeMillis();        elapsed = (now - mLastTime) / 1000.0;        posistionY += elapsed * speed;        mLastTime = now;}</code></pre>","394093","","394093","","2010-07-22 22:10:03","2013-06-11 19:43:13","Android 2d canvas game: FPS Jitter problem","<android><fps>","5","0","7","",""
"3312730","1","3312912","","2010-07-22 19:41:09","1","1187","<p>How can I download android android 2.0 (not 2.1) sdk now?I tried 'android sdk and avd manager', it does not have android 2.0 downloadable.</p><p>Thank you.</p>","286802","","","","","2011-06-02 04:14:13","How can I download android 2.0 sdk now","<android>","4","1","","",""
"3312755","1","","","2010-07-22 19:44:11","0","1224","<p>I have a TextView inside a LinearLayout and a VideoView inside a LinearLayout. </p><p>The parent layout is a RelativeLayout that includes the TextView's linear layout and VideoView's linear layout. </p><p>Since I add the VideoView with FILL_PARENT, FILL_PARENT params (coz I want it to fill the screen in landscape mode), in some phones when I rotate to landscape, the VideoView fills the entire screen, and the TextView is not visible.</p><p>This happens only in certain phones, and only in landscape mode. </p><p>I have tried setting a top padding for the VideoView's linear layout, but it looks like the padding should be different for different phones. For eg: a top padding of 10 works on a myTouch but not on Droid.</p><p>Any ideas?</p><p>ThanksChris</p>","398505","","","","","2010-07-22 21:23:38","Android - TextView and VideoView problem","<android><layout><textview><linear><videoview>","1","1","","",""
"3312914","1","","","2010-07-22 20:02:25","5","6118","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3397071/service-discovery-failed-exception-using-bluetooth-on-android"">Service discovery failed exception using Bluetooth on Android</a>  </p></blockquote><p>Alright, I've been reading a lot of topics the past two or three days and nothing seems to have asked this.</p><p>I am writing a PC side server for my andriod device, this is for exchanging some information and general debugging. Eventually I will be connecting to a SPP device to control a microcontroller.</p><p>I have managed, using the following (Android to pc) to connect to rfcomm channel 11 and exchange data between my android device and my pc.</p><p>Method m = device.getClass().getMethod(""createRfcommSocket"", new Class[] { int.class });tmp = (BluetoothSocket) m.invoke(device, Integer.valueOf(11));</p><p>I have attempted the createRfcommSocketToServiceRecord(UUID) method, with absolutely no luck.</p><p>For the PC side, I have been using the C Bluez stack for linux.  I have the following code which registers the service and opens a server socket:</p><pre><code>int main(int argc, char **argv){    struct sockaddr_rc loc_addr = { 0 }, rem_addr = { 0 };    char buf[1024] = { 0 };    char str[1024] = { 0 };    int s, client, bytes_read;    sdp_session_t *session;    socklen_t opt = sizeof(rem_addr);    session = register_service();    s = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);    loc_addr.rc_family = AF_BLUETOOTH;    loc_addr.rc_bdaddr = *BDADDR_ANY;    loc_addr.rc_channel = (uint8_t) 11;    bind(s, (struct sockaddr *)&loc_addr, sizeof(loc_addr));    listen(s, 1);    client = accept(s, (struct sockaddr *)&rem_addr, &opt);    ba2str( &rem_addr.rc_bdaddr, buf );    fprintf(stderr, ""accepted connection from %s\n"", buf);    memset(buf, 0, sizeof(buf));    bytes_read = read(client, buf, sizeof(buf));    if( bytes_read > 0 ) {     printf(""received [%s]\n"", buf);    }    sprintf(str,""to Android."");    printf(""sent [%s]\n"",str);    write(client, str, sizeof(str));    close(client);    close(s);    sdp_close( session );    return 0;}    sdp_session_t *register_service(){    uint32_t svc_uuid_int[] = { 0x00000000,0x00000000,0x00000000,0x00000000 };    uint8_t rfcomm_channel = 11;    const char *service_name = ""Remote Host"";    const char *service_dsc = ""What the remote should be connecting to."";    const char *service_prov = ""Your mother"";    uuid_t root_uuid, l2cap_uuid, rfcomm_uuid, svc_uuid;    sdp_list_t *l2cap_list = 0,                *rfcomm_list = 0,               *root_list = 0,               *proto_list = 0,                *access_proto_list = 0;    sdp_data_t *channel = 0, *psm = 0;    sdp_record_t *record = sdp_record_alloc();    // set the general service ID    sdp_uuid128_create( &svc_uuid, &svc_uuid_int );    sdp_set_service_id( record, svc_uuid );    // make the service record publicly browsable    sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);    root_list = sdp_list_append(0, &root_uuid);    sdp_set_browse_groups( record, root_list );    // set l2cap information    sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID);    l2cap_list = sdp_list_append( 0, &l2cap_uuid );    proto_list = sdp_list_append( 0, l2cap_list );    // set rfcomm information    sdp_uuid16_create(&rfcomm_uuid, RFCOMM_UUID);    channel = sdp_data_alloc(SDP_UINT8, &rfcomm_channel);    rfcomm_list = sdp_list_append( 0, &rfcomm_uuid );    sdp_list_append( rfcomm_list, channel );    sdp_list_append( proto_list, rfcomm_list );    // attach protocol information to service record    access_proto_list = sdp_list_append( 0, proto_list );    sdp_set_access_protos( record, access_proto_list );    // set the name, provider, and description    sdp_set_info_attr(record, service_name, service_prov, service_dsc);    int err = 0;    sdp_session_t *session = 0;    // connect to the local SDP server, register the service record, and     // disconnect    session = sdp_connect( BDADDR_ANY, BDADDR_LOCAL, SDP_RETRY_IF_BUSY );    err = sdp_record_register(session, record, 0);    // cleanup    //sdp_data_free( channel );    sdp_list_free( l2cap_list, 0 );    sdp_list_free( rfcomm_list, 0 );    sdp_list_free( root_list, 0 );    sdp_list_free( access_proto_list, 0 );    return session;}</code></pre><p>And another piece of code, in addition to 'sdptool browse local' which can verifty that the service record is running on the pc:</p><pre><code>int main(int argc, char **argv){    uuid_t svc_uuid;    uint32_t svc_uuid_int[] = { 0x00000000,0x00000000,0x00000000,0x00000000 };    int err;    bdaddr_t target;    sdp_list_t *response_list = NULL, *search_list, *attrid_list;    sdp_session_t *session = 0;    str2ba( ""01:23:45:67:89:AB"", &target );    // connect to the SDP server running on the remote machine    session = sdp_connect( BDADDR_ANY, BDADDR_LOCAL, SDP_RETRY_IF_BUSY );    // specify the UUID of the application we're searching for    sdp_uuid128_create( &svc_uuid, &svc_uuid_int );    search_list = sdp_list_append( NULL, &svc_uuid );    // specify that we want a list of all the matching applications' attributes    uint32_t range = 0x0000ffff;    attrid_list = sdp_list_append( NULL, &range );    // get a list of service records that have UUID 0xabcd    err = sdp_service_search_attr_req( session, search_list, \            SDP_ATTR_REQ_RANGE, attrid_list, &response_list);    sdp_list_t *r = response_list;    // go through each of the service records    for (; r; r = r->next ) {        sdp_record_t *rec = (sdp_record_t*) r->data;        sdp_list_t *proto_list;        // get a list of the protocol sequences        if( sdp_get_access_protos( rec, &proto_list ) == 0 ) {        sdp_list_t *p = proto_list;        // go through each protocol sequence        for( ; p ; p = p->next ) {            sdp_list_t *pds = (sdp_list_t*)p->data;            // go through each protocol list of the protocol sequence            for( ; pds ; pds = pds->next ) {                // check the protocol attributes                sdp_data_t *d = (sdp_data_t*)pds->data;                int proto = 0;                for( ; d; d = d->next ) {                    switch( d->dtd ) {                         case SDP_UUID16:                        case SDP_UUID32:                        case SDP_UUID128:                            proto = sdp_uuid_to_proto( &d->val.uuid );                            break;                        case SDP_UINT8:                            if( proto == RFCOMM_UUID ) {                                printf(""rfcomm channel: %d\n"",d->val.int8);                            }                            break;                    }                }            }            sdp_list_free( (sdp_list_t*)p->data, 0 );        }        sdp_list_free( proto_list, 0 );        }        printf(""found service record 0x%x\n"", rec->handle);        sdp_record_free( rec );    }    sdp_close(session);}</code></pre><pre><code>Output:$ ./search rfcomm channel: 11found service record 0x10008sdptool:Service Name: Remote HostService Description: What the remote should be connecting to.Service Provider: Your motherService RecHandle: 0x10008Protocol Descriptor List:  ""L2CAP"" (0x0100)  ""RFCOMM"" (0x0003)    Channel: 11</code></pre><p>And for logcat I'm getting this:</p><pre><code>07-22 15:57:06.087: ERROR/BTLD(215): ****************search UUID = 0000***********07-22 15:57:06.087: INFO//system/bin/btld(209):         btapp_dm_GetRemoteServiceChannel()07-22 15:57:06.087: INFO//system/bin/btld(209): ##### USerial_Ioctl: BT_Wake, 0x8003 ####07-22 15:57:06.097: INFO/ActivityManager(88): Displayed activity com.example.socktest/.socktest: 79 ms (total 79 ms)07-22 15:57:06.697: INFO//system/bin/btld(209): ##### USerial_Ioctl: BT_Sleep, 0x8004 ####07-22 15:57:07.517: WARN/BTLD(215): ccb timer ticks: 214748364807-22 15:57:07.517: INFO//system/bin/btld(209): ##### USerial_Ioctl: BT_Wake, 0x8003 ####07-22 15:57:07.547: WARN/BTLD(215): info:x1007-22 15:57:07.547: INFO/BTL-IFS(215): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DTUN_SIGNAL_EVT (CTRL) 10 pbytes (hdl 14)07-22 15:57:07.547: DEBUG/DTUN_HCID_BZ4(253):         dtun_dm_sig_link_up()07-22 15:57:07.547: INFO/DTUN_HCID_BZ4(253): dtun_dm_sig_link_up: dummy_handle = 34207-22 15:57:07.547: DEBUG/ADAPTER(253): adapter_get_device(00:02:72:AB:7C:EE)07-22 15:57:07.547: ERROR/BluetoothEventLoop.cpp(88): pollData[0] is revented, check next one07-22 15:57:07.547: ERROR/BluetoothEventLoop.cpp(88): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/253/hci0/dev_00_02_72_AB_7C_EE07-22 15:57:07.777: WARN/BTLD(215): process_service_search_attr_rsp07-22 15:57:07.787: INFO/BTL-IFS(215): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DTUN_SIGNAL_EVT (CTRL) 13 pbytes (hdl 14)07-22 15:57:07.787: INFO/DTUN_HCID_BZ4(253): dtun_dm_sig_rmt_service_channel: success=0, service=0000000007-22 15:57:07.787: ERROR/DTUN_HCID_BZ4(253): discovery unsuccessful!07-22 15:57:08.497: INFO//system/bin/btld(209): ##### USerial_Ioctl: BT_Sleep, 0x8004 ####07-22 15:57:09.507: INFO//system/bin/btld(209): ##### USerial_Ioctl: BT_Wake, 0x8003 ####07-22 15:57:09.597: INFO/BTL-IFS(215): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DTUN_SIGNAL_EVT (CTRL) 11 pbytes (hdl 14)07-22 15:57:09.597: DEBUG/DTUN_HCID_BZ4(253):         dtun_dm_sig_link_down()07-22 15:57:09.597: INFO/DTUN_HCID_BZ4(253): dtun_dm_sig_link_down device = 0xf7a0 handle = 342 reason = 2207-22 15:57:09.597: ERROR/BluetoothEventLoop.cpp(88): pollData[0] is revented, check next one07-22 15:57:09.597: ERROR/BluetoothEventLoop.cpp(88): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/253/hci0/dev_00_02_72_AB_7C_EE07-22 15:57:09.597: DEBUG/BluetoothA2dpService(88): Received intent Intent { act=android.bluetooth.device.action.ACL_DISCONNECTED (has extras) }07-22 15:57:10.107: INFO//system/bin/btld(209): ##### USerial_Ioctl: BT_Sleep, 0x8004 ####07-22 15:57:12.107: DEBUG/BluetoothService(88): Cleaning up failed UUID channel lookup: 00:02:72:AB:7C:EE 00000000-0000-0000-0000-00000000000007-22 15:57:12.107: ERROR/Socket Test(5234): connect() failed07-22 15:57:12.107: DEBUG/ASOCKWRP(5234): asocket_abort [31,32,33]07-22 15:57:12.107: INFO/BLZ20_WRAPPER(5234): blz20_wrp_shutdown: s 31, how 207-22 15:57:12.107: DEBUG/BLZ20_WRAPPER(5234): blz20_wrp_shutdown:  fd (-1:31), bta -1, rc 0, wflags 0x007-22 15:57:12.107: INFO/BLZ20_WRAPPER(5234): __close_prot_rfcomm: fd 3107-22 15:57:12.107: INFO/BLZ20_WRAPPER(5234): __close_prot_rfcomm: bind not completed on this socket07-22 15:57:12.107: DEBUG/BLZ20_WRAPPER(5234): btlif_signal_event:  fd (-1:31), bta -1, rc 0, wflags 0x007-22 15:57:12.107: DEBUG/BLZ20_WRAPPER(5234): btlif_signal_event: event BTLIF_BTS_EVT_ABORT matched07-22 15:57:12.107: DEBUG/BTL_IFC_WRP(5234): wrp_close_s_only: wrp_close_s_only [31] (31:-1) []07-22 15:57:12.107: DEBUG/BTL_IFC_WRP(5234): wrp_close_s_only: data socket closed07-22 15:57:12.107: DEBUG/BTL_IFC_WRP(5234): wsactive_del: delete wsock 31 from active list [ad3e1494]07-22 15:57:12.107: DEBUG/BTL_IFC_WRP(5234): wrp_close_s_only: wsock fully closed, return to pool07-22 15:57:12.107: DEBUG/BLZ20_WRAPPER(5234): btsk_free: success07-22 15:57:12.107: DEBUG/BLZ20_WRAPPER(5234): blz20_wrp_write: wrote 1 bytes out of 1 on fd 3307-22 15:57:12.107: DEBUG/ASOCKWRP(5234): asocket_destroy07-22 15:57:12.107: DEBUG/ASOCKWRP(5234): asocket_abort [31,32,33]07-22 15:57:12.107: INFO/BLZ20_WRAPPER(5234): blz20_wrp_shutdown: s 31, how 207-22 15:57:12.107: DEBUG/BLZ20_WRAPPER(5234): blz20_wrp_shutdown: btsk not found, normal close (31)07-22 15:57:12.107: DEBUG/BLZ20_WRAPPER(5234): blz20_wrp_write: wrote 1 bytes out of 1 on fd 3307-22 15:57:12.107: INFO/BLZ20_WRAPPER(5234): blz20_wrp_close: s 3307-22 15:57:12.107: DEBUG/BLZ20_WRAPPER(5234): blz20_wrp_close: btsk not found, normal close (33)07-22 15:57:12.107: INFO/BLZ20_WRAPPER(5234): blz20_wrp_close: s 3207-22 15:57:12.107: DEBUG/BLZ20_WRAPPER(5234): blz20_wrp_close: btsk not found, normal close (32)07-22 15:57:12.107: INFO/BLZ20_WRAPPER(5234): blz20_wrp_close: s 3107-22 15:57:12.107: DEBUG/BLZ20_WRAPPER(5234): blz20_wrp_close: btsk not found, normal close (31)07-22 15:57:12.157: DEBUG/Sensors(88): close_akm, fd=15107-22 15:57:12.167: ERROR/CachedBluetoothDevice(477): onUuidChanged: Time since last connect1497069007-22 15:57:12.237: DEBUG/Socket Test(5234): -On Stop-</code></pre><p>Sorry for bombarding you guys with what seems like a difficult question and a lot to read, but I've been working on this problem for a while and I've tried a lot of different things to get this working.</p><p>Let me reiterate, I can get it to work, but not using service discovery protocol.  I've tried a several different UUIDs and on two different computers, although I only have my HTC Incredible to test with.</p><p>I've also heard some rumors that the BT stack wasn't working on the HTC Droid, but that isn't the case, at least, for PC interaction.</p>","399530","","883699","","2012-10-19 05:31:20","2012-10-19 05:31:20","Setting up a pc bluetooth server for android","<android><bluetooth><spp><bluez>","1","1","6","2012-10-22 12:02:04",""
"3312932","1","","","2010-07-22 20:04:34","2","1918","<p>My Activity implements OnItemSelected listener for a spinner.  It has the interesting problem of firing off the onItemSelected callback when the activity shows.  So I used a flag hack to solve it (I hate it, but at this point I just want the app to work).</p><p>Strangely enough, even though the callback gets called right at activity start, my actual touch selections don't work.   I can touch the list, open it, see the strings from the array adapter, and even touch it to make it dismiss - but the callback is never called.</p><p>My code:</p><pre><code>public class MyActivity extends Activity implements OnItemSelectedListener {…private ArrayList&lt;String&gt; mMyTypes = null;private ArrayAdapter&lt;String&gt; mMyAdapter = null;private Spinner mMyTypeSpinner = null;// hack for spinnerboolean isFirstRunWithSpinner = true;</code></pre><p>In onCreate():</p><pre><code>mMyTypeSpinner = (Spinner) findViewById(R.id.my_activity_spinner);mMyTypes = new ArrayList&lt;String&gt;();mMyTypes.add(""Test string"");mMyAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.custom_spinner_style, mMyTypes);mMyAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);mMyTypeSpinner.setAdapter(mMyAdapter);// spinner listenermMyTypeSpinner.setOnItemSelectedListener(this);</code></pre><p>The callback:</p><pre><code>@Overridepublic void onItemSelected(AdapterView&lt;?&gt; parent, View v, int position, long id) { Toast .makeText(ConfirmEditActivity.this, ""Selected"", Toast.LENGTH_LONG) .show();if( isFirstRunWithSpinner ) { isFirstRunWithSpinner = false; return; }…}@Overridepublic void onNothingSelected(AdapterView&lt;?&gt; arg0) { Toast .makeText(ConfirmEditActivity.this, ""Nothing"", Toast.LENGTH_LONG) .show();}</code></pre><p>The toast is shown right when the activity is shown, but when I select items in the spinner, the spinner dismisses and no toast is displayed again (not to mention the rest of the code in the callback fails to execute).</p><p>Any observations?</p><p>I really hope this something simple...</p>","386541","","","","","2013-02-21 19:03:34","Spinner won't respond to clicks...even though onItemSelected is called?","<android>","2","3","","",""
"3312956","1","","","2010-07-22 20:07:45","2","369","<p>Is it possible for an Android application use the cell phone to dial out to a remote modem and interact with it? I have a PC program that calls to a remote modem and collects data from a controller. The information send back and forth between the PC app and the controller is just a simple string of characters. I would like to port some of this application to work on a cell phone, if possible. Does the Android OS provide for this type of communication? If so, is there some API's that make this work easier?</p><p>If the Android OS doesn't provide this ability, is there any other mobile OS that does?</p><p>Thanks for any help with this.</p>","399571","","","","","2010-07-22 20:07:45","Is it possible to have an Android app dial a remote modem and send info back and forth?","<android>","0","0","","",""
"3313072","1","3313140","","2010-07-22 20:21:28","2","571","<p>The first thing described in the howto (<a href=""http://www.assembla.com/wiki/show/scala-ide/Developing_for_Android"" rel=""nofollow"">http://www.assembla.com/wiki/show/scala-ide/Developing_for_Android</a>) is this:</p><p>Step 1:  Create the ant files for your project:</p><pre><code> cd &lt;project dir&gt; android update project --target 1 --path .</code></pre><p>which yields 'command not found'. I'm in the 'workspace/name_of_my_app/' folder.</p><p>How do I get to have the 'android' command?</p>","8522","","321731","","2014-03-04 22:36:58","2014-03-04 22:36:58","android development with scala","<android><scala><command-line>","1","0","2","",""
"3313116","1","3313271","","2010-07-22 20:27:27","0","500","<p>I have four tabs (reports, review reports, map and settings). I have an sqlite database populated with report information. I wish to have the database accessible throughout the application. The reports tab successfully adds data to the database however using the same methodology crashes the application. The Android debugger points to the line where the database is called again.</p><p>In the reports tab the following code is used to launch the database...</p><pre><code>this.reportDatabase = new ReportDatabase(this);  this.reportDatabase.insert(""("" + latitude + "", "" + longitude + "", "" + time + "", '"" + spinnerState + ""', "" + lower + "", "" + upper + "", "" + agreed + "", "" + getAlgorithmCount() + "", "" + xAxis + "", "" + yAxis + "", "" + zAxis + "", "" + altitude + "", ""+ accuracy + "", 'photo');"");</code></pre><p>In the onCreate() method of the Review Tab - Where I wish to review reports - I try to access to the database through the call calling the return report method </p><p>this.reportDatabase = new ReportDatabase(this);</p><p>However this fails to work. In the android debugger highlights that the problem belongs with the context being provided to it. I realise that the report database has already been accessed by the report tab and wonder if this is causing the issue. I am new to programming android, the application is designed to report on flamingos in Africa, any help would be greatly appreciated!</p><p>Following the suggestion of Seva Alekseyev I have adapted as follows...</p><p>I have adapted my ReportDatabase as...</p><pre><code> public ReportDatabase(Context context) {  super(context, DATABASE_NAME, null, DATABASE_VERSION);  ReportDatabase.context = context;  OpenHelper openHelper = new OpenHelper(ReportDatabase.context);  this.database = openHelper.getWritableDatabase(); } static ReportDatabase open(Context c){  if(reportDatabase == null){   reportDatabase = new ReportDatabase(ReportDatabase.context);   return reportDatabase;  }  return reportDatabase; }</code></pre><p>using...</p><pre><code> reportDatabase = ReportDatabase.open(this); </code></pre><p>As the call in both the report and review tab. Unfortunately this doesn't seem to work, the debugger stops on the same method. The full ReportDatabase.java file is here...</p><pre><code>package com.android.flamingo;import java.util.Vector;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;public class ReportDatabase extends SQLiteOpenHelper {private static Context context;private SQLiteDatabase database;static ReportDatabase reportDatabase;private static final String DATABASE_NAME = ""flamingo_reports"";private static final int DATABASE_VERSION = 1;private static final String TABLE_NAME = ""reports"";/** * Default (and only) constructor.... *  * @param context */public ReportDatabase(Context context) {    super(context, DATABASE_NAME, null, DATABASE_VERSION);    ReportDatabase.context = context;    OpenHelper openHelper = new OpenHelper(ReportDatabase.context);    this.database = openHelper.getWritableDatabase();}static ReportDatabase open(Context c){    if(reportDatabase == null){        reportDatabase = new ReportDatabase(ReportDatabase.context);        return reportDatabase;    }    return reportDatabase;}/** *  * @param name */public void insert(String name){    this.database.execSQL(""INSERT INTO "" + TABLE_NAME + ""(latitude, longitude, time, lake, lower_estimate, higher_estimate, agreed_estimate, algorithm_count, xaxis, yaxis, zaxis, altitude, accuracy, photo_identifier) VALUES "" + name);}/** * This method returns a double array and probably shouldn't be this hacky... *  *  * @return */public Vector&lt;ReportInstanceQuery&gt; reportSelect(){    Vector&lt;ReportInstanceQuery&gt; tempReports = new Vector&lt;ReportInstanceQuery&gt;();    Cursor c = database.rawQuery(""SELECT id,time,lake,lower_estimate,higher_estimate,agreed_estimate,algorithm_count FROM"" + TABLE_NAME + "";"",null);    int indexTime = c.getColumnIndex(""time"");    int indexLake = c.getColumnIndex(""lake"");    int indexLowerEstimate = c.getColumnIndex(""lower_estimate"");    int indexHigherEstimate = c.getColumnIndex(""higher_estimate"");    int indexAgreedEstimate = c.getColumnIndex(""agreed_estimate"");    int indexAlgorithmCount = c.getColumnIndex(""algorithm_count"");    if (c != null){        int i = 0;        do {            i++;            int columnTime = c.getInt(indexTime);            String columnLake = c.getString(indexLake);            int columnLowerEstimate = c.getInt(indexLowerEstimate);            int columnHigherEstimate = c.getInt(indexHigherEstimate);            int columnAgreedEstimate = c.getInt(indexAgreedEstimate);            int columnAlgorithmCount = c.getInt(indexAlgorithmCount);            tempReports.add(new ReportInstanceQuery(columnTime, columnLake, columnLowerEstimate, columnHigherEstimate, columnAgreedEstimate, columnAlgorithmCount));        } while (c.moveToNext());    }    reportDatabase.close();    return tempReports;}/** * This method connects to the database   *  */public void CSVReportSelect(){}public void delete(){    this.database.delete(TABLE_NAME, null, null);}@Overridepublic void onCreate(SQLiteDatabase database) {        }@Overridepublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {      }private static class OpenHelper extends SQLiteOpenHelper {    OpenHelper(Context context) {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    @Override    public void onCreate(SQLiteDatabase db) {        db.execSQL(""CREATE TABLE "" + TABLE_NAME + ""(id INTEGER PRIMARY KEY AUTOINCREMENT, latitude REAL, longitude REAL, time INTEGER, lake TEXT, lower_estimate INTEGER, higher_estimate INTEGER, agreed_estimate INTEGER, algorithm_count INTEGER, xaxis REAL, yaxis REAL, zaxis REAL, altitude REAL, accuracy REAL, photo_identifier TEXT)"");    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        Log.w(""Example"", ""Upgrading database, this will drop tables and recreate."");        db.execSQL(""DROP TABLE IF EXISTS "" + TABLE_NAME);        onCreate(db);    }}</code></pre><p>}</p><p>With the error stack being...</p><p>ReportDatabase.(Context) line: 29 ReportDatabase.open(Context) line: 37<br>ReviewTab.onCreate(Bundle) line: 26 Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1123<br>ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord) line: 2231<br>ActivityThread.startActivityNow(Activity, String, Intent, ActivityInfo, IBinder, Bundle, Object) line: 2112 LocalActivityManager.moveToState(LocalActivityManager$LocalActivityRecord, int) line: 130<br>LocalActivityManager.startActivity(String, Intent) line: 342<br>TabHost$IntentContentStrategy.getContentView() line: 600<br>TabHost.setCurrentTab(int) line: 310<br>TabHost$2.onTabSelectionChanged(int, boolean) line: 126 TabWidget$TabClickListener.onClick(View) line: 268<br>RelativeLayout(View).performClick() line: 2183<br>RelativeLayout(View).onTouchEvent(MotionEvent) line: 3849<br>RelativeLayout(View).dispatchTouchEvent(MotionEvent) line: 3389 RelativeLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 831 TabWidget(ViewGroup).dispatchTouchEvent(MotionEvent) line: 863<br>LinearLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 863<br>TabHost(ViewGroup).dispatchTouchEvent(MotionEvent) line: 863<br>FrameLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 863<br>LinearLayout(ViewGroup).dispatchTouchEvent(MotionEvent) line: 863<br>PhoneWindow$DecorView(ViewGroup).dispatchTouchEvent(MotionEvent) line: 863<br>PhoneWindow$DecorView.superDispatchTouchEvent(MotionEvent) line: 1707<br>PhoneWindow.superDispatchTouchEvent(MotionEvent) line: 1197 HelloFlamingos(Activity).dispatchTouchEvent(MotionEvent) line: 1993 PhoneWindow$DecorView.dispatchTouchEvent(MotionEvent) line: 1691<br>ViewRoot.handleMessage(Message) line: 1525<br>ViewRoot(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 123 ActivityThread.main(String[]) line: 3948<br>Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]<br>Method.invoke(Object, Object...) line: 521<br>ZygoteInit$MethodAndArgsCaller.run() line: 782<br>ZygoteInit.main(String[]) line: 540 NativeStart.main(String[]) line: not available [native method]  </p><p>Ideas?</p>","195633","","219159","","2010-07-23 17:14:55","2010-07-23 17:14:55","Android Database Access Across Tabs","<android><database><sqlite>","1","3","0","",""
"3313317","1","","","2010-07-22 20:49:06","1","1335","<pre><code>public class Unistallreceiver extends BroadcastReceiver {     @Override     public void onReceive(Context context, Intent intent) {             // TODO Auto-generated method stub             String action = intent.getAction();             if (action == null)                     Log.e(""uninstall "", ""Action==null!"");             else if (""android.intent.action.BOOT_COMPLETED"".equals(action)) {                     Log.e(""uninstall "", ""action :""+action);             }     } </code></pre><p>} </p><p>Doing something like this, but can't get notification.Reference said :</p><blockquote>  <p>public static final String ACTION_PACKAGE_REMOVED</p></blockquote><p>Since: API Level 1Broadcast Action: An existing application package has been removed from the device. The data contains the name of the package. <strong>The package that is being installed does not receive this Intent</strong></p><p>A need this intent to set uninstall password.</p><p>Any suggestions??</p>","215381","","215381","","2010-07-23 09:47:38","2011-04-07 13:54:38","Can I catch uninstall action in my Android app","<java><android>","1","0","1","",""
"3313347","1","","","2010-07-22 20:52:20","7","9758","<p>Is it possible to update a SimpleAdapter?  I have a list of data and a footer that says ""See Next Results"" When that list item is clicked I capture the event and get new data.  I then want to replace the data in the ListView with this new data but I can't figure out how to do it.  Any Ideas?  I don't want to use an ArrayAdapter, cause as far as I can see the items can only hold one string where I need it to hold multiple strings and ints.</p>","347503","","","","","2013-08-22 14:52:23","How to update SimpleAdapter in Android","<android><listview><listadapter>","4","0","1","",""
"3313483","1","","","2010-07-22 21:06:49","8","16196","<p>I am aware of <code>setSelection()</code>, <code>setSelectionFromTop()</code>, and <code>setSelectionAfterHeaderView()</code>, but none of them seems to do what I want.</p><p>Given an item in the list, I want to scroll so that it is in view.  If the item is above the visible window of the list, I want to scroll until the item is the first visible item in the list; if the item is below the visible window, I want it to scroll up until it is the last visible item in the list.  If the item is already visible, I don't want any scrolling to occur.</p><p>How do I go about this?</p>","82118","","","","","2014-03-31 20:55:05","Setting ListView scroll position nicely in Android","<android><listview><scrolling>","3","5","3","",""
"3313579","1","3313723","","2010-07-22 21:18:21","1","521","<p>I've spent so much time trying to figure this out.  I'm building a dialog layout and trying to get the Title centered relative to the dialog while having 2 buttons on either side of the title.  The buttons are to be 'gravity-ed' towards far left and far right.</p><p>The easy part is centering the dialog, OR doing the buttons far left and far right.  It's getting them to play nice with each other on the same line.</p><p><strong>Easy way to think about it:</strong></p><ol><li>Title is centered in dialog</li><li>2 Buttons are independently aligned left and right on the same line</li></ol><p>Any thoughts on how to do this?</p>","399632","","298389","","2012-09-16 18:40:24","2012-09-16 18:40:24","Absolute Centering in Android Layout","<java><android><xml><android-layout>","1","0","","",""
"3313712","1","3314829","","2010-07-22 21:36:33","0","1670","<p>I try to save a unique image to each object but I get this error, how should the constructor look for it to work that way?The constructor Beer(String, int, int) is undefined</p><pre><code>m_beer = new ArrayList&lt;Beer&gt;();              final Beer b1 = new Beer(""Tuborg"", 7, R.drawable.tuborg);              final Beer b2 = new Beer(""Carlsberg"", 7, R.drawable.carlsberg);              final Beer b3 = new Beer(""Urquel"", 9, R.drawable.urquel);public class Beer {    //Members    private String name;    private int color; //1 = Very dark 10 = Very light    private R.drawable icon;    //Methods    public Beer(String name, int color, R.drawable icon)    {        this.name = name;        this.color = color;        this.icon = icon;    }    public String getName()    {        return name;    }    public void setName(String name)    {        this.name = name;    }    public int getColor()    {        return this.color;    }    public void setColor(int color)    {        this.color = color;    }    public R.drawable getIcon()    {        return icon;    }}</code></pre>","399658","","","","","2010-07-23 01:51:02","How do I pass a R.drawable as a parameter so I can get images parsed","<java><android>","2","0","1","",""
"3313960","1","","","2010-07-22 22:17:50","2","2221","<p>I'd like to have some emergency cleanup code execute just before my app crashes. I tried using onDestroy(),, onFinal() and finalize() to no avail. Is this possible in an Android Activity?</p>","108478","","","","","2010-07-22 23:05:16","Callback before Force Close of Android Activity?","<android>","2","3","1","",""
"3314094","1","","","2010-07-22 22:41:12","4","1135","<p>I've got my ListView on screen.  It's scrolled to the top.  I see 6 rows.  And when I Log getFirstVisiblePosition() and getLastVisiblePosition(), it says 0 and 6.</p><p>Is getLastVisiblePosition() actually returning the first non-visible position?  In other words, should my test for whether a particular row is onscreen be not</p><pre><code>first &lt;= row &amp;&amp; row &lt;= last</code></pre><p>but rather</p><pre><code>first &lt;= row &amp;&amp; row &lt; last</code></pre><p>?</p>","82118","","","","","2011-03-21 17:39:08","Do ListView's getFirstVisiblePosition and getLastVisiblePosition lie?","<android><listview>","1","1","","",""
"3314110","1","3314134","","2010-07-22 22:44:47","9","2541","<p>What has people's experience been in learning Android?</p><p>I'd be interested in how long it takes to get to the point where you're writing your first app, and how the experience compares to learning some other programming API.</p><p>I know several professional programmers who have tried to learn Android and failed.  Is it inherently more difficult or larger than you might expect?  But there's a survey here<a href=""http://www.infoq.com/news/2010/07/Mobile-Survey"">http://www.infoq.com/news/2010/07/Mobile-Survey</a>that claims Android has the shortest learning curve of all smartphone platforms.  I wonderhow the survey guys could have got such a perverse and unlikely result.</p><p>I have my own views and observations on this, which I'll mention as a dialog develops.  I don't want to bias the discussion with my perspective at this point.  Thanks.</p><p>Peter</p>","253661","","","","","2010-07-23 00:15:41","What's the learning curve for Android?","<android><time>","3","3","3","",""
"3314137","1","","","2010-07-22 22:50:44","58","38433","<p>I am using Android SDK 2.2, testing my application with the emulator. I want to send a HTTP Post. When I do I get a UnknownHostException. I have placed the required permissions <br><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /</code>><br> in the manifest.xml. Also I can open the browser on the emulator and navigate to the URL with no problem.</p><p>Here is my code:</p><pre><code>HttpClient httpclient = new DefaultHttpClient();HttpPost httppost = new HttpPost( uri );HttpResponse response = null;try{// Add your dataList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2 );nameValuePairs.add( new BasicNameValuePair( ""id"", ""edit-name"" ) );nameValuePairs.add( new BasicNameValuePair( ""stringdata"", userName ) );httppost.setEntity( new UrlEncodedFormEntity( nameValuePairs ) );// Execute HTTP Post Requestresponse = httpclient.execute( httppost );// Log.i( ""HttpManager:"", ""======&gt; response: ""// + response.getEntity().getContent() );}catch (ClientProtocolException e){Log.e( ""HttpManager"", ""ClientProtocolException thrown"" + e );}catch (IOException e){Log.e( ""HttpManager"", ""IOException thrown"" + e );}</code></pre>","399711","","197325","","2010-07-29 22:15:06","2013-03-28 10:00:33","Android: UnknownHostException","<android><http><post><android-emulator>","9","0","8","",""
"3314176","1","3314257","","2010-07-22 22:57:31","10","13700","<p>I have a table with column headings: | _id (long) | Name (String) | x (integer) | y (integer) |</p><p>I want to delete the row in the table that has Name myName.</p><pre><code>// In onCreatedbHelper = new DBAdapter(this);dbHelper.open()// Function in DBAdapter classpublic boolean deleteTitleGivenName(String myName) {    return dbHelper.delete(DATABASE_TABLE_2, KEY_NAME + ""="" + myName, null) &gt; 0;}// Function call in java codedbHelper.deleteTitleGivenName(myName);  // this is where my code fails  dbHelper.close();           </code></pre><p>Just as a note: myName is for sure in the database. Also, I can not use the ROWID since I am getting myName from a ListView.</p><p>I just started programming with Android and I have tried for days to solve this problem.Is my WHERE clause correct (KEY_NAME + ""="" + myName)?</p><p>Thanks in advance.</p>","399717","","","","","2013-05-18 11:06:44","Delete row in database table given one column value - which is a string","<android>","4","0","4","",""
"3314229","1","3319816","","2010-07-22 23:06:21","1","82","<p>I have a listview. Whenever I strike an item of listview the debugger gets opened instead of starting a new activity (i.e. what I want).</p><p>here is the listview code..</p><pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, s));        ListView lv = getListView();        lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,int position, long id) {                startAc();    }  });</code></pre><p>the startAc() function is defined on top as:</p><pre><code>public void startAc()    {        startActivity( new Intent(this, contents.class) );    }</code></pre><p>the contents class file is defined as:</p><p>package com.webkul.feedGrabber;</p><pre><code>import android.app.ListActivity;import android.os.Bundle;public class contents extends ListActivity{     @Override     protected void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.m);     }}</code></pre><p>P.S. all the xml files are correct.</p>","172543","","","","","2010-07-23 15:43:21","starting a new activity throws me into debug mode and stops the app","<java><android>","3","3","","",""
"3314304","1","","","2010-07-22 23:24:20","0","2008","<p>I'm trying to add a listview on the bottom of my opening activity that has two text items. Anyone know how to do this? I see stuff on how to do a listview with two columns, and how to do a listview at the bottom of an activity, but I can't find any that does both. </p>","399741","","","","","2010-07-23 00:04:32","Android ListView with two columns that only takes up bottom part of the screen","<android><listview>","1","0","","",""
"3314388","1","3320224","","2010-07-22 23:45:01","1","987","<p>I have a listview which is populated by a <code>SimpleCursorAdapter</code> that is binding data to the view from a cursor from a sqlite database. I would like to have a context menu option to delete the a list item when it is long pressed, so I register the ListView for a context menu by calling <code>registerForContextMenu(historyListView)</code>. I've been trying to remove the row from the database by getting the row id in <code>OnCreateContextMenu</code> and storing it as a private field called <code>lastSelectedId</code>, then if the remove context item is selected in <code>OnContextItemSelected</code>, removing the row from the database by checking the <code>_id</code> column against <code>lastSelectedId</code>.</p><p>This isn't working.</p><p>So - (1.) is the row as given by </p><pre><code>public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo;        lastSelectedId = info.id;</code></pre><p>the same as the _id column in the database?</p><p>and (2.) if not, how else can I delete the item in <code>onContextItemSelected()</code> based on the <code>_id</code> of the row in the database? </p><p>EDIT: Sorry about not explaining why this approach wasn't working more in-depth: What happens is that nothing happens when I attempt to delete the row: I call <code>mDB.delete(DB_TABLENAME,""_id="" + lastSelectedId, null);</code> on the database and then I call <code>bookmarksListAdapter.notifyDataSetChanged();</code> on my <code>SimpleCursorAdapter</code>. Then I see no change in the entries in my listview, which differs from my expected behavior that the row which I called remove on will disappear.</p>","381299","","381299","","2010-07-23 16:10:45","2010-07-23 17:43:58","Deleting row from database using _id column in context menu from ListView","<android>","2","0","1","",""
"3314565","1","3314574","","2010-07-23 00:35:51","0","1487","<p>If I create buttons dynamically in a loop,</p><p>for(i=0; i &lt; size; i++) {</p><pre><code>Button button = new Button(this);myLayout.addView(button);</code></pre><p>}</p><p>How can I reference each of these buttons at a later time? So, for eg, if I wanted to change the text on a few buttons, how would I do that?</p><p>ThanksChris</p>","398505","","","","","2010-07-23 02:03:44","Android accessing buttons created dynamically","<android><dynamic><button>","2","0","","",""
"3314602","1","4642266","","2010-07-23 00:43:44","2","2069","<p>is there a way to have 2 gradients in a drawable xml using either a <code>&lt;layer-list&gt;</code> or <code>&lt;shape&gt;</code> or some combination of them?</p>","372405","","","","","2011-01-09 22:31:24","Android multiple gradient xml","<android><gradient><drawable>","2","0","1","",""
"3314659","1","3314675","","2010-07-23 01:02:05","0","103","<p>Can you please tell me where I can find example in how to invoke andord recoding sound/voice functionality?</p><p>Thank you.</p>","286802","","","","","2010-07-23 01:06:15","How to invoke recoding sound/voice functionality in android","<android>","1","0","","",""
"3314735","1","","","2010-07-23 01:28:13","7","3786","<p>Often my programs simply crash.  I can't see anything in the LogCat or otherwise useful information elsewhere to find out what's gone wrong.  The only thing I see is some kind of exception.  This is unacceptable and makes Android programming nearly impossible.  I'm sure there must be some additional help to debugging, but after weeks of searching, nothing.  </p><p>Does anyone have hints on how to find a bug in a program that simply crashes?  </p><p>General question I know, but without an answer, I'm going to have to quit trying to develop apps for Android.  I can't spend weeks of searching for every simple mistake.  </p>","329999","","","","","2013-02-25 07:06:22","Android Debugging Tips","<android><debugging>","6","1","1","",""
"3314760","1","","","2010-07-23 01:34:18","1","480","<p>On an Android 2.1 device (Samsung Galexy S), I am trying to record audio data using the following code. </p><hr><p>int frequency = 16000;   </p><p>int channelConfiguration = AudioFormat.CHANNEL_IN_MONO;<br>   int audioEncoding = AudioFormat.ENCODING_PCM_16BIT;    int bufferSize = AudioRecord.getMinBufferSize(frequency, channelConfiguration, audioEncoding);   AudioRecord audioRecord = new AudioRecord( MediaRecorder.AudioSource.MIC,      frequency, channelConfiguration, audioEncoding, bufferSize);    short [] buffer = new short[bufferSize]; </p><p>isAdIdle = false;    audioRecord.startRecording(); </p><p>while( isRecording ) {    int bufferReadResult = audioRecord.read(buffer, 0, bufferSize);                                // save buffer data</p><h2>                        }</h2><p>This code worked well on other devices, such as nexus one, but on the Samsung Galexy S, I have the following error message: </p><hr><h2>AFCCreateReSampler: avAFCInfo->bUsed[0] in SampleRate[44100] outSampleRate[16000] nChannel[2] outBitDepth[16]</h2><p>What is the problem? Could anyone help me to resolve this one? </p><p>Thanks in advance~ YI Kim. </p>","399796","","","","","2010-09-05 09:11:54","what the error message ""AFCCreateReSampler: avAFCInfo->bUsed[0] in SampleRate[44100] outSampleRate[16000]..."" mean?","<android>","3","0","","",""
"3314798","1","3314802","","2010-07-23 01:42:28","0","479","<p>I looked for the answer but didn't find one - my question(s) follow:</p><p>I wrote code that works with the emulator (I send local coords vis DDMS).</p><p>The code also works on the device <strong>BUT</strong>, only after running Google Map.  I'm guessing there's something missing in either the manifest or in the code but I don't know what it is and I could use some advice/suggestions.</p><p><strong>Here are snippets of the relevant portions of the Code:</strong>(I wasn't able to figure out how to properly embed this stuff so it looked intelligent/organized but, I think you get the point...)</p><pre><code>homeboy = (LocationManager)getSystemService(Context.LOCATION_SERVICE);    locationListener = new MyLocationListener();Location recentLoc = homeboy.getLastKnownLocation(LocationManager.GPS_PROVIDER);I also have a LocationListener method (shown w/o it's four methods of checking for enabled, changed,...etc)private class MyLocationListener implements LocationListener {... etc.I include this in the manifest file near the top:&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;</code></pre><p>So, what's missing?Also, how to get location from wifi (as in getting the location by any means available short of saving the last location to a file and retrieving it).</p><p>Thanks for any input</p>","382200","","","","","2010-07-23 02:07:09","Android GPS Only Communicates After Google Map Runs","<android><gps><location>","2","0","","",""
"3314838","1","3314952","","2010-07-23 01:52:50","2","6773","<p>The official documentation describes tasks as follows:</p><blockquote>  <p>*All the activities in a task move together as a unit. The entire task (the entire activity stack) can be brought to the foreground or sent to the background. Suppose, for instance, that the current task has four activities in its stack — three under the current activity. The user presses the HOME key, goes to the application launcher, and selects a new application (actually, a new task). The current task goes into the background and the root activity for the new task is displayed. Then, after a short period, the user goes back to the home screen and again selects the previous application (the previous task). That task, with all four activities in the stack, comes forward. </p></blockquote><p>Is there a way to programmatically detect when the task of the current Activity moves into and out of the background? I would like to know when the user has switched switched to another application, vs. when the user navigated to another Activity in the current app.</p>","440093","","","","","2012-07-23 21:49:17","Android: How to detect if current stack of activities (task) moves to background?","<android>","8","2","5","",""
"3314869","1","3315178","","2010-07-23 01:59:34","9","1939","<p>When is it preferable to use a Dialog box as opposed to an Activity in Android? From my understanding, anything you can do with a Dialog box you can also accomplish with an Activity. Are there any tasks that can only be accomplished by an Activity or a Dialog?</p>","440093","","","","","2012-07-26 03:08:19","Android: When to use Dialog vs. Activity","<android>","3","0","","",""
"3314957","1","3315171","","2010-07-23 02:22:43","6","3709","<p>I get this exception when I try to inflate</p><p>07-22 19:15:39.903: ERROR/AndroidRuntime(3810): Caused by: java.lang.ClassCastException: android.widget.RelativeLayout</p><p>I have a base class:</p><pre><code>public class UIBase extends RelativeLayout {}</code></pre><p>And a more specific class:</p><pre><code>public class Countdown extends UIBase {}</code></pre><p>Then I try to inflate and it exceptions:</p><pre><code>UIBase newView = (UIBase) inflater.inflate(layoutId, parent, true);</code></pre><p>Here's the XML file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.Countdown xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/countdown""    android:layout_alignParentTop=""true""    android:layout_alignParentRight=""true""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    &gt;&lt;TextView    android:id=""@+id/countdownText""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:layout_centerInParent=""true""    android:text=""0"" /&gt;&lt;/com.Countdown&gt;</code></pre><p>Does anyone know what I'm doing wrong?</p>","92259","","92259","","2010-07-23 02:36:09","2010-07-23 03:28:02","Class cast exception when inflating a custom Relative Layout?","<android>","1","3","","",""
"3315018","1","3315081","","2010-07-23 02:37:37","1","819","<p>I am trying to get my samsung moment (android 2.1) connected to my windows 7 64bit desktop so that I can debug on phone from the netbeans ide.  </p><p>In my phone settings I have Settings > Applications > Development > USB Debugging checkedI read that Settings > About phone > Additional Settings > Mass store, should not be checked but I don't have an additional settings item in the about phone section</p><p>I have the android sdk downloaded and unzipped along with the usb drivers downloaded through the sdk manager.  </p><p>When I plug the phone in windows says it cant find the drivers.  When I goto device manager I see SAMSUNG_Android listed under Other devices.  When I hit update drivers and point it at the android-sdk-windows\usb_driver folder it says ""Windows could not find driver software for your device""</p><p>running adb devices on the command prompt only lists the virtual device emulator i setup.</p><p>running adb kill-server prior to adb devices doesnt have any effect.</p><p>Any ideas?</p><p>p.s.  If I turn off usb debugging and connect the usb to the computer, it recognizes the sd card</p>","122229","","","","","2011-03-12 22:56:48","How to get samsung moment to connect with adb","<android>","1","0","","",""
"3315060","1","3316213","","2010-07-23 02:49:01","9","1275","<p>I made a custom title bar for my app which works. However, when the app first loads, the app name is displayed in the title bar for a moment before my text appears. How do I stop this from happening?</p><p>I set my custom title bar in my main activity here:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);    setContentView(R.layout.main);    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle);</code></pre><p>mytitle.xml is where I set my text:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/myTitle""    android:text=""my text""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:gravity=""center""    android:textAppearance=""?android:attr/textAppearance""    /&gt;</code></pre><p>My title bar background doesn't flash, just the text.</p><p>Thanks.</p>","398607","","398607","","2010-07-23 03:04:54","2013-05-07 04:46:00","Stop app name from flashing in title bar","<android>","3","0","6","",""
"3315167","1","3315704","","2010-07-23 03:26:36","2","510","<p>I am still trying to figure out frame animation, but I need to use IDs. I don't get it... I get the wierdest errors... </p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;animation-list xmlns:android=""http://schemas.android.com/apk/res/android"" android:oneshot=""false"" android:id=""@+id/carrotsmileanim""&gt; &lt;item android:drawable=""@drawable/carrotsmile"" android:duration=""2000"" /&gt; &lt;item android:drawable=""@drawable/carrotblink"" android:duration=""2000"" /&gt; &lt;android:id=""@+id/carrotsmileanim&gt;&lt;/android:id&gt;&lt;/animation-list&gt;</code></pre><p>In the ID section the error is: ""</p><pre><code>android:id"" must be followed by either attribute specifications, ""&gt;"" or ""/&gt;""</code></pre><p>My Java code is this:</p><pre><code>package com.example.carrottest2;import android.app.Activity;import android.graphics.drawable.AnimationDrawable;import android.os.Bundle;import android.widget.ImageView;import android.R;public class Carrottest2 extends Activity {/** Called when the activity is first created. */AnimationDrawable mainanimation; public void onCreate(Bundle icicle) {       super.onCreate(icicle);       ImageView carrotsmile = (ImageView) findViewById(R.id.carrotblink);     rocketImage.setBackgroundResource(R.drawable.rocket_thrust);     c = (AnimationDrawable) rocketImage.getBackground();     carrotsmileanim.start();</code></pre><p>The tutorial frame animation android IDs are still there, I never changed them, but it does not recognize carrotblink, rocketImage, rocketthrust, c, carrotsmileanim, and says ""cannot be resolved or is not a field."" error. </p><p>Can someone help me with this? Which is supposed to go where?</p><p>Is main.xml involved in this? I know there is supposed to be an imageview somewhere, but where?</p>","394842","","","","","2010-07-23 06:10:09","Android Question - Please explain Android ID's to me?","<android><eclipse><sdk>","1","0","","",""
"3315253","1","","","2010-07-23 03:48:15","1","572","<p>I configure my email in the Android simulator(Default Email configuration in android aimulator 2.1) .And I download the attachment from my mail. I need to read that file in my application .Is there any possibility to read the file in my application. I am new to android. Can anyone help me to solve this ??? Thanks in advance?  </p><p>Note in the Eclipse android file explore it show the data in data/data/com.email.attachmentprovidr/databases/_att.1/<strong>1</strong>  I export that object 1 to my computer it has the actual data</p>","399864","","399864","","2010-07-23 04:21:21","2012-08-31 15:47:31","How to read the downloaded file in android?","<android>","0","3","","",""
"3315269","1","3315349","","2010-07-23 03:54:01","1","3808","<p>What I have here real simple activity with two buttons. When you press each of them it plays a sound.</p><p>When i press and hold the first button it brings up a context menu asking the user if they want to save the sound as a ringtone or notification. This works perfectly on the first button.</p><p>The second button's sound plays when pressed. When long pressed it brings up the context menu....BUT it saves the first sound file as ringtone/notification NOT the second...</p><p>Would someone be able to shed some insight on why the second context menu isn't working properly?</p><pre><code>package com.my.app;import java.io.File;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import android.view.ContextMenu.ContextMenuInfo;  import android.widget.Button;  import android.widget.Toast; import android.app.Activity;import android.content.ContentValues;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.provider.MediaStore;import android.view.ContextMenu;import android.view.MenuItem;import android.view.View;import android.view.View.OnClickListener;public class One extends Activity implements OnClickListener{    private SoundManager mSoundManager;   @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.one);        mSoundManager = new SoundManager();        mSoundManager.initSounds(getBaseContext());        mSoundManager.addSound(1, R.raw.blah);        mSoundManager.addSound(2, R.raw.rofl);//BUTTONS PLAY SOUND WHEN PRESSED        View SoundButton1 = findViewById(R.id.Sound1);        SoundButton1.setOnClickListener(this);        View SoundButton2 = findViewById(R.id.Sound2);        SoundButton2.setOnClickListener(this); }            public void onClick(View v) {                switch (v.getId()) {                case R.id.Sound1:        mSoundManager.playSound(1);                break;            case R.id.Sound2:    mSoundManager.playSound(2);                break;    }//WHEN LONG PRESSED BUTTONS BRING UP CONTEXT MENU FOR SAVE AS RINGTONE OR NOTIFICATION        Button SoundButton11 = (Button) findViewById(R.id.Sound1);          registerForContextMenu(SoundButton11);          Button SoundButton22 = (Button) findViewById(R.id.Sound2);          registerForContextMenu(SoundButton22);      }  //CONTEXT MENU FOR BUTTON 1    @Override      public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {      super.onCreateContextMenu(menu, v, menuInfo);          menu.setHeaderTitle(""Save as..."");          menu.add(0, v.getId(), 0, ""Ringtone"");          menu.add(0, v.getId(), 0, ""Notification"");      }      @Override      public boolean onContextItemSelected(MenuItem item) {          if(item.getTitle()==""Ringtone""){function1(item.getItemId());}          else if(item.getTitle()==""Notification""){function2(item.getItemId());}          else {return false;}      return true;      }      public void function1(int id){         if (savering(R.raw.blah)){              // Code if successful              Toast.makeText(this, ""Saved as Ringtone"", Toast.LENGTH_SHORT).show();            }              else              {              // Code if unsuccessful              Toast.makeText(this, ""Failed - Check your SDCard"", Toast.LENGTH_SHORT).show();            }    }      public void function2(int id){          if (savenot(R.raw.blah)){              // Code if successful              Toast.makeText(this, ""Saved as Notification"", Toast.LENGTH_SHORT).show();            }              else              {              // Code if unsuccessful              Toast.makeText(this, ""Failed - Check your SDCard"", Toast.LENGTH_SHORT).show();            }//CONTEXT MENU FOR BUTTON 2     }    public void onCreateContextMenu1(ContextMenu menu, View v,ContextMenuInfo menuInfo) {      super.onCreateContextMenu(menu, v, menuInfo);          menu.setHeaderTitle(""Save as..."");          menu.add(0, v.getId(), 0, ""Ringtone"");          menu.add(0, v.getId(), 0, ""Notification"");      }      public boolean onContextItemSelected1(MenuItem item) {          if(item.getTitle()==""Ringtone""){function11(item.getItemId());}          else if(item.getTitle()==""Notification""){function21(item.getItemId());}          else {return false;}      return true;      }      public void function11(int id){         if (savering(R.raw.rofl)){              // Code if successful              Toast.makeText(this, ""Saved as Ringtone"", Toast.LENGTH_SHORT).show();            }              else              {              // Code if unsuccessful              Toast.makeText(this, ""Failed - Check your SDCard"", Toast.LENGTH_SHORT).show();            }    }      public void function21(int id){          if (savenot(R.raw.rofl)){              // Code if successful              Toast.makeText(this, ""Saved as Notification"", Toast.LENGTH_SHORT).show();            }              else              {              // Code if unsuccessful              Toast.makeText(this, ""Failed - Check your SDCard"", Toast.LENGTH_SHORT).show();            }            }   public boolean savering(int ressound){         byte[] buffer=null;         InputStream fIn = getBaseContext().getResources().openRawResource(ressound);         int size=0;         try {          size = fIn.available();          buffer = new byte[size];          fIn.read(buffer);          fIn.close();         } catch (IOException e) {          // TODO Auto-generated catch block          return false;         }         String path=""/sdcard/media/audio/ringtones/"";         String filename=""HahaSound""+"".ogg"";         boolean exists = (new File(path)).exists();         if (!exists){new File(path).mkdirs();}         FileOutputStream save;         try {          save = new FileOutputStream(path+filename);          save.write(buffer);          save.flush();          save.close();         } catch (FileNotFoundException e) {          // TODO Auto-generated catch block          return false;         } catch (IOException e) {          // TODO Auto-generated catch block          return false;         }             sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse(""file://""+path+filename)));         File k = new File(path, filename);         ContentValues values = new ContentValues();         values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());         values.put(MediaStore.MediaColumns.TITLE, ""HahaSound"");         values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/ogg"");         values.put(MediaStore.Audio.Media.ARTIST, ""cssounds "");         values.put(MediaStore.Audio.Media.IS_RINGTONE, true);         values.put(MediaStore.Audio.Media.IS_NOTIFICATION, false);         values.put(MediaStore.Audio.Media.IS_ALARM, true);         values.put(MediaStore.Audio.Media.IS_MUSIC, false);         //Insert it into the database         this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);         return true;        }     public boolean savenot(int ressound){         byte[] buffer=null;         InputStream fIn = getBaseContext().getResources().openRawResource(ressound);         int size=0;         try {          size = fIn.available();          buffer = new byte[size];          fIn.read(buffer);          fIn.close();         } catch (IOException e) {          // TODO Auto-generated catch block          return false;         }         String path=""/sdcard/media/audio/notifications/"";         String filename=""HahaSound""+"".ogg"";         boolean exists = (new File(path)).exists();         if (!exists){new File(path).mkdirs();}         FileOutputStream save;         try {          save = new FileOutputStream(path+filename);          save.write(buffer);          save.flush();          save.close();         } catch (FileNotFoundException e) {          // TODO Auto-generated catch block          return false;         } catch (IOException e) {          // TODO Auto-generated catch block          return false;         }             sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse(""file://""+path+filename)));         File k = new File(path, filename);         ContentValues values = new ContentValues();         values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());         values.put(MediaStore.MediaColumns.TITLE, ""HahaSoundSound"");         values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/ogg"");         values.put(MediaStore.Audio.Media.ARTIST, ""cssounds "");         values.put(MediaStore.Audio.Media.IS_RINGTONE, false);         values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);         values.put(MediaStore.Audio.Media.IS_ALARM, true);         values.put(MediaStore.Audio.Media.IS_MUSIC, false);         //Insert it into the database         this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);         return true;        }  }</code></pre><p>UPDATED SINCE STOLE'S RESPONSE-</p><pre><code>//BUTTON 1        View SoundButton1 = findViewById(R.id.Sound1);        SoundButton1.setOnClickListener(this);        View SoundButton2 = findViewById(R.id.Sound2);        SoundButton2.setOnClickListener(this); }            public void onClick(View v) {                switch (v.getId()) {                case R.id.Sound1:        mSoundManager.playSound(1);                break;            case R.id.Sound2:        mSoundManager.playSound(2);                break;                }                Button SoundButton11 = (Button) findViewById(R.id.Sound1);                  registerForContextMenu(SoundButton11);                  Button SoundButton22 = (Button) findViewById(R.id.Sound2);                  registerForContextMenu(SoundButton22);              }    @Override      public void onCreateContextMenu(ContextMenu menu, View v,             ContextMenuInfo menuInfo) {         super.onCreateContextMenu(menu, v, menuInfo);        menu.setHeaderTitle(""Save as..."");         menu.add(0, MENU_RINGTONE, 0, ""Ringtone"");         menu.add(0, MENU_NOTIFICATION, 0, ""Notification""); }     public boolean onContextItemSelected(MenuItem item) {         AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();        long SoundButton11 = info.id;        switch (item.getItemId()) {     case MENU_RINGTONE:        if (savering(R.raw.schwing)){              // Code if successful              Toast.makeText(this, ""Saved as Ringtone"", Toast.LENGTH_SHORT).show();            }              else              {              // Code if unsuccessful              Toast.makeText(this, ""Failed - Check your SDCard"", Toast.LENGTH_SHORT).show();            }            break;    case MENU_NOTIFICATION:        if (savenot(R.raw.schwing)){              // Code if successful              Toast.makeText(this, ""Saved as Notification"", Toast.LENGTH_SHORT).show();            }              else              {              // Code if unsuccessful              Toast.makeText(this, ""Failed - Check your SDCard"", Toast.LENGTH_SHORT).show();            }            break;    }        return false;    } </code></pre><p>This is what 've got since reading your last response. I'm just trying to get it working on the first button before i try moving onto the next. But with your code i'm getting a warning under SoundButton11 ""The local variable SoundButton11 is never read""I'm confused because I have...</p><pre><code>Button SoundButton11 = (Button) findViewById(R.id.Sound1);                      registerForContextMenu(SoundButton11); </code></pre><p>I also tried Sound1 and that did not work either. Any suggestions?</p>","393373","","393373","","2010-08-07 03:51:40","2012-04-13 10:58:07","Android: Trouble with using multiple context menu's","<java><android><button><onclick><contextmenu>","2","1","2","",""
"3315389","1","3315407","","2010-07-23 04:25:08","41","19988","<p>How can I empty the logcat buffer in Android?</p><p>I use adb logcat from command line and pipe the output to a file, since the DDMS has a very limited buffer. At the moment, when I restart my app (after fixing bugs etc) the logcat buffer has data from the previous launch as well. Even uninstalling the app does not clear the buffer. The only way I've found so far to clear the buffer, is reboot. This is effective, but would like to know if there's an easier way.</p>","337120","","","","","2013-10-29 22:18:49","How to empty the logcat buffer in Android","<android>","2","0","9","",""
"3315439","1","","","2010-07-23 04:40:40","0","1190","<p>I have an doubt, I don't know how to use cmyk colors in android. If any one knows please help me. I am waiting for your valuable replies.</p>","399080","","1471203","","2013-01-09 11:19:03","2013-01-09 11:19:03","How to use use cmyk color codes in android?","<android><colors><rgb><cmyk>","1","1","","",""
"3315669","1","3359688","","2010-07-23 05:59:20","12","6580","<p>I am trying the following sample app for twitter oauth.</p><p><a href=""http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html"" rel=""nofollow"">http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html</a></p><pre><code>private void askOAuth() {        try {            consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);            provider = new DefaultOAuthProvider(""http://twitter.com/oauth/request_token"",                                                ""http://twitter.com/oauth/access_token"",                                                ""http://twitter.com/oauth/authorize"");            String authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL);            Toast.makeText(this, ""Please authorize this app!"", Toast.LENGTH_LONG).show();            this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));        } catch (Exception e) {            Log.e(APP, e.getMessage());            Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();        }    }</code></pre><p>When i run the following code it gives exception as following </p><p>""oauth.signpost.exception.OAuthNotAuthorizedException: Authorization failed (server replied with a 401). This can happen if the consumer key was not correct or the signatures did not match.""</p><p>on this line             <code>String authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL);</code></p><p>I provided the correct 'key' and 'secret' does twitter giving me wrong key and secret ?</p>","216431","","569101","","2013-03-20 13:13:20","2013-11-14 16:06:43","android twitter retrieveRequestToken 401 on request token","<android><twitter4j>","6","6","3","",""
"3315718","1","","","2010-07-23 06:14:38","3","8562","<p>I m generating one random card from array. and assigning it.'Below is the code..but its is showing an error.What is the problem?</p><pre><code>public void rand() {    String rank[]=  {""tclub1.png"", ""tclub2.png"", ""tclub3.png"", ""tclub4.png"", ""tclub5.png"", ""tclub6.png"", ""tclub7.png"", ""tclub8.png"", ""tclub9.png"", ""tclub10.png"",""tclub11.png"", ""tclub12.png"", ""tclub13.png""};    Random randInt = new Random();    int b = randInt.nextInt((rank.length));    showcard1.setBackgroundResource(b); }</code></pre>","383597","","114066","","2010-07-23 07:11:50","2011-12-14 15:14:34","Android Random Number","<java><android>","2","6","1","",""
"3315912","1","3316097","","2010-07-23 06:52:31","0","861","<p>Here is my Arrival.java</p><pre><code>package one.two;import java.io.IOException;import java.util.ArrayList;import java.util.List;import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class Arrival extends ListActivity{    private ListView listView;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        ArrayList&lt;String&gt; retList = new ArrayList&lt;String&gt;();        System.out.println(""Start onCreate Function\n"");        super.onCreate(savedInstanceState);        setContentView(R.layout.listview);        System.out.println(""In onCreate Function\n"");        System.out.println(""In of GetData\n"");        DBAdapter db = new DBAdapter(this);         System.out.println(""DB Open\n"");        db.open();        System.out.println(""DB Opened\n"");        retList = getData();        System.out.println(""Out of GetData\n"");        // force count no. of records in table        // dump to check index        int cnt = 2;        int i=0;        for (i = 0; i&lt;cnt; i++)            System.out.println(retList.toString());        System.out.println(""Array 2 String\n"");        Cursor c = db.getCursor();        String[] from = new String[] {DBAdapter.status};        int[] to = new int[] {R.id.txt1};        SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this, R.layout.listtext, c, from, to);        this.setListAdapter(mAdapter);        System.out.println(""Show List\n"");        db.close();    }    public static ArrayList&lt;String&gt; getData()     {        ArrayList&lt;String&gt; items = DBAdapter.getAllTitles();        System.out.println(""Return a LIST titles\n"");         return items;        }    }</code></pre><p>DBAdapter.java</p><pre><code>package one.two;import java.util.List;import android.app.ListActivity;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteDatabase.CursorFactory;import java.util.ArrayList;public class DBAdapter{    public static String status = ""status"";    public String id = ""id"";    public String arrival = ""arrival"";    public String destination = ""destination"";    public String ferry = ""ferry"";    private static String DB_PATH = ""/data/data/one.two/databases/"";    private static final String DATABASE_NAME = ""ferry.db"";    private static final String DATABASE_TABLE = ""port"";    public static Context context;    public Cursor c;    public static SQLiteDatabase DbLib;        //overloaded non-null constructor    public DBAdapter(Context context)     {        DbLib = context.openOrCreateDatabase(DATABASE_NAME,  SQLiteDatabase.CREATE_IF_NECESSARY,null);        System.out.println(""OpenOrCreateDB Done"");    }    public class DatabaseHelper extends SQLiteOpenHelper    {        Context context;        DatabaseHelper(Context context)        {            super(context, DATABASE_NAME, null, DATABASE_VERSION);            this.context = context;        }//end constructor DatabaseHelper        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion,                int newVersion)        {        }//end onUpgrade()        @Override        public void onCreate(SQLiteDatabase db)        {        }//end onCreate()    }// end class DatabaseHelper    private static DatabaseHelper DBHelper;    //private static SQLiteDatabase DbLib;    private static final int DATABASE_VERSION = 1;    //// context brought up /////////////    //private final Context context;        /*public void DBAdapter() throws SQLException        {            String myPath = DB_PATH + DATABASE_NAME;            db = SQLiteDatabase.openDatabase(myPath, null,                    SQLiteDatabase.OPEN_READONLY);        }//end DBAdapter()*/        public static ArrayList&lt;String&gt; getAllTitles()        {            ArrayList&lt;String&gt; port = new ArrayList&lt;String&gt;();                Cursor c=null;                c = DbLib.query(""port"",                        new String[] { ""status"", ""id"", ""arrival"",                                ""destination"", ""ferry"" }, null, null,                        null, null, null);                try {                    if (c!=null) { // start - when there is at least 1 record                        System.out.println(""Cursor is NOT NULL"");                        int i =0;                        for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext())                         {                                    // Debug Stm                            System.out.println(""Record No. ""+i);                            System.out.println(c.getString(0));                            System.out.println(c.getString(1));                            System.out.println(c.getString(2));                            System.out.println(c.getString(3));                            System.out.println(c.getString(4));                            // Assign database cursor.records to arraylist                            port.add(i,c.getString(0));                            port.add(i,c.getString(1));                            port.add(i,c.getString(2));                            port.add(i,c.getString(3));                            port.add(i,c.getString(4));                            i = i + 1;                        }                    } // end - where there is at least 1 record                } finally {                    if (c!=null) {                    c.close();                }                }               return port;        }//end getAllTitles()        public void open() {            //Open the database            String myPath = DB_PATH + DATABASE_NAME;            DbLib = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);        }        public Cursor getCursor(){            return c;        }        public void close()        {            DbLib.close();        }    }//end class DBAdapter</code></pre><p>main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/widget0""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextViewandroid:id=""@+id/widget32""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Ferry Hub""android:textSize=""25sp""android:textStyle=""bold""android:textColor=""#ff009999""android:layout_x=""97px""android:layout_y=""15px""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/widget35""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Arrival Time""android:layout_x=""116px""android:layout_y=""48px""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/Text1""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""""android:layout_x=""200px""android:layout_y=""90px""&gt;&lt;/TextView&gt;&lt;Buttonandroid:id=""@+id/widget36""android:layout_width=""96px""android:layout_height=""40px""android:text=""Back""android:layout_x=""101px""android:layout_y=""299px""&gt;&lt;/Button&gt;&lt;ListView     android:layout_width=""wrap_content""    android:layout_y=""132dip""    android:layout_x=""150dip""    android:id=""@android:id/list""    android:layout_height=""wrap_content""&gt;&lt;/ListView&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>Error from logcat:</p><pre><code>07-23 07:00:45.625: ERROR/AndroidRuntime(725): Uncaught handler: thread main exiting due to uncaught exception07-23 07:00:45.654: ERROR/AndroidRuntime(725): java.lang.RuntimeException: Unable to start activity ComponentInfo{one.two/one.two.Departure}: java.lang.ClassCastException: java.util.ArrayList07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at android.os.Handler.dispatchMessage(Handler.java:99)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at android.os.Looper.loop(Looper.java:123)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at android.app.ActivityThread.main(ActivityThread.java:3948)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at java.lang.reflect.Method.invokeNative(Native Method)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at java.lang.reflect.Method.invoke(Method.java:521)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at dalvik.system.NativeStart.main(Native Method)07-23 07:00:45.654: ERROR/AndroidRuntime(725): Caused by: java.lang.ClassCastException: java.util.ArrayList07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at one.two.Departure.onCreate(Departure.java:27)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)07-23 07:00:45.654: ERROR/AndroidRuntime(725):     ... 11 more</code></pre><p>May i know why isn't there any data being shown on my ListView?</p>","358218","","114066","","2012-01-27 08:43:58","2012-01-27 08:43:58","No data shown on listview","<android><database><eclipse><sqlite><android-listview>","2","1","0","",""
"3315966","1","","","2010-07-23 07:02:18","0","4436","<p>Is it possible to use OpenGL to display video and be able to resize the view in runtime?</p>","381699","","44729","","2010-07-23 15:17:48","2014-01-13 04:55:53","OpenGL in Android for video display","<android><opengl-es>","1","0","2","",""
"3316092","1","","","2010-07-23 07:22:07","0","158","<p>I am basically using a datetime control in my application.</p><p>Wherein on a click event i am initiating datetime dialog.</p><p>In another scenario, i want to move current date, to next day, or previous day.I don't want the dialogbox of date time control to be displayed.</p><p>Is it possible??</p>","395563","","","","","2011-06-27 17:53:22","Calling the date time , without initiating the dialog box of Datetime control","<android>","1","0","","",""
"3316282","1","3317957","","2010-07-23 07:52:27","2","1199","<p>I configure email by using the android2.1 emulator. When I download the files from mail attachment I get the path <strong>content://com.android.email.attachmentprovider/1/1/RAW</strong></p><p>I need to read that file data. How to read the data from the device.??Is there any permission to read file from the phone memory.My code is here:</p><pre><code> intent = getIntent();         String str_sel_fname=intent.getDataString();</code></pre><p>In the eclipse file explorer /data/data/com.android.email/databases/1.db_att/<strong>1</strong></p><p>here 1 is store the attachment file .Now can anyone help me to get the data from that.??</p>","398981","","398981","","2010-07-23 11:58:39","2010-07-23 12:08:22","Read mail Attachment files in Android2.1?","<android>","1","0","","",""
"3316287","1","","","2010-07-23 07:53:09","0","485","<p>Is Android capable of recognizing the lmx file format for a landmark when it receives one  by e-mail ? Can it react to this by opening google maps , or other application ?</p>","304866","","","","","2010-07-23 08:03:02","lmx file format in android","<android>","1","0","","",""
"3316431","1","5032267","","2010-07-23 08:13:56","17","11781","<p>Basically I have this inside XML, but I have to recreate it inside a code. How do I do it?</p><pre><code>&lt;EditText         android:layout_width=""140dp""        android:layout_height=""20dp""        android:background=""@drawable/input_bg01""        android:textSize=""10dp""        android:gravity=""center""        android:text=""111-222-333     FOOO"" /&gt;</code></pre><p>I can use this to set text size, but what about the layout_width and height?</p><pre><code>edTxt.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 10);</code></pre><p>Is there a way to tell the code to use DP unit instead of pixel? Or a conversion function to convert DP into pixel?</p>","271736","","","","","2013-06-19 11:30:51","How do I set Layout and Text size to DP inside program?","<java><android><layout>","2","0","1","",""
"3316466","1","","","2010-07-23 08:19:57","6","790","<p>I would like to find out whether my android phone (ADP) is using A5/0, A5/1 or A5/2 at a specific time. How can I achieve this?</p>","400032","","","","","2011-09-27 16:30:56","Identify GSM encryption algorithm","<android><encryption><gsm>","1","1","4","",""
"3316502","1","","","2010-07-23 08:25:24","4","802","<p>In AndroidManifest.xml file I have set -</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;supports-screens android:normalScreens=""true"" android:smallScreens=""false"" android:largeScreens=""false"" android:anyDensity=""false""/&gt;</code></pre><p>So that app should be available for android 1.5 and higher devices. But I am unable to find this app from Android Market for 1.5 devices. App is available for 1.6 and higher devices.</p><p>I am able to install app on 1.5 devices using USB cable and it works fine.</p><p>Please explain why the app is not available from market for 1.5 devices. </p><p>Thanks </p>","215419","","","","","2012-03-02 04:56:53","Android minSdkVersion=3 but app is not availabe for android 1.5 devices from Android Market?","<android>","2","3","1","",""
"3316629","1","3317051","","2010-07-23 08:45:04","2","2315","<p>I need to read the file from the phone memory.How read file ?can anyone help me?? </p>","389404","","","","","2010-07-23 09:46:02","how to read file from the phone memory in android?","<android>","2","0","2","",""
"3316650","1","3317937","","2010-07-23 08:48:26","2","4276","<p>I got a question is it possible in Android to load the video data into a VideoView without it instantly starting to play?? If so, how could I do that?</p><p>Thank you.</p>","390782","","","","","2013-12-30 05:22:28","Only loading video into VideoView without instantly playing","<android><video><videoview>","6","0","4","",""
"3316768","1","3316804","","2010-07-23 09:05:38","3","707","<pre><code>String rank[] = {""tclub1.png"", ""tclub2.png"", ""tclub3.png"", ""tclub4.png"",  ""tclub5.png"", ""tclub6.png"", ""tclub7.png"", ""tclub8.png"", ""tclub9.png"",  ""tclub10.png"", ""tclub11.png"", ""tclub12.png"", ""tclub13.png""};Random randInt = new Random();int b = randInt.nextInt(rank.length);String d = (""tclub"" + b + "".png"");Log.v(LOG_TAG, ""in value:="" + d);</code></pre><p>Above is the code.Actually my array is giving me one random index between(0 to 12)..after that i m appending it to make an image name. eg(tclub1.png)Now the image name which it gives to me is String fromat.how can i assign thhis image now randomly??</p>","383597","","221509","","2011-11-13 11:39:26","2011-11-13 11:39:26","Android Random","<android><random>","2","1","1","",""
"3316801","1","3316970","","2010-07-23 09:09:51","49","63055","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1994703/which-programming-languages-can-i-use-on-android-dalvik"">Which programming languages can I use on Android Dalvik?</a>  </p></blockquote><p>Mostly, Android applications are written in Java. But i heard that its also possible to use Scala or some other languages. And I also read that it's possible to include native C/C++ code.</p><p>Is there a refernce/list available that shows which languages can be used?</p>","329637","","379693","","2010-07-24 08:35:17","2014-01-07 12:24:26","Which programming languages can be used to develop in Android?","<java><android><scala><programming-languages><scripting>","7","4","23","2010-07-24 01:58:31",""
"3316903","1","3321016","","2010-07-23 09:27:39","0","1735","<p>When I'm instantiating myView in the Activity, why is it necessary to pass the context and why is it required to pass the context to the View's constructor? What is the significance?</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.graphics.Canvas;public class POCII extends Activity {   myView mv = new myView(this);   /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(mv);   }}class myView extends View {   public myView(Context context) {      super(context);   }   @Override   public void onDraw(Canvas canvas) {      Paint paint = new Paint();      canvas.drawRect(0,0,100,100, paint);   }}</code></pre>","381699","","122585","","2011-04-20 17:20:30","2011-04-20 17:20:30","subclassing a View and overriding onDraw(Canvas)","<android>","2","0","","",""
"3316984","1","3317179","","2010-07-23 09:36:04","0","668","<p>I want to fix a view at the bottom of the screen.How can i do that?</p>","307585","","114066","","2012-02-02 13:05:09","2012-02-02 13:05:09","Fix view at the bottom of the screen in an Activity in android","<android><android-layout>","1","0","1","",""
"3317148","1","3317918","","2010-07-23 10:01:44","1","969","<p>Is there any programmatic way to get email notification in my application from the built in android email client? Do I have to write my own email client if I want to add custom features like auto-reply and stuffs like it or I can extend some notification framework from any existing application?</p>","321098","","","","","2010-07-23 12:03:59","How to get email notifications from email client?","<android>","1","0","","",""
"3317456","1","","","2010-07-23 10:51:32","4","2304","<p>I build my Android Application and want do add layouts for different orientations now. I created a layout-land folder and put a different layout for my first Starter Activity ""myStartActivity"" (with the same name as the layout i used before for both orientations) in there.</p><p>Depending on my Screen Orientation BEFORE i start the app the right layout is chosen: ""myLayout.xml"" from within the ""layout""-folder when i start in portrait and the ""myLayout.xml"" from within the ""layout-land""-folder when i start in landscape.</p><p>The Problem is, that when i rotate the device when I'm already in the Activity, after rotation I dont get the new layout. For example: rotating from portrait to landscape it stills shows ""myLayout.xml"" from within the ""layout""-folder and not the ""layout-land""-folder as it should.</p><p>I didnt overwrite any OnConfigurationChange Methods or anything. All I do in ""myStartActivity"" is instantiate some buttons and give them some listeners. I wanna use a different layout in landscape to change the ordering of the buttons.</p>","351723","","351723","","2010-07-23 14:11:32","2011-10-26 12:07:05","Android: Screen Rotation within Activity doesnt switch portrait/landscape layout","<android><landscape><screen-orientation><portrait><device-orientation>","3","0","2","",""
"3317520","1","3317903","","2010-07-23 10:59:50","1","924","<p>i find some examples in the web which uses android.app.ActivityThread but I can't find it in my android sdk installation(2.1 and 2.2) neither on the <a href=""http://developer.android.com/reference/packages.html"" rel=""nofollow"">android sdk webpage</a></p><p>Was the ActivityThread removed from current sdk? If so, is there a alternative?</p><p>ThanksThomas</p>","400162","","","","","2010-07-23 12:01:27","android.app.ActivityThread is missing in current sdk","<android>","1","0","1","",""
"3317569","1","3317703","","2010-07-23 11:06:56","0","587","<p>I created a MapActivity that contains a MapView and a Button on the top of the MapView.</p><p>Like this:</p><p><img src=""http://desmond.yfrog.com/Himg9/scaled.php?tn=0&amp;server=9&amp;filename=devicef.png&amp;xsize=640&amp;ysize=640"" alt=""alt text""></p><p>I would like that the user touch a point of the mapView with a finger and then touch the button ""Add Place"" with another finger (the MapView is still pushed by the first finger).</p><p>The problem is when the first finger touch the mapView, it is like if the mapView gains the focus.So when the second finger touch the button ""Add Place"" it is recognized as the second finger touched the mapView in the location where it is placed the button ""Add Place""</p><p>I have a Nexus One with Froyo and so it should support multi-touch...</p><p>What do you think should I do to make multi-touch working in this context?!?</p><p>THANKS FOR YOUR HELP!!!! :)</p>","373542","","","","","2010-09-23 13:14:13","Touching both a MapView and a Button on Android","<android><touch><android-mapview><touchscreen><multi-touch>","1","0","","",""
"3317618","1","","","2010-07-23 11:14:52","2","749","<p>I am trying to obtain the GPS coordinates with the following code:</p><pre><code>public class conTest extends Activity implements LocationListener{TextView headerText;BufferedReader in = null;private LocationManager lm;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,this);}public void onLocationChanged(Location location) {    if (location != null) {        Toast.makeText(getApplicationContext(),""Location changed : Lat: "" + location.getLatitude() + "" Lng: "" + location.getLongitude(),Toast.LENGTH_SHORT).show();    }}public void onProviderDisabled(String provider) {    // TODO Auto-generated method stub}public void onProviderEnabled(String provider) {    // TODO Auto-generated method stub}    public void onStatusChanged(String provider, int status, Bundle extras) {        // TODO Auto-generated method stub    }}</code></pre><p>Problem is that when i try to send gps coordinates using DDMS, a toast will appear and say that the location is 0.0,0.0. This is not what i entered. When i try to send a new and different location, nothing happens.<br>I have allowed mock locations on the emulator and the LOCATION_FINE/INTERNET permissions has been set.<br>I am developing in Eclipse 3.5 using Api 2.1</p><p>Help! What have I done wrong?</p>","400181","","95313","","2010-07-23 11:32:38","2010-07-23 11:32:38","Unable to get GPS coordinates on Android","<java><android>","0","2","0","",""
"3317812","1","","","2010-07-23 11:48:30","2","994","<p>I need a database in which I can store data and get data whenever I need.Is this possible with android.preference package. I do not want to use sqlite database</p><p>regards</p>","394607","","","","","2010-07-23 11:55:10","Can I perform database specific operation using android.preference package?","<android><database><preference>","1","0","","",""
"3317911","1","3317938","","2010-07-23 12:02:48","1","482","<p>Hey. I just started with Android. I'm using the ViewFlipper layout with 2 LinearLayouts. First layout has a button that switches to the second layout. I would like to add a timer that would switch to the first layout after 3000ms.I tried with a Thread but it did not work (can not communicate with UI element of other thread).</p><p>My code:</p><p>public class Test extends Activity {</p><pre><code>ViewFlipper f;LinearLayout l1;LinearLayout l2;Button b1;Thread s;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    f = (ViewFlipper) findViewById(R.id.f);    l1 = (LinearLayout) findViewById(R.id.l1);    l2 = (LinearLayout) findViewById(R.id.l2);    b1 = (Button) findViewById(R.id.b1);    updateSwitch = new Thread() {        @Override        public void run() {            try {sleep(3000);            } catch (InterruptedException e) {            } finally {f.showPrevious();}        }    };    b1.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            f.setAnimation(AnimationUtils.loadAnimation(v.getContext(), R.anim.push_left_in));            lFlipper.showNext();            updateSwitch.start();        }    });}</code></pre><p>}</p><p>My guess is that I need some kind of handler that would connect a new Thread with the main thread.Please update my code. Thx 10x.</p>","132257","","","","","2010-07-23 12:06:13","Android ViewFlipper showPrevious after 300ms","<android><timer><viewflipper>","1","0","","",""
"3317961","1","3496250","","2010-07-23 12:08:42","0","2198","<p>I am trying to set a different wallpaper for every home screen, but I get OutOfMemory issues. I have 5 Bitmaps which I am trying to overlay on a wallpaper Bitmap which is 5 times the display width. Using the code below I get OOM. The problem seems to be the first line of code which creates the large wallpaper Bitmap. My question is whether there is a way to do this (i.e. some way that takes up less memory, or someway to allocate more memory??). Thanks!</p><pre><code> Bitmap wallpaper = Bitmap.createBitmap(displayWidth*5,displayHeight, Config.ARGB_8888); Canvas canvas = new Canvas(wallpaper); Uri data = getIntent().getData(); Bitmap bmp = getBitmap(data, imagePosition, displayWidth, displayHeight); canvas.drawBitmap(bmp, 0, 0,null); WallpaperManager wallpaperManager = (WallpaperManager) SetterActivity.this.getSystemService(Context.WALLPAPER_SERVICE); wallpaperManager.setBitmap(wallpaper); wallpaperManager.suggestDesiredDimensions(bmp.getWidth()*2, bmp.getHeight());</code></pre>","396106","","","","","2011-03-30 22:53:48","Android - A different Bitmap wallpaper for every home screen - OutOfMemory","<java><android><bitmap><out-of-memory><wallpaper>","2","5","","",""
"3317969","1","3318442","","2010-07-23 12:09:29","0","894","<p>my android give me an error about the certificate.is it a problem coz im using ssl class 1 from startssl?</p>","353322","","","","","2010-07-23 13:16:49","ssl class 1 certificate problem","<android><ssl-certificate>","1","0","","2012-08-22 11:48:46",""
"3318050","1","","","2010-07-23 12:21:35","1","1044","<p>Are there any tutorials or guidelines available on the web for making android apps for the Samsung TV exclusively?</p><p>Here's the link:</p><p><a href=""http://www.samsung.com/us/samsungapps/?cid=ppc_hdt_goo_Apps_TV%20Apps_tv+apps"" rel=""nofollow"">http://www.samsung.com/us/samsungapps/?cid=ppc_hdt_goo_Apps_TV%20Apps_tv+apps</a></p><p>Looking forward for feedback. Thank you</p>","2355649","","364483","","2011-12-29 06:55:54","2011-12-29 06:55:54","Any guidelines for making android apps for Samsung TV","<android><samsung-smart-tv>","2","0","","",""
"3318079","1","3318117","","2010-07-23 12:24:59","3","169","<p>This is a question to all of you out there who develop for both Android and iPhone. How do you maintain support for the two platforms? Specifically, do you </p><ul><li>maintain the two products totally separate from each other?</li><li>create ""native"" GUIs in Java/ObjC and a ""core"" library in C/C++?</li><li>write both versions in the same language (e.g. Java) and a third-party tool to generate code for each platform?</li><li>write everything in the same code base and use an even more fancy tool to generate native bindings for each platform?</li></ul>","292477","","","","","2010-07-23 12:29:33","Maintaining product for Android + iPhone","<iphone><android><portability>","1","2","2","",""
"3318083","1","","","2010-07-23 12:25:25","5","7633","<p>Hai,I have an Android Program with one text field.I need to display a message inside that textfield when it loads on an emulator.When the user clicks inside that textbox that message should dispappear. For Ex: Please enter nameCan any one post some sample code over here...</p>","400244","","","","","2010-07-23 12:29:49","Display a message inside Android Edit Text Field","<android><field><edittext>","2","1","","",""
"3318219","1","3318459","","2010-07-23 12:43:29","0","341","<p>I have designed a main menu in android, but now I have no idea how to open that application when I click some specific icon for that application.</p><p>Any help or hint will be appreciateable.</p><p>Thanks alot.</p>","397901","","20402","","2010-07-23 12:46:00","2010-07-23 13:19:17","how to put action to open applications on Grid icon menu","<android>","1","0","","",""
"3318312","1","","","2010-07-23 12:57:34","-3","100","<p>i am new in android database.i downloaded sqlite database browser.can u give me the steps how to use already generated database in android sdk with eclips.give me proper structure where to store database in eclips folder structure</p>","398721","","","","","2010-07-23 13:04:28","about databases in android","<android>","1","1","1","",""
"3318371","1","","","2010-07-23 13:06:49","1","1144","<p>My configuration is this:</p><ul><li>Windows 7 x64</li><li>Eclipse Helios x64</li><li>JDK x64</li><li>Android SDK r06</li></ul><p>When I try to start an emulator from Eclipse (Android SDK setup application) with the scale parameter it just fails. Second Command Prompt screen (which I think is actually a Java app) shows some exception but it closes itself right after. This is very annoying because without the scale, WVGA emulator does not fit on my laptop's screen. Any idea how to fix this?</p><p>And when I try to start an emulator from Command Prompt with the scale, it works.</p>","130057","","","","","2011-07-16 11:22:30","Android emulator fails to start when using scale (Win7 x64)","<android><android-emulator>","1","0","","",""
"3318517","1","","","2010-07-23 13:26:21","20","11058","<p>I there any Face recognition sdk/library available that one can use in to android ?</p><p>whenever i search on google i just came across Recognizr , so does anyone has any idea about sdk or something like that which helps the developer in developing face recognition application </p>","381153","","","","","2013-06-19 22:31:01","Face recognition library in android","<java><android>","2","0","11","",""
"3318617","1","","","2010-07-23 13:37:12","0","3917","<p>Can you tell me when we select an item in <code>GalleryView</code> its  comes to the center of the screen how to restrict it? I want to just be there where i click that item. How? Simple words, I wanna horizontal Listview. How?</p><p>Thanks</p>","267269","","267269","","2010-07-23 13:47:32","2011-10-06 07:20:06","TextView on Horizontal ScrollView in android?","<android><gallery>","1","0","1","",""
"3318629","1","3752417","","2010-07-23 13:39:00","17","62698","<p>Can anybody tell me how to resize the imageButton to fit the image exactly..This is the code that i tried, but the image is placed at the position that i am locating using <code>android:scaleType</code> but i can't able to reduce the size of imageButton, pls help me out in rectifying this issue...The code that i tried is ...</p><pre><code>&lt;ImageButton&gt;android:id=""@+id/Button01""android:scaleType=""fitXY"" // i have tried all the values for this attrandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:cropToPadding=""false""android:paddingLeft=""10dp""android:src=""@drawable/eye""&gt; // this is the image(eye)&lt;/ImageButton&gt;</code></pre>","384193","","244296","","2010-07-23 13:39:42","2013-10-23 10:10:47","ImageButton in Android","<android><imagebutton>","9","4","4","",""
"3318631","1","5119252","","2010-07-23 13:39:15","3","659","<p>How can I query if a sync account is checked for syncing or not?</p>","400162","","244296","","2010-07-23 13:42:01","2011-02-25 15:43:27","Android - query if a sync account is checked for syncing","<android>","1","0","1","",""
"3318644","1","","","2010-07-23 13:41:07","1","839","<p>Looking at the following image, the button on the left is android 2.1, the one on the right is 2.2:</p><p><img src=""http://www.freeimagehosting.net/uploads/286374c727.jpg"" alt=""alt text""></p><p>As you can see the corners on the left image are not being applied correctly, but they look perfect in 2.2.  The xml I'm using is here:</p><pre><code>&lt;layer-list xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:right=""0dip"" android:left=""0dip"" android:bottom=""0dip""    android:top=""0dip""&gt;    &lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""        android:shape=""rectangle""&gt;        &lt;corners android:bottomRightRadius=""3dip""            android:bottomLeftRadius=""3dip"" android:topLeftRadius=""3dip""            android:topRightRadius=""3dip"" /&gt;        &lt;stroke android:width=""1dip"" android:color=""#70532B"" /&gt;        &lt;padding android:left=""1dip"" android:top=""1dip""            android:right=""1dip"" android:bottom=""1dip"" /&gt;    &lt;/shape&gt;&lt;/item&gt;&lt;item android:right=""0dip"" android:left=""0dip"" android:bottom=""0dip""    android:top=""9dip""&gt;    &lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""        android:shape=""rectangle""&gt;        &lt;gradient android:startColor=""#ECAF08"" android:endColor=""#F6E34B""            android:angle=""270"" /&gt;        &lt;corners android:bottomRightRadius=""3dip""            android:bottomLeftRadius=""3dip"" android:topLeftRadius=""0dip""            android:topRightRadius=""0dip"" /&gt;    &lt;/shape&gt;&lt;/item&gt;&lt;item android:right=""0dip"" android:left=""0dip"" android:bottom=""11dip""    android:top=""0dip""&gt;    &lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""        android:shape=""rectangle""&gt;        &lt;gradient android:startColor=""#FCEF94"" android:endColor=""#FFBA00""            android:angle=""270"" /&gt;        &lt;corners android:bottomRightRadius=""0dip""            android:bottomLeftRadius=""0dip"" android:topLeftRadius=""3dip""            android:topRightRadius=""3dip"" /&gt;    &lt;/shape&gt;&lt;/item&gt;</code></pre><p></p><p>am i doing something wrong, or is this a bug in android 2.1???</p>","372405","","","","","2011-01-14 18:09:20","bug in android 2.1 xml drawables?","<android><xml><drawable>","1","0","1","",""
"3318675","1","3343742","","2010-07-23 13:44:23","0","1043","<p>I am using following code to capture image through camera and then displaying it.</p><p>The problem , I am facing is when i take picture and press <strong>done</strong> button it does not display that taken image in my activity.</p><p>It just shows blank image field.</p><p>Any one guide me what mistake am i doing? might be path related issue but I am not sure.</p><pre><code>protected Button _button;    protected ImageView _image;    protected TextView _field;    protected String _path;    protected boolean _taken;    protected static final String PHOTO_TAKEN   = ""photo_taken"";    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        _image = ( ImageView ) findViewById( R.id.image );        _field = ( TextView ) findViewById( R.id.field );        _button = ( Button ) findViewById( R.id.button );        _button.setOnClickListener( new ButtonClickHandler() );        _path = Environment.getExternalStorageDirectory() + ""/images/media/make_machine_example.png"";      //media/external/images/media/2    }    public class ButtonClickHandler implements View.OnClickListener     {        public void onClick( View view ){            Log.i(""MakeMachine"", ""ButtonClickHandler.onClick()"" );            startCameraActivity();        }    }    protected void startCameraActivity()    {        Log.i(""MakeMachine"", ""startCameraActivity()"" );        File file = new File( _path );        Uri outputFileUri = Uri.fromFile( file );        Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );        intent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri );        startActivityForResult( intent,0);    }    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data)     {           Log.i( ""MakeMachine"", ""resultCode: "" + resultCode );        switch( resultCode )        {            case 0:                Log.i( ""MakeMachine"", ""User cancelled"" );                break;            case -1:                onPhotoTaken();                break;        }    }    protected void onPhotoTaken()    {        Log.i( ""MakeMachine"", ""onPhotoTaken"" );        _taken = true;        BitmapFactory.Options options = new BitmapFactory.Options();        options.inSampleSize = 4;        Bitmap bitmap = BitmapFactory.decodeFile( _path, options );        _image.setImageBitmap(bitmap);        _field.setVisibility( View.GONE );    }</code></pre>","249991","","244296","","2010-07-23 13:48:02","2010-07-27 12:47:08","problem displaying image after capturing through camera?","<android><image-processing>","2","0","","",""
"3318709","1","3318786","","2010-07-23 13:48:21","3","837","<p>When developing an Android app, is there a rule of thumb for when you should stop changing layouts and instead switch to a new activity?  What factors might influence the decision?</p>","376079","","","","","2011-02-26 09:31:27","Android Activities and Views","<android><activity>","2","0","","",""
"3318736","1","","","2010-07-23 13:52:54","1","599","<p>It may be wrong place to log my query, but its urgent.can anyone please help me how to delete google accounts from ""accounts and sync"".I'm trying to call this line my app: AccountManagerService.getSingleton().onServiceChanged(null,true);</p><p>whereas onServiceChanged() method is defined in AccountManagerService.java.</p><p>=============================================================================</p><pre><code>public void onServiceChanged(AuthenticatorDescription desc, boolean removed) {    boolean accountDeleted = false;    SQLiteDatabase db = mOpenHelper.getWritableDatabase();    Cursor cursor = db.query(TABLE_ACCOUNTS,            new String[]{ACCOUNTS_ID, ACCOUNTS_TYPE, ACCOUNTS_NAME},            ACCOUNTS_TYPE + ""=?"", new String[]{desc.type}, null, null, null);    try {        while (cursor.moveToNext()) {            final long accountId = cursor.getLong(0);            final String accountType = cursor.getString(1);            final String accountName = cursor.getString(2);            Log.d(TAG, ""deleting account "" + accountName + "" because type ""                    + accountType + "" no longer has a registered authenticator"");            db.delete(TABLE_ACCOUNTS, ACCOUNTS_ID + ""="" + accountId, null);            accountDeleted = true;        }    } finally {        cursor.close();        if (accountDeleted) {            sendAccountsChangedBroadcast();        }    }</code></pre><p>=============================================================================</p><p>this piece of code is not doing anything i feel exception is bieng thrown which is handled at lower layer.</p>","400301","","101258","","2010-08-27 21:11:04","2011-06-21 14:58:20","Android : how to delete account from database which are displayed under ""accounts and sync"" from my own application","<android><sdk><account>","1","0","1","",""
"3318738","1","","","2010-07-23 13:53:10","36","37028","<p>I get the following error in Eclipse:</p><pre><code>[timestamp - ddms] Can't bind to local 8600 for debugger</code></pre><p>Why?</p>","394590","","499214","","2013-05-28 10:29:25","2014-04-10 07:48:37","Eclipse DDMS error ""Can't bind to local 8600 for debugger""","<android>","19","5","7","",""
"3318757","1","3318803","","2010-07-23 13:54:38","13","12864","<p>When one wants to publish his App on the Android Market he can upload up to two screenshots of his app. I would like to take these screenshots with my current device (Motorola Droid) that I'm using to test the application.</p><p>There are some Apps on the Android Market that allow you to take screenshots, but you have to root your phone, which I dont want to. There are related topics within stackoverflow where people want to take screenshots out of there code (<a href=""http://stackoverflow.com/questions/2661536/screenshot-android"">here</a>). However I just want to take screenshots of my running app with the current device, which is connected via USB to my computer; I'm developing via Eclipse, so there should be a way to tell your running device that it should take a screenshot via the sdk, right?</p><p>Some website mention a way to do this ""To take a screenshot, you'll be required to enable USB Debugging under the settings, install the Android software development kit, and then connect to the phone with a debug tool"" (<a href=""http://lifehacker.com/5319693/take-screenshots-of-your-android-phone"">here</a>) but they dont explain what I actually need to do step-by-step.</p><p>I would really appreciate if someone can help me out.</p>","351723","","351723","","2010-07-23 14:02:12","2010-07-23 14:50:48","Android: Taking Screenshot of current screen with device","<android><screenshot><device>","4","0","3","",""
"3319067","1","3319089","","2010-07-23 14:24:35","0","268","<p>What's the proper way for other people to reuse my Activities? Should they hard code the intent actions in their app or is it customary to provide them with a jar file enumerating my app's intent actions? Is there a less tightly-coupled way to lookup the intent actions?</p>","440093","","","","","2010-07-23 16:48:37","Android: Proper way to reuse my app's activities?","<android>","2","0","","",""
"3319129","1","3319724","","2010-07-23 14:32:30","0","7080","<p>How to apply action listener on Image view</p>","397901","","229044","","2012-07-17 03:55:19","2013-05-20 20:54:39","Action Listener on Image View","<android>","2","0","","",""
"3319158","1","3319868","","2010-07-23 14:35:05","5","6043","<p>I'm currently writing an app displaying a MapView showing a google map. i used the ""hello map view"" tutorial from <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a> and this works so far: the map is displayed, centered and zoomed correctly, even the OverlayItems i added are displayed correctly.</p><p>But when i click on one of those overlay items i added, the application crashes with a null pointer exception:</p><pre><code>07-23 16:24:48.167: ERROR/AndroidRuntime(2530): java.lang.NullPointerException07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at     com.android.internal.app.AlertController$AlertParams.&lt;init&gt;(AlertController.java:753)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.app.AlertDialog$Builder.&lt;init&gt;(AlertDialog.java:273)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at net.xenonite.wifiloc.act_map$MapItemizedOverlay.onTap(act_map.java:182)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:453)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at com.google.android.maps.MapView$1.onSingleTapUp(MapView.java:347)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at com.google.android.maps.GestureDetector.onTouchEvent(GestureDetector.java:533)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at com.google.android.maps.MapView.onTouchEvent(MapView.java:647)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.view.View.dispatchTouchEvent(View.java:3709)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:874)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1695)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1116)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.app.Activity.dispatchTouchEvent(Activity.java:2068)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1679)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1708)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.os.Handler.dispatchMessage(Handler.java:99)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.os.Looper.loop(Looper.java:123)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at android.app.ActivityThread.main(ActivityThread.java:4595)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at java.lang.reflect.Method.invokeNative(Native Method)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at java.lang.reflect.Method.invoke(Method.java:521)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)07-23 16:24:48.167: ERROR/AndroidRuntime(2530):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>my code is mostly copied from the tutorial:</p><pre><code>public class act_map extends MapActivity{    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.map);        intent = getIntent();        lat = intent.getDoubleExtra(""lat"", 0.0);        lng = intent.getDoubleExtra(""lng"", 0.0);        MapView = (MapView) findViewById(R.id.act_map_mapview);        List&lt;Overlay&gt; mapOverlays = MapView.getOverlays();        Drawable positionMarker             = getResources().getDrawable(R.drawable.act_map_androidmarker);        MapItemizedOverlay itemizedOverlay            = new MapItemizedOverlay(positionMarker);        geoPoint = new GeoPoint((int) (lat * 1000000), (int) (lng * 1000000));        Pointer = new OverlayItem(geoPoint, ""Thats me!"", ""wohooo"");        itemizedOverlay.addOverlay(Pointer);        mapOverlays.add(itemizedOverlay);        MapView.setSatellite(false);        MapController = MapView.getController();        MapController.setCenter(geoPoint);        MapController.setZoom(18);        MapView.setBuiltInZoomControls(true);        MapView.displayZoomControls(true);    }    @Override    protected boolean isRouteDisplayed()    {        return false;    }    public boolean onKeyDown(int keyCode, KeyEvent event)    {        if (keyCode == KeyEvent.KEYCODE_I)        {            MapView.getController().setZoom(MapView.getZoomLevel() + 1);            return true;        }        else if (keyCode == KeyEvent.KEYCODE_O)        {            MapView.getController().setZoom(MapView.getZoomLevel() - 1);            return true;        }        else if (keyCode == KeyEvent.KEYCODE_S)        {            MapView.setSatellite(true);            return true;        }        else if (keyCode == KeyEvent.KEYCODE_M)        {            MapView.setSatellite(false);            return true;        }        return false;    }    public class MapItemizedOverlay extends ItemizedOverlay&lt;OverlayItem&gt;    {        private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;();        private Context mContext;        public MapItemizedOverlay(Drawable defaultMarker)        {            super(boundCenterBottom(defaultMarker));        }        public MapItemizedOverlay(Drawable defaultMarker, Context context)        {            super(defaultMarker);            mContext = context;        }        public void addOverlay(OverlayItem overlay)        {            mOverlays.add(overlay);            populate();        }        @Override        protected OverlayItem createItem(int i)        {            return mOverlays.get(i);        }        @Override        public int size()        {            return mOverlays.size();        }        @Override        protected boolean onTap(int index)        {            OverlayItem item = mOverlays.get(index);            AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);            dialog.setTitle(item.getTitle());            dialog.setMessage(item.getSnippet());            dialog.show();            return true;        }    }</code></pre><p>How do I fix this?</p>","370969","","881229","","2013-12-30 07:50:32","2013-12-30 07:50:32","GoogleMaps MapView crashes onTap in Android?","<android><google-maps><google-maps-markers>","4","0","1","",""
"3319212","1","3319268","","2010-07-23 14:40:14","0","495","<p>In my onCreate method for the first loaded Activity I have:</p><pre><code>super.onCreate(savedInstanceState);final int splash = R.layout.splash;setContentView(splash);</code></pre><p>This causes the app to crash. But if I use:</p><pre><code>super.onCreate(savedInstanceState);setContentView(R.layout.splash);</code></pre><p>everything is fine.  What gives?</p><p>The only reason I am experimenting with this is because I want to load different layouts based on a set of data-driven options that will come from another class depending on the customer's choices.</p>","396005","","","","","2010-07-23 17:00:05","setContentView - strange behavior if not using R.id.?","<android><activity>","2","0","","",""
"3319328","1","","","2010-07-23 14:54:50","0","1289","<p>I am a beginner developer in android, I have a problem with playing video, It works with black screen I am using eclipse Galileo 3.5 with android 1.6 when I use android 2.2 it won't work at all !!Here is the code :</p><pre><code>import android.app.Activity;import android.graphics.PixelFormat;import android.media.MediaPlayer;import android.net.Uri;import android.os.Bundle;import android.widget.MediaController;import android.widget.VideoView;public class Video extends Activity { @Override public void onCreate(Bundle icicle) {  super.onCreate(icicle);  setContentView(R.layout.main);                    VideoView videoView = (VideoView) findViewById(R.id.VideoView);                 MediaController mediaController = new MediaController(this);                mediaController.setAnchorView(videoView);                // Set video link (mp4 format )                Uri video = Uri.parse(""android.resource://video/""+R.raw.boeing707crash);                videoView.setMediaController(mediaController);                videoView.setVideoURI(video);                videoView.start(); }}</code></pre><p>So what is the problem ?!</p><p>Thanks in advance.</p>","400349","","","","","2010-11-10 12:23:08","Android VideoView problem","<android>","2","1","","",""
"3319352","1","4058137","","2010-07-23 14:57:53","2","4503","<p>I am working on a paint application for Android. Now I want to implement an eraser to allow erasing parts of a loaded bitmap by using touch input and making the bitmap transparent along the finger's path. </p><p>A very good example of what I try to achieve is shown in the application <a href=""http://swisscodemonkeys.appspot.com/app/steam/android-steamy-window-get-your-phone-steamy.html"" rel=""nofollow"" title=""Steamy Window"">Steamy Window</a> for Android. Steamy Window simulates a fogged window, where a user can wipe parts of the fog via touch input.</p><p>Any suggestions how I could implement the feature?</p><p>UPDATE: I have posted the most important sections of my current code below. I am not really happy with it for the following reasons:</p><ol><li><p>Drawing is quite sluggish. What can I improve here?</p></li><li><p>I am looking for a way to use an alpha mask in order to set the pixel transparency/alpha of the pixels as I want to simulate a paint brush. Any suggestions how this could be achieved?</p></li></ol><pre>        public DrawView(Context context, String imageName) {        super(context);        // Get the overlay image and its dimensions        Bitmap overlayImageOriginal = BitmapFactory.decodeResource(                getResources(), R.drawable.overlay);        width = overlayImageOriginal.getWidth();        height = overlayImageOriginal.getHeight();        // Get a copy of the overlay image and recycle the original        overlayImage = overlayImageOriginal.copy(Config.ARGB_8888, true);        overlayImageOriginal.recycle();        // Get background image of this level        int resId = getResources().getIdentifier(imageName, ""drawable"",                ""com.xxx"");        backgroundImage = BitmapFactory.decodeResource(getResources(), resId);        // Copy pixels        overlayImagePixels = new int[width * height];        overlayImage.getPixels(overlayImagePixels, 0, width, 0, 0, width,                height);        getHolder().addCallback(this);        _thread = new DrawThread(getHolder(), this);        setFocusable(true);    }    @Override    public boolean onTouchEvent(MotionEvent event) {        synchronized (_thread.getSurfaceHolder()) {            switch (event.getAction()) {            case MotionEvent.ACTION_DOWN:                touchStart(event.getX(), event.getY());                return true;            case MotionEvent.ACTION_MOVE:                touchMove(event.getX(), event.getY());                return true;            case MotionEvent.ACTION_UP:                touchStop();                return true;            }            return false;        }    }    @Override    public void onDraw(Canvas canvas) {       // draw the image to guess       canvas.drawBitmap(backgroundImage, 0, 0, null);       // apply user input to the overlay-image       setRegionTransparency((int) mTouchX, (int) mTouchY, 20, 0);       // draw the overlay-image (hiding the image to guess)       canvas.drawBitmap(overlayImage, 0, 0, null);    }    /**     *      * @param posX     * @param posY     * @param radius     * @param alpha - 0: full transparent, 255: full opaque     */    private void setRegionTransparency(int posX, int posY, int radius, int alpha) {        int left = posX - radius;        int right = posX + radius;        int top = posY - radius;        int bottom = posY + radius;        int color = 0;        // onDraw() is called before any user input        // -> assume 0/0 as invalid arguments        if (posX == 0 && posY == 0) {              return;        }        // TODO currently only rectangular area is supported        // but we need circular        // we should use a pre-made alpha mask with smoothed edges        // we should take into account: pressure and/or duration of touch        for (int y = top; y = 0 && y = 0 && x = TOUCH_TOLERANCE || dy >= TOUCH_TOLERANCE) {            mPath.quadTo(mTouchX, mTouchY, (x + mTouchX) / 2, (y + mTouchY) / 2);            mTouchX = x;            mTouchY = y;        }    }}</pre>","400334","","400334","","2010-07-28 11:24:40","2010-10-30 09:55:23","Draw transparent lines on bitmap via touch input","<android><bitmap><transparency>","1","5","3","",""
"3319365","1","3319894","","2010-07-23 15:00:10","3","2004","<p>In the examples, they create Intent as:</p><pre><code>Intent intent = new Intent(this, AlarmReceiver.class);</code></pre><p>But suppose my AlarmReceiver class is in another app, how do I create this intent?</p><p>I've tried with</p><pre><code>new Intent(""com.app.AlarmReceiver"")</code></pre><p>but nothing happens.. It was not called..</p><p>Any idea?</p><p>--<em>Broadcast definition added using the manifest editor on Eclipse:</em></p><pre><code>&lt;receiver android:name=""AlarmReceiver""&gt;&lt;/receiver&gt;&lt;/application&gt;</code></pre><p>--<br>Related:<br><a href=""http://stackoverflow.com/questions/3259912/how-do-i-start-my-app-from-my-other-app/3259975#3259975"">http://stackoverflow.com/questions/3259912/how-do-i-start-my-app-from-my-other-app/3259975#3259975</a> (but this same code is not working for broadcasts..)</p>","287316","","287316","","2010-07-23 17:34:54","2010-07-23 17:50:05","How to create a new Intent for another app's broadcast receiver?","<android><android-intent><broadcast><broadcastreceiver>","1","6","1","",""
"3319695","1","3319736","","2010-07-23 15:30:26","1","131","<p>This was my code:</p><pre><code>&lt;android:id=""@+id/carrotsmileanim&gt;&lt;/android:id&gt;</code></pre><p>I fixed it because it was missing a quotation mark, but now eclipse won't recognize the quotiations nor the @ sign! What do I do?!?</p>","394842","","","","","2010-07-23 15:34:41","Eclipse Will Not Recognize Quotation Marks?","<android><eclipse><sdk>","1","1","","",""
"3319739","1","","","2010-07-23 15:35:22","2","417","<p>I am trying to play a wave file(VoiceMail) in Android. The file is downloaded from a remote server and written to sdcard.</p><p>I use the following code to play the Wave file usign the MediaPlayer class bundled with the SDK:</p><pre><code>FileDescriptor fd = new FileInputStream(songFile).getFD();                              MediaPlayer mMediaPlayer = new MediaPlayer();                mMediaPlayer.reset();                try{                    mMediaPlayer.setDataSource(fd);                }                catch(IllegalStateException e){                    mMediaPlayer.reset();                    mMediaPlayer.setDataSource(fd);                }                mMediaPlayer.prepare();                                     mMediaPlayer.start();</code></pre><p>However when I run my code, I get the following error:Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupportederror (1, -4).</p><p>Note that when I pull this file on my desktop machine and copy it to the Music folder of my HTC hero device, the Music player of the device can play this file so I am guessing the file format is compatible with Android.</p><p>Not sure of what the problem is; please help.</p><p>Thanks.</p>","362325","","","","","2012-08-23 23:36:02","Playing wave files in Android","<android>","2","1","1","",""
"3319987","1","3320067","","2010-07-23 16:00:22","0","1083","<p>I have a custom CursorAdapter that is taking items from a database and displaying them in a listview. If possible, I would like to display only certain elements based on some boolean value within a database element. Here is something similar to what I would like to do:</p><pre><code>package itp.uts.program;import android.content.Context;import android.database.Cursor;import android.graphics.Color;import android.graphics.Typeface;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.CursorAdapter;import android.widget.TextView;//Adapter tests if an element is read or unread, and bolds the items that are unreadpublic class BoldAdapter extends CursorAdapter{private final LayoutInflater mInflater;public BoldAdapter(Context context, Cursor c, boolean autoRequery) {    super(context, c, autoRequery);    mInflater = LayoutInflater.from(context);}public BoldAdapter(Context context, Cursor c) {    super(context, c);    mInflater = LayoutInflater.from(context);}@Overridepublic void bindView(View view, Context context, Cursor cursor) {}@Overridepublic View newView(Context context, Cursor cursor, ViewGroup parent) {    //Creates a view to display the items in    final View view = mInflater.inflate(R.layout.notes_row, parent, false);    TextView textRequestNo = (TextView) view.findViewById(R.id.text1);    TextView textMessage = (TextView) view.findViewById(R.id.text2);    StringBuilder requestNo = new StringBuilder(cursor.getString(cursor            .getColumnIndex(""requestNo"")));    StringBuilder message = new StringBuilder(cursor.getString(cursor            .getColumnIndex(""Message"")));    //Sets the text fields as elements from the database    textRequestNo.setText(requestNo);    textMessage.setText(message);    if (cursor.getString(cursor.getColumnIndex(""Read"")).equals(""true""))    {//Tests if the item is unread        **//DO NOT SHOW THE ELEMENT, HOW DO I DO THIS?**    }    return view;}</code></pre><p>}</p>","381508","","","","","2010-07-23 16:07:11","How to only show specific elements in a CursorAdapter","<android><database><cursor>","2","0","","",""
"3320115","1","3320148","","2010-07-23 16:13:03","51","114881","<pre><code>public class Mtest extends Activity {  Button b1;  Button b2;  public void onCreate(Bundle savedInstanceState) {    ...    b1 = (Button) findViewById(R.id.b1);    b2 = (Button) findViewById(R.id.b2);    b1.setOnClickListener(myhandler);    b2.setOnClickListener(myhandler);    ...  }  View.OnClickListener myhandler = new View.OnClickListener() {    public void onClick(View v) {      // MY QUESTION STARTS HERE!!!      // IF b1 do this      // IF b2 do this      // MY QUESTION ENDS HERE!!!    }  }}</code></pre><p>How do I check which button has been clicked?</p>","132257","","","","","2013-11-14 21:29:19","Android OnClickListener - identify a button","<android><events><resources><listener>","9","0","30","",""
"3320271","1","3321714","","2010-07-23 16:30:55","2","2534","<p>Hi allIm trying to understand how the Android drawings work.</p><p>I hoping that someone can explain how the drawing components relate to each other (View, Drawable, Canvas, Bitmap)</p><p>It all seems very confusing and the documentation doesnt do a very good job explaining it. </p><p>Does the bitmap inside the Canvas object you get injected in your View's via onDraw() represent the whole display, or just the chunk that the view draws?</p><p>What does the drawable do, are they just objects that encapsulate a set of commands to a Canvas object?</p><p>Im hoping someone can help me get a basic understanding on how it works, i dont have eny java background only Action script and C# (silverlight).</p>","246234","","","","","2010-07-26 16:49:08","2D drawing with Android","<android>","2","0","3","",""
"3320298","1","","","2010-07-23 16:33:54","2","777","<p>I know how to drag a Ball around by extending View and overriding OnDraw and then calculating the new coordinates and redrawing my Ball.What if I have hundreds of shapes inside that view and need the entire view moved around with all the shapes together.  Recalculating for every single shape doesn't seem feasible.On the Iphone I can draw a bunch of things inside a view and then move the entire view and it takes care of drawing the things inside the view for me.  I only have to recalculate the coordinates of the view and then set the position not for everything inside the view.Is that possible on Android?</p><p>Thanks,Steven</p>","377597","","","","","2011-10-21 13:40:27","How to move/drag an entire android view that contains a bunch of shapes inside?","<android><view>","1","2","1","",""
"3320466","1","","","2010-07-23 16:52:39","3","21026","<p>I'm running through the notepad exercises on the android dev website, currently working on exercise (found <a href=""http://developer.android.com/resources/tutorials/notepad/notepad-ex2.html"" rel=""nofollow"">here</a>). </p><p>I came to the end of the tutorial and found that I had several errors in the main two java files regarding R file relations, such as <code>setContentView(R.layout.notes_list);</code> and <code>menu.add(0, INSERT_ID,0, R.string.menu_insert);</code></p><p>I've tried cleaning and re-genning <code>R.java</code> to no avail.</p><p>These also occur in the solution for the exercise so I think they are deliberate mistakes, or something with my eclipse, but I can't seem to fix them, any help would be great thanks!</p>","","","621188","","2013-01-02 13:02:34","2013-01-02 13:03:01","Cannot be resolved or is not a field (Notepad exercises from android dev website)","<android><eclipse><eclipse-plugin><notepad>","5","0","","",""
"3320534","1","","","2010-07-23 17:00:22","21","12352","<p>In the same way a web or desktop app might have three or n tiers - UI, Business, Data for example - what is the suggested structure for an Android application? How do you group classes together, what layers do you have etc? </p><p>I'm just starting Android dev (an internet-based app that must respond to incoming notifications) and have no real feel for the structure I'm aiming at. Suggestions appreciated.</p>","146588","","10433","","2013-09-26 05:13:12","2013-09-26 05:13:12","Android application architecture - what is the suggested model?","<android><design><design-patterns><architecture>","2","0","14","",""
"3320832","1","","","2010-07-23 17:35:00","1","370","<p>I am planning to implement the Bluetooth SAP Server role for the Android platform.Can any one tell me whether there are any APIs for the required SIM access?</p><p>thanks,Krishna</p>","400519","","","","","2010-07-23 17:35:00","SIM access in Android platform","<android>","0","0","1","",""
"3320888","1","3320907","","2010-07-23 17:41:41","0","1535","<p>To be able to do some accurate calculations that I want for my app, I need to be able to get an accelerometer reading every 100ms. I haven't found a way to do this on android, it seems like the only way to get accelerometer readings is to put a listener that can listen at different intervals. Basically, is there a way to get a reading at exact intervals?</p><p>-Jake</p>","399306","","","","","2010-07-23 17:48:46","Way to get accelerometer reading every x seconds?","<android><accelerometer>","2","0","1","",""
"3320930","1","3321146","","2010-07-23 17:47:36","1","232","<p>I'd like to enable a ""silent send"" from my application-- that is, I'd like to catch the SEND intent in a Service, not an Activity. How does the default Android web browser send that intent? Is it possible to handle it in a Service, or in an Activity that never sets a View?</p>","177467","","","","","2010-07-23 18:16:23","How does the default browser on Android send ""SEND"" intents?","<java><android>","1","0","","",""
"3320935","1","3542321","","2010-07-23 17:48:09","0","3230","<p>I'm developing an application that tracks the user's current position and stores it into a SQLite database. Everything works fine, but now I have the problem when querying the database for a track with more than 1000 records it takes nearly 1.5 minutes. On my Desktop it just takes 1 second.</p><p>I know it's a query with many subselects but I wasn't able to get the right result another way. In my opinion this belongs to the aggregate functions like avg() and sum().</p><p>Here's my query:</p><pre><code>Cursor c = readableDB    .rawQuery(            ""SELECT DISTINCT t._id , title , strftime('%Y-%m-%d' , starttime , 'unixepoch' , 'localtime') as date , description, ""            + ""round((SELECT sum(distToPrev)/1000 FROM positions p WHERE p.trackid=t._id) , 2) as distance , ""             + ""(SELECT count(latitude) FROM positions p WHERE p.trackid=t._id) as waypoints, ""            + ""(SELECT (avg(speed)*3.6) FROM positions p WHERE p.trackid=t._id) as avgspeed, ""            + ""(SELECT (max(speed)*3.6) FROM positions p WHERE p.trackid=t._id) as maxspeed, ""            + ""(SELECT sum(altitudeUP) FROM positions p WHERE p.trackid=t._id) as climb , ""            + ""(SELECT avg(heartbeat) FROM heartbeats h WHERE h.trackid=t._id) as avgheartbeat , ""            + ""(SELECT max(heartbeat) FROM heartbeats h WHERE h.trackid=t._id) as maxheartbeat , ""            + ""(SELECT avg(cadence) FROM heartbeats h WHERE h.trackid=t._id) as avgcadence ""            + ""FROM tracks t LEFT JOIN heartbeats h ON t._id = h.trackid WHERE t._id = ?"",            new String[]{String.valueOf(trackId)});     c.moveToFirst();</code></pre><p>How can I optimize this query? I tried it already this way, but then the result was wrong and it took the same amount of time.</p><pre><code>SELECT t._id , title , strftime('%Y-%m-%d' , starttime , 'unixepoch' , 'localtime') as date , description,sum(distToPrev)/1000 as distance ,count(latitude) as waypoints, (avg(speed)*3.6) as avgspeed, (max(speed)*3.6) as maxspeed, sum(altitudeUP) as climb , avg(heartbeat)  as avgheartbeat ,max(heartbeat)  as maxheartbeat ,avg(cadence) as avgcadence FROM tracks t LEFT JOIN heartbeats h ON t._id = h.trackid INNER JOIN positions p ON t._id = p.trackid      WHERE t._id = ?</code></pre><p>Since 2 hours I'm looking for a solution and I don't know what I'm doing wrong. Maybe I have to take a break.</p><p>EDIT: </p><p>Here my create statements:</p><pre><code>CREATE TABLE heartbeats(_id INTEGER PRIMARY KEY AUTOINCREMENT, trackid INTEGER NOT NULL, heartbeat INTEGER NOT NULL, cadence INTEGER, timestamp TIMESTAMP);CREATE TABLE positions(_id INTEGER PRIMARY KEY AUTOINCREMENT, trackid INTEGER NOT NULL, longitude REAL NOT NULL, latitude REAL NOT NULL, altitude REAL, altitudeUP REAL, speed REAL, accuracy REAL, distToPrev REAL, timestamp TIMESTAMP);CREATE TABLE tracks(_id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT NOT NULL, description TEXT, starttime DATETIME NOT NULL, endtime DATETIME);</code></pre>","353048","","353048","","2010-07-23 18:23:24","2010-08-22 16:40:35","Optimize SQL statement for android sqlite","<sql><android><sqlite><query-optimization>","3","4","","",""
"3321007","1","","","2010-07-23 18:00:21","12","1939","<p>I just started using Net Beans.  I am wanting to try my hand at developing android apps.  I got the android sdk downloaded and everything is working well.  I can create little apps and run them in the emulator.  However, the intelisense popup for the android methods says that the Javadoc isn't found.  Is there a way to add it?</p>","122229","","","","","2012-12-28 19:56:56","How to add javadoc for android to Netbeans","<android><netbeans>","4","0","5","",""
"3321035","1","3321608","","2010-07-23 18:03:52","0","666","<p>I have some resources in my app that are going to be loaded optionally for different brands.  I don't want to set up entirely different projects each time we re-brand the app so I want to know if the resources that are not used will be always packaged in and if there is a way to avoid this.  Here's an example:</p><pre><code>MyProject/res    /layout        main.xml (used in all apps)        productlist1.xml (used in app ABC.apk)        productlist2.xml (used in app XYZ.apk)</code></pre><p>main.xml should be packaged in both ABC and XYZ apps</p><p>productlist1.xml should be packaged with app ABC but not with app XYZ</p><p>productlist2.xml should be packaged with app XYZ but not with app ABC</p>","396005","","","","","2010-07-23 19:16:55","Does android always package unused resources?","<android><resources>","1","0","","",""
"3321039","1","3321288","","2010-07-23 18:04:43","6","1204","<p>I have some quetions:</p><p>Should I buy any license to distribute my applications?</p><p>Which profit from the sale of applications?</p><p>(sorry, I dont speak english very well :P )</p>","312081","","312081","","2010-08-23 02:59:51","2013-04-17 14:14:10","How does the Android Market work for developers?","<android><google-play>","3","0","2","",""
"3321047","1","3322279","","2010-07-23 18:05:57","2","821","<p>My application uses in-app search, dynamically builds search suggestions on each request, puts them in a <code>MatrixCursor</code> and returns the suggestions to be displayed. Info on search suggestions here:<br><a href=""http://developer.android.com/guide/topics/search/adding-custom-suggestions.html"" rel=""nofollow"">http://developer.android.com/guide/topics/search/adding-custom-suggestions.html</a></p><p>This works perfectly fine in 2.1-update1, but when I loaded it on a 2.2 phone, I get a fatal error when I try to search. Here is the relevant logs:</p><pre><code>07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): error changing cursor and caching columns07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): java.lang.NumberFormatException: My String Message07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at java.lang.Long.parse(Long.java:364)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at java.lang.Long.parseLong(Long.java:354)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at java.lang.Long.parseLong(Long.java:320)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.database.MatrixCursor.getLong(MatrixCursor.java:255)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.database.CursorWrapper.getLong(CursorWrapper.java:127)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.widget.CursorAdapter.getItemId(CursorAdapter.java:156)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.widget.AutoCompleteTextView.buildDropDown(AutoCompleteTextView.java:1248)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1137)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:1019)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:1002)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.app.SearchDialog.onDataSetChanged(SearchDialog.java:612)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.app.SuggestionsAdapter.notifyDataSetChanged(SuggestionsAdapter.java:193)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.widget.CursorAdapter.changeCursor(CursorAdapter.java:260)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.app.SuggestionsAdapter.changeCursor(SuggestionsAdapter.java:238)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.widget.CursorFilter.publishResults(CursorFilter.java:67)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:282)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.os.Handler.dispatchMessage(Handler.java:99)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.os.Looper.loop(Looper.java:123)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at java.lang.reflect.Method.invokeNative(Native Method)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at java.lang.reflect.Method.invoke(Method.java:521)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028):     at dalvik.system.NativeStart.main(Native Method)07-22 12:13:05.935: DEBUG/AndroidRuntime(1028): Shutting down VM07-22 12:13:05.935: WARN/dalvikvm(1028): threadid=1: thread exiting with uncaught exception (group=0x4001d7f0)07-22 12:13:05.945: ERROR/AndroidRuntime(1028): FATAL EXCEPTION: main07-22 12:13:05.945: ERROR/AndroidRuntime(1028): java.lang.NumberFormatException: My String Message07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at java.lang.Long.parse(Long.java:364)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at java.lang.Long.parseLong(Long.java:354)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at java.lang.Long.parseLong(Long.java:320)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at android.database.MatrixCursor.getLong(MatrixCursor.java:255)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at android.database.CursorWrapper.getLong(CursorWrapper.java:127)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at android.widget.CursorAdapter.getItemId(CursorAdapter.java:156)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at android.widget.AutoCompleteTextView.buildDropDown(AutoCompleteTextView.java:1248)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1137)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:1019)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:1002)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:285)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at android.os.Handler.dispatchMessage(Handler.java:99)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at android.os.Looper.loop(Looper.java:123)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at java.lang.reflect.Method.invokeNative(Native Method)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at java.lang.reflect.Method.invoke(Method.java:521)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-22 12:13:05.945: ERROR/AndroidRuntime(1028):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>where ""My String Message"" is the value of the SUGGEST_COLUMN_TEXT_1 field of the first (in this case only) row to be returned as a suggestion in the cursor. The stack trace does not touch my code at all, and following it in a debugger shows the error occurs some time after I return the suggestions cursor in my search suggestion content provider.</p><p>Why is their adapter suddenly trying to interpret a String as a Long? Has anyone else encountered this?</p><p>Thanks!</p>","304742","","995926","","2012-05-05 13:39:15","2013-03-28 08:48:15","Search suggestions fail in 2.2","<android><android-2.2-froyo>","2","0","","",""
"3321504","1","3321521","","2010-07-23 19:04:52","6","2500","<p>I ask if there is a simple way because there is a google issue report saying that using decodeByteArray isn't possible. But that report originated in 2008 and I was hoping there was a solution not posted on there. The method listed on the issue report was to decode the format yourself, but I'd prefer to not have to put that in and slow down the program. Any help at all would be appreciated.</p>","379220","","","","","2010-12-06 14:13:17","Is there a simple way to turn the byte array from the camera's onPreviewFrame into a picture in android?","<android><image><camera><preview>","2","0","1","",""
"3321514","1","3322076","","2010-07-23 19:05:50","12","14031","<p>In my android app, I wanted to start an activity 'B' from initial activity 'A'. I have created classes for both of these. However when using following code to start B, I get a runtime error: <code>application has stopped unexpectedly, try again</code>. Here is my code:</p><pre><code>Intent myIntent = new Intent(this, AddNewActivity.class);startActivity(myIntent); </code></pre><p>When I added a new entry in <code>AndroidManifest.xml/manifest/application/activity/intent-filers</code> for activity B then the application worked.</p><p>I have two questions:</p><ul><li>When there are multiple activities entries in <code>AndroidManifest.xml</code>, how does android know which activity to start first?</li><li>I could not understand intent-filters. Can anyone please explain.</li></ul><p>Here is my partial <code>AndroidManifest.xml</code></p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".ListAllActivity""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".AddNewActivity"" android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;/application&gt;</code></pre>","229106","","2441810","","2013-06-01 00:51:09","2014-02-06 16:33:31","What are intent-filters in Android?","<android><android-intent><intentfilter>","5","0","2","",""
"3321515","1","3367754","","2010-07-23 19:05:55","3","206","<p>My project has the run-of-the-mill HTTP calls to fetch XML files, parsing the XML files, and creating domain objects. Those objects are later used in the actions and services of the Android app.</p><p>I'd like to isolate that code. I also want to write tests for it. What are some good ways of doing this?</p><p>Creating an Android Library doesn't seem appropriate. The tests would have to be in a separate project. And there are no services or activities in the extracted HTTP and XML related code. So the test suite doesn't have to be an Android test suite, it could be regular JUnit tests.</p><p>Note: I'm new to both Java and Android.</p>","26051","","","","","2010-09-28 20:29:32","Isolating units and writing tests in Android","<android><unit-testing>","2","0","2","",""
"3321587","1","3323872","","2010-07-23 19:14:53","3","1693","<p>I can't seem to find any documentation on the details of an Activity's run loop for Android.</p><p>Apple documents the ""<a href=""http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/Multithreading/RunLoopManagement/RunLoopManagement.html#//apple_ref/doc/uid/10000057i-CH16-SW20"" rel=""nofollow"">anatomy of a run loop</a>"", and that's pretty much what I'm looking for.  The Android documentation just says ""<a href=""http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle"" rel=""nofollow"">Activity Is Running</a>"" in its life cycle state diagram.  Obviously that's backed up by some sort of run loop.</p><p>Anyone have some insight (aka Documentation) into the internals of an Activity's run loop?</p><p>edit - I should clarify that I presume the run loop is actually owned and run by the main UI thread.  The current Activity's functionality is likely injected into this runloop at a certain point.  I'm interested in the overall UI thread run loop, as well as what role the Activity takes in it.</p>","205192","","205192","","2010-07-23 21:00:57","2010-07-24 04:54:48","Anatomy of an Android Run Loop","<java><android>","2","7","","",""
"3321618","1","3321880","","2010-07-23 19:17:29","0","430","<p>Hello I have two activities:</p><ol><li><p>""a"" that spawns thread for generating a dynamic array of values inside <code>public void run()</code> function.</p></li><li><p>""b"", graphics activity that will help me draw rectangular pulses based on array values calculated in activity ""a"" (calculated in a's thread to be precise).</p></li></ol><p>When I am in thread inside ""a"",  how do I pass values of array to activity ""b"" and call activity as well. </p><pre><code>activity a{    thread - array calculation,    call activity b,    pass array values,    call another activity}activity b{    store array values from activity a,    draw rectangles based on array values}</code></pre>","357349","","25427","","2010-07-23 19:33:51","2010-07-23 19:55:04","passing array by calling activity from a thread","<java><android>","1","0","","",""
"3321761","1","3321779","","2010-07-23 19:37:02","0","422","<pre><code>ListView lv = getListView();        lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,int position, long id) {Intent i = new Intent(this, contents.class);        startActivityForResult(i, 1);</code></pre><p>But when i click on ListView it encounters en error. Tell me where i m wrong????</p>","389797","","244296","","2010-07-23 19:45:53","2010-07-23 19:45:53","I want to start new Activity when i click on ListView's content","<android>","1","0","","",""
"3321818","1","","","2010-07-23 19:45:20","2","2236","<p>Hi guys I just want the program to display the layout main0 and stay for a few secounds then display layout main1 like the programs we see in any phone where an image or layout show up at the start of the program and then fade.</p><pre><code>/**the main activity */public class rdwt extends Activity implements OnClickListener{Button b1;Button b2;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main0);    //Here    setContentView(R.layout.main1);    b1= (Button)findViewById(R.id.Button01);    b2= (Button)findViewById(R.id.Button02);    b1.setOnClickListener(this);    b2.setOnClickListener(this);}    public void onClick(View v) {        if (v==this.b1){            Intent callwrite = new Intent(this, wto.class);                          startActivity(callwrite);        }        if(v==this.b2){            Intent callread = new Intent(this, rfr.class);                           startActivity(callread);        }    }</code></pre><p>}</p>","377604","","19750","","2010-07-23 19:54:48","2010-07-24 23:28:47","How can I make the android program display a layout and then wai a few sec. and the display another layout?","<android><layout><timer><wait><time-wait>","3","1","","",""
"3321876","1","","","2010-07-23 19:54:38","0","217","<p>In terms of usability, what are the best practices for going landscape mode with your application. I can see the need for both in some screens, but I can also see no reason for others. Providing a landscape view just because you can opens your application's UI to layout problems, shrinking views and headaches for designers. </p><p>What's your take?</p>","400621","","203968","","2010-07-23 21:11:41","2013-11-05 15:46:49","Landscape mode or no. That is the question","<android><landscape>","1","3","","",""
"3321877","1","","","2010-07-23 19:54:51","2","1047","<p>Say I add a linear layout with top padding of 20. Does it mean that the layout is rendered with 20 pixels of padding in all phones? Or does it scale according to the height/width/density of the phone?</p>","400622","","1140748","","2012-05-06 16:45:42","2012-05-06 16:45:42","Padding in different phones","<android><layout><padding><linear>","2","0","2","",""
"3321954","1","7503078","","2010-07-23 20:05:49","1","745","<p>The developer console provides basic install statistics but does not provide any historical data or graphs. Many sites (androidzoom.com and many more) provide a view of the Market but they seem to be very out of date and generally provide much less granular data.</p><p>Is there any way to access the data Google already has on my application and display it usefully or will I have to look at tracking statistics myself /using Analytics?</p><p>Thanks,Peter</p>","141249","","","","","2011-09-21 16:11:56","Tracking Android Market statistics","<android><statistics><google-play>","1","0","","",""
"3322019","1","","","2010-07-23 20:15:46","0","606","<p>Consider a VideoView added to a Linear Layout with parameteres FILL_PARENT, FILL_PARENT. </p><p>The Linear Layout gets added to the root layout which is a Relative Layout, with parameters WRAP_CONTENT, WRAP_CONTENT.</p><p>Which parameters take precedence here?</p>","400622","","","","","2010-07-23 20:28:33","Android - Nested layout question","<android><layout><relative><linear>","1","0","","",""
"3322055","1","","","2010-07-23 20:19:20","1","1325","<p>Is it possible to use a layout defined in XML as an OverlayItem to be added to a MapView instead of just a single drawable?  I have several Overlays being drawn on the map but they are just single images, I would now like to place Overlays that are more complex objects instead of just a simple drawable.</p><p>I am planning on drawing a marker with a dynamic image inside it (just a friend locator type thing), where each marker has a different picture inside.</p><p>Is adding these as OverlayItems the way to go about it or do I need to add each one to the MapView as a child view (this seems like it would be inefficient)?</p>","393288","","","","","2011-05-12 22:12:03","Use Layout as OverlayItem on MapView?","<android><overlay><android-mapview>","1","0","","",""
"3322144","1","3322205","","2010-07-23 20:32:01","4","5716","<p>I'v been coming to drawing graphics in Android. There's a lot of sample applications out there, but one thing I always seeing is lockCanvas. Can someone explain it closer since I really don't get it and also because im think it's important to understand to future programming?</p><p>An example:            </p><pre><code>try {     c = panel_thread.getHolder().lockCanvas(null);    synchronized (panel_thread.getHolder()) {        panel_thread.update();        panel_thread.onDraw(c);    }}</code></pre><p>This is what I have for now.How should I interpret this correct? What does synchronized do? Why is it important to assign the canvas-object into a getHolder and lockCanvas?</p><p>This part is also confusing:</p><pre><code>panel_thread.getHolder().unlockCanvasAndPost(c);</code></pre><p>Why is this necessary? I really need a closer explanation. :)</p>","386562","","1961634","","2013-06-15 10:45:45","2013-06-15 10:45:45","What does lockCanvas mean (elaborate)","<android><android-canvas>","1","0","2","",""
"3322172","1","","","2010-07-23 20:37:57","4","5220","<p>According to documentaion, FILL_PARENT basically lets the view take up the entire extra space. Weight also dictates how much of the extra space can be taken by the view. What is the difference?</p><p>For eg: What happens when I use,</p><pre><code>new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 1.0f)</code></pre>","400622","","244296","","2010-07-23 20:44:25","2012-01-19 15:17:27","Android Linear Layout - Difference between weight and FILL_PARENT","<android><layout><params><linear><weight>","1","0","1","",""
"3322307","1","3322357","","2010-07-23 20:59:34","1","1071","<p>I have a program with several activities. One can start activity B from clicking on a button in Activity A, and can start C from clicking on a button in B, and so on. In short A->B->C->D->E.</p><p>If i click the button ""Exit"" in Activity E, i want to shut down my whole program, in another word, i want to finish all of the activities. How can i do it?</p><p>Thanks a lot!</p>","353857","","","","","2010-07-24 23:17:50","Android: How to shut down the Program completely?","<android><activity>","2","0","","",""
"3322335","1","3323243","","2010-07-23 21:02:46","2","1165","<p>Hi I am trying to get a contacts first name. I know how to get a contacts full name, but I cannot figure out how obtain just the name. any ideas?</p><pre><code>Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));String[] mPhoneNumberProjection = { PhoneLookup._ID, PhoneLookup.NUMBER, PhoneLookup.DISPLAY_NAME };    Cursor cur = context.getContentResolver().query(lookupUri,mPhoneNumberProjection, null, null, null);    try {       if (cur.moveToFirst()) {        String name =  cur.getString(2);        // do something with the name       }    } finally {       cur.close();    }</code></pre>","354607","","","","","2010-07-24 00:17:33","android getting contact first name","<android><contacts>","1","0","","",""
"3322362","1","3325594","","2010-07-23 21:06:14","0","132","<p>I have a UI layout that's comprised of a single outer layout that contains three internal layouts.  The internal layouts are essentially a header, body and footer.</p><p>I would like to cause the top, header view to become completely hidden if it's forced to shrink past a certain threshold.  It contains a logo image, and if it shrinks past a certain point, I'd rather just hide it completely.</p><p>What's the best way to do this?  Is there a way to accomplish this statically in a layout xml?  If not, do I need to subclass the View and listen for resizes?  Is there another way?</p>","205192","","","","","2010-07-24 15:08:52","Threshold for showing View in Android","<android>","2","0","","",""
"3322523","1","","","2010-07-23 21:28:28","8","5880","<p>In my app, I display pictures thanks to a webView. So for each image I create small HTML code that I load with the webView. So my html code consist basically in a img tag (with the path to my picture).</p><p>My pictures have different sizes, that's why I'd like to set my webView zoom to fit the pictures width to the webView width. So the user don't have do zoom in or out to be able to see the entire picture.</p><p>Is there a way to achieve it ?</p><p>Thanks.</p>","400695","","","","","2013-12-06 14:59:07","Image fit screen in a WebView","<android>","6","2","7","",""
"3322560","1","","","2010-07-23 21:33:33","3","1864","<p>I made a SoundManager class that uses SoundPool functions in order to loop a specific sound, however I can't figure out why it isn't playing a sound.</p><pre><code>public class SoundManager {private  SoundPool mSoundPool; private  HashMap&lt;Integer, Integer&gt; mSoundPoolMap; private  AudioManager  mAudioManager;private  Context mContext;public SoundManager(){}public void initSounds(Context theContext) {      mContext = theContext;     mSoundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);      mSoundPoolMap = new HashMap&lt;Integer, Integer&gt;();      mAudioManager = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);         } public void addSound(int Index, int SoundID) {    mSoundPoolMap.put(Index, mSoundPool.load(mContext, SoundID, 1));}public void playSound(int index) {      int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);      mSoundPool.play(mSoundPoolMap.get(index), streamVolume, streamVolume, 1, 0, 1f); }public void playLoopedSound(int index) {      int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);      mSoundPool.play(mSoundPoolMap.get(index), streamVolume, streamVolume, 1, -1, 1f); }</code></pre><p>}</p><p>This class is being called from my Activity via:</p><pre><code>private SoundManager mSoundManager;mSoundManager = new SoundManager();mSoundManager.initSounds(getBaseContext());mSoundManager.addSound(1, R.raw.sound);mSoundManager.playSound(1);</code></pre>","397531","","","","","2012-05-18 19:55:18","SoundPool not playing sounds","<android><soundpool>","2","0","1","",""
"3322608","1","3322818","","2010-07-23 21:41:00","0","1252","<ol><li>BroadcastReceiver receives a broadcast, opens a wakelock, starts a Service</li><li>Service opens another wakelock, then sends a ""release wakelock"" broadcast</li><li>BroadcastReceiver receives the release wakelock broadcast and releases its wakelock</li><li>Service does its thing and releases its wakelock</li></ol><p>There's a problem though. Currently the BroadcastReceiver stores its WakeLock as a member variable. Sometimes the garbage collector will run after the BroadcastReceiver starts the service but before it receives the release wakelock broadcast, and then I get a force close because the wakelock is finalized before it is released (since it gets garbage collected).</p><p>So I need to, in the onReceive method, do one of the following:</p><ul><li>wait for the service to start, wait for it to establish its wakelock, and then release the BroadcastReceiver wakelock; the 'release wakelock' broadcast will no longer be necessary</li><li>or, somehow transmit the wakelock to the service, and then the service will be responsible for releasing the single wakelock</li></ul><p><strong>Which one is the better option and how would I accomplish it?</strong></p>","47493","","","","","2010-07-23 22:21:43","Android BroadcastReceiver wait for Service to start or transmit WakeLock to Service?","<java><android>","1","0","","",""
"3322681","1","3373445","","2010-07-23 21:55:13","0","621","<p>I'm getting some very jerky scrolling while using the code below to create a ListView from a Cursor. Is there something I'm doing wrong, or any way to improve the performance of this ListView? </p><pre><code>bookmarksListView = (ListView)findViewById(R.id.bookmarks_listview);                         bookmarksDbCursor = bookmarkStore.getCursor();                         startManagingCursor(bookmarksDbCursor);                         String[] bookmarksColumns = new String[3];                         bookmarksColumns[0] = ""TITLE"";                         bookmarksColumns[1] = ""URL"";                         bookmarksColumns[2] = ""ICONID"";                         int[] bookmarksViews = new int[3];                         bookmarksViews[0] = R.id.title_text;                         bookmarksViews[1] = R.id.subtitle_text;                         bookmarksViews[2] = R.id.icon_view;                         bookmarksListAdapter = new SimpleCursorAdapter(this,                                         R.layout.list_item,                                         bookmarksDbCursor,                                         bookmarksColumns,                                         bookmarksViews);                         bookmarksListView.setAdapter(bookmarksListAdapter);                         bookmarksListView.setOnItemClickListener(new OnItemClickListener() {                                 @Override                                 public void onItemClick(AdapterView&lt;?&gt; parent, View view,                                                 int position, long id) {                                         Toast.makeText(BookmarkHistoryTabActivity.this, ""Clicked ID "" + Long.toString(id), Toast.LENGTH_SHORT).show();                                 }                         });                         registerForContextMenu(bookmarksListView); </code></pre><p>Note: <code>bookmarkStore.getCursor()</code> returns an unmanaged cursor from a sqlite database containing the columns from <code>bookmarksColumns</code>.</p><p>The icons I'm loading (from R.drawable) aren't the issue - I've tried turning them off and it has no effect. I've encountered a similar scrolling issue with a custom ListAdapter extending BaseAdapter I wrote a while ago, and it was caused by not properly setting the view's values in getView() I resolved it using the fix posted at <a href=""http://stackoverflow.com/questions/1320478/how-to-load-the-listview-s"">http://stackoverflow.com/questions/1320478/how-to-load-the-listview-s</a>..., but that was for a custom adapter class, and I'm not really sure how to implement that fix when I'm using a stock SimpleCursorAdapter, or if that fix even applies to this situation. </p><p>EDIT: The query returning info on the database looks like this, in case that helps:</p><pre><code>public Cursor getCursor() {            openDB();            Cursor c = mDB.query(DB_TABLENAME, new String[]{""_id"", ""ICONID"", ""DATE"", ""TITLE"", ""URL""}, null, null, null, null,""DATE DESC"");            return c;    }</code></pre><p>EDIT2: I have no idea why, but this behavior only occurs in android 1.6+ I've tried changing my query, removing the sorting, etc. for my cursor, nothing seems to help. The database is very small (&lt;20 items) and only contains the columns present in the query above.</p>","381299","","381299","","2010-07-27 21:24:33","2010-07-30 16:25:37","Jerky Scrolling when using SimpleCursorAdapter with ListView","<android><listview>","2","0","","",""
"3322726","1","","","2010-07-23 22:03:35","3","786","<p>will android OS support unicode ? </p>","400718","","","","","2011-07-15 03:49:10","android support unicode?","<android>","2","0","","",""
"3322821","1","","","2010-07-23 22:22:04","1","224","<p>I am trying to display a dynamic paint window in android, I want to make a red line move across the rectangular pulses that have been generated. </p><p>Here is the code for generating 4 pulses</p><pre><code>canvas.drawLine(ps, size ,(p0+p1) , size, paint);//start x,start y,stop x,stop y        canvas.drawLine((p0+p1+p2), size ,(p0+p1+p2+p3) , 300, paint);        canvas.drawLine((p0+p1+p2+p3+p4), size ,(p0+p1+p2+p3+p4+p5) ,size, paint);        canvas.drawLine((p0+p1+p2+p3+p4+p5+p6) , size ,(p0+p1+p2+p3+p4+p5+p6+p7),size, paint);</code></pre><p>now I want a red line to slide across the x axis (imaginary ) from (0,0) until the end of window with a movement at every 200 msec. Can someone suggest a way to do it. Thanks</p>","357349","","","","","2010-07-24 13:27:34","append paint objects android","<android>","1","1","","",""
"3322833","1","3354759","","2010-07-23 22:24:04","4","6837","<p>The software team in our graduation project asked for increasing the heap size per process in Android. They said that the default is ""16MB"" which isn't sufficient for them.How could I custom the size?</p><p>I found a commented line in the file: <code>/acme/my_board/BoardConfig.mk</code> in my android source code:</p><pre><code># USE_CUSTOM_RUNTIME_HEAP_MAX := ""64M""</code></pre><p>Is that what I need to edit??</p>","292942","","","","","2010-07-28 15:52:56","Custom Heap Size in Android Platform?","<android><embedded><source-code><porting>","2","3","5","",""
"3323074","1","","","2010-07-23 23:26:35","28","8821","<p>Why does Android provide 2 interfaces for serializing objects? Do Serializable objects interopt with Android <code>Binder</code> and AIDL files?</p>","272934","","","","","2014-03-12 11:44:35","Android: Difference between Parcelable and Serializable?","<android>","3","0","10","",""
"3323241","1","5382392","","2010-07-24 00:16:31","0","552","<p>In OpenGL ES, how do I specify what the maximum visibility distance is? I've found that when I do:</p><pre><code>gl.glTranslatef(0,0,-10f);</code></pre><p>everything I draw is invisible because it's too far away from the camera. How do I specify that it should draw things farther away?</p>","124696","","345717","","2010-07-24 00:19:46","2012-11-26 18:32:16","Setting OpenGL ES maximum distance on Android","<android><opengl-es>","1","0","","",""
"3323271","1","3323275","","2010-07-24 00:25:11","3","948","<p>I got a Droid X for development, and after setting it up just like all my other test devices, it showed nothing when I ran ""adb devices"".  When I plugged it in each time, OS X complained that it could not connect to the mass storage device.</p><p>How can I fix this, and connect my Droid X to OS X for development?</p><p>Finally found the answer, so I wanted to share it here.</p>","205192","","","","","2010-12-09 04:05:45","Droid X not connecting to adb on OS X","<android>","2","0","","",""
"3323376","1","","","2010-07-24 01:01:22","1","144","<p>I am looking to create an android widget for my application. It is a static widget, meaning it does not periodically update itself with new data (like google search widget)?  If that is the case, do I still need to create a service like the Word Widget sample in the android sdk?</p><p>Thank you.</p>","286802","","","","","2010-07-24 01:35:22","Question about creating a widget under android","<android>","1","0","","",""
"3323436","1","3324371","","2010-07-24 01:26:07","0","1065","<p>Anyone have any luck querying for a contacts nickname given a phone number or contacts name?</p><p>Thanks</p><p><a href=""http://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.Nickname.html"" rel=""nofollow"">http://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.Nickname.html</a></p>","354607","","379693","","2010-07-24 08:21:16","2010-07-24 08:21:16","android getting a contacts nickname","<android><android-widget><contacts>","1","0","0","",""
"3323496","1","3324487","","2010-07-24 01:51:53","14","35955","<p>I've looked all over the internet and can't seem to find what i'm looking for...</p><p>I'm just trying to find a site with some examples on how to use the OFFICIAL facebook android SDK <a href=""http://github.com/facebook/facebook-android-sdk"" rel=""nofollow"">http://github.com/facebook/facebook-android-sdk</a></p><p>To be specific i'd like to see some examples on notification use and simple photo upload. But i'll take anything to help get a feel for using the SDK. </p><p>If anyone knows of any examples please share thank you so much!</p>","393373","","1765573","","2013-07-19 12:56:09","2013-07-19 12:56:09","Looking for android Facebook SDK examples","<java><android><facebook><sdk><facebook-android-sdk>","7","2","18","",""
"3323524","1","","","2010-07-24 02:06:29","4","348","<p>I need to store data to use in my android program. Here are the details about the data:</p><ul><li><p>There will be one table. Each ""row"" of data will have a unique INT identifier. Other then that field, there will be four other INT fields and a text field. The string field will probably be a 2 or 3 sentences long. Each of the 4 INT fields will correspond to the ID of other rows.</p></li><li><p>There will be 100 rows, maybe 200. But all the rows will be read-only, and pre-populated.</p></li><li><p>The data will be read frequently, and non-sequentially.</p></li></ul><p>The first answer for storing data is SQLite a lot of times, but given the particulars of the data, another storage method might be more efficient. I'm open to any suggestions, and code examples are always welcome!</p>","386680","","","","","2010-07-26 05:05:56","What is the best method to store this small read-only data table in an android phone?","<android><sqlite><data-storage>","2","2","3","",""
"3323867","1","3324723","","2010-07-24 04:52:59","2","435","<p>I have a large bitmap that i would like to keep in memory when the qwerty keyboard is visible. My app is always in landscape, so this is the only configuration change that will cause a reDraw. I heard this is what onRetainNonConfigurationinstance() is for...but cant figure it out. Can someone point me in the right direction? Thanks.</p>","385051","","","","","2010-07-24 10:30:33","Keeping a bitmap in memory with the help of onRetainNonConfigurationInstance()","<android><activity><lifecycle>","1","0","","",""
"3323889","1","","","2010-07-24 05:03:17","0","405","<p>I have a strange behaviour of BroadcastReceiver when trying to listenincoming call. I set up the BroadcastReceiver to listen to bothincoming calls and sms. The BroadcastReceiver run after the booting iscomplete. When first i fake a call into the emulator, i can not catchthe call. I try again with sms and my Broadcastreceiver can catch thesms correctly. I try again with the incoming call and now theBroadcastReceiver works. I restart the emulator and try again. Itseems that i always have to fake a sms to trigger theBroadcastReceiver. After that the BroadcastReceiver behaves correctlyas i want.</p><p>What did i do wrong? </p>","399886","","","","","2010-07-24 05:03:17","broadcast incoming call? error","<android><error-handling>","0","2","","",""
"3323980","1","","","2010-07-24 05:44:21","0","393","<p>I'm working on an Android application where I'm performing a search on all businesses in a radius around a city, and I'm looking for a way to get the addresses of the businesses at each pin into my application so I can work with them. I can perform the search and display it on a map using MapViews, but I can't figure out a way to get access to the list of results. When I use an HTTP GET approach with a output=csv or xml, it only returns the address / GeoPoint of the city I centered the search around.</p><p>Does anyone know of a set of methods or a different approach that I can use to get the addresses of the returned businesses from my query in an Android application? Thanks.</p>","400882","","","","","2012-04-14 21:42:11","Getting addresses from all results in a Google Maps query in Android?","<android>","1","1","","",""
"3323986","1","3324309","","2010-07-24 05:46:52","7","8138","<p>I am using a public AsynTask to download data, and I am trying to show a progress bar which would show the download progress. I think I have the code right, but all I get is a spinner progressdialog. Am I missing something? Why isn't the progress bar showing up? Here is the code.Thanks for any pointers.</p><pre><code>public class FileDownloader extends AsyncTask&lt;String, Integer, Void&gt;{private Context _appContext;private HttpURLConnection _urlConn;private ProgressDialog _progressDia = null;private DialogInterface.OnCancelListener _progDiaCancelListener = new DialogInterface.OnCancelListener(){    /**     * When the progress dialog is canceled, stop the GET request.     */    public void onCancel(DialogInterface dialog)     {        FileDownloader.this.cancel(true);    }};/** * Constructor. * @param appContext */public FileDownloader(Context appContext){    _appContext = appContext;    _progressDia = new ProgressDialog(_appContext, ProgressDialog.STYLE_HORIZONTAL);    _progressDia.setMax(100);    _progressDia.setTitle(_appContext.getString(R.string.diaHeader1));    _progressDia.setMessage(_appContext.getString(R.string.diaBody1));    _progressDia.setCancelable(true);    _progressDia.setIndeterminate(false);    _progressDia.setOnCancelListener(_progDiaCancelListener);}// Runs on the UI thread@Overrideprotected void onPreExecute() {         _progressDia.setProgress(0);         _progressDia.show();                           }@Overrideprotected Void doInBackground(String... args) {    String dloadURL = args[0],           saveLoc = args[1];            ...            ...        while((len = input.read(buf)) &gt; 0)        {            output.write(buf, 0, len);            total += len;            publishProgress((int)total * 100/lenghtOfFile);        }            ...            ...    }    catch(SocketTimeoutException ex)    {       }    finally    {         ...}// This is executed on main UI thread.@Overrideprotected void onProgressUpdate(Integer... values) {     _progressDia.setProgress(values[0]);}@Overrideprotected void onCancelled() {         ...}// This is executed on main UI thread.@Overrideprotected void onPostExecute(Void result) {        removeProgressDialog();        ...}    /**     * Remove the message dialog, if still showing.     */    private void removeProgressDialog()    {        if(_progressDia != null &amp;&amp; _progressDia.isShowing())        _progressDia.dismiss();    }}</code></pre>","194742","","2045611","","2010-07-24 17:15:41","2010-07-24 23:51:50","I want a progressbar but get a spinner progressdialog","<android><progress-bar><progressdialog>","4","0","4","",""
"3324008","1","","","2010-07-24 05:57:38","0","2262","<p>I have done a ton of searching and am hitting a brick wall. I am able to use HTML5  on a Motorola Droid with Android 2.1. The problem is when I add fallback options for firefox, and flash that add multiple source files. If I use src within the video tag, and add the onclick=""this.play();"" code within the video tag, I can watch the mp4 on the Droid. I found this code at this link below. When I use this with multiple src files, I either dont know where to put this piece of code or it just doesn't work. </p><p><a href=""http://stackoverflow.com/questions/1711078/html5-video-element-on-android"">http://stackoverflow.com/questions/1711078/html5-video-element-on-android</a></p><p>When I use the  code like below, it always work on my droid, where I touch the video thumbnail and it opens the video in the video player:</p><pre><code>&lt;video src=""video/placeholder.m4v"" poster=""video/placeholder.jpg"" onclick=""this.play();""/&gt;</code></pre><p>This is my code but it wont allow me to click the video or shows the thumbnail in the Android browser. I have tried putting the onclick= in the src lines as well, with no luck:</p><pre><code>&lt;video width=""640"" height=""360"" controls onclick=""this.play();"" /&gt;&lt;source src=""2.mp4"" type=""video/mp4"" /&gt;&lt;source src=""spit.ogv"" type=""video/ogg"" /&gt;&lt;div style=""width:640px;height:360px;"" id=""player""&gt;&lt;/div&gt;&lt;script language=""JavaScript""&gt;flowplayer(""player"",""flowplayer-3.2.2.swf"",""splash.flv"");&lt;/script&gt;  &lt;/video&gt;</code></pre><p>I want to update my entire site to use HTML5 through firefox, safari, flash for older browsers and hopefully for android and iphones. It seems like it is much harder to get html5 working for phones than desktop browsers. I saw this guy <a href=""http://www.awakecoding.com/android/"" rel=""nofollow"">using this</a> but I think it is annoying (and I would need to redesign the site for these buttons) that I have to have external buttons created by java for it to work on a phone.</p><p>Any help is greatly appreciated!</p>","400889","","400889","","2010-07-24 06:04:16","2010-07-25 19:56:41","Html5 Video on Android 2.1 with multiple source files","<android><html5>","1","0","","",""
"3324010","1","3324107","","2010-07-24 05:59:34","0","6287","<p>i am facing a problem of OutOfMemoryError that is bitmap size exceeds vm budget while changing the orientation of the Droid mobile (but not in any of other mobiles like Android normal and Android small).I am displaying 10 images in gridview, each one size is less than 20kb. </p><p>If i insert 6 images then it doesn't arise that error.</p><p>How can i resolve this problem, any one  please solve this problem.Thanks</p>","247921","","","","","2013-07-03 07:17:13","Android OutOfMemoryError : bitmap size exceeds VM budget","<android>","2","0","1","",""
"3324178","1","","","2010-07-24 07:10:33","0","638","<p>I would like to ask all of you if you know any good <strong>books</strong>, <strong>articles</strong> etc ... on development for these mobile platforms. I'm looking for learning material where the whole technology, OSes and development is discussed in <strong><em>great detail</em></strong> so i could gain a deeper understanding of the system as a whole.So any <em>quick start</em> tutorial and stuff like that does not count.</p><p>Major thanks for all your replies.</p>","1205130","","","","","2010-10-19 13:41:12","Android, iPhone, Symbian and Windows Mobile development learning material","<iphone><android><windows><mobile><symbian>","3","2","1","2012-08-25 16:04:55",""
"3324273","1","","","2010-07-24 07:45:36","0","2391","<p>I cannot stop Toast messages that continue even when I have destroyed the activity from which they originate. They are queued and just carry on and on and on when I am in the next activity. </p>","400923","","400923","","2010-07-24 07:52:58","2013-01-15 04:41:54","How to shut down toast messages and activities","<android><kill><toast>","3","2","","",""
"3324377","1","3370982","","2010-07-24 08:21:42","1","1379","<p>HI ALL</p><p>I need to show :</p><p>1) Photostream of a particular account on flickr in a grid view.2) List OR Grid of you tube videos for a particular channel.</p><p>Please suggest tutorials OR link to do that.</p><p>Thanks..</p>","152867","","","","","2010-07-30 11:25:27","Flickr and Youtube integration on Android","<android><youtube><flickr>","1","0","3","2013-11-09 14:56:10",""
"3324467","1","3324496","","2010-07-24 09:00:13","2","705","<p>hi friends i identified problem in changing one activity using tab, in on tab activity i  am adding data to sqlite in other tab activity i am displaying them using listview(array adapter)but when i come back to add data and after adding new item to sqlite the newly added records are not updated in listview </p><p>plz forward u r valuable suggestions to solve my problem</p>","400942","","379693","","2010-07-24 09:23:38","2010-08-30 15:21:50","how to manage activities in android","<android><android-widget>","2","0","1","",""
"3324820","1","","","2010-07-24 11:00:33","0","831","<p>I configure email in Android2.1 emulator(Default email Configuration).Is there any possibility to get the userid and password of that email account in my application?</p>","398981","","940096","","2011-12-01 14:02:48","2011-12-01 14:02:48","Get UserId and password in android application?","<android><email>","0","0","","2014-04-15 15:49:04",""
"3324902","1","3325248","","2010-07-24 11:27:36","0","1520","<p>I have a ListView that contains some data from sqllite table.the table is updated by some other process, and I would like torefresh it's data.</p><p>I tried invalidate,tried doing setAdapter() again and again,nothing helped. it does not reload.Should I close the adapter somehow and re-open it?</p><p>The strange thing is that if I open another activity, then go back -it WILL refresh itself.</p>","400942","","","","","2010-07-24 16:11:45","how to refresh a list view when the activity still in active mode","<android>","2","1","2","",""
"3324934","1","","","2010-07-24 11:38:20","2","3021","<p>im new on android development.</p><p>I had a requirement of recording video on an android device.. when i searched for it, i didn't find any proper code that is working. even android developers doesn't provide clear code..</p><p>Please, if anyone has links or code.. share with me..</p><p>Thank you..</p>","365184","","","","","2013-11-13 07:26:01","code for video recording on android","<android><video><recording>","2","1","","",""
"3325156","1","","","2010-07-24 12:54:18","0","134","<p>So, I've been trying to learn a bit about programming for Android. I've got past ""Hello, World!"" and I've got GPS stuff to work.</p><p>I'm trying to have the device sit on a port and pipe GPS data over the port ( Eventually NEMA std, and have that talk with Marble for long drives )</p><p>It throws the I/O Error and Toast-s me ""Ohh fuuuuu -- Can't create a GPS port on port 20017""</p><p>At first, I thought it was the port ( originally 2017 being normal user, might not have been able to create a reserved port ) but then I bumped it up to a very high number.</p><p>Here's what I've got so far:</p><pre><code>public class GeoLoc extends Activity {    public void onCreate(Bundle savedInstanceState){         super.onCreate(savedInstanceState);         setContentView(R.layout.main);         /* Use the LocationManager class to obtain GPS locations */         LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);         LocationListener mlocListener;         int port = 20017;         try {             mlocListener = new MyLocationListener( port );             mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener);         } catch (IOException e) {             String Text = ""Ohh fuuuuu -- Can't create a GPS port on port "" + port;             Toast.makeText( getApplicationContext(), Text, Toast.LENGTH_SHORT).show();         }    }    ...     SNIP    ...    public class MyLocationListener extends Thread implements LocationListener {        ServerSocket s;        ArrayList&lt;ServerThread&gt; childs;         public MyLocationListener( int port ) throws IOException {            this.s = new ServerSocket( port );            this.start();    }    @Override    public void run() {        try {            String Text = ""Waiting on port "" + this.s.getLocalPort();            Toast.makeText( getApplicationContext(), Text, Toast.LENGTH_SHORT).show();            Socket s = this.s.accept();            this.childs.add(new ServerThread( s ) );        } catch (IOException e) {            // crap-tastic but managable.        }    }    @Override    public void onLocationChanged(Location loc) {        for ( int i = 0; i &lt; this.childs.size(); ++i ) {            this.childs.get(i).sendLoc(loc);        }    }    ...     SNIP    ...    }}</code></pre><p>Thanks, guys!</p>","289862","","289862","","2010-07-24 13:20:41","2010-07-24 13:20:41","Android G1 ServerSocket I/O Errors on Creation","<android>","0","2","","",""
"3325197","1","3325434","","2010-07-24 13:08:46","0","1542","<p>I have trouble with finding my SQLite Database.</p><p>As we can access the SQLite databases on a running emulator like below:</p><pre><code> adb -s emulator-5554 shell sqlite3 /data/data/package_name/databases/database_name</code></pre><p>But what if I am testing my application on real device(HTC Here-Android) ?where does i find my database?</p>","379693","","114066","","2010-07-26 14:36:18","2010-07-26 16:32:17","Location of SQLite Database when application is executed on real device","<android><sqlite>","3","2","1","",""
"3325236","1","","","2010-07-24 13:20:22","0","501","<p>I use the below code to create a file in my application.I need to check is the file is exist or not from my code ? Help me </p><pre><code>FileOutputStream fOut = null;            OutputStreamWriter osw = null;    String data=""My file Test "";      try{        fOut = openFileOutput(""settings.dat"",MODE_PRIVATE);             osw = new OutputStreamWriter(fOut);        osw.write(data);        osw.flush();                   }        catch (Exception e) {              e.printStackTrace();                  }</code></pre>","389404","","","","","2010-07-24 13:35:18","Check file is available or not in android?","<android>","1","0","","",""
"3325601","1","3325643","","2010-07-24 15:12:08","9","3003","<p>I have a custom ContentProvider I use to store fixes obtained from the GPS into a SQLite database.  This class overrides ContentProvider methods (delete, insert, query...), but notice I have also included a method to query the last fix.</p><pre><code>public class FixesContentProvider extends ContentProvider {    @Override    public int delete(...) { ... }    ...    @Override    public Cursor query(...) { ... }    public Cursor getLastFix(Uri uri) { ... }}</code></pre><p>It is pretty easy to query data from other services or activities by calling <code>getContentResolver()</code>.</p><pre><code>ContentResolver cR = getContentResolver();Cursor fixes = cR.query(CONTENT_URI, ...);</code></pre><p>But I am not able to call my custom method (<code>FixesContentProvider#getLastFix</code>).  <strong>How could I call custom methods defined in a ContentProvider?</strong></p><p>Maybe I don't understand how ContentProviders/ContentResolvers work in this case, but official <a href=""http://developer.android.com/guide/topics/providers/content-providers.html"">Android documentation provided by Google</a> is not very clear in this sense.</p>","12388","","12388","","2010-07-24 15:32:37","2013-02-27 12:12:52","Android: call custom methods in a ContentProvider","<android><android-contentprovider>","2","0","2","",""
"3325609","1","","","2010-07-24 15:15:24","1","633","<p>The text to speech API in android is awesome.. Is there any way in which I can play this text to speech content to a call instead of the speaker? As in I call a number automatically and then play text to speech to the callee..</p><p>PS: This is not another opening to phone spam if you are wondering.. Working on an automated distress call system :D</p>","344398","","244296","","2010-07-24 15:33:41","2010-07-24 22:53:00","How do I play an automated call to a number in android?","<android>","1","0","3","",""
"3325736","1","","","2010-07-24 15:54:21","147","40921","<p>What files/folders can I safely ignore for inclusion with git?</p><p>I copied a good project, removed its gen and bin folders and tried to run the app. The Android Launch window says, ""Your project contains error(s), please fix them before running your application. There is a red X on the icon to the left of the project in the Package Explorer. While the gen folder does not exist in Windows Explorer, it does in Package Explorer.</p>","401120","","1317927","","2013-07-09 20:59:52","2014-04-07 08:59:43","Eclipse Android and gitignore","<android><eclipse><git>","5","7","47","",""
"3325767","1","3325788","","2010-07-24 16:01:27","2","5217","<p>Is this normal.</p><p>The docs say</p><p>""The onStart() and onStop() methods can be called multiple times, as the activity alternates between being visible and hidden to the user""</p><p>When I press the back button an it will go back to the previous activity which totally covers the old one.</p><p>What is going on here?</p>","248521","","","","","2010-07-24 16:07:29","onStop() not getting called when I press the back button","<android>","1","1","","",""
"3325883","1","3326046","","2010-07-24 16:29:23","2","2327","<p>hi i have an activity and in the activity i have some buttons and textviews, and i would like to draw a rectangle with text inside. i saw some examples online but the all say to create my on view , override onDraw and the set this view as my layout, but i have my layout already.</p><pre><code>  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    TextView baramzona = (TextView) findViewById(R.id.TextView01);    baramzona.setText(R.string.baram_zona_textview);    final Button pocniparking = (Button) findViewById(R.id.ButtonStart);    final TextView momentalnazona = (TextView) findViewById(R.id.TextView02);    //momentalnazona.setText(""?????????? ?? ??????? ?? ??????"");    pocniparking.setText(R.string.btn_Start_Parking);    pocniparking.setEnabled(false);    }  }</code></pre><p>any ideas?</p>","366659","","366659","","2010-07-24 16:35:35","2010-07-24 17:16:39","How can i draw a rectangle in android and put some text inside it and then place it?","<android><draw>","1","2","","",""
"3325915","1","3325945","","2010-07-24 16:39:28","3","2195","<p>I have an Activity which looks up data from the web in its onCreate method. The Activity is activated by the user hitting a notification. So it is a common problem that the user will quickly turn on their phone, unlock it, slide open notifications, tap the notification, and the Activity will activate before the phone is done connecting to internet.</p><p>I do have a friendly AlertDialog that pops up informing the user that the data couldn't be received and to try again when the network is connected; but <strong>is there a way for the Activity to actively tell the phone to connect and detect that a connection is being made and then wait for the connection to establish, and then load its data successfully</strong>?</p>","47493","","","","","2010-07-24 16:48:07","Android: Activity establish network connection","<java><android>","1","0","2","",""
"3325922","1","3325968","","2010-07-24 16:41:03","5","1712","<p>I have a scrollable map app which for now has a huge bitmap. It loads fine on startup, but when it looses foreground status and the user brings it backs again im getting an out of memory error. In onPause it trashes the bitmap using recycle, and marks it as null. The onResume checks to see if map==null and will load the bitmap back again, which is crashing the program despite me recycling the bitmap...Here are some bits of code. All of the other references to Bitmap map first check if it is null before loading/drawing.</p><p><strong>onPause</strong></p><pre><code>protected void onPause() {super.onPause();Log.e(""sys"",""onPause was called"");if (map != null){        map.recycle();        map = null;        System.gc();        Log.e(""sys"",""trashed the map"");}}</code></pre><p><strong>my onResume</strong></p><pre><code>protected void onResume(){super.onResume();Log.e(""sys"",""onResume was called"");if (map == null)        map = BitmapFactory.decodeResource(getResources(),                        R.drawable.lowresbusmap);Log.e(""sys"",""redrew the map"");}</code></pre>","385051","","238639","","2010-07-24 16:43:13","2010-07-24 16:52:43","out of memory error dealing with large bitmaps and the android activity life cycle","<android><bitmap><memory-management>","1","2","","",""
"3326014","1","","","2010-07-24 17:05:10","0","857","<p>It seems that a TextView inside a LinearLayout forces that LinearLayout to be larger.  I am trying split my screen top 50% and bottom 50% and also the bottom 50% is split into 3 parts.  So I did my weights 3 (for the top), and then 1, 1, 1 (for the bottom) for a total of 6.</p><p>Here is what it looks like.<a href=""http://i.imgur.com/3FJSW.jpg"" rel=""nofollow"">http://i.imgur.com/3FJSW.jpg</a></p><p>As soon as I take out the TextView inside the first LinearLayout the splits are proper.  The moment I put the TextView inside the top LinearLayout the top LinerLayout gets larger by the amount of the the TextView.  </p><p>Here is my code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt; &lt;LinearLayout     android:layout_width=""fill_parent""      android:layout_height=""wrap_content""     android:orientation=""horizontal""     android:background=""#cccccc""     android:layout_weight=""3""&gt;      &lt;TextView       android:text=""@string/hello""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:textColor=""#000000""         android:layout_weight=""1""/&gt; &lt;/LinearLayout&gt;     &lt;LinearLayout     android:layout_width=""fill_parent""      android:layout_height=""wrap_content""     android:orientation=""horizontal""     android:background=""#aa0000""     android:layout_weight=""1""&gt; &lt;/LinearLayout&gt;      &lt;LinearLayout     android:layout_width=""fill_parent""      android:layout_height=""wrap_content""     android:orientation=""horizontal""     android:background=""#00aa00""     android:layout_weight=""1""&gt; &lt;/LinearLayout&gt;      &lt;LinearLayout     android:layout_width=""fill_parent""      android:layout_height=""wrap_content""     android:orientation=""horizontal""     android:background=""#0000cc""     android:layout_weight=""1""&gt; &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","401148","","401148","","2010-07-24 17:08:09","2012-06-16 02:36:14","How do I prevent TextView from stretching out it's parent LinearLayout?","<android><textview><android-linearlayout>","1","1","","",""
"3326074","1","3326239","","2010-07-24 17:22:53","1","619","<p>I use the following code to check file availability </p><pre><code>    File f1=new File(""/data/data/com.myfiledemo/files/settings.dat"");    if(f1.exists())    textview.setText(""File Exist"");</code></pre><p>If i use the following code it's not responding</p><pre><code>   File f1=new File(""settings.dat"");   if(f1.exists())   tv.setText(""File Exist"");</code></pre><p>Here com.myfiledemo is my application package . I simply create the file like this </p><pre><code>   fileInputstream = openFileInput(""settings.dat"");  </code></pre><p>why It's not responding for the second if condition.??Is it Wrong?? </p>","399864","","244296","","2010-07-24 17:41:33","2010-07-24 18:06:10","get file location in android?","<android>","2","0","","",""
"3326099","1","3327370","","2010-07-24 17:27:32","2","416","<p>I've been working on frame animation for a week now, and every code I've used has a tremendous amount of errors and plainly just doesn't work. Can you please give me a code that has worked for you? Please include the exact java code you used, the main.xml code, the mainanim.xml, the android:id's, even the images in the res/drawable-hdpi, -mdpi, and -idpi folders, and what each picture's id is. Thanks! </p>","394842","","","","","2013-05-28 05:37:55","Android - Please Just Give Me a Decent, Working Animation Frame Code","<android><eclipse><animation><sdk><frame>","1","1","","",""
"3326110","1","","","2010-07-24 17:30:56","11","5846","<p>Edit: My bad, I meant objective-c, not c#. Some reason I got it into my head it was c# the iphone used. So the answers for c# were great, thanks, but theyre a bit irrelevant, sorry about that.</p><p>I've had a look but can't find anything that answers this, though a few have shortened the question by answering parts of it. Between a small group, we were planning on doing some work on iPhone and Android, the 2 seperate for the most part but helping each other out, and with some guys doing graphics work split between them.</p><p>But we were thinking about the possibilities of moving things between the two, not necessarily apps, maybe just useful classes or something. Looking at objective-c and Java, they seem to have about the same features that the biggest obstacle would be system interface stuff, so we were wondering whether, if we created an abstraction over these on each system so they could be given the same input (which unless I'm wrong wouldn't put too much strain on the system?), would there be any problems in writing something to convert between objective-c and Java, worse than the locations of methods in the sdks? Or are there key features or something in one language that the other doesn't have which we've missed that would mean the only way to do it would be rewriting from scratch.</p>","303674","","303674","","2010-07-27 17:41:25","2012-10-07 21:46:51","Are there any huge differences between objective-c and Java, or iPhone and Android?","<java><iphone><objective-c><android><porting>","8","4","10","",""
"3326157","1","3326649","","2010-07-24 17:42:57","1","396","<p>I want a Layout that is as big as the screen with two rows  and three columns </p><p>like that image => <a href=""http://dl.dropbox.com/u/2024237/Bildschirmfoto-DroidDraw.png"" rel=""nofollow"">http://dl.dropbox.com/u/2024237/Bildschirmfoto-DroidDraw.png</a></p><p>the colors should be buttons...</p><p>please help .... i cant figure it out</p>","401171","","","","","2011-05-20 01:57:47","How to do such a layout in xml? Android","<java><android><xml><layout>","1","0","1","",""
"3326283","1","7449955","","2010-07-24 18:17:50","3","1552","<p>Hi: When the user clicks on another tab an animation should appear to the next view? What is the best to do this?</p>","281535","","","","","2011-09-16 20:19:28","Animate tab switch with TabHost","<android><animation>","1","0","2","",""
"3326317","1","3344514","","2010-07-24 18:29:25","3","2154","<p>Is it possible to have an EditTextPreference with AutoComplete attached to it?</p><p>I know ho to attach one to an element with an id, but am having trouble figure out how to attach the ArrayAdapter to the preference field.</p><p><strong>This is wrong, but it's as close as I can get.</strong></p><pre><code>final String[] TEAMS = getResources().getStringArray(R.array.teams);   AutoCompleteTextView EditTextPreference = (AutoCompleteTextView) findViewById(R.id.editTextPrefTeam);     ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_dropdown_item_1line, TEAMS);EditTextPreference.setAdapter(adapter);</code></pre>","401183","","401183","","2010-07-25 00:37:53","2011-08-09 21:24:56","Possible to autocomplete a EditTextPreference?","<android><autocomplete><edittext>","3","0","1","",""
"3326366","1","3326475","","2010-07-24 18:42:09","4","9954","<p>Could anyone please explain what context should i use the AlertDialog.Builder class? I am new to android app development and I frankly don't understand which context to use when?</p><p>Say, I want to create an object for AlertDialog.Builder class - </p><pre><code>AlertDialog.Builder ab = new AlertDialog.Builder();ab.setMessage(""Test"");ab.show();</code></pre><p>What context should I use it in? Does it differ if I use the Alert Dialog <code>onCreate</code> or <code>OnClickListener</code> or in the handler of any such event? </p>","227809","","","","","2011-12-02 08:59:38","what context should i use AlertDialog.Builder in?","<android><alertdialog>","3","0","","",""
"3326390","1","3327667","","2010-07-24 18:47:05","3","734","<p>In the Android MapsDemo available in Eclipse for the Google API, they create an inner class <code>SmoothCanvas</code> in MapViewCompassDemo.java. Within this class the re-implement seemingly every method and reroute it to a delegate instance of <code>Canvas</code>.</p><pre><code>static final class SmoothCanvas extends Canvas {    Canvas delegate;    private final Paint mSmooth = new Paint(Paint.FILTER_BITMAP_FLAG);    public void setBitmap(Bitmap bitmap) {        delegate.setBitmap(bitmap);    }    public void setViewport(int width, int height) {        delegate.setViewport(width, height);    }    ...</code></pre><p>What is the point of the delegate in this instance?  </p>","401173","","","","","2010-07-25 01:42:14","Why does the Android maps compass demo use a delegate for the SmoothCanvas class?","<java><android><class><delegates><demo>","2","0","","",""
"3326518","1","3326537","","2010-07-24 19:21:02","0","1677","<p>My program contains a file with the name ""size.txt"", which contains just a word ""15"". If a user choose a value from a spinner,say 17, then the chosen value should be stored in the file and replace ""15"". </p><p>I have added the permission to the program</p><pre><code>&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""&gt;&lt;/uses-permission&gt;</code></pre><p>But somehow i can not make the chosen value be written to the file. Here is my code</p><pre><code>try {    FileOutputStream fos = openFileOutput(""size"", Context.MODE_PRIVATE);    OutputStreamWriter osw = new OutputStreamWriter(fos);    osw.write(""17"");    osw.flush();    osw.close();} catch (java.io.IOException e) {//do something if an IOException occurs.}</code></pre><p>Can anybody help me? Thank youvery much!</p>","353857","","","","","2011-08-04 07:52:27","Android: can not write to a txt file","<android><file>","2","0","","",""
"3326673","1","3350462","","2010-07-24 20:04:34","0","744","<p>I am starting an activity from one by passing some data in the intent. I want the next activity to call some asynchronous service (rest service) with the data from intent and show the result on screen.</p><p>I made the asynchronous call by starting a different thread from onStartup method. But this is failing with below error:</p><pre><code>: INFO/ProductAdvertisingAPIOperation(290): done requesting and parsing: WARN/ActivityManager(73): Launch timeout has expired, giving up wake lock!: INFO/Process(290): Sending signal. PID: 290 SIG: 9: INFO/WindowManager(73): WIN DEATH: Window{43f64a28 com.zzzz.android.xxxx.main/com.zzzz.android.xxxx.main.HomeScreen paused=false}: INFO/WindowManager(73): WIN DEATH: Window{43ffe9b8 com.zzzz.android.xxxx.main/com.zzzz.android.xxxx.main.CameraView paused=false}: INFO/UsageStats(73): Unexpected resume of com.android.launcher while already resumed in com.zzzz.android.xxxx.main: WARN/InputManagerService(73): Got RemoteException sending setActive(false) notification to pid 290 uid 10034</code></pre><p>Does anybody know  the reason?Thanks</p>","183871","","183871","","2010-07-24 20:18:05","2010-07-28 06:42:37","Asynchronous service call while starting the activity in android","<android>","1","1","","",""
"3326679","1","","","2010-07-24 20:05:55","4","780","<p>Hi    I am developing an Android App where I require a user to authenticate his session before using the app. One way is to store a user name and password by asking him to register on the app and then use that to authenticate him. But i was looking to do something else, maybe use an OpenId account to authenticate or Opensoial or something like Facebook Connect. Any Suggestions and comments? thanks for you help.</p>","363441","","","","","2011-02-14 15:33:50","Authentication on your Android App","<java><android><android-widget>","2","0","","",""
"3326854","1","","","2010-07-24 20:50:17","1","2453","<p>I am a beginner Android developer and I need to know how to Save and Load images (Bitmaps) from the Android Gallery, But I dont even know where to start! Can someone help me to know where to get started, or even look?</p>","401237","","","","","2010-08-02 13:28:44","Saving / Loading Images from android gallery as bitmap?","<java><android><image>","1","0","","",""
"3326949","1","3328046","","2010-07-24 21:16:28","7","4165","<p>I have an app that is available from the Android Market. Some users have asked for a way of debugging when things don't work out as expected. I have been looking into adding a menu item that will display the output of </p><pre><code>    Process mLogcatProc = null;    BufferedReader reader = null;    mLogcatProc = Runtime.getRuntime().exec(        new String[] {""logcat"", ""-d"", ""AndroidRuntime:E BDtN:V *:S"" });    reader = new BufferedReader(new InputStreamReader (mLogcatProc.getInputStream()));    String line;    ArrayList listOfLogLines = new ArrayList();    while ((line = reader.readLine()) != null)    {        listOfLogLines.add(line);    }</code></pre><p>Basically I am extracting the parts of the Log.* lines that my app has been writing and the errors that the AndroidRuntime has been throwing.</p><p>I have a working prototype that will display to the user the contents of the part of the log that I have extracted in a ListView.</p><p>I will have to add android.permission.READ_LOGS to the AndroidManifest.xml file in order for my app to have read access to the log, and this of course will be information that the user will be prompted with before installing.And the question is if this is considered impolite, dangerous or otherwise out of the ordinary. Will it keep users from installing?</p>","401236","","","","","2011-12-02 18:31:01","Android app using android.permission.READ_LOGS - is that impolite?","<android><logging>","2","1","2","",""
"3327087","1","","","2010-07-24 21:59:04","8","9023","<p>ScrollView has a method for setting the x and y scroll offset, but no method for getting the current offset (all I'm really interested is the y offset, since ScrollView only supports vertical scrolling). I don't see any method that would work in the superclasses, and tried getTop() for the content view, which is always zero. Am I missing something?</p>","315884","","","","","2013-04-26 06:58:05","How to get the current Y offset of a ScrollView","<android>","3","0","1","",""
"3327089","1","3639657","","2010-07-24 21:59:57","1","186","<p>I have a list view with several columns; things such as name, date, etc. I want to be able to click on the header TextView and sort the list by that field. When the list loads the variable works, and a list is queried and sorted by the field _id (no surprise other than it works), but when i click on the header TextView i get a force close ::</p><p>Thread [&lt;3> main] (Suspended (exception SQLiteException))<br>    ViewRoot.handleMessage(Message) line: 1757<br>    ViewRoot(Handler).dispatchMessage(Message) line: 99     Looper.loop() line: 123     ActivityThread.main(String[]) line: 4595<br>    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]<br>    Method.invoke(Object, Object...) line: 521<br>    ZygoteInit$MethodAndArgsCaller.run() line: 860<br>    ZygoteInit.main(String[]) line: 618     NativeStart.main(String[]) line: not available [native method]  </p><p>The TextView gives no errors when not changing my orderby variable. </p><p>SETTING VARIABLE:</p><p><code>private View.OnClickListener NameSortbtnListener = new View.OnClickListener(){</code></p><pre><code>    public void onClick(View v){            sort = "" KEY_JOURNAL_TITLE "";            fillData();        }    };</code></pre><p>POPULATING LIST:</p><p><code>   private void fillData() {            Cursor notesCursor = mDbHelper.fetchAllJournals(sort);            startManagingCursor(notesCursor);</code></p><pre><code>        String[] from = new String[]{journalDbAdapter.KEY_JOURNAL_TITLE,                 journalDbAdapter.KEY_LOCATION, journalDbAdapter.KEY_JDATE,                journalDbAdapter.KEY_STEPS};        int[] to = new int[]{R.id.text1, R.id.text2, R.id.text3, R.id.text4};        SimpleCursorAdapter notes =             new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, </code></pre><p><code>from, to);            setListAdapter(notes);        }</code></p><p>QUERY (IN DB ADAPTER):</p><p><code>public Cursor fetchAllJournals(String sort) {</code></p><pre><code>        return mDb.query(DATABASE_JOURNAL_TABLE, new String[] {KEY_JROWID,                 KEY_JOURNAL_TITLE, KEY_JOURNAL_NOTES, KEY_JDATE, KEY_LOCATION,                KEY_STEPS},null , null, null, null, sort ,null);    }</code></pre>","393328","","","","","2010-09-03 21:23:31","Passing an Orderby","<java><android><sqlite><sql-order-by>","2","0","","",""
"3327103","1","","","2010-07-24 22:05:47","0","175","<p>I added my dev account to my personal email and i want to change it to my company email...how to do this?Second: I used google checkout when first released and added scottrade account to google checkout. I let it go and never verified. No account is closed and I tried to verify but I'm now locked out of bank verification. I cannot add new bank account or move dev account to work account.</p><p>Please help because google will not.</p><p>Ed</p>","401262","","","","","2011-06-14 20:51:20","bank account error google checkout","<android><google-checkout>","1","0","","",""
"3327139","1","3327245","","2010-07-24 22:20:50","0","1519","<p>I want to show the Android version of a <a href=""http://bit.ly/dc3pXu"" rel=""nofollow"">Model Dialog</a> with text input however I think the keyboard will be behind the actual activity since dialogs weren't made to have inputs. Is there any way I can get the keyboard to show in an actual dialog. </p><p>I did see <a href=""http://bit.ly/aqgpOL"" rel=""nofollow"">this</a> SO question -- however I'd rather not use an Theme.Dialog'ed activity because I feel like an activity would be too heavy for my purposes. How can I show this Model Dialog with the keyboard input in the foreground?</p><p>This is what I am talking about:<img src=""http://www.bitquill.net/trac/raw-attachment/wiki/Android/GreekIME/greekim-change-im.png"" alt=""alt text""></p>","354247","","354247","","2010-07-24 23:02:44","2010-07-25 00:16:06","Showing Keyboard with Android Dialog","<android><gui><user-input>","1","0","1","",""
"3327296","1","3330311","","2010-07-24 23:18:10","2","2929","<p>I'm trying to launch a service from another service with certain extras. However, I can't retrieve those extras in the launched service, <code>.getIntExtra</code> returns a NullPointerException.<br><br></p><p>This is how I <strong>launch</strong> the service:</p><pre><code>Intent serviceIntent = new Intent(context, RefreshService.class);serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);PendingIntent contentIntent = PendingIntent.getService(this, 0, serviceIntent, 0);updateViews.setOnClickPendingIntent(R.id.btnRefresh, contentIntent);</code></pre><p><br>And this how I'm trying to <strong>receive</strong> the extras in the started service:</p><pre><code>@Override    public void onStart(Intent intent, int startId){    super.onStart(intent, startId);    mAppWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);}</code></pre><p>In my example, <code>mAppWidgetId</code> always resorts to the default value -1.</p><p>What am I doing wrong?<br><br><br>Thanks for your help,</p><p>Nick</p>","241189","","","","","2010-07-25 17:53:00","Cannot retrieve Intent Extras in Service onStart()","<android><android-intent>","2","0","","",""
"3327329","1","","","2010-07-24 23:30:41","2","7268","<p>I want a <code>TextView</code> on top and a <code>VideoView</code> below it. I want to have the <code>VideoView</code> as center verical and below the <code>TextView</code>. I am using <code>RelativeLayout</code>.</p><p>I am trying to do this in code:</p><pre><code>RelativeLayout layout = new RelativeLayout(this);TextView tv = new TextView(this);tv.setText(""Hello"");tv.setGravity(Gravity.RIGHT);tv.setTextColor(Color.WHITE);tv.setId(1);RelativeLayout.LayoutParams one = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);one.addRule(RelativeLayout.ALIGN_PARENT_TOP);one.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);RelativeLayout.LayoutParams two = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);  two.addRule(RelativeLayout.CENTER_VERTICAL); two.addRule(RelativeLayout.BELOW, 1);VideoView mVideoView = new VideoView(this);layout.addView(tv, one);layout.addView(mVideoView, two);setContentView(layout);</code></pre><p>The <code>VideoView</code> gets placed below the <code>TextView</code>, but the <code>VideoView</code> is not center vertical.</p>","321927","","244296","","2010-07-25 14:21:52","2012-02-13 05:51:45","Android - RelativeLayout CENTER_VERTICAL and BELOW issue","<android><center><relativelayout>","1","0","3","",""
"3327422","1","","","2010-07-24 23:58:33","1","422","<p>I cannot find any articles on the content restrictions for developing on Andriod. Are there any? My client wants to make an app that contains 'strong adult language' for sexual position as well as potentially adult imagery.</p>","216121","","127880","","2011-07-15 04:08:12","2011-07-15 04:08:12","content restrictions on Android?","<android>","2","1","","",""
"3327599","1","","","2010-07-25 01:13:37","8","9586","<p>I've been looking for hours on how to get all TableRow's in a TableLayout. I already know how to add and delete rows dynamically, but I need to loop over all the rows and selectively delete some of them.</p><p>I think I can come up with a work around, but I'm trying to avoid crude hacks in my app.</p>","388986","","244296","","2010-07-25 01:21:27","2014-04-04 17:59:18","Get all TableRow's in a TableLayout","<android><tablelayout><tablerow>","4","1","3","",""
"3327615","1","","","2010-07-25 01:22:00","2","1501","<p>Android has no SASL by default. Curious, if there some 3rd party implementation that can be used on Android? Did some one try <a href=""http://www.cryptix.org/"" rel=""nofollow"">http://www.cryptix.org/</a>?</p>","62192","","","","","2011-02-21 00:04:59","Is there SASL implementation that works on Android?","<android><sasl>","2","0","","",""
"3327626","1","","","2010-07-25 01:25:03","2","1239","<p>I want to set the background to a transparent image and change the color of the background on an event firing. </p><p>I can set the background image to a resource in an xml file, and I can also change the color of a TextView on event firing, but for some reason I can't do both at the same time. Do I need to create a drawable or something? </p><p>Also, how do I reference the top level LinearLayout. I'm programming using Eclipse Java EE Galileo with the ADT Plugin and the android sdk. O.S. android 2.1-update1 (eclair). My friend can do it in actionscript and I have to do it in java to beat him lol.</p>","401307","","472792","","2013-05-13 06:57:09","2013-05-13 06:57:09","Dynamic transparent background in my Android App Java","<java><android><dynamic><background><android-linearlayout>","1","0","0","",""
"3327643","1","3327716","","2010-07-25 01:31:53","2","899","<p>What happens to the width and height params declared in LayoutParams on configuration change?</p><p>For eg: if I have an ImageView declared with, new LinearLayout.LayoutParams(30, 40);</p><p>On Configuration Change, does the width become 40 and height 30?</p>","321927","","746010","","2012-01-29 07:11:17","2012-01-29 07:11:17","Android Configuration Change","<android><configuration><imageview>","1","0","","",""
"3327696","1","3327823","","2010-07-25 01:56:13","0","888","<p>I have an <code>ImageView</code> in my android layout. And I would like to add a 'decorator' image at the lower right corner of my image view.Can you tell me how can I do it?</p><p>I am thinking of doing with a FramLayout with 2 image views as its child, but how can i make one image the lower right corner of another?</p><pre><code>&lt;FrameLayout&gt;   &lt;ImageView .../&gt;   &lt;ImageView .../&gt;&lt;/FrameLayout&gt;</code></pre>","286802","","244296","","2010-07-25 02:02:06","2012-09-24 09:24:06","How can I add a decorator image on top of my image view","<android>","3","0","","",""
"3327769","1","3344428","","2010-07-25 02:33:12","0","1085","<p>could you point me to an example where I can find more information about how to parse a text file in Java and extracting a particular String or reg ex out of It.</p>","218665","","243782","","2010-07-27 14:01:55","2010-07-27 14:03:51","Parse a Text File using Java","<java><android>","1","3","","",""
"3327977","1","","","2010-07-25 04:14:03","3","8107","<p>HI,</p><p>I am trying the following example in using radio group/radio button in my android application.<a href=""http://www.androidpeople.com/android-radiobutton-example/"" rel=""nofollow"">http://www.androidpeople.com/android-radiobutton-example/</a></p><p>But the radio button is on the left side of the label (text).</p><p>Can you please tell me how can i configure it so that the radio button is on the right side of the label? and text is left aligned with the parent and the radio button is aligned with the right of the parent?</p><p>Thank you.</p>","286802","","","","","2012-11-08 23:25:20","How can I align radio button in android","<android>","3","1","","",""
"3328177","1","","","2010-07-25 05:36:45","2","373","<p>I'm working on and Augmented reality app for android 2.2 but i want in integrate a face recognition module... i try to use the findFaces method from FaceDetector class but it recive a bitmap... and i want to send a camera preview any idea?</p>","283896","","995926","","2012-05-05 13:39:33","2012-05-05 13:39:33","find Faces Camera android","<android><camera><augmented-reality><android-2.2-froyo>","0","4","1","",""
"3328319","1","3332834","","2010-07-25 06:41:35","3","830","<p>I have successfully been getting GPS data through the registerLocationListener() and onLocationChanged() methods. The only problem with this is that the speed reading of my app freezes if there is no more GPS data (e.g. when I go indoors, enter a tunnel, etc). The behavior I want for my app is that the user is somehow notified that the speed reading is probably not accurate due to a lack of fresh data (set speed to zero, blink the speed reading, etc).</p><p>How can I do that? I though of checking periodically whether the GPS unit was detecting any satellites, but I'm not sure how to force periodic checks.</p>","349169","","114066","","2010-07-26 07:46:18","2010-07-26 07:46:18","Periodically check if android GPS has new data","<android><performance><gps>","1","1","1","",""
"3328476","1","3328654","","2010-07-25 08:00:13","2","1239","<p>I would like to insert image into text, for example: </p><p>I would like to show the text likie this:</p><p>""To edit picture you should click on"" [image] ""button.""</p><p>Where [image] is real image (e.g. ImageView)</p>","332311","","","","","2010-07-25 09:18:26","android image wrapped by text","<android><text><image>","1","0","2","",""
"3328496","1","3328844","","2010-07-25 08:06:48","1","106","<p>I've created a nice app widget that I could not find on the market, and even took the time to publish it (more details at <a href=""http://code.google.com/p/frequentcontacts/"" rel=""nofollow"">http://code.google.com/p/frequentcontacts/</a> ). I've been contacted by people having problems with this widget, and I don't know what to do about them. It work great on the emulator, and on my Nexus One, but one user reports about com.android.mms force close on HTC incredible, another about motor droid not displaying any data, and a third with nothing more than ""doesn't work"" without any further details. The widget does have more than 400 active users, so I guess it is not total crap, and I use it all the time. How do I help these users without buying more devices? I'm not even sure that is the real cause, but I can't be sure, since I've already seen differences between the emulator and my Nexus One.</p>","329611","","","","","2010-07-29 11:17:22","how to troubleshoot a device I don't have?","<android><android-widget>","3","2","1","",""
"3328545","1","3328562","","2010-07-25 08:30:11","10","13595","<p>I have preferences page. It has field 'Show info screen' (as checkbox). </p><p>I have also info page which also should have checkbox 'Show me again'.</p><p>As I've understand, I can get value from preferences page via <code>PreferencesManager.getDefaultPreferences(context)</code> ...</p><p>But how I should set preferences value for the checkbox on info page? </p><p>I tried to use <code>context.getSharedPreferences(PREF_NAME, 0).edit()</code>, to set value but it doesn't correlate with PreferencesManager's corresponding value.</p><p>What should I do??? F1</p>","332311","","","","","2013-01-23 04:18:09","android sharedpreferences set value","<android><preferences>","1","0","2","",""
"3328612","1","","","2010-07-25 08:57:35","0","357","<p>Does anyone know how to read values from MANIFEST.MF from my custom dependent JAR in Android ?I`ve tried many ways but it seems that they do not work for Android environment.</p>","398798","","","","","2013-12-13 06:43:11","How to read manifest file from dependent JAR in Android?","<android><jar><manifest>","1","2","","",""
"3328660","1","","","2010-07-25 09:22:11","0","540","<p>I want to use Samsung Corby to develop a location-based app. I want to know the things that this phone model can offer and the possible issues that I might encounter with it. It's a cheap phone and is available in our country, that's why I chose it. Thanks a lot!</p>","376290","","","","","2010-07-25 09:50:28","What are the advantages & disadvantages on using Samsung Corby for Android App development?","<android>","1","1","","",""
"3328757","1","","","2010-07-25 10:02:35","65","78973","<p>I know this is so easy (doh...) but I am looking for a way to run a method on tapping or clicking a TextView line of text in an Android App.</p><p>I keep thinking about button listeners and anonymous method listener calls, but it just does not seem to apply to TextView.</p><p>Can someone point me at some code snippet to show how clicking or tapping on a piece of text in a TextView runs a method?</p>","400923","","","","","2013-09-11 01:50:34","How to click or tap on a TextView text","<android><onclick><listener><textview>","4","3","15","",""
"3328898","1","3328903","","2010-07-25 10:56:02","3","12228","<p>I'm using <code>BitmapFactory.decodeStream</code> to load an image from a url in Android. I want to only download images below a certain size, and I'm currently using <code>getContentLength</code> to check this. </p><p>However, I'm told that <code>getContentLength</code> doesn't always provide the size of the file, and in those cases I would like to stop the download as soon as I know that the file is too big. What is the right way to do this?</p><p>Here is my current code. I currently return null if <code>getContentLength</code> doesn't provide an answer.</p><pre><code>HttpGet httpRequest = new HttpGet(new URL(urlString).toURI());HttpClient httpClient = new DefaultHttpClient();HttpResponse response = (HttpResponse) httpClient.execute(httpRequest);HttpEntity entity = response.getEntity();BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity); final long contentLength = bufHttpEntity.getContentLength();if ((contentLength &gt;= 0 &amp;&amp; (maxLength == 0 || contentLength &lt; maxLength))) {    InputStream is = bufHttpEntity.getContent();    Bitmap bitmap = BitmapFactory.decodeStream(is);    return new BitmapDrawable(bitmap);} else {    return null;}</code></pre>","143378","","114066","","2010-07-26 07:48:50","2011-03-04 13:26:57","Load image from url in Android, only if small","<android><url><bitmap><httpclient><httprequest>","3","0","2","",""
"3328941","1","3328963","","2010-07-25 11:10:36","2","133","<p>Developing applications for Android in Eclipse, press F11 to run the program in the emulator.  </p><p>However, this means waiting for the emulator to bootup (and then unlocking the emulator's screen) each time you want to test changes to your program.  Is there any way around this delay?</p>","46478","","","","","2010-07-25 11:21:13","Speeding the Android edit-debug cycle","<android>","2","0","","",""
"3329024","1","3329056","","2010-07-25 11:39:54","4","3204","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/5800657/how-to-create-custom-ratings-bar-in-android"">How to create Custom Ratings bar in Android</a>  </p></blockquote><p>The inbuilt rating bar is too big for my application . How can i reduce its height &amp; width?Also the color of the stars should be orange &amp; not green . How can i achieve it ?</p><p>Also can i have the rating bar in vertical next to a image on my screen ? if yes how ?</p>","335429","","","","","2011-07-15 07:50:54","Customized Rating bar ","<android>","1","0","1","2011-09-28 11:14:24",""
"3329073","1","3494991","","2010-07-25 11:52:30","4","7963","<p>I want to specifically run the default Android browser for a given URL. I'm using this code:</p><pre><code>Intent i = new Intent();i.setAction(""android.intent.action.VIEW""); i.addCategory(""android.intent.category.BROWSABLE"");i.setClassName(""com.google.android.browser"", ""com.android.browser.BrowserActivity"");i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);i.setData(Uri.parse(url));startActivity(i);</code></pre><p>The error I receive is:</p><pre><code>Unable to find explicit activity class {com.google.android.browser/com.android.browser.BrowserActivity}; have you declared this activity in your AndroidManifest.xml?</code></pre><p>I also tried filtering the intents by the package:</p><pre><code>i.setPackage(""com.google.android.browser"");</code></pre><p>instead of <code>setClassName</code>, but to no avail:</p><pre><code>No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=http://www.google.com/ flg=0x10000000 pkg=android }</code></pre><p>I also tried adding <code>&lt;uses-library android:name=""com.google.android.browser"" /&gt;</code> to the manifest. </p><p>Am I missing something here?</p><p>PS: I'm not interested in using <code>startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(""http://www.google.com"")))</code> as it will list all the choices for the browsing <code>Intent</code>.</p>","192308","","192308","","2010-08-03 14:20:28","2010-08-16 16:12:21","Launch Browser Intent with Custom Class - cannot find Activity","<android><android-emulator><android-intent><android-browser>","3","0","3","",""
"3329135","1","3813375","","2010-07-25 12:13:07","1","16449","<p>When I press a button, I would like to disable screen rotation <strong><em>on all my activities</em></strong>. How can I do that?</p><p>BTW, phone can be located in landscape|portrait position when user click the button. ...</p>","332311","","332311","","2010-07-25 12:23:50","2010-09-28 13:45:39","android disable screen rotating","<android><screen-orientation>","3","0","1","2013-02-08 13:25:56",""
"3329253","1","3330199","","2010-07-25 12:59:13","0","154","<p>OK, I know this questions sounds weird at first, as GALLERY is designed to be user interactive, but, I like the Gallery functionality, as it suits a lot of my needs. i.e. I can give it a number of pictures, move the whole of them from right to left, or left to right and get them an animate (in my case, zoom) when one of them is selected. So all good.</p><p>I just need to do the selection programatically, which I currently have working. I just don't want the user to be able to fling, scroll, select, longpress, etc. by themselves. So no user interaction is required. </p><p>So, how can I prevent a user from doing theses things, without writting a gallery function myself (and without chopping a users fingers off!).</p><p>Thanks.</p>","330770","","","","","2012-05-08 15:55:06","Android - How to prevent a user interacting with Gallery","<android><gallery><interactive><non-interactive>","2","0","","",""
"3329310","1","","","2010-07-25 13:17:21","4","20800","<p>How can I decrease the font size of my spinner?  I have reduced the spinner size to 35 pix because of which my text gets cut in half.</p><p>How do i do that? Also I dont want anything to be selected beforehand. </p><p>Default text should be <code>""select some value""</code>.</p>","335429","","2598","","2010-08-18 13:16:31","2013-07-01 04:00:39","Text Size of a Spinner","<android><spinner>","3","1","1","",""
"3329318","1","3329486","","2010-07-25 13:20:22","19","15455","<p>I have an app that works only in portrait mode, and I have made the changes in my manifest file for every activity the orientation to be portrait. But when I rotate the device, the activity recreates again.How to not destroy the activity?</p>","391770","","","","","2013-07-04 10:53:16","Android, how to not destroy the activity when I rotate the device?","<android><activity><orientation>","3","2","7","",""
"3329341","1","","","2010-07-25 13:27:37","0","380","<p>I am creating an animated drawable and then adding it to a <code>FrameLayout</code>. The variable is created as a class field and then, each new <code>AnimatedDrawable</code> is created and added to the frame, like that :  </p><pre><code>for (int i = 0; i &lt; 10; i++) {sampleView = new SampleView(Drink.this);frame.addView(sampleView);}</code></pre><p>But when I do that from the background thread (AsyncTask in which I run the <code>frame.addView(sampleView);</code> in runOnUIThread to avoid issue of updating UI from another thread than UI's), I get an error unless I add this to my code : <code>frame.removeView(sampleView);</code> </p><p>So, I can't grab the issue here...More over, when I do that, instead of getting 10 elements, I only get 3...</p><p>The error I get is the classical :  </p><blockquote>  <p>java.lang.IllegalStateException: The  specified child already has a parent.  You must call removeView() on the  child's parent first.</p></blockquote>","263521","","263521","","2010-07-25 21:05:56","2010-07-25 21:05:56","Dynamic addition of a View [Android] from background thread","<android><dynamic><view>","0","4","","",""
"3329363","1","","","2010-07-25 13:34:23","1","737","<p>My application interacts with the Browser in a couple of use cases:</p><p>First Case:</p><ol><li>Start MyApplication ActivityA from launcher.  </li><li>Start MyApplication ActivityB using startActivityForResult (ActivityA's onSaveInstanceState is called).  </li><li>Start Browser using startActivity (ActivityB's onSaveInstanceState is called).</li><li>Close browser or press Back. ActivityB is restored from the saved instance state bundle.</li></ol><p>Second Case:</p><ol><li>Start MyApplication ActivityA from launcher.  </li><li>Start Browser using startActivity (ActivityA's onSaveInstanceState is called).  </li><li>Browser calls back MyApplication ActivityA (i have no control over how the browser calls back, as in what flags are using for starting the activity. How it calls back is that i am passing it a callback URL (Google OAuth callback URL), and i have an intent filter in my ActivityA to intercept that URL.)  </li><li>Start MyApplication ActivityB using startActivityForResult (ActivityA's onSaveInstanceState is called).  </li><li>Start Browser using startActivity (ActivityB's onSaveInstanceState is <strong>NOT</strong> called).  </li><li>Close browser or press Back. ActivityB can't fully be restored, because onSaveInstanceState isn't called in the previous step.  </li></ol><p>My questions would be related to step 5 of the second case, where the onSaveInstanceState is NOT called.</p><p>Reading through the Android fundamentals on lifecycle, as well as the onSaveInstanceState API, i sort of understand why it was not called. This is from the API for onSaveInstanceState:</p><blockquote>  <p>One example of when onPause()  and onStop()  is called and not this method is when a user navigates back from activity B to activity A: there is no need to call onSaveInstanceState(Bundle)  on B because that particular instance will never be restored so the system avoids calling it.</p></blockquote><p>i.e. Because the flow is like<br>ActivityA -> Browser -> ActivityA -> ActivityB -> Browser</p><p>since there is already a prior Browser activity, ActivityB is deemed to be <em>navigating back</em> to the Browser, hence onSaveInstanceState is not called.</p><ol><li><p>Am i correct with the understanding above?</p></li><li><p>In this case, should i really be using onPause instead of onSaveInstanceState? (From a laziness point-of-view, onSaveInstanceState is much simpler because i can just dump stuffs into the bundle instead of having to design/create a SQLite table which i'll have to do for onPause.) But what is the best practice for this?</p></li><li><p>It would seem then, if i am correct on 1 and 2, that saving state using onPause is much more robust than using onSaveInstanceState. What cases then, should we really be using onSaveInstanceState instead of onPause?</p></li></ol>","254959","","","","","2010-07-25 13:34:23","Question on Application Lifecycle and onSaveInstanceState","<android>","0","4","","",""
"3329452","1","3329485","","2010-07-25 14:02:36","0","517","<p>I am developing an application where one of my Activity contains a button as ""Set as Home Page"".</p><p>So my problem is that when I will click this button the status will be saved in the shared preference and next time when this application will be opened I want to start this Activity (the Activity which has been set as home page) instead of the default one. </p><p>So how can i do it???          </p>","307585","","938695","","2013-03-07 04:47:29","2013-03-07 04:47:29","dynamically launching activity in android","<android><dynamic><activity>","2","0","","",""
"3329462","1","","","2010-07-25 14:05:10","0","415","<p>Is there an API for Android to delete the web browser's saved passwords?</p>","401561","","","","","2010-07-25 19:40:03","Is there an API for Android to delete the web browser's saved passwords?","<android>","1","1","","",""
"3329721","1","3364621","","2010-07-25 15:18:37","0","524","<p>I copy over a valid Android SQLite database from the apk to the databases folder on my AVD. I verify with the DDMS FileExplorer that it is there and the size is correct. When I call the following function to open it,</p><pre><code> mDb = SQLiteDatabase.openDatabase(mDatabase_path, null, SQLiteDatabase.OPEN_READONLY);</code></pre><p>The SQLite DB file is <strong>deleted</strong> and a SQLiteException, ""Unable to open database"" is thrown.</p><p>What could be deleting it if it exists before the line, then is gone after?</p><p>Ian</p>","172861","","","","","2010-07-29 16:09:05","Android SQLite database being deleted on ""SQLiteDatabase.openDatabase""","<android><sqlite>","1","0","","",""
"3329871","1","","","2010-07-25 15:56:46","0","2308","<p>I can detect a long click on my WebView using the following code:</p><pre><code>webView.setOnLongClickListener(new OnLongClickListener() {        @Override        public boolean onLongClick(View v) {            Log.d(""Debug"",""On Long Press Web View"");            return false;        }    });</code></pre><p>This works fine when i long press on a link, but doesnt work when I long press in an area where no link is, i.e whitespace.</p><p>My first thought to address this was to use the GestureDetector:</p><pre><code>public boolean dispatchTouchEvent(MotionEvent event) {                  super.dispatchTouchEvent(event);    return detector.onTouchEvent(event);}</code></pre><p>or</p><pre><code>public OnTouchListener otl = new OnTouchListener() {    @Override    public boolean onTouch(View v, MotionEvent event) {        if (detector.onTouchEvent(event)){            return true;        }else{            return false;        }    }};</code></pre><p>And then overide the onLongPress method of the GestureDetector:</p><pre><code>public void onLongPress(MotionEvent e) {}</code></pre><p>Either of the above methods above work and the onLongPress method is executed when I long click on the web page but not on a link. The problem is when I now long click on a link both long press methods are called, firstly the GestureDetector onLongPress and secondlythe WebView onLongClick. Is there a way to just invoke only the WebView onLongClick() when i long click on a link.</p><p>Andy</p>","376338","","","","","2013-04-07 17:27:47","Android WebView Long Press NOT on link i.e in White Space","<android><webview>","3","0","1","",""
"3329889","1","","","2010-07-25 15:59:38","3","777","<p>Ive no doubt this question may have been addressed before but how can I turn on a framerate monitor to use when I run my programs using the android emulator so I can see exactly what my android game is achieving at a given time?</p>","300037","","119895","","2011-06-27 15:40:39","2011-06-27 15:41:01","Testing FPS using Android plugin for Eclipse?","<android>","1","2","","",""
"3329900","1","","","2010-07-25 16:02:46","3","3850","<p>this is my first time posting to this site so hopefully it will be a positive experience.  I have an Android SQLite/ContentProvider problem that I have been beating my head against the wall for over the past 3 hours.  Below is the ContentProvider code:</p><pre><code>public class IncidentProvider extends ContentProvider {private static final UriMatcher sUriMatcher;private static final HashMap&lt;String, String&gt; projectionMap;private static final int INCIDENTS = 1;public static final String AUTHORITY = ""com.test.providers.IncidentsProvider"";public static final String TABLE_NAME = ""incidents"";private static class DatabaseHelper extends SQLiteOpenHelper {    public DatabaseHelper(Context context) {        super(context, context.getString(R.string.database_name), null, Integer.parseInt(context.getString(R.string.database_version)));    }    @Override    public void onCreate(SQLiteDatabase db) {        db.execSQL(""CREATE TABLE "" + TABLE_NAME + "" (""                 + Incidents.INCIDENT_ID + "" INTEGER PRIMARY KEY AUTOINCREMENT,""                 + Incidents.NAME + "" VARCHAR(30),""
                + Incidents.CREATE_TIME + "" LONG,""                 + Incidents.LAST_UPDATE + "" LONG,""                 + Incidents.IS_ACTIVE + "" VARCHAR(30)"" + "");"");    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        db.execSQL(""DROP TABLE IF EXISTS "" + TABLE_NAME );        onCreate(db);    }}private DatabaseHelper dbHelper;/** * Delete a row from the database */@Overridepublic int delete(Uri uri, String where, String[] whereArgs) {    SQLiteDatabase db = dbHelper.getWritableDatabase();    int count;    switch(sUriMatcher.match(uri)) {        case INCIDENTS:            count = db.delete(TABLE_NAME, where, whereArgs);            break;        default:            throw new IllegalArgumentException(""Unknown URI "" + uri);    }    getContext().getContentResolver().notifyChange(uri, null);    db.close();    return count;}/** * Return the content type managed by this ContentProvider */@Overridepublic String getType(Uri uri) {    switch(sUriMatcher.match(uri)) {        case INCIDENTS:            return Incidents.CONTENT_TYPE;        default:            throw new IllegalArgumentException(""UNKNOWN URI "" + uri);    }}/** * Insert new content into a row in the database */@Overridepublic Uri insert(Uri uri, ContentValues initialValues) {    if(sUriMatcher.match(uri) != INCIDENTS)         throw new IllegalArgumentException(""UNKNOWN URI "" + uri);    ContentValues values;    if(initialValues != null) {        values = new ContentValues(initialValues);    } else {        values = new ContentValues();    }    SQLiteDatabase db = dbHelper.getWritableDatabase();    long rowId = db.insert(TABLE_NAME, Incidents.NAME, values);    if(rowId &gt; 0) {        Uri incidentUri = ContentUris.withAppendedId(Incidents.CONTENT_URI, rowId);        getContext().getContentResolver().notifyChange(incidentUri, null);        db.close();        return incidentUri;    }    db.close();    throw new SQLException(""Failed to insert row into "" + uri);}/** * Called when creating this ContentProvider */@Overridepublic boolean onCreate() {    dbHelper = new DatabaseHelper(getContext());    return false;}/** * Called when making a query to this content provider */@Overridepublic Cursor query(Uri uri, String[] projection, String selection,        String[] selectionArgs, String sortOrder) {    SQLiteQueryBuilder qb = new SQLiteQueryBuilder();    switch(sUriMatcher.match(uri)) {        case INCIDENTS:            qb.setTables(TABLE_NAME);            qb.setProjectionMap(projectionMap);            break;        default:            throw new IllegalArgumentException(""UNKNOWN URI "" + uri);    }    SQLiteDatabase db = dbHelper.getWritableDatabase();    Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, sortOrder);    c.setNotificationUri(getContext().getContentResolver(), uri);    db.close();    return c;}/** * Called when updating a row through this content provider */@Overridepublic int update(Uri uri, ContentValues values, String where,        String[] whereArgs) {    SQLiteDatabase db = dbHelper.getWritableDatabase();    int count;    switch(sUriMatcher.match(uri)) {        case INCIDENTS:            count = db.update(TABLE_NAME, values, where, whereArgs);            break;        default:            throw new IllegalArgumentException(""UNKNOWN URI "" + uri);    }    getContext().getContentResolver().notifyChange(uri, null);    db.close();    return count;}static {    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);    sUriMatcher.addURI(AUTHORITY, TABLE_NAME, INCIDENTS);    projectionMap = new HashMap&lt;String, String&gt;();    projectionMap.put(Incidents.INCIDENT_ID, Incidents.INCIDENT_ID);    projectionMap.put(Incidents.NAME, Incidents.NAME);    projectionMap.put(Incidents.CREATE_TIME, Incidents.CREATE_TIME);    projectionMap.put(Incidents.LAST_UPDATE, Incidents.LAST_UPDATE);    projectionMap.put(Incidents.IS_ACTIVE, Incidents.IS_ACTIVE);}  </code></pre><p>}</p><p>I also wrote a db helper class to make it easy to interact with the ContentProvider.  2 example DBHelper methods are as follows (1 to insert, 1 to query).</p><pre><code>    /**     *  Adds a new incident to the database     **/ public void addNewIncident(ContentResolver contentResolver, Incident incident) {  ContentValues contentValues = new ContentValues();  contentValues.put(Incidents.NAME, incident.getName());  contentValues.put(Incidents.CREATE_TIME, incident.getCreateTime());  contentValues.put(Incidents.LAST_UPDATE, incident.getLastUpdate());  contentValues.put(Incidents.IS_ACTIVE, incident.isActive()?""true"":""false"");  contentResolver.insert(Incidents.CONTENT_URI, contentValues); }     /**     * Retrieves all incidents from the database     **/    public ArrayList&lt;Incident&gt; getIncidents(ContentResolver contentResolver) {  Cursor c = contentResolver.query(Incidents.CONTENT_URI, null, null, null, null);  ArrayList&lt;Incident&gt; returnList = new ArrayList&lt;Incident&gt;();  if(c!=null &amp;&amp; c.moveToNext()) {   for(int i=0; i&lt;c.getCount(); i++) {    c.moveToPosition(i);    Incident incident = new Incident(c.getString(c.getColumnIndex(Incidents.NAME)));    incident.setCreateTime(c.getLong(c.getColumnIndex(Incidents.CREATE_TIME)));    incident.setLastUpdate(c.getLong(c.getColumnIndex(Incidents.LAST_UPDATE)));    incident.setActive(c.getString(c.getColumnIndex(Incidents.IS_ACTIVE)).equalsIgnoreCase(""true""));    returnList.add(incident);   }   c.close();  }  return returnList; }</code></pre><p>Okay!  So here is my problem.  I can insert into the database without any problems! If I query the database through adb shell I can see all of the records that are being inserted.  When I query using SQLiteQueryBuilder, or SQLiteDatabase.rawQuery, or any other method of querying, the returned cursor comes back with -1.  Does not matter if I query for an individual record, or query the entire database.  The query still comes back -1.  </p><p>Any ideas?  Am I missing something incredibly simple?</p><p>Thanks in advance to anyone willing to help a frustrated individual!</p><p>UPDATE:</p><p>Below is example code for inserting (that works), and querying (that doesn't work)</p><pre><code>/**  * Following db insert works */IncidentsDB db = IncidentsDB.getInstance(); workingIncident.setLastUpdate(System.currentTimeMillis());     // isActive, and createTime set in constructordb.addNewIncident(this.getContentResolver(), workingIncident);/** * Following db queries do not work, cursor ends up with mCount=-1  */ Cursor c = IncidentsDB.getInstance().getIncidents(this.getContentResolver());</code></pre>","401610","","401610","","2010-07-25 16:36:06","2010-07-25 17:42:52","Android SQLite Insert working, Query not working","<android><sqlite>","1","6","1","",""
"3329926","1","","","2010-07-25 16:10:27","12","23453","<p>I am just beginning to use Eclipse for Android applications.I have installed Eclipse 3.5.2 and Java 5AVD is Android 2.1 API 7</p><p>My initial Hello Android program ran fine but will not run again.</p><p>getting the following error:</p><blockquote>  <p>[2010-07-25 09:47:31 - HelloAndroid] WARNING: Application does not specify an API level requirement!<br>  [2010-07-25 09:47:31 - HelloAndroid] Device API version is 7 (Android 2.1-update1)</p></blockquote><p>searched the forums but could only find a refernece to manifest file to be sure following was set:</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" /&gt;</code></pre><p>my manifest file does not contain that line:</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt;  &lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android"" package=""com.example.helloandriod"" android:versionCode=""1"" android:versionName=""1.0""&gt;     &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;         &lt;activity android:name="".HelloAndroid"" android:label=""@string/app_name""&gt;             &lt;intent-filter&gt;                 &lt;action android:name=""android.intent.action.MAIN"" /&gt;                  &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;              &lt;/intent-filter&gt;         &lt;/activity&gt;     &lt;/application&gt;  &lt;/manifest&gt;</code></pre><p>I have checked the adv mgr and it is set to 7In Eclipse i went to properties -> Android and set it to 7</p><p>get same warnings</p>","401612","","12707","","2010-07-25 16:13:49","2014-02-26 21:35:27","Application does not specify API level","<android><eclipse>","5","1","3","",""
"3329934","1","3330760","","2010-07-25 16:12:41","0","975","<p>I was the Android Developer article on Search: <a href=""http://developer.android.com/guide/topics/search/index.html"" rel=""nofollow"">http://developer.android.com/guide/topics/search/index.html</a> and was wondering if I could add other UI Elements to the searchable.xml file? Here is what I want to do:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;searchable xmlns:android=""http://schemas.android.com/apk/res/android""    android:label=""@string/app_name"" &gt;    &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_marginTop=""10dip""        android:text=""System:""/&gt;    &lt;Gallery    android:id=""@+id/gallery""    android:layout_width=""fill_parent""    android:layout_height=""52px""    android:padding=""8px""    android:unselectedAlpha=""0.5""    android:spacing=""3px""&gt;    &lt;/Gallery&gt;&lt;/searchable&gt;</code></pre><p>I wan to provide the gallery as a way to specify what category to search in. Is this possible? If it is, how and where do I access the the user selection for this component? If not, how else might I implement giving a choice to the user to search more specifically?</p>","325081","","","","","2010-07-25 19:48:46","Can I customize the Android searchable.xml layout?","<java><android><xml><gui><search>","1","1","","",""
"3329958","1","3330001","","2010-07-25 16:17:32","5","1066","<p>I am a newbie to Android and the Eclipse development environment and would like some advice on best practices for debugging my apps when they throw a Force Close.</p><p>I have researched ADB, however, I can not get this to interact with my phone even though I have explicitly turned debug mode to true on my test handset.</p><p>Obviously Android comes with a LOG method which I have seen utilized in many example apps, can someone please explain how to review these logs quickly and how to setup logging appropriately to determine the cause of a Force Close (always occurs when I push the Home button).</p><p>Any advice on debugging effectively in Eclipse would be much appreciated!</p><p>Sincerely,Ryan</p>","459095","","","","","2010-07-25 16:48:56","Help a newbie learn Eclipse/Android debugging best practices","<android>","2","2","","",""
"3329993","1","3635415","","2010-07-25 16:26:50","1","1417","<p>I am using a <code>TabActivity (Main)</code> with 3 TabSpecsI am using Intents for the content of the 3 Tabs<code>TabA</code>, <code>TabB</code>, <code>TabC</code> for example.</p><p>All these tab activities use common data that is stored in <code>SharedPreferences</code></p><p>In the <code>Main</code> <code>TabActivity</code> I have an options menu which has a refresh option.</p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu) {MenuInflater inflater = getMenuInflater();inflater.inflate(R.menu.menu, menu);return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case R.id.refresh_menu:        new updateCommonDataFromWeb().execute();    ...    }}</code></pre><p>this refresh uses an <code>AsyncTask</code> (updateCommonDataFromWeb) to reload the common data from the web.</p><p>I need a way to tell the 3 tab activities to refresh their views and rebuild their content from the newly downloaded data.</p><p>When the tab activities are first created they load the data from <code>SharedPreferences</code> like so:</p><pre><code>public class TabA extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.taba);        SharedPreferences prefs = getSharedPreferences(this.getString(R.string.prefs_name), 0);        String usage_data = prefs.getString(""common_data"", """");    }}</code></pre><p>I thought about making a common method on each of the tab activitieslike.... <code>reloadViewData()</code></p><p>I thought maybe I could use the activity manager from the <code>Main</code> <code>TabActivity</code> to get the activity of the current tab like so:</p><pre><code>String tabTag = tabHost.getCurrentTabTag();Activity activity = getLocalActivityManager().getActivity(tabTag);# then call the reloadData() method of the tab activityactivity.reloadViewData();</code></pre><p>Unfortunately i cant get this approach to work, whilst <code>activity</code> is the correct instance its an <code>Activity</code> instead of a <code>TabA</code>,<code>TabB</code> or <code>TabC</code></p><p>Maybe i've completely taken the wrong approach to the whole thing.</p><p>I have also read alot about not using Activities for tab content instead using views.However I dont know what view to use to replace my <code>&lt;RelativeLayout /&gt;</code> as i cant use my R.layout.* as views.</p>","149615","","229044","","2012-05-02 18:38:32","2012-05-02 18:38:32","Updating views of sub Activities of TabActivity from background process","<android><views><activity><tabactivity>","2","0","1","",""
"3330085","1","3330098","","2010-07-25 16:50:11","3","770","<p>My app requires that devices are running at least Android 2.0 OS. Would it make more sense for me to compile my project with the 2.0 SDK or does it make more sense to always compile my project using the latest SDK, even if it's well beyond 2.0...?</p><p>The problem with compiling against 2.1 for example would be that I don't know if an Android 2.0 device would even run an app compiled with 2.1...?</p>","268803","","","","","2010-07-25 17:05:13","Should I compile my Android apps against the latest SDK?","<android>","1","2","1","",""
"3330174","1","","","2010-07-25 17:13:13","4","2830","<p>I'm working on a simple app that receives, but not handles sms messages.  It checks each incoming sms for a specific keyphrase.  If the sms contains that keyphrase then it responds accordingly.  If the keyphrase doesn't exist, then my app does nothing. I have this much working.</p><p>I was wondering if there was a way to prevent the default sms app on the phone from receiving the text only if my app finds that keyphrase. </p><p>Thanks for the help<br>Andrew</p>","401644","","234938","","2010-07-25 20:54:39","2012-03-12 07:50:59","How to prevent incoming SMS from reaching the inbox?","<android><sms>","2","2","3","",""
"3330352","1","","","2010-07-25 18:02:20","4","14706","<p>I've a little problem with alignement in LinearLayout.</p><p>I'm trying to have the frist two elements with left alignement, and the third at the center of the screen.</p><p>Here is my code (cleaned from id, text, src) :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@color/color_background""    &gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""&gt;        &lt;ImageView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""&gt;        &lt;/ImageView&gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""&gt;        &lt;/TextView&gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""center_horizontal""&gt;        &lt;/TextView&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p><img src=""http://img807.imageshack.us/img807/5953/imageg.png"" alt=""alt text""></p><p>Here is what I'm trying to do, pink and yellow on left, red in the center</p><pre><code>pink = imageviewyellow = 1st texviewred = 2nd textview</code></pre><p>Any idea ?</p>","401669","","347565","","2011-12-12 22:07:49","2011-12-12 22:07:49","LinearLayout Center","<android><center><android-linearlayout>","2","0","","",""
"3330509","1","","","2010-07-25 18:41:02","2","128","<p>I have a activity B that is called by activity A, I want to debug the code in B. I have set the breakpoint, however the debug control never enters B. </p><p>public class A extends Activity {</p><pre><code>  Intent j = new Intent(mContext, B.class);                    startActivity(j);}</code></pre><p>--</p><pre><code>public class B extends Activity </code></pre><p>{</p><p>some code</p><p>--Break Point--// I want eclipse pointer to stop here while debugging.</p><p>}</p><hr><p>When I debug in eclipse, although the class B is called from class A, the debbugger pointer  never enters the new window, where I have placed a debug point in Class B. I am not able to take the pointer control to class B and stop at a specific point, which will help me verify certain variable values. Hope this time the question makes sense. </p>","357349","","357349","","2010-07-26 02:23:33","2010-07-26 02:37:36","how to reach the sub activity code in debug mode","<java><android><android-emulator>","2","1","","",""
"3330522","1","3330782","","2010-07-25 18:44:07","7","13323","<p>I'm writing something like a reminder for users. Users will set reminders for their events, when the time comes, a repeating alarm will be set to trigger a status bar notification. But the alarm seems non-stop after I selected the notification or cleared the notification. I am not sure where to cancel this repeating alarm. Below are some of the codes: Set up the repeating alarm in my main activity</p><pre><code>alarmTime = Calendar.getInstance();Intent intent = new Intent(this, AlarmReceive.class);PendingIntent sender = PendingIntent.getBroadcast(this, 0, intent, 0);AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);alarmTime.add(Calendar.MINUTE,offset_time);//Schedule the alarmalarmManager.setRepeating(AlarmManager.RTC_WAKEUP, alarmTime.getTimeInMillis(), 30 * 1000, sender);</code></pre><p>In my OnReceive method, I just display the notification in status bar and set the flag as <code>FLAG_AUTO_CANCEL</code></p><pre><code>manager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);// Set the icon, scrolling text and timestampNotification notification = new Notification(R.drawable.medical, text, System.currentTimeMillis());PendingIntent contentIntent = PendingIntent.getActivity(context, 0, i, 0);notification.flags = Notification.FLAG_AUTO_CANCEL;manager.notify(R.string.service_text, notification);</code></pre><p>How can I stop the alarm when the user selects the notification or clears it?   </p>","394815","","1065525","","2013-12-10 12:29:32","2013-12-10 12:29:43","How to cancel this repeating alarm?","<android><alarm>","1","1","2","",""
"3330607","1","3348409","","2010-07-25 19:06:27","0","519","<p>I am trying to implement my own Search using searchable, and as soon as press return after entering a query into my custom search field, I get a RuntimeException:</p><pre><code>Thread [&lt;1&gt; main] (Suspended (exception RuntimeException))  ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2585  ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2679   ActivityThread.access$2300(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 125 ActivityThread$H.handleMessage(Message) line: 2033  ActivityThread$H(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 123 ActivityThread.main(String[]) line: 4627    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  Method.invoke(Object, Object...) line: 521  ZygoteInit$MethodAndArgsCaller.run() line: 868  ZygoteInit.main(String[]) line: 626 NativeStart.main(String[]) line: not available [native method]  </code></pre><p>Here is what the logCat reported:</p><pre><code>07-25 18:56:12.688: DEBUG/SearchDialog(313): launching Intent { act=android.intent.action.SEARCH flg=0x10000000 cmp=com.bookcessed.booksearch/.SearchActivity (has extras) }07-25 18:56:12.708: INFO/SearchDialog(313): Starting (as ourselves) #Intent;action=android.intent.action.SEARCH;launchFlags=0x10000000;component=com.bookcessed.booksearch/.SearchActivity;S.query=Adventure;S.user_query=Adventure;end07-25 18:56:12.728: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.SEARCH flg=0x10000000 cmp=com.bookcessed.booksearch/.SearchActivity (has extras) }07-25 18:56:13.058: DEBUG/dalvikvm(313): newInstance failed: no &lt;init&gt;()07-25 18:56:22.765: WARN/ActivityManager(59): Launch timeout has expired, giving up wake lock!07-25 18:56:22.845: WARN/ActivityManager(59): Activity idle timeout for HistoryRecord{43fc2f60 com.bookcessed.booksearch/.SearchActivity}</code></pre><p>(More):</p><pre><code>07-25 19:06:24.698: ERROR/AndroidRuntime(313): FATAL EXCEPTION: main07-25 19:06:24.698: ERROR/AndroidRuntime(313): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.bookcessed.booksearch/com.bookcessed.booksearch.SearchActivity}: java.lang.InstantiationException: com.bookcessed.booksearch.SearchActivity07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at android.os.Handler.dispatchMessage(Handler.java:99)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at android.os.Looper.loop(Looper.java:123)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at java.lang.reflect.Method.invokeNative(Native Method)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at java.lang.reflect.Method.invoke(Method.java:521)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at dalvik.system.NativeStart.main(Native Method)07-25 19:06:24.698: ERROR/AndroidRuntime(313): Caused by: java.lang.InstantiationException: com.bookcessed.booksearch.SearchActivity07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at java.lang.Class.newInstanceImpl(Native Method)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at java.lang.Class.newInstance(Class.java:1429)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)07-25 19:06:24.698: ERROR/AndroidRuntime(313):     ... 11 more</code></pre><p>I have been trying to figure it out for hours. Here is my AndroidXML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      android:versionCode=""1""      android:versionName=""1.0"" package=""com.bookcessed.booksearch""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;    &lt;activity android:name=""TestActivity""&gt;&lt;intent-filter&gt;&lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;&lt;action android:name=""android.intent.action.MAIN""&gt;&lt;/action&gt;&lt;/intent-filter&gt;&lt;meta-data android:name=""android.app.default_searchable""           android:value="".SearchActivity"" /&gt;&lt;/activity&gt;&lt;activity android:name="".SearchActivity""              android:launchMode=""singleTop"" &gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.SEARCH"" /&gt;    &lt;/intent-filter&gt;    &lt;meta-data android:name=""android.app.searchable""                      android:resource=""@xml/searchable""/&gt;  &lt;/activity&gt;&lt;activity android:name="".bookListView""&gt;&lt;intent-filter&gt;&lt;action android:name=""com.bookcessed.booksearch.action.LIST_BOOKS""&gt;&lt;/action&gt;&lt;/intent-filter&gt;&lt;/activity&gt;&lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""4"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre>","325081","","","","","2010-07-27 22:03:41","Customized Search in Android RuntimeException can't set breakpoints","<java><android><xml><search>","1","1","","",""
"3330761","1","","","2010-07-25 19:49:32","20","7457","<p>I am a fresh developer on Googles Android Platform - my HTC Desire arrived last week.</p><p>Now i need a way to sign in to my existing application (Java, currently running on jetty).The server Application is developed using spring security 3.0.2</p><p>In my case, i want to support the following:If a user has set up his Android phone with a googlemail/google-Account (and most users do) i want to use this account credentials to automagically log in to my server app.</p><p>Is there any Android framework supporting that use-case?Or are there any alternatives? </p><p>I read: http  code.google.com intl/de-DE/apis/accounts/docs/OpenID.html</p><p>How we do sign in with an app on google AppEngine is described here: <a href=""http://blog.notdot.net/2010/05/Authenticating-against-App-Engine-from-an-Android-app"">http://blog.notdot.net/2010/05/Authenticating-against-App-Engine-from-an-Android-app</a></p>","401717","","638471","","2011-11-29 19:16:53","2013-01-30 13:26:27","OpenID for android apps that require SignIn","<android><openid>","3","1","16","",""
"3330847","1","3331139","","2010-07-25 20:17:00","1","2056","<p>I would like to set the height of a <code>TextView</code> to <code>WRAP_CONTENT</code> remotely. </p><p>How would I do that, since there is no <code>remoteviews.setLayoutParams(viewId, param)</code> function? </p><p>I tried <code>remoteviews.setInt.(viewId, ""setHeight"", -2)</code>, but that just sets the height of the <code>TextView</code> to zero...</p><p>Thanks!</p>","241189","","","","","2010-07-25 21:42:29","RemoteViews setLayoutParams?","<android><views><textview>","1","0","2","",""
"3330969","1","3331700","","2010-07-25 20:57:00","13","21773","<p>In iPhone we can create a view that has a tab bar and make it the root view of the application then use the tab bar to navigate through sub views.</p><p>what is the most close approach to this in Android?</p><p>Is it to use a Tabbed Control? but this includes using just one activity.</p><p>what is the approach to use in Android to create an activity with a navigation control to other activities in a way similar to that of the iPhone?</p>","235123","","114066","","2010-07-26 12:04:59","2013-06-18 07:01:44","iPhone- like tab bar in Android?","<android><android-tabhost>","4","1","6","",""
"3331258","1","3331269","","2010-07-25 22:18:30","4","3647","<p>I have an app that using alot of .png fils, so to reduce app size I used PngOptimizer to optimze them.  I was happy with the results and the file size of the png's went from alittle over 1mb to 300kb or so.  but for some reason the app size only went down about about 100kb.  doesn anyone know why?  I would really like the file size reduction that I saw in my png files to carry over to my app size.  please help</p>","274365","","","","","2011-05-12 15:34:02","android png optimization","<android><optimization><png>","2","0","1","",""
"3331392","1","3331421","","2010-07-25 23:08:06","2","4552","<p>I've written a few bluetooth apps now, but I had never seen <a href=""http://stackoverflow.com/questions/3072776/android-bluetooth-cant-connect-out"">this particular approach</a> until recently. In the example they use <code>device.getClass().getMethod(""createRfcommSocket"", new Class[] { int.class });</code> which seems to me a long way of just saying <code>BluetoothSocket bs = createRfcommSocket(...</code>. </p><p>What is the difference between their approach</p><pre><code>Method m = device.getClass().getMethod(""createRfcommSocket"", new Class[] { int.class });sock = (BluetoothSocket) m.invoke(device, Integer.valueOf(1));</code></pre><p>and mine</p><pre><code>sock = createRfcommSocket(.....</code></pre><p>Is there a reason to use one or the other? </p><p>Thank you</p>","268803","","","","","2013-10-16 18:53:50","Is it ""reflection"" when I use getClass.getMethod(...)?","<java><android>","6","4","2","",""
"3331527","1","3331673","","2010-07-26 00:06:25","89","92754","<p>I have a large bitmap (say 3888x2592) in a file. Now, I want to resize that bitmap to 800x533 and save it to another file.I normally would scale the bitmap by calling <code>Bitmap.createBitmap</code> method but it needs a source bitmap as the first argument, which I can't provide because loading the original image into a Bitmap object would of course exceed the memory (see <a href=""http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue"">here</a>, for example).</p><p>I also can't read the bitmap with, for example, <code>BitmapFactory.decodeFile(file, options)</code>, providing a <code>BitmapFactory.Options.inSampleSize</code>, because I want to resize it to an exact width and height. Using <code>inSampleSize</code> would resize the bitmap to 972x648 (if I use <code>inSampleSize=4</code>) or to 778x518 (if I use <code>inSampleSize=5</code>, which isn't even a power of 2).</p><p>I would also like to avoid reading the image using inSampleSize with, for example, 972x648 in a first step and then resizing it to exactly 800x533 in a second step, because the quality would be poor compared to a direct resizing of the original image.</p><p>To sum up my question:Is there a way to read a large image file with 10MP or more and save it to a new image file, resized to a specific new width and height, without getting an OutOfMemory exception?</p><p>I also tried <code>BitmapFactory.decodeFile(file, options)</code> and setting the Options.outHeight and Options.outWidth values manually to 800 and 533, but it doesn't work that way.</p>","388826","","277304","","2013-05-23 14:49:23","2014-02-12 17:33:42","Android: Resize a large bitmap file to scaled output file","<android><image><resize><bitmap>","16","1","67","",""
"3331595","1","","","2010-07-26 00:35:48","1","701","<p>I decided to create my first Android widget this weekend and although I have gotten it to work somewhat, it does not display the dynamically-loaded content until I rotate the device (using Launcher Pro Plus which allows landscape orientation and rotation of home screens).</p><p>The widget is pretty simple, it just retrieves an image from a website and displays the image. I created a service that is started in onUpdate() of the AppWidgetProvider subclass. The service then retrieves the image, builds the RemoteViews object and then calls updateAppWidget() on the AppWidgetManager.  Here is the code for the widget:</p><pre><code>public class PropagationWidget extends AppWidgetProvider {@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager,        int[] appWidgetIds) {    context.startService(new Intent(context, UpdateService.class));}public static class UpdateService extends IntentService {    public UpdateService() {        super(""PropagationWidget$UpdateService"");    }    @Override    protected void onHandleIntent(Intent intent) {        ComponentName me=new ComponentName(this,                 PropagationWidget.class);        AppWidgetManager mgr=AppWidgetManager.getInstance(this);        mgr.updateAppWidget(me, buildUpdate(this));    }    public RemoteViews buildUpdate(Context context) {        RemoteViews views = null;        URL imageUrl = null;        try {            views = new RemoteViews(context.getPackageName(),                    R.layout.widget_layout);            imageUrl = new URL(                    ""http://www.mountainlake.k12.mn.us/ham/aprs/path.cgi?map=na&amp;img=node&amp;freq=144&amp;type=image"");            InputStream is = (InputStream) imageUrl.getContent();            Bitmap image = BitmapFactory.decodeStream(is);            views.setImageViewBitmap(R.id.image, image);            Time today = new Time();            today.setToNow();            views.setTextViewText(R.id.last_updated, ""Last updated: "" + today.format(""%D %r""));        } catch (MalformedURLException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        return views;    }}</code></pre><p>When the widget loads, I only get the frame of the widget, but no content, which makes sense because UpdateService still hasn't retrieved the image from the website yet. However, even after UpdateService has finished retrieving the image and immediate calls updateAppWidget(), the image still does not appear. When I rotate the device, however, the image appears, and will remain upon subsequent rotations.</p><p>Also too, the widget is set in the appwidget-provider XML to update every 30 minutes. These updates do not show up until I rotate the device, and when the widget is redrawn, I then see the update.</p><p>Is there something really basic here that I'm missing?  Any insight would be greatly appreciated! Please let me know if I should provide any additional information to help with this.</p>","182651","","1288","","2011-04-20 14:51:44","2011-10-21 07:12:29","Android: Widget does not load content on creation","<android><widget>","1","0","","",""
"3331779","1","3470435","","2010-07-26 01:44:44","1","2054","<p>I think this is a general Java question, but it does involve some Android stuff.</p><p>So here's the deal: I've got a JNI wrapped version of MPG123 for Android, and I can pull PCM data from an MP3 file on the SDCard.  I'd like to pull a chunk this data, do an analysis on it using another class I wrote, then push it into a queue.  Ideally, I'd like the audio to play back with a four second delay.  I achieved it with no delay using this code:</p><pre><code>public void run() {  // The actual thread where the PCM data gets processed and analyzed short[] pcm = new short[ 4096 ]; short[] zero = new short[ 4096 ]; Queue&lt;short[]&gt; buffer = new LinkedList&lt;short[]&gt;(); // Fill the zero buffer for( int i = 0; i &lt; 4096; i++ )  zero[i] = 0; // Push back 4 seconds of silence - Note this commented section //for( int i = 0; i &lt; 43; i++ ) // buffer.add( zero ); // Analyze the whole file  while( !isInterrupted() ) {  // Grab and analyze data, add events  int ret = audio.GetPCM( pcm );  //Log.d( ""AudioThread"", ""GetPCM returns: "" + ret );  if( ret != MPG123.MPG123_DONE )  {   // Process the PCM data   if( bd.Process( pcm ) != BeatDetection.AUDALYSIS_OK )    Log.v( ""AudioThread"", ""Beat Detection Error!"" );   // Add the data to the PCM buffer   buffer.add( pcm );  }  // Play the audio  short[] data = buffer.poll();  if( data != null ) // If we have data left in the buffer   at.write( data, 0, 4096 ); // Write it to the audio track  else   break; // Otherwise we need to exit the loop  Log.d( ""AudioThread"", ""BufferSize= "" + buffer.size() ); } // Debug message Log.d( ""AudioThread"", ""Exiting Thread."" ); // Clean stuff up bd.Cleanup(); audio.Cleanup(); at.stop(); at.release();  }</code></pre><p>That said, when I try to introduce a delay into my queue by adding ""4 seconds"" worth of 0's into the queue (<strong>Note the commented block</strong>), my music plays right away, but starts 4 seconds into the song and plays in realtime until the queue starts to empty where it plays the same chunk over and over until breaking out of the loop.  It almost seems as if the queue is acting like a ""First In Last Out"" queue rather than a ""First In First Out"" queue.</p><p>Perhaps I'm not using a Java Queue correctly?  Maybe this is some odd bug with the android AudioTrack?</p><p>Thanks!</p><p>-Griff</p><p><strong>EDIT</strong> -  I solved the problem.  It appears to be a problem with my JNI implementation of GetPCM.  It appears that when I copied data into PCM from the JNI level, it set the same data for every instance of PCM pushed back into the queue, setting every PCM entry in the queue to the same frame of PCM data.  I solved the problem by changing:</p><pre><code>buffer.add( pcm );</code></pre><p>to </p><pre><code>buffer.add( pcm.clone() );</code></pre><p><strong>New Question:</strong>Is this normal Java behavior?  Did I implement the JNI function incorrectly?</p><pre><code>JNIEXPORT jint JNICALL Java_com_motalenbubble_projectlucid_MPG123_GetPCM(    JNIEnv* env,    jobject obj,    jshortArray data ) // jshortarray already has a size attribute{    // Call mpg123_read    jint  err  = MPG123_OK, length;    jshort *pcm;    jsize len = (*env)-&gt;GetArrayLength( env, data );    pcm = (*env)-&gt;GetShortArrayElements( env, data, NULL );    err = mpg123_read( mh, (unsigned char*)pcm, len * sizeof( short ), &amp;length ); // Read length is in bytes - we need in shorts.     (*env)-&gt;ReleaseShortArrayElements( env, data, pcm, 0 );    // Annoying logging    //dprintf(0, ""read(%d): %s\n"", length, err == MPG123_ERR ? mpg123_strerror(mh) : mpg123_plain_strerror(err));     return err;}</code></pre>","383288","","383288","","2010-07-27 00:57:22","2010-08-12 17:37:42","Java Queue, Arrays, and JNI","<java><android><arrays><jni><android-ndk>","1","2","1","",""
"3331805","1","4651665","","2010-07-26 01:54:56","8","9404","<pre><code>public class POCII extends Activity {     myView mv = new myView(this);     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(mv);     }}class myView extends View {     public myView(Context context) {        super(context);     }     @Override     public void onDraw(Canvas canvas) {         Paint paint = new Paint();         canvas.drawRect(0,0,100,100, paint);         canvas.clipRect(0,0,50,50);    } }</code></pre><p>My question is, shouldn't the above code draw a rectangle and then crop the top left portion? The rectangle is not getting cropped.</p><p>Please explain what clipRect does. What is it actually clipping? Does it clip in the form of a rectangle, given the co-ordinates? If so, Why is the above code not working?</p>","381699","","533552","","2011-12-09 00:09:39","2014-01-24 07:29:53","Using clipRect - explantion","<android>","3","0","5","",""
"3331844","1","3331874","","2010-07-26 02:10:55","1","1623","<p>With the below code, nothing appears in the <code>ListActivity</code> as I would expect.<br>No errors are shown in logcat.</p><p><strong>Arrival.java</strong></p><pre><code>package one.two;import java.io.IOException;import java.util.ArrayList;import java.util.List;import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class Arrival extends ListActivity{    private ListView listView;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        ArrayList&lt;String&gt; retList = new ArrayList&lt;String&gt;();        System.out.println(""Start onCreate Function\n"");        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        System.out.println(""In onCreate Function\n"");        System.out.println(""In of GetData\n"");        DBAdapter db = new DBAdapter(this);         System.out.println(""DB Open\n"");        db.open();        System.out.println(""DB Opened\n"");        retList = getData();        System.out.println(""Out of GetData\n"");        // force count no. of records in table        // dump to check index        int cnt = 2;        int i=0;        for (i = 0; i&lt;cnt; i++)            System.out.println(retList.toString());        System.out.println(""Array 2 String\n"");        Cursor c = db.getCursor();        String[] from = new String[] {DBAdapter.status};        int[] to = new int[] {R.id.txt1};        SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this, R.layout.listtext, c, from, to);        this.setListAdapter(mAdapter);        System.out.println(""Show List\n"");        db.close();    }    public static ArrayList&lt;String&gt; getData()     {        ArrayList&lt;String&gt; items = DBAdapter.getAllTitles();        System.out.println(""Return a LIST titles\n"");         return items;        }    }</code></pre><p><strong>DBAdapter.java</strong></p><pre><code>package one.two;import java.util.List;import android.app.ListActivity;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteDatabase.CursorFactory;import java.util.ArrayList;public class DBAdapter{    public static String status = ""status"";    public String id = ""id"";    public String arrival = ""arrival"";    public String destination = ""destination"";    public String ferry = ""ferry"";    private static String DB_PATH = ""/data/data/one.two/databases/"";    private static final String DATABASE_NAME = ""ferry.db"";    private static final String DATABASE_TABLE = ""port"";    public static Context context;    public Cursor c;    public static SQLiteDatabase DbLib;        //overloaded non-null constructor    public DBAdapter(Context context)     {        DbLib = context.openOrCreateDatabase(DATABASE_NAME,  SQLiteDatabase.CREATE_IF_NECESSARY,null);        System.out.println(""OpenOrCreateDB Done"");    }    public class DatabaseHelper extends SQLiteOpenHelper    {        Context context;        DatabaseHelper(Context context)        {            super(context, DATABASE_NAME, null, DATABASE_VERSION);            this.context = context;        }//end constructor DatabaseHelper        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion,                int newVersion)        {        }//end onUpgrade()        @Override        public void onCreate(SQLiteDatabase db)        {        }//end onCreate()    }// end class DatabaseHelper    private static DatabaseHelper DBHelper;    //private static SQLiteDatabase DbLib;    private static final int DATABASE_VERSION = 1;        public static ArrayList&lt;String&gt; getAllTitles()        {            ArrayList&lt;String&gt; port = new ArrayList&lt;String&gt;();                Cursor c=null;                c = DbLib.query(""port"",                        new String[] { ""status"", ""id"", ""arrival"",                                ""destination"", ""ferry"" }, null, null,                        null, null, null);                try {                    if (c!=null) { // start - when there is at least 1 record                        System.out.println(""Cursor is NOT NULL"");                        int i =0;                        for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext())                         {                                    // Debug Stm                            System.out.println(""Record No. ""+i);                            System.out.println(c.getString(0));                            System.out.println(c.getString(1));                            System.out.println(c.getString(2));                            System.out.println(c.getString(3));                            System.out.println(c.getString(4));                            // Assign database cursor.records to arraylist                            port.add(i,c.getString(0));                            port.add(i,c.getString(1));                            port.add(i,c.getString(2));                            port.add(i,c.getString(3));                            port.add(i,c.getString(4));                            i = i + 1;                        }                    } // end - where there is at least 1 record                } finally {                    if (c!=null) {                    c.close();                }                }               return port;        }//end getAllTitles()        public void open() {            //Open the database            String myPath = DB_PATH + DATABASE_NAME;            DbLib = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);        }        public Cursor getCursor(){            return c;        }        public void close()        {            DbLib.close();        }    }//end class DBAdapter</code></pre><p>main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;!-- snip... --&gt;&lt;ListView     android:layout_width=""wrap_content""    android:layout_y=""132dip""    android:layout_x=""150dip""    android:id=""@android:id/list""    android:layout_height=""wrap_content""&gt;&lt;/ListView&gt;</code></pre>","358218","","234938","","2010-07-26 02:31:21","2010-07-26 02:31:21","No data appearing in ListView, using SimpleCursorAdapter","<android><sqlite><listview>","1","0","1","",""
"3331969","1","3337464","","2010-07-26 02:54:35","1","506","<p>I have created a book that each page is a JPG picture (believe me, this is how the book is intended to be). This book is intended to be read in landscape. </p><p>This will be a kindle book, intended to be read on all kindle platorms (kindle 1, kindle 2, iphone, ipad, mac, windows and android). I don't have a kindle yet, but I have kindle app for iPhone and mac.</p><p>I have prepared the HTML structure to be used. </p><p>My question is: the images were created to be seen in landscape, and all images were saved in this format (I mean, the largest size is the horizontal).</p><p>If I create an HTML for kindle and all images are saved that way, the images will be scaled down, so they fit on the horizontal size of the device screen, right?</p><p>As this was the way this book was created for iPhone and iPad, I suppose that at least on Android users will have the option to turn the device sideways and the image will expand to fill the screen. But what about Kindle 1 and 2?</p><p>If I rotate the images 90 degrees CCW, kindle 1 and 2 will see the image at the maximum dimension possible but when the android user rotates the device, the image will rotate and the user will not be able to see it correctly.</p><p>How to solve that? What's the best way to do that?thanks</p>","316469","","316469","","2010-07-26 03:36:21","2010-07-26 17:48:46","Kindle - best way to save images","<android><kindle>","1","0","","",""
"3332169","1","3334640","","2010-07-26 04:15:07","-1","74","<p>I cant be able to show my data into a listview using this code which Ive found on a particular website. I am able to show all the images in listview but the data are not there! Someone please help! </p><pre><code>db = new DBAdapter(this);             toptext = (TextView) findViewById (R.id.toptext);             bottomtext = (TextView) findViewById (R.id.bottomtext);             ArrayList&lt;HashMap&lt;String, String&gt;&gt; list = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();            HashMap&lt;String, String&gt; item;            for (int i = 0; i &lt; 31; i++) {                    item = new HashMap&lt;String, String&gt;();                    item.put(""Date:"", ""Saved Date"" );                    item.put(""Title:"", ""Saved Title"");                    list.add(item);            }            SimpleAdapter notes = new SimpleAdapter(this, list, R.layout.view_list,                                    new String[] { ""date"", ""title"" },                                     new int[] {R.id.toptext, R.id.bottomtext });            setListAdapter(notes);        } catch(Throwable e){         Log.e(""DBAdapter"",e.toString());         } </code></pre><p>What should I change or do?For clearer explanation you can mail me at chuaisarocker@hotmail.com :) </p>","372750","","","","","2010-07-28 13:17:24","Data still not able to be showed in Listview","<android><database><listview>","1","1","","",""
"3332370","1","3332459","","2010-07-26 05:21:20","5","8348","<p>I am using the Apache HttpClient (4.1) included in Android to execute a HttpPut.  I have verified that I only have 1 content-length header.  However, every time I send the request, I get a protocol exception about the Content-Length header already specified.</p><pre><code>HttpClient client = new DefaultHttpClient();putMethod = new HttpPut(url + encodedFileName);putMethod.addHeader(..)  //&lt;-once for each headerputMethod.setEntity(new ByteArrayEntity(data));client.execute(putMethod);  //throws Exception</code></pre><p>Caused by: org.apache.http.ProtocolException: Content-Length header already present     at org.apache.http.protocol.RequestContent.process(RequestContent.java:70)     at org.apache.http.protocol.BasicHttpProcessor.process(BasicHttpProcessor.java:290)</p><p>Any ideas?</p>","16476","","","","","2011-05-18 13:49:43","Content-Length header already present","<java><android><httpclient>","2","0","1","",""
"3332541","1","","","2010-07-26 06:08:30","0","2632","<p>Where can i found below link </p><pre><code>07-26 11:32:31.865: VERBOSE/MAKIService(1081): Received Broadcast:android.intent.action.START_TETHER07-26 11:32:31.865: VERBOSE/MAKIService(1081):         DataString:null07-26 11:32:31.865: VERBOSE/MAKIService(1081):           toString:Intent { act=android.intent.action.START_TETHER }</code></pre><p>I need to use this one for my bluetooth tether enabling .While pressing on the power widget tether button I observed this one on my log.Where can i found MAKIService?</p><p>At least give me code link of Power Control Widget.This will available from Android 1.6 onwards?</p>","362544","","114066","","2011-02-08 12:59:18","2012-09-19 07:10:18","Where can i found Power Control Widget source android?","<android><android-widget>","1","0","2","",""
"3332557","1","","","2010-07-26 06:12:57","0","797","<p>Is it possible to manipulate images using canvas? How do we get the image onto the canvas?</p><pre><code>@Override protected void onDraw(Canvas canvas) {   Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon);   Bitmap mBitmap = bitmap.copy(bitmap.getConfig(), true);   canvas = new Canvas(mBitmap);   Matrix matrix = new Matrix();   canvas.drawBitmap(mBitmap, matrix, mPaint);}</code></pre><p>I'm unable to see the image on the screen. canvas.drawBitmap() shouldn't be necessary since I'm using the constructor and passing mBitmap.</p>","381699","","114066","","2010-09-22 07:17:59","2010-09-22 07:24:19","can an image be manipulated using canvas","<android><video><canvas><image-manipulation>","2","0","","",""
"3332573","1","3332591","","2010-07-26 06:15:16","1","767","<p>I am developing an application that has to capture the key events both in foreground and in background. I used the following code. But am unable to capture the keys in background.</p><pre><code>package com.sri.KeyCap;import android.app.Activity;import android.content.Intent;import android.os.IBinder;import android.view.KeyEvent;import android.widget.Toast;import java.io.OutputStreamWriter;public class KeyCap extends Activity { OutputStreamWriter out; int flag = 0; /** Called when the activity is first created. */ public IBinder onBind(Intent intent) {  return null;  //super.onCreate(savedInstanceState);  //setContentView(R.layout.main); } public boolean onKeyDown(int keyCode, KeyEvent event) {  try {   if (flag == 0) {    out = new OutputStreamWriter(      openFileOutput(""myfilename.txt"", 0));    flag = 1;   }   out.write("""" + keyCode);   out.flush();   Toast.makeText(getApplicationContext(), """" + keyCode,     Toast.LENGTH_LONG).show();  } catch (java.io.IOException e) {   // do something if an IOException occurs.  }  return true; }}</code></pre><p>I used broadcast reciever..</p><pre><code>package com.sri.KeyCap;import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public class _service extends BroadcastReceiver { public void onReceive(Context aContext, Intent aIntent) {   aIntent.setClass(aContext,KeyCap.class);  aContext.startActivity(aIntent); }}</code></pre><p>Can anyone correct me..</p>","399046","","328193","","2010-09-13 12:08:16","2010-09-13 12:08:16","Problem In Key Capture","<android>","1","0","","",""
"3332656","1","3341638","","2010-07-26 06:28:46","2","369","<p>I wrote a thread application which runs an infinite loop. The problem is since its defined as a thread the loop is not holding and process hostage but does use up a lot of my processing power hence reducing my battery life. Now I know this is not how normally programs a written but considering the fact that rouge applications may be built, what precaution does android take to stop processes which implement an infinite loop. While at it, is there a specific class I can access to access the memory usage by an application and also the processor usage?</p><p>The code...</p><pre><code>package com.shouvik.HandlerThread;import android.app.Activity;import android.app.ProgressDialog;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class HandlerThread extends Activity{private ProgressDialog progressDialog;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ((Button) findViewById(R.id.Button01)).setOnClickListener(new OnClickListener()     {        public void onClick(View view)         {            DoSomething();        }           });}private Handler messageHandler = new Handler() {    public void handleMessage(Message msg)     {        super.handleMessage(msg);        Log.v(""Handler"", ""Message Received. Dismissing Dialog"");    }};protected void DoSomething() {    new Thread()     {        public void run()         {                Log.v(""Sleep"", ""Starting Count"");                for(int i= 1; i!=0; i++)                {                    Log.v(""Count"","" i = ""+i);                }            messageHandler.sendEmptyMessage(0);        }    }.start();}}</code></pre><p>Edited: Okay we know android does nothing to halt this program! So then how can we write a program to detect such flaws in programs and shut them down?Also I would like to know, is clicking on the button supposed to launch new threads of the same function while the previous ones are still running? Are they not supposed to be queued?</p>","393459","","393459","","2010-07-27 03:33:16","2010-07-27 07:55:53","Is it possble to detect an endless loop?","<android><multithreading>","3","2","","",""
"3332734","1","3332819","","2010-07-26 06:44:38","2","1073","<p>As i am being an Android developer, and android is supporting SQLite database, </p><p>i would like to know that which are the other mobile platforms supports the SQLite Databaseso that i can make SQLite database common and can place it at one place,and thereafter i can make database transaction from different mobile platforms.</p>","379693","","379693","","2010-07-26 09:10:05","2010-08-20 04:06:31","which mobile platforms supports SQLite Database","<android><sqlite><mobile>","3","0","1","",""
"3332753","1","3333234","","2010-07-26 06:49:22","5","1625","<p>I would like to know if there is an option of setting an auto icon link of my application in the user's desktop, after installing it?</p><p>The only way I know to do it, is that the user could drag it manually to his desktop from the applications list. Is there any way of doing it automaticlly for the user(withouth his touch) ?</p><p>Thanks,</p><p>Moshic.</p>","273550","","","","","2010-07-26 08:20:15","Desktop Icon link","<android>","1","0","1","",""
"3332757","1","","","2010-07-26 06:50:30","1","368","<p>My application intends to update the facebook status to the area in which my cellphone is. How do i go about it ?From where should i start &amp; in what direction should i proceed ?(I am able to get the GPS locations. Only cant figure out of linking my application to facebook. )</p>","335429","","114066","","2010-07-26 07:38:03","2010-07-26 07:38:03","Updating your facebook status?","<android><facebook>","1","0","","",""
"3332773","1","3370616","","2010-07-26 06:52:46","2","3417","<p>I need HTTP/RTSP Video Streaming with Android. Any Ideas ?Is that possible to go with JMF with Android ? Any Working examples ?</p><p>Already tried with <a href=""http://davanum.wordpress.com/2007/12/29/android-videomusic-player-sample-from-local-disk-as-well-as-remote-urls/"" rel=""nofollow"">http://davanum.wordpress.com/2007/12/29/android-videomusic-player-sample-from-local-disk-as-well-as-remote-urls/</a></p><p>Its not working with my case. Are there any specific types of videos that Android can stream ?Thanks.</p>","206809","","","","","2012-11-08 10:19:58","Android Video Streaming","<android><video-streaming><jmf><http-streaming>","1","0","3","",""
"3332843","1","","","2010-07-26 07:04:38","1","565","<p>I download a ics file (Outlook Calendar File) from a mail attachment in my application. Another application also downloads the ics file. I need to set my application as the default application to open the ics files (from my program). <strong>Is there any possibility to know our application is the default application or not from our program?</strong> </p><p>If my application is not a default application, is the user select my application at that time i have to get some details from the user.Can anyone help me to solve this???</p>","398981","","398981","","2010-07-26 12:48:05","2010-07-26 12:48:05","How to set the application as a default one?","<android>","1","0","","",""
"3332855","1","3332930","","2010-07-26 07:06:45","1","142","<p>I'm reading the book 'Hello, Android'. In the Sudoku example, it uses a options menu. It needs a MenuInflater that we use to read the menu definition from XML and turns it into a real view.To use button, textview, or many other views, I don't need to inflate them.</p><p>My question is, in what situations, I need inflaters? Why doesn't Android treat menus like other views?</p>","151627","","","","","2013-01-23 09:38:45","When do I need inflaters?","<android>","2","0","","",""
"3332870","1","","","2010-07-26 07:08:53","1","215","<p>when im going to insert the the data in database i found the following errorsplease give me solution</p><pre><code>07-26 12:24:38.275: ERROR/Zygote(32): setreuid() failed. errno: 207-26 12:24:45.445: ERROR/Zygote(32): setreuid() failed. errno: 1707-26 12:24:46.705: ERROR/BatteryService(58): usbOnlinePath not found07-26 12:24:46.705: ERROR/BatteryService(58): batteryVoltagePath not found07-26 12:24:46.705: ERROR/BatteryService(58): batteryTemperaturePath not found07-26 12:24:46.757: ERROR/SurfaceFlinger(58): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake07-26 12:24:52.576: ERROR/EventHub(58): could not get driver version for /dev/input/mouse0, Not a typewriter07-26 12:24:52.576: ERROR/EventHub(58): could not get driver version for /dev/input/mice, Not a typewriter07-26 12:24:52.727: ERROR/System(58): Failure starting core service07-26 12:24:52.727: ERROR/System(58): java.lang.SecurityException07-26 12:24:52.727: ERROR/System(58):     at android.os.BinderProxy.transact(Native Method)07-26 12:24:52.727: ERROR/System(58):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)07-26 12:24:52.727: ERROR/System(58):     at android.os.ServiceManager.addService(ServiceManager.java:72)07-26 12:24:52.727: ERROR/System(58):     at com.android.server.ServerThread.run(SystemServer.java:184)07-26 12:24:53.727: ERROR/SoundPool(58): error loading /system/media/audio/ui/Effect_Tick.ogg07-26 12:24:53.737: ERROR/SoundPool(58): error loading /system/media/audio/ui/KeypressStandard.ogg07-26 12:24:53.737: ERROR/SoundPool(58): error loading /system/media/audio/ui/KeypressSpacebar.ogg07-26 12:24:53.737: ERROR/SoundPool(58): error loading /system/media/audio/ui/KeypressDelete.ogg07-26 12:24:53.746: ERROR/SoundPool(58): error loading /system/media/audio/ui/KeypressReturn.ogg07-26 12:24:56.527: ERROR/ThrottleService(58): Could not open GPS configuration file /etc/gps.conf07-26 12:24:57.955: ERROR/logwrapper(142): executing /system/bin/tc failed: No such file or directory07-26 12:24:58.026: ERROR/logwrapper(144): executing /system/bin/tc failed: No such file or directory07-26 12:24:58.096: ERROR/logwrapper(146): executing /system/bin/tc failed: No such file or directory07-26 12:25:10.246: ERROR/HierarchicalStateMachine(58): TetherMaster - unhandledMessage: msg.what=307-26 12:25:41.245: ERROR/AndroidRuntime(274): FATAL EXCEPTION: main07-26 12:25:41.245: ERROR/AndroidRuntime(274): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dataApplication/com.dataApplication.Edit}: java.lang.NullPointerException07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at android.os.Handler.dispatchMessage(Handler.java:99)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at android.os.Looper.loop(Looper.java:123)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at java.lang.reflect.Method.invokeNative(Native Method)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at java.lang.reflect.Method.invoke(Method.java:521)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at dalvik.system.NativeStart.main(Native Method)07-26 12:25:41.245: ERROR/AndroidRuntime(274): Caused by: java.lang.NullPointerException07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at com.dataApplication.Edit.onCreate(Edit.java:87)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)07-26 12:25:41.245: ERROR/AndroidRuntime(274):     ... 11 more07-26 12:26:54.735: ERROR/AndroidRuntime(285): FATAL EXCEPTION: main07-26 12:26:54.735: ERROR/AndroidRuntime(285): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dataApplication/com.dataApplication.Edit}: java.lang.NullPointerException07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at android.os.Handler.dispatchMessage(Handler.java:99)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at android.os.Looper.loop(Looper.java:123)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at java.lang.reflect.Method.invokeNative(Native Method)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at java.lang.reflect.Method.invoke(Method.java:521)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at dalvik.system.NativeStart.main(Native Method)07-26 12:26:54.735: ERROR/AndroidRuntime(285): Caused by: java.lang.NullPointerException07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at com.dataApplication.Edit.onCreate(Edit.java:87)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)07-26 12:26:54.735: ERROR/AndroidRuntime(285):     ... 11 more</code></pre>","398721","","114066","","2010-07-26 07:41:07","2010-07-26 07:41:07","I get an error during database insertion","<android>","1","0","","",""
"3332924","1","3333855","","2010-07-26 07:19:55","21","25744","<p>I have tried to use marquee and its not workinghere is my code, please let me know where im going wrong</p><pre><code>&lt;TextView   android:text=""lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00""   android:id=""@+id/TextView02""   android:layout_width=""200dip""   android:layout_height=""wrap_content""   android:marqueeRepeatLimit=""marquee_forever""   android:ellipsize=""marquee""   android:singleLine=""true""   android:focusable=""true""   android:inputType=""text""   android:maxLines=""1""&gt;&lt;/TextView&gt;</code></pre><p>i am using android SDK 2.0.1</p>","367016","","114066","","2010-07-26 07:40:31","2013-11-13 04:27:23","TextView Marquee not working","<android><textview>","11","2","14","",""
"3333109","1","","","2010-07-26 07:57:28","1","632","<p>How can I make sure I only retain one copy of an activity on the stack when called from non-activity?</p><p>When called from an activity I can just add the FLAG_ACTIVITY_REORDER_TO_FRONT flag to the Intent, but how can I do this from e.g. a widget or a notification?</p>","367101","","","","","2010-07-26 10:45:45","Retain only one copy of an activity on the stack when called from non-activity","<android><stack><activity><android-intent><notifications>","0","0","0","",""
"3333181","1","","","2010-07-26 08:08:38","0","3030","<pre><code>07-26 13:32:38.705: ERROR/Zygote(32): setreuid() failed. errno: 207-26 13:32:46.206: ERROR/Zygote(32): setreuid() failed. errno: 1707-26 13:32:47.526: ERROR/BatteryService(58): usbOnlinePath not found07-26 13:32:47.526: ERROR/BatteryService(58): batteryVoltagePath not found07-26 13:32:47.526: ERROR/BatteryService(58): batteryTemperaturePath not found07-26 13:32:47.556: ERROR/SurfaceFlinger(58): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake07-26 13:32:54.275: ERROR/EventHub(58): could not get driver version for /dev/input/mouse0, Not a typewriter07-26 13:32:54.285: ERROR/EventHub(58): could not get driver version for /dev/input/mice, Not a typewriter07-26 13:32:54.496: ERROR/System(58): Failure starting core service07-26 13:32:54.496: ERROR/System(58): java.lang.SecurityException07-26 13:32:54.496: ERROR/System(58):     at android.os.BinderProxy.transact(Native Method)07-26 13:32:54.496: ERROR/System(58):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)07-26 13:32:54.496: ERROR/System(58):     at android.os.ServiceManager.addService(ServiceManager.java:72)07-26 13:32:54.496: ERROR/System(58):     at com.android.server.ServerThread.run(SystemServer.java:184)07-26 13:32:55.756: ERROR/SoundPool(58): error loading /system/media/audio/ui/Effect_Tick.ogg07-26 13:32:55.765: ERROR/SoundPool(58): error loading /system/media/audio/ui/KeypressStandard.ogg07-26 13:32:55.775: ERROR/SoundPool(58): error loading /system/media/audio/ui/KeypressSpacebar.ogg07-26 13:32:55.795: ERROR/SoundPool(58): error loading /system/media/audio/ui/KeypressDelete.ogg07-26 13:32:55.804: ERROR/SoundPool(58): error loading /system/media/audio/ui/KeypressReturn.ogg07-26 13:32:59.184: ERROR/ThrottleService(58): Could not open GPS configuration file /etc/gps.conf07-26 13:33:00.706: ERROR/logwrapper(148): executing /system/bin/tc failed: No such file or directory07-26 13:33:00.764: ERROR/logwrapper(149): executing /system/bin/tc failed: No such file or directory07-26 13:33:00.815: ERROR/logwrapper(150): executing /system/bin/tc failed: No such file or directory07-26 13:33:12.188: ERROR/HierarchicalStateMachine(58): TetherMaster - unhandledMessage: msg.what=307-26 13:34:04.617: ERROR/AndroidRuntime(276): FATAL EXCEPTION: main07-26 13:34:04.617: ERROR/AndroidRuntime(276): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dataApplication/com.dataApplication.Edit}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at android.os.Handler.dispatchMessage(Handler.java:99)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at android.os.Looper.loop(Looper.java:123)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at java.lang.reflect.Method.invokeNative(Native Method)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at java.lang.reflect.Method.invoke(Method.java:521)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at dalvik.system.NativeStart.main(Native Method)07-26 13:34:04.617: ERROR/AndroidRuntime(276): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at android.app.ListActivity.onContentChanged(ListActivity.java:245)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:201)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at android.app.Activity.setContentView(Activity.java:1647)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at com.dataApplication.Edit.onCreate(Edit.java:32)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)07-26 13:34:04.617: ERROR/AndroidRuntime(276):     ... 11 more</code></pre>","398721","","243782","","2010-07-26 10:29:04","2010-07-26 12:25:45","I got an error during activity start","<android>","2","1","","2011-12-11 15:31:31",""
"3333237","1","3371089","","2010-07-26 08:21:00","1","3063","<p>I am struggling a bit with the LocationListener in Android. I want to make an app that will get the current GPS location, and then afterwards sleep for a long time. A day or more. In this period of time i want the GPS notification icon to not show.</p><p>What i have now, is in the onLocationChanged a Thread.sleep(x) but this will keep the icon on in the sleep period. How can i do this, and is there a better approach than to use Thread.sleep?</p><p>Thanks in advance</p>","402044","","","","","2012-01-13 09:31:54","Turn off GPS icon when LocationListener is sleeping","<android><gps>","2","0","2","",""
"3333285","1","3333292","","2010-07-26 08:31:02","1","1053","<p>I need to know about servlet simulation.</p><p>Which programe or software should I install? </p>","380770","","","","","2010-07-26 08:31:53","ANDROID: How do you create an android servlet","<android>","1","0","","",""
"3333294","1","3337349","","2010-07-26 08:31:56","0","1359","<p>In android 1.5 sdk, with QVGA800 skin(resolution), I added 8 EditText in LinearLayout. When 8th EditText box is tapped, the onscreen appears. However, layout doesnt move up enough, I mean, it moves up however it still covers EditText box which is being typed. How to solve this ?</p><p>Main Class :</p><pre><code>package com.i;import android.app.Activity;import android.os.Bundle;import android.widget.EditText;public class myClass extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        EditText txt1=(EditText)findViewById(R.id.txt1);        EditText txt2=(EditText)findViewById(R.id.txt2);        EditText txt3=(EditText)findViewById(R.id.txt3);        EditText txt4=(EditText)findViewById(R.id.txt4);        EditText txt5=(EditText)findViewById(R.id.txt5);        EditText txt6=(EditText)findViewById(R.id.txt6);        EditText txt7=(EditText)findViewById(R.id.txt7);        EditText txt8=(EditText)findViewById(R.id.txt8);    }}</code></pre><p>main.xml :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;    &lt;EditText android:id=""@+id/txt1"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;    &lt;EditText android:id=""@+id/txt2"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;    &lt;EditText android:id=""@+id/txt3"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;    &lt;EditText android:id=""@+id/txt4"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;    &lt;EditText android:id=""@+id/txt5"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;    &lt;EditText android:id=""@+id/txt6"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;    &lt;EditText android:id=""@+id/txt7"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;    &lt;EditText android:id=""@+id/txt8"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Thanks.</p>","368084","","368084","","2010-07-26 11:09:49","2010-07-26 17:31:50","Onscreen keyboard covers up EditText on QVGA800 skin(resolution) in android 1.5","<android><android-emulator>","1","1","","",""
"3333408","1","","","2010-07-26 08:54:49","2","1768","<p>My application builds from 2 activities and one service.The main activity is list of data (extends ListActivity).The second activity is a simple progress bar.</p><p>The service responsibility is to retrieve the data from the server.Once the user launches the application the service creates a new thread and send request to the server, since it is asynchronous request I want to display my progress bar, once the response arrived I want to display the data using the list activity.</p><p>At the moment my main activity (the list) start the service and bind with it (bindService), the main activity and the service must live and communicate until the user close the application so I implemented handleMessage at the list activity.</p><p>My problem is how to inform the progress bar activity that the data arrived, finish the progress bar (I don’t need it anymore) and display the data in the list activityRegards</p>","402075","","","","","2010-07-26 10:13:20","Android activity and service communication","<android>","1","0","","",""
"3333523","1","","","2010-07-26 09:14:54","1","607","<p>I'm studying Android push service (C2DM) for Android Froyo version.The Google says the max size of message is 1024 bytes (http://code.google.com/intl/ko/android/c2dm/).What is the message encoding type? I want to put extra message which is not English.</p>","402088","","29995","","2011-02-25 14:59:05","2011-02-25 14:59:05","What's the encoding type of Android 2.2 push message?","<android><encoding><android-c2dm>","1","0","","",""
"3333531","1","","","2010-07-26 09:15:47","1","1310","<p>I'm working on the android automatic test, and try to test the alarmclock app in the android. I want to get the TimePicker after the TimePickerDialog pop up, then  we can use it to invoke the methods 'setCurrentHour(...)' and 'setCurrentMinute()' to set the alarm time programmatically instead of sending the key event so many times.Thank you.</p>","402068","","","","","2013-09-04 06:36:26","How to get the TimePicker after the TimePickerDialog pop up","<android><testing><timepicker>","2","0","","",""
"3333658","1","8893285","","2010-07-26 09:34:33","15","21951","<p>Can a seekbar be vertical? I am not very good at UI design, so how make seekbar more beautiful, please give me some templates and examples.</p>","389204","","3330969","","2014-04-11 04:27:03","2014-04-11 04:27:03","How to make a vertical SeekBar in Android?","<android><seekbar>","4","1","5","",""
"3333749","1","6317599","","2010-07-26 09:50:23","2","9198","<p>I am new comer to android but not to java. I have been designing UI in android through XML file, in that page i have 3 linear Layouts, in my top layout(first LinearLayout) i have kept some image and in the last layout i have kept some buttons,now i need to place a circle(of red color) in my center layout using canvas,i have written a separate class that extends View where in onDraw(Canvas canvas) ,i have drawn a circle.</p><pre>package com.project.TargetTrackr3;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.view.View;public class DrawCanvasCircle extends View{    public DrawCanvasCircle(Context mContext) {        super(mContext);    }    public void onDraw(Canvas canvas) {        Paint paint = new Paint();        paint.setStyle(Paint.Style.FILL);        canvas.drawColor(Color.WHITE);        paint.setColor(Color.BLUE);        canvas.drawCircle(20, 20, 15, paint);    }}</pre><p>Now i have to bring this canvas to the second layout,my main.xml is shown below</p><pre>package com.project.TargetTrackr3;import android.app.Activity;import android.content.Context;import android.graphics.Canvas;import android.graphics.ColorFilter;import android.graphics.drawable.Drawable;import android.os.Bundle;import android.view.View;import android.widget.LinearLayout;public class TargetTrackr3Activity extends Activity {    /** Called when the activity is first created. */      protected LinearLayout ll;      DrawCanvasCircle c;      public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main1); //layouting file         ll = (LinearLayout) findViewById(R.id.LinearLayout_DrawCircle);//This is where i have to bring the canvas        c = new DrawCanvasCircle(this);           ...................................           ................................    }}</pre>","384193","","900570","","2014-03-22 19:43:01","2014-03-22 19:43:01","How to add Canvas in a specific LinearLayout?","<android>","1","0","3","","2010-07-26 09:51:08"
"3333881","1","3334004","","2010-07-26 10:11:12","6","10365","<p>There are some others applications doing this, like Twitter, Facebook, or even native applications such as Android Market. When you want to display a list of items retrieved from the internet, this looks like a standard way for displaying the user some notification about action in progress. This is a white background screen with an animated spinning wheel and a ""Loading..."" text. Does somebody know how to do this?. I've been able to do something similar with this code, but i don't like it too much yet. Still work in progress:</p><pre><code>    &lt;ListView android:id=""@+id/post_list""             android:layout_width=""fill_parent""   android:layout_height=""wrap_content""/&gt;    &lt;TextView android:id=""@android:id/loading"" android:background=""@color/white""   android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""    android:gravity=""center"" android:text=""Loading..."" /&gt;</code></pre>","367029","","","","","2011-10-29 14:11:55","How to display a ""Loading..."" text while retrieving items for a ListView","<android><listview><uiview><loading>","3","0","3","",""
"3333946","1","","","2010-07-26 10:19:26","0","1331","<p>I have an <code>EditText</code> where users can set text to bold, italic, etc but I can't figure out how to save that text with styles as .txt file/any other way to save it.If we save as HTML page we can't edit the webview. I use <code>getText</code> but that only returns text and no style info.</p>","342873","","1288","","2011-11-19 21:20:12","2011-11-19 21:20:23","How to save Android edit text content with rich text","<android>","1","0","0","",""
"3334048","1","3760027","","2010-07-26 10:40:28","49","26870","<p>I have a xml-layout file main with two textviews A/B and a view C.Than I have two other xml layout files option1 and option2.Is it possible to load either option1 or option2 in run time via Java into C? If so, what function do I have to use?</p>","25282","","","","","2012-02-28 12:04:29","Android layout replacing a view with another view on run time","<android><android-layout>","2","0","24","",""
"3334050","1","","","2010-07-26 10:40:32","0","955","<p>I have a Text View in my application and I want to select text from that text view and i want the starting &amp; ending position of that selected text so can anyone please help me. </p>","356158","","","","","2010-07-26 12:20:24","selection in textview","<android>","2","1","","",""
"3334271","1","","","2010-07-26 11:12:19","1","265","<p>We have an application which on start up pulls up a Terms and Conditions screen. When the user declines these terms we have to ask the user if he wishes to delete the package.</p><p>So, from within the application we launch the following intent:</p><pre><code>Uri uninstallUri = Uri.parse(""package:some.package.name"");Intent intent = new Intent(Intent.ACTION_DELETE, uninstallUri);startActivity(intent);</code></pre><p>This brings the Settings-> Manage Applications -> Uninstall page for our application.</p><p>The user can go ahead and uninstall the pacakge. But when he chooses not to(by pressing Cancel) he is taken to our Terms and Conditions Activity. If he presses Back again, he is taken out of application. The problem is that now if we pull the launcher menu, our application icon does not show up. We can see it in the ""Recently Launched application list"" and the application is still there on the device.</p><p>Is this because PackageManager disabled our application? If so, how do we re-enable it?</p><p>What did we miss here?</p><p>Please help.</p><p>Thanks.</p>","236128","","","","","2010-07-26 11:12:19","Problem uninstalling an Application package from Android device","<android><android-package-managers>","0","0","1","",""
"3334336","1","","","2010-07-26 11:22:52","0","2270","<p>I'm trying to call a method from inside a Runnable that is running. It waits for a string to be entered and when it is then depending on the string (the strings act as commands) it calls a method and is supposed to run whats inside it.</p><p><code>public class App extends Activity implements Runnable {</p><pre><code>public void run() {     try {         ServerSocket serverSocket = new ServerSocket(portNum);         while (true) {                       Socket client = serverSocket.accept();             try {                  BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));                  String str = in.readLine();                  if(str.equals(""test"")) {                      //method call here                  }             } catch(Exception e) {                    Log.d(""App"", e.getMessage());             } finally {                        client.close();                    Log.d(""App"", ""Done."");                }         }            } catch (Exception e) {         Log.d(""App"", e.getMessage());     }}</code></pre><p></code></p>","402208","","","","","2011-07-14 19:19:56","Run method from extends Activity extends Runnable","<android><multithreading><activity><extends><runnable>","2","0","","",""
"3334365","1","3334532","","2010-07-26 11:27:13","0","3994","<p>I am getting the following error:</p><p>ERROR: The method killBackgroundProcesses(String) is undefined for the type ActivityManager</p><p>Now I am dead sure that ActivityManager contains that method <a href=""http://developer.android.com/reference/android/app/ActivityManager.html#killBackgroundProcesses%28java.lang.String%29"" rel=""nofollow"">http://developer.android.com/reference/android/app/ActivityManager.html#killBackgroundProcesses%28java.lang.String%29</a>.</p><p>Here is the code, please help me figure out where I am going wrong?</p><pre><code>package com.robosoft.killswitch;import java.util.List;import android.app.ActivityManager;import android.app.ListActivity;import android.app.ActivityManager.RunningAppProcessInfo;import android.content.Context;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ListView;import android.widget.AdapterView.OnItemClickListener;public class KillSwitch extends ListActivity {/** Called when the activity is first created. */private RunningApplicationAdapter runningApplicationAdapter;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);    final List&lt;ActivityManager.RunningAppProcessInfo&gt; RunningApp = am.getRunningAppProcesses();            runningApplicationAdapter = new RunningApplicationAdapter(this, RunningApp);    //setContentView(R.layout.main);    setListAdapter(runningApplicationAdapter);    ListView lv = getListView();    lv.setTextFilterEnabled(true);    lv.setOnItemClickListener(new OnItemClickListener()    {          public void onItemClick(AdapterView&lt;?&gt; parent, View v, int pos, long id) {            RunningAppProcessInfo x = RunningApp.get(pos);            String y = x.processName;            am.killBackgroundProcesses(x.processName); //Error Here!    }    });}}</code></pre>","393459","","12388","","2010-07-26 12:01:58","2010-07-26 12:36:54","Error: The method xxx is undefined for the type ActivityManager","<android><activity>","2","0","1","",""
"3334372","1","","","2010-07-26 11:28:31","4","618","<p>I will be developing a dictionary app for both Android and iPhone. The data will be embedded within the app, and it consists out of approximately 100000 words, with genus and plural form. Is it better to use a SQLite database or can I just stick to XML? Somehow SQLite sounds more efficient, but I thought let's just ask.</p><p>Thanks!</p>","402213","","","","","2010-07-26 11:37:27","Which is faster when reading large amounts of data: XML or SQLite","<iphone><android>","3","0","","",""
"3334398","1","3334654","","2010-07-26 11:32:33","0","354","<p>Why does Gesture Builder pop up with Mandarin/Japanese predictive text when entering the name of a gesture, and then subsequently save that name in this language. Please help me set it back to English? all the dialogue on screen apart from that is in English???</p>","300037","","","","","2010-07-26 12:12:02","Android Gesture Builder displays Mandarin/Japanese characters?","<android><gestures>","1","0","","",""
"3334406","1","","","2010-07-26 11:33:23","1","1773","<p>I am trying to access the current cell location information. When Itry to call <code>getCellLocation()</code>, it returns <code>null</code>.</p><p>I am unable to reason out this.. the same code works on 1.5 but failson 1.6 or 2.1. (Tested on G1 with 1.6 and HTC legend 2.1.)</p><p>Can someone help me in correcting this bug? My code is below.</p><pre><code>TelephonyManager tMgr = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);outputView = (TextView) findViewById(R.id.output);outputView.append(""Device type:"" + tMgr.getPhoneType() + ""\n"");GsmCellLocation gsmCellLocation = (GsmCellLocation) tMgr.getCellLocation();if (gsmCellLocation != null) {    String mCellId = """" + gsmCellLocation.getCid();    String mLAC = """" + gsmCellLocation.getLac();    Log.d(""SDKService"", ""Cell Id: "" + mCellId + "" LAC: "" + mLAC);    outputView.append(""Cell Id: "" + mCellId + "" LAC: "" + mLAC + ""\n"");}</code></pre><p>Also, I have added the following permissions :</p><ul><li><code>ACCESS_FINE_LOCATION</code></li><li><code>ACCESS_COARSE_LOCATION</code></li><li><code>CONTROL_LOCATION_UPDATES</code></li></ul><p>Do I need to add any other permissions?</p><p>Kindly let me know where I have gone wrong.</p>","362416","","707111","","2012-12-19 03:08:30","2012-12-19 03:08:30","getCellLocation returns null","<android><cellid>","1","0","","",""
"3334431","1","3359965","","2010-07-26 11:38:10","1","394","<p>Hello i m new to android and working on Radio application i gt stuck coz i m unable to stream live audio in android 1.5...</p><p>is that possible to stream live audio in android 1.5 SDK..</p><p>can any on suggest wht to do???</p><p>Many Thanks...</p>","392506","","","","","2010-07-29 06:30:01","Unable to Stream live audio on android 1.5","<android>","1","0","","2012-08-23 01:35:27",""
"3334456","1","","","2010-07-26 11:42:34","1","2200","<p>I want to place an animated marker showing a user's current location in an Overlay over a MapActivity. I need to be able to turn the animation on and off. I thought this could be accomplished as follows:</p><pre><code>/** * Class to display current location marker above MapActivity */public class MyLocationOverlay extends Overlay {    private Canvas canvas;    private final Handler handler = new Handler();    private Runnable runnable;    private GeoPoint geoPoint;    private int xMarker, yMarker;    private int markerNumber = 0;    private Bitmap marker, marker0, marker1, marker2, marker3;    public MyLocationOverlay(Context context) {        Resources r = context.getResources();        marker0 = BitmapFactory.decodeResource(r, R.drawable.marker);        marker1 = BitmapFactory.decodeResource(r, R.drawable.marker1);        marker2 = BitmapFactory.decodeResource(r, R.drawable.marker2);        marker3 = BitmapFactory.decodeResource(r, R.drawable.marker3);        marker = marker0;    }    /** Sets location marker is to be drawn at */    public void setLocation(GeoPoint geoPoint) {        this.geoPoint = geoPoint;    }    /** Sets whether marker is to be animated or static */    public void animateMarker(boolean on) {        if (on) {    // activate animation            if (runnable == null) runnable = new Runnable() {                public void run() {                    switch (markerNumber) {                    case 0: marker = marker0; break;                    case 1: marker = marker1; break;                    case 2: marker = marker2; break;                    case 3: marker = marker3; break;                    }                    markerNumber = ++markerNumber % 3;                    canvas.drawBitmap(marker, xMarker, yMarker, null);                    handler.postDelayed(this, 500);                }            };        } else {    // cancel animation, make marker static version            handler.removeCallbacks(runnable);            runnable = null;            marker = marker0;        }    }    @Override    public void draw(Canvas canvas, MapView mapView, boolean shadow) {        if (shadow == false) {            Projection projection = mapView.getProjection();            // convert the location to screen pixels                     Point point = projection.toPixels(geoPoint, null);            // record the canvas and the marker position for the animated marker            this.canvas = canvas;            xMarker = point.x - marker.getWidth()/2;            yMarker = point.y - marker.getHeight()/2;            // draw the marker centred at the location            canvas.drawBitmap(marker, xMarker, yMarker, null);        }        super.draw(canvas, mapView, shadow);    }    @Override    public boolean onTap(GeoPoint point, MapView mapView) { return false; }}</code></pre><p>The constructor is invoked from the main MapActivity.onResume() using </p><pre><code>    locationOverlay = MyLocationOverlay(this)</code></pre><p>And the animate/draw is invoked by</p><pre><code>    GeoPoint point = new GeoPoint(latE6, lonE6);    locationOverlay.setLocation(point);    locationOverlay.animateMarker(true);    mapView.getController().animateTo(point);</code></pre><p>However, the run() method never seems to be invoked. What am I doing wrong?</p>","342943","","","","","2010-07-27 08:08:53","Problem using Runnable + Handler.postDelayed for bitmap marker animation","<android><animation><android-maps>","1","0","3","",""
"3334499","1","3334665","","2010-07-26 11:47:47","2","1401","<p>Anyone know of an example of an opengl implementation of something like the Gallery widget? Basically, I am looking for an example of how to horizontally scroll a list of images using opengl. I have seen this behavior in the Gallery 3D app from cooliris but there is ALOT of code in that app and I haven't been able to figure out how it works exactly. I am new to using opengl.</p>","386654","","44729","","2010-07-26 14:14:24","2010-07-26 20:13:33","Opengl Gallery implementation?","<android><opengl-es><widget><gallery>","2","0","3","",""
"3334511","1","","","2010-07-26 11:50:34","1","1172","<p>If more than one application supports to open a specified file format. I need to make my application as a default application from my code.How it possible to make it default from the code?? Can anyone help me? </p>","389404","","389404","","2010-07-27 04:36:32","2010-07-27 04:36:32","make default application in android?","<android>","2","0","1","",""
"3334525","1","","","2010-07-26 11:53:24","0","289","<p>I have saved an object of an activity in a variable. Now i exit from this activity. Then i want that i can use the object of the activity to restart the same activity.</p><p>Is it possible to launch an intent of this object of the activity</p>","402232","","114066","","2010-07-26 15:38:38","2010-09-28 11:53:14","how to fire an activity from a given activity object","<android><activity>","2","0","2","",""
"3334543","1","","","2010-07-26 11:56:02","12","3544","<p>In my app i have gradient as drawable which i am using as background and i wan't it to make it look as smooth as possible. After googling  and trying by myself i came up with the following. On nexus one if you call only setDither(true) your gradient is still banding so you have to set PixelFormat like this Window.setFormat(PixelFormat.RGBA_8888). But on the other side G1 does not support RGBA_8888 so calling it make the gradient even uglier than before so Window.setFormat(PixelFormat.RGBA_8888) will not work well on devices that don't support it.</p><p>What is the correct way smooth my gradient on all devices on which my app will run.</p><p>PS: i found some related topics</p><p><a href=""http://stackoverflow.com/questions/2936803/how-to-draw-a-smooth-dithered-gradient-on-a-canvas-in-android"">http://stackoverflow.com/questions/2936803/how-to-draw-a-smooth-dithered-gradient-on-a-canvas-in-android</a></p><p><a href=""http://stackoverflow.com/questions/2791045/is-it-possible-to-dither-a-gradient-drawable"">http://stackoverflow.com/questions/2791045/is-it-possible-to-dither-a-gradient-drawable</a></p>","184601","","","","","2011-01-17 12:36:24","smooth gradient on different devices","<android><gui><gradient>","3","0","3","",""
"3334754","1","","","2010-07-26 12:27:59","6","6916","<p></p><pre><code>&lt;TextView android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:layout_margin=""24dip""    android:text=""Add Notes"" /&gt;&lt;TableLayout android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:layout_marginLeft=""24dip""    android:layout_marginRight=""24dip"" android:id=""@+id/tlNotes""    android:stretchColumns=""0""&gt;&lt;/TableLayout&gt;&lt;Button android:id=""@+id/bAddNoteLine""    android:layout_marginLeft=""24dip"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:text=""ADD""&gt;&lt;/Button&gt;&lt;LinearLayout android:id=""@+id/llIndex""    android:orientation=""horizontal"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:layout_margin=""21dip""    android:gravity=""center""&gt;    &lt;Button android:id=""@+id/bSaveSubjectiveNote""        android:layout_width=""192dip"" android:layout_height=""wrap_content""        android:text=""Save"" /&gt;    &lt;Button android:id=""@+id/bDiscardSubjectiveNote""        android:layout_width=""192dip"" android:layout_height=""wrap_content""        android:layout_marginLeft=""48dip"" android:background=""@drawable/button""        android:text=""Discard"" /&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>how to retrieve the index of linearLayout which has ""llIndex"" as id.Thanks</p>","373885","","147141","","2011-06-10 16:09:56","2012-04-26 07:11:32","How to get the index of particular view OR ViewGroup which is added to the ViewGroup(layout)","<android>","2","0","3","",""
"3334832","1","3714132","","2010-07-26 12:40:20","0","432","<p>Does anyone know why the WebView onLongClick method doesnt fire event when the built in zoom controls are used, webView.setBuiltInZoomControls(true).</p><p>API level 7</p>","376338","","683261","","2012-01-12 04:50:30","2012-01-12 04:50:30","Android WebView LongPress does not fire when using Built in Zoom Controls?","<android><android-webview>","1","0","","",""
"3334858","1","16301904","","2010-07-26 12:43:58","10","3688","<p>Does <code>onPostExecute</code> execute if the <code>AsyncTask</code> has been cancelled?</p><p>If it does execute, is it safe to say that I should always ask if the task has been cancelled (<code>isCancelled</code>) at the start of <code>onPostExecute</code>, before doing anything else?</p>","143378","","143378","","2010-07-26 13:36:57","2013-04-30 21:33:32","onPostExecute on cancelled AsyncTask","<android><multithreading><android-asynctask>","3","1","3","",""
"3335108","1","3336885","","2010-07-26 13:16:19","-1","2389","<p>I have to repeat the image sequence I am using with Thread and AnimationDrawable but it is not working continuously. I don't want to stop this animation until next activity is started through button click event.</p><p>Here is my java code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);{final ImageView splashImage=(ImageView)findViewById(R.id.heartFunction);     splashImage.setBackgroundResource(R.drawable.slide_right);  splashAnimation = (AnimationDrawable) splashImage.getBackground();}public void onWindowFocusChanged(boolean hasFocus) {    super.onWindowFocusChanged(hasFocus);    if ( isFocused ) {        //isFocused = false;        splashAnimation.start();        var=false;        new Thread(new Runnable() {        public void run() {            try {                Thread.sleep(SPLASH_DISPLAY_LENGTH);            } catch (InterruptedException e) {                e.printStackTrace();            }        }    }).start();}</code></pre><p>slide_right.xml:-</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;animation-listxmlns:android=""http://schemas.android.com/apk/res/android""android:oneshot=""true""&gt;&lt;item android:drawable=""@drawable/heartcolored0"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/heartcolored2"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/heartcolored4"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/heartcolored5"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/heartcolored6"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/heartcolored7"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/heartcolored8"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/heartcolored9"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/heartcolored10"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/heartcolored11"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/heartcolored12"" android:duration=""200"" /&gt;&lt;item android:drawable=""@drawable/heartcolored13"" android:duration=""200"" /&gt;&lt;/animation-list&gt;</code></pre>","304961","","1278949","","2013-01-30 20:40:08","2013-01-30 20:40:08","image animation in android","<android><android-animation><android-drawable>","1","1","","",""
"3335194","1","3336961","","2010-07-26 13:26:52","1","4561","<p>I am adding gesture recognition to my app. I have added the view as described in the Android Developers Gestures article but when it comes to adding:</p><pre><code>mLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures);if(!mLibrary.load()){   finish();}</code></pre><p>where do I put this in my code, do I have to create a new class for it, or can I have it in an inner class, or does it not need a class at all?! I have a set up similar to Lunar Lander which comprises of two files, one of which is a thread that handles pretty much all the physics and drawing of the game. The other file begins the thread and saveInstanceState method.</p><p>Furthermore, what type is mLibrary?! I cannot find out anywhere!!</p><p>I imagine I will put the OnGesturePerformed method in my thread as this is where I handle all keyUp and Down events.</p>","300037","","114066","","2010-07-26 14:35:06","2013-02-19 15:12:59","Implementing Gesture Recognition In An Android App","<android><gestures>","1","0","1","",""
"3335199","1","","","2010-07-26 13:27:41","3","14466","<p>I want to flip image in android through translate animation.</p><p>eg:- suppose i have one card. when translate animation starts it shows the card into the new position. now here the card should flip? from backside to front.how can i do that.?</p>","383597","","114066","","2010-07-26 14:32:19","2012-11-01 21:55:48","Android flip image animation","<android><animation>","2","1","6","",""
"3335211","1","3337164","","2010-07-26 13:28:35","0","3229","<p>My application have three pages (three tabs) and I want to switch beetween two gridviews by moving finger horizontaly. The touch code works fine but I can't click anymore on the grid items! I use the method onItemClickListener (onClickListener don't works on Gridview) but the grid item is not clicked.Thanks for your help!</p><p>The code is :</p><pre><code>myGrid.setOnTouchListener(this);myGrid.setOnItemClickListener(this);....public boolean onTouch(View v, MotionEvent event) {    int eventaction = event.getAction();    switch (eventaction) {    case MotionEvent.ACTION_DOWN:        xStart = event.getX();        break;    case MotionEvent.ACTION_UP:        xEnd = event.getX();        if (xEnd - xStart &gt; 20){            //switch to previous tab        }        if (xEnd - xStart &lt; -20){            //switch to next tab        }        return true;    default:        break;    }    return true;}</code></pre>","393590","","","","","2010-07-26 17:08:09","Android, GridView and onTouchListener","<android><gridview><click><touch>","1","0","1","",""
"3335214","1","","","2010-07-26 13:29:06","4","2871","<p>Under what circumstances would using <a href=""http://developer.android.com/guide/developing/tools/aidl.html"" rel=""nofollow"">AIDL</a> to define a service interface be the correct decision (rather than just creating an extension to the <code>service</code> class)?</p>","146588","","114066","","2010-07-26 14:08:44","2010-07-26 14:15:27","When to use an aidl based service?","<android><aidl>","2","0","","",""
"3335372","1","3335517","","2010-07-26 13:46:27","1","994","<p>I am using a progress bar in android, so that till my data is loaded, user is getting a proper feedback of what is going on.the code for the bar is below:</p><pre><code>final ProgressDialog myProgressDialog;myProgressDialog = ProgressDialog.show(ListingPage.this,""Please Wait"", ""Loading Date"", true);new Thread() {   public void run() {      try{         setSelected();                              sleep(5000);      } catch (Exception e) { }      myProgressDialog.dismiss();   }}.start();</code></pre><p>The setSelected() method is inserting data into an array list, and then creating an array adapter and then using a list view to show those items.</p><p>so when I put the setSelected() method in progress bar, it shows the loading circle, but once loading is done. Nothing is displayed in listview. But if I take out progress bar code (thread and run method), and simply call setSelected() method, the listview successfully declares the data.so far it concludes that the progress bar code is doing some thing...so wanted to know am I missing something to add in or take out from the code. I need to the show progress bar as I am reading data from online source and it takes time , which may make user uncomfortable.</p>","328518","","114066","","2012-01-27 08:46:54","2012-01-27 08:46:54","Using progress bar ends up in not populating list view","<android><multithreading><progress-bar><android-listview>","1","0","1","",""
"3335639","1","3336590","","2010-07-26 14:14:42","1","1194","<p>All of the android examples for XmlPullParser pull from a local resource file, and all of the SAX examples pull the XML from a URL. I've been told SAX is faster, so I'm trying to use that to pull data from a local resource file (res/xml/thefile.xml)</p><p>The example code I'm working off of is <a href=""http://www.ctctlabs.com/index.php/blog/detail/parsing_xml_on_android/"" rel=""nofollow"" title=""here"">here</a>. So in that example, the code I want to change is:</p><pre><code>URL url = new URL(""http://example.com/example.xml"");...xr.parse(new InputSource(url.openStream()));</code></pre><p>Instead of using <code>URL</code>, I want to use <code>getXml(R.xml.thefile)</code>Is that possible, or does SAX need to get data from a URL?</p>","386680","","","","","2010-07-26 15:59:07","Can SAX use a local resource XML file?","<android><resources><sax>","1","0","","",""
"3335652","1","","","2010-07-26 14:15:27","1","391","<p>I want to create a ""main"" service/application which will providedifferent functionalities to other applications.</p><p>According to android docs I can use elements from an application/service in other. ""A central feature of Android is that oneapplication can make use of elements of other applications (providedthose applications permit it). ..."".Is there any examples/documentation on this direction?TicTacToeMain/TicTacToeLib example is not helping me because it seems""TicTacToeLib"" will be embedded in final TicTacToeMain apk file.Also I want to ask if is possible to detect if the ""main"" service/application is missing (if is missing I want to tell user to installit, or to install it automatically).</p>","402364","","114066","","2010-07-26 14:26:31","2010-07-26 14:31:01","Sharing code between applications","<android>","1","0","","",""
"3336019","1","3836137","","2010-07-26 14:54:16","2","13312","<p>I'm using the following piece of codes to create a new contact. It follow closely the ContactManager example provided by Android. The problem is, the created contacts do not appear in the Contacts app that shipped with Android. Nevertheless, when I load all the contacts from the phonebook, I can see the newly created contacts. </p><p>private void insertPBEntry()     throws RemoteException, OperationApplicationException    { </p><pre><code>     ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();     ops.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI)             .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, ""Account type"")             .withValue(ContactsContract.RawContacts.ACCOUNT_NAME, ""Account name"")             .build());     ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)             .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)             .withValue(ContactsContract.Data.MIMETYPE,                     ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)             .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, ""TOTAL_NEW"")             .build());     ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)             .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)             .withValue(ContactsContract.Data.MIMETYPE,                     ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)             .withValue(ContactsContract.CommonDataKinds.Phone.NUMBER, ""9090"")             .withValue(ContactsContract.CommonDataKinds.Phone.TYPE,Phone.TYPE_MOBILE)             .build());          getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);}</code></pre><p>I've searched hard but have yet to find the answer. I found one answer suggesting that the problem might have (sth) to do with my strings ""Account type"" and ""Account name"". For my case, I do not need to create any account whatsoever. All I want is to add a new contact with a name, email/mail address, phones. </p><p>Thanks, guys!</p>","397455","","","","","2011-03-15 15:37:27","New contacts created using ContactsContract do not appear in Contacts app","<android><contactscontract>","4","2","5","",""
"3336025","1","","","2010-07-26 14:54:25","1","149","<p>In the Google Maps app, there's a unique EditText that I'd like to reproduce.  If you click ""menu"" then go to ""directions"", the ""start point"" field should begin with ""My Location"" as the text.  The interesting part of this field is its behavior - you cannot edit ""My Location"" without completely deleting it first.</p><p>I have a few places where such behavior would be useful, but I can never quite fully reproduce this.  There are three challenges involved with this behavior:</p><ol><li><p>No matter what the user does, they cannot partially edit the field; it is always fully selected.</p></li><li><p>The keyboard directional keys, rather than moving around the EditText field, change focus.</p></li><li><p>When the user does choose to change the text, the behavior of #1 and #2 disappear and the field acts like a normal EditText.</p></li></ol><p>Has anyone ever successfully reproduced this behavior?</p>","60261","","","","","2012-02-23 11:13:15","How do you make an EditText whose original text can only be fully changed?","<android>","1","0","","",""
"3336125","1","3336620","","2010-07-26 15:04:09","1","213","<p>I was wondering in what order the following methods - onDraw(), onMeasure(), onSizeChanged() - are called automatically when we create a custom component.</p><p>Not sure if this question makes sense ... I've just been kinda confused as to what the methods  are supposed to do exactly.</p><p>Thanks for the help in advance.</p><p>Cheers. </p>","388025","","","","","2010-07-26 16:02:47","Sequence of method calls while creating custom components","<android>","1","0","","",""
"3336147","1","","","2010-07-26 15:07:16","1","1090","<p>i need to write a variable height listview. also i need it for display purpose. column numbers are constant. also i need backgrouund of some cells in different color. so, how to achive this ? should i go listview way or do some custom drawing on a scrollview ? some snippets would help me. </p>","384185","","","","","2010-07-26 17:16:24","variable height list view","<java><android>","1","1","1","",""
"3336253","1","3345508","","2010-07-26 15:19:03","0","1309","<p>I wanna use the Gdata Apis within my Android Application. Being more specific I wanna give the user the ability to search for keywords, use the Gdata api to search for products within googleproducts for these keywords and parse the xml that I get back.</p><p>I know how to parse xml files via an org.xml.sax.helpers.DefaultHandler but I guess that I am not suppose to use such a Handler but rather rely on the Gdata api to parse the xml for me.</p><p>My Problem is that I dont know how to integrate the api in my App. There is a similiar topic within stackoverflow (<a href=""http://stackoverflow.com/questions/524257/best-option-for-using-the-gdata-apis-on-android"">hier</a>) but I am not at all satisfied with the answer they gave. Just giving someone the information to ""look at our recently announced version 2.1.0-alpha of the GData Java library which supports Android"" doesnt quite help me to integrate gdata in my app.</p><p>I would very appreciate if someone could give a step-by-step guide how to integrate the gdata api within my app, including code examples to make a search-request and parsing back the results from google products.</p>","351723","","351723","","2010-07-27 16:09:50","2010-08-04 15:30:59","Android: Accessing the Google Products Search within your Android-Application","<android><google-product-search>","1","0","","",""
"3336576","1","3336623","","2010-07-26 15:57:31","8","3122","<p>There was a bin folder in version control with a bunch of .class files and other junk that should not be versioned.  Could someone please explain to me how the following commit:</p><pre><code>529  svn rm --force bin/530  svn ci -m ""Bin should not be under version control.""</code></pre><p>Leads to the following:</p><pre><code>Revision 249Author:     ndunnDate:   Mon Jul 26 14:52:14 2010 UTC (62 minutes, 34 seconds ago)Log Message:    Bin should not be under version control.trunk/projname/src/     deleted</code></pre><p>I went back through the svn logs as someone reminded me that this had happened before - sure enough, one two separate occasions developers had attempted to remove the bin folder and instead the src folder completely disappeared.  </p><p>Any idea what the heck could be going on?  This is an Android project that's under version control.</p>","155392","","155392","","2010-07-26 17:13:00","2013-05-04 21:49:04","SVN - how does removing a bin folder cause the src folder to be removed instead?","<android><eclipse><svn>","2","0","3","",""
"3336579","1","3826637","","2010-07-26 15:57:56","6","686","<p>I developed an application that interfaces with an institution's emergency alert system. How it works is, when there is an alert, on all of the institution's web pages it displays a scrolling marquee at the top of the page that is put there by javascript using protoype and scriptaculous.</p><p>All of this works perfectly on desktop browsers (IE6-8, Chrome, Safari, Firefox, Opera). It also works well on iPhones. My only problem is the rendering on Android.</p><p>In researching the problem initially, I found a CSS Property for mobile devices (namely webkit) -webkit-text-size-adjust, that keeps mobile devices from resizing text when zooming and changing screen orientation. I have set this property to 'none' as stated by many articles.</p><p>Below is a picture of screen shots from an Android emulator. The left screen shot shows 1x magnification of the page. The spacing between each of the messages is as it should be. The right screen shot shows the page zoomed in. The messages overlap, as the text size is rendered differently, and the div width is not wide enough to contain the text.</p><p><a href=""http://www.themonkeyonline.com/spacing-example.jpg"" rel=""nofollow"">http://www.themonkeyonline.com/spacing-example.jpg</a></p><p>Here is the code that places the div on the page:</p><pre><code>var marquee = new Element( 'div', { 'id' : 'marquee' + marquee_counter } ) .setStyle( { 'display' : 'block'  , 'WebkitTextSizeAdjust' : 'none'  , 'fontSize' : '12px'  , 'lineHeight' : '25px'  , 'left' : $( marquee_container ).getDimensions().width + 'px' } ) .addClassName( 'marquee_text' ) .update( marquee_text );$( marquee_container ).insert( marquee );</code></pre><p>Is there something I am missing?</p><p>I will keep researching the problem in the time being. Thanks to everyone who read all of this.</p><hr><p>A brief update...after more testing, it appears that the problem isn't necessarily based on zoom. It looks as if the problem is the viewport. I tested some really long text, and even zoomed all the way out, it has overlapped. It seems as though the div containing the text will not size itself greater than the window.</p><hr><p>Here is an example of the code in action:</p><p><a href=""http://elliottr.www-dev.seminolestate.edu/alert/"" rel=""nofollow"">http://elliottr.www-dev.seminolestate.edu/alert/</a></p>","402467","","938089","","2011-12-27 22:14:19","2011-12-27 22:14:19","Android Web Development...Div width (more likely inner text) is changing in pixels based on device zoom","<javascript><android><css><prototypejs><scriptaculous>","2","0","","",""
"3336594","1","3336842","","2010-07-26 15:59:32","1","1209","<p>How would  dynamically draw markers on a Mapview? I've got the following code which will hardcode one point in. I'm looking to pull values from a database..</p><pre><code>                 //---translate the GeoPoint to screen pixels---        Point screenPts = new Point();        mapView.getProjection().toPixels(p, screenPts);        //---add the marker---        Bitmap bmp = BitmapFactory.decodeResource(            getResources(), R.drawable.pushpin);                    canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null); </code></pre><p>I've got all the locations in the database. How would I not declare a Point variable etc. for each point the exists in a database table of size N?</p><p>Thanks.</p>","358438","","","","","2010-07-26 16:27:31","Dynamic markers on a map?","<android><google-maps><dynamic>","1","0","2","",""
"3336610","1","3344720","","2010-07-26 16:01:20","3","1868","<p>One of the Preferences in my PreferenceActivity needs to get its values from a database. How do I add these values? </p><pre><code>public class Settings extends PreferenceActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.preference_screen);        ListPreference customPref = (ListPreference) findPreference(""language"");        **ADD_CUSTOM_VALUES_HERE**?????     }</code></pre>","172861","","","","","2013-04-18 13:21:44","Android Preferences Add Values from Database","<android><preferenceactivity>","2","2","1","",""
"3336743","1","","","2010-07-26 16:17:16","5","1545","<p>I'm looking for a solution to send multicast (text) messages to all my google contacts from my android app. Is there a way to do this with the GTalk App (Intent), or do i have to use my own xmpp implementation? Any recommendations for an appropriate solution/framework besides gtalk piggybacking? Thx</p>","20278","","","","","2010-12-23 16:57:15","Is it possible to send message via GTalk Intent?","<android><xmpp><google-talk>","2","0","3","",""
"3336753","1","","","2010-07-26 16:18:04","1","1579","<p>I have searched with google, and can't find out how much of CACHE.MANIFEST android supports, and what versions of android that supports it.</p><p>Anyone out there that have more knowledge on the subject???</p>","384380","","","","","2011-03-16 21:16:13","Android and HTML5 CACHE.MANIFEST","<android>","1","0","","",""
"3336771","1","4187691","","2010-07-26 16:19:51","1","718","<p>Does anyone know if it's possible to have the adapter for an AutoCompleteTextView search a different field then what it returns to the text view to be inserted?</p><p>For example, I have a string that contains a phone number, an address, and a name. This works good for searching because I can enter any of those values to get what I want, but I only want the full name to be returned back to the TextView to be displayed?</p><p>Is this possible or does the adapter have to use the same value for both searching and returning to the AutoCompleteTextView?</p><p>Hope this makes sense, thanks for reading,Tony</p>","215056","","","","","2010-11-15 18:42:51","Android:AutoCompleteTextView Search a Different Field Then What's Inserted In The Text View","<android><adapter><autocompletetextview>","2","0","","",""
"3336845","1","3337742","","2010-07-26 16:27:45","0","397","<p>I'd like to know if there's a way to get the size or the limits of a touched area ? So for instance, it could give me how many pixel the finger is covering.</p><p>In fact the same question has been posted here for the Ipad : <a href=""http://stackoverflow.com/questions/3316358/ipad-measure-detect-covered-area-by-a-finger-touch-on-screen-not-only-touch-coo"">http://stackoverflow.com/questions/3316358/ipad-measure-detect-covered-area-by-a-finger-touch-on-screen-not-only-touch-coo</a></p><p>I think it will depend also of which type of screen android is running on.</p><p>So I'd like to know if it is possible under android ? Thank you.</p>","400695","","","","","2010-07-26 18:22:31","Get the touched area","<android>","1","0","","",""
"3337286","1","3337586","","2010-07-26 17:23:24","0","183","<p>I was wondering if there is a way I can update my Android application which is not listed on the Android Market. I mean, maybe thorough my website? Any ideas? Many Thanks!</p>","363441","","","","","2010-07-26 18:02:35","Updating Android Application","<java><android>","1","0","","",""
"3337371","1","","","2010-07-26 17:36:16","55","26485","<p>Is it possible to set the margin or padding for the image which we added with the <code>android:drawableLeft</code>?</p>","402568","","2117902","","2013-03-28 01:40:02","2014-02-04 10:44:02","android:drawableLeft margin and/or padding","<android>","4","0","13","",""
"3337394","1","","","2010-07-26 17:39:28","0","181","<p>I will have several objects on my canvas at once and need to detect over which one the user performed a gesture. The only way I can think of is splitting the screen up in to many views and listening in each but this isnt very efficient so has anyone a better way, preferably using seperate gesturedetectors that belong to each object individually?</p><p>I will be so so so grateful if someone can help me as I've been tearing my hair out trying to solve this all day</p>","300037","","","","","2010-11-16 14:34:00","Listening for when a gesture occurs on a specific object on screen","<android><gesture-recognition>","1","0","","",""
"3337457","1","","","2010-07-26 17:47:36","0","3023","<p>I get a class not found exception.</p><p>I have included the required entry in manifest file.The code in current activity is as follows:</p><pre><code> Intent i = new Intent(MainListingA.this, DrawTheatreMap.class);            try{             startActivity(i);             }</code></pre><p>........</p><p>The error I get is as follows:</p><pre><code>07-26 23:03:20.259: WARN/dalvikvm(307): threadid=1: thread exiting with uncaught exception (group=0x4001d800)07-26 23:03:20.397: ERROR/AndroidRuntime(307): FATAL EXCEPTION: main07-26 23:03:20.397: ERROR/AndroidRuntime(307): java.lang.NoClassDefFoundError: com.mobilo.movie.DrawTheatreMap07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at com.mobilo.movie.MainListingA$1.onItemClick(MainListingA.java:101)07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at android.widget.ListView.performItemClick(ListView.java:3382)07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at android.os.Handler.handleCallback(Handler.java:587)07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at android.os.Handler.dispatchMessage(Handler.java:92)07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at android.os.Looper.loop(Looper.java:123)07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at java.lang.reflect.Method.invokeNative(Native Method)07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at java.lang.reflect.Method.invoke(Method.java:521)07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-26 23:03:20.397: ERROR/AndroidRuntime(307):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Any help is highly appreciated.</p><p>On a standalone basis, the same map activity works fine.</p><p>Rgds, PP</p>","395482","","21234","","2010-07-26 17:50:16","2012-10-24 15:27:12","calling a mapactivity from another activity","<android><map>","4","0","","",""
"3337481","1","3337817","","2010-07-26 17:51:21","0","289","<p>I am looking into writing an Android app that has a database of approximately 2000 longitudes and latitudes which are effectively hard coded.</p><p>I assume that once my app is installed, I can put this information into the SQLite database, but how should I distribute this information when the app is downloaded?</p><p>One option I thought of was some kind of Patricia Trie to minimise the size of the data (the points will be in a number of clusters, rather than evenly distributed), but I'm not sure whether such a collection would work when there are two associated numbers to store, along with perhaps some other information such as place name.</p><p>Does anyone have any thoughts, input or suggestions?</p><p>Rich</p>","68283","","","","","2010-07-26 18:31:02","How to store lots of longitudes/latitudes on an Android device","<android><latitude-longitude><patricia-trie>","1","0","","",""
"3337505","1","3412672","","2010-07-26 17:53:36","24","7401","<p>I'm developing Android application using third party libraries (Twitter4j). I want to be able mock those objects (also objects created by me) in JUnit and functional tests.</p><p>Do you have any good experiences using some mocking libraries and you can recommend them?</p>","296427","","477415","","2012-03-25 11:26:38","2013-11-03 15:31:12","Mocking library/framework that works best in Android?","<android><unit-testing><mocking><android-testing>","7","0","18","",""
"3337513","1","3337753","","2010-07-26 17:54:29","8","1487","<p>Android includes</p><pre><code>config_longAnimTimeconfig_mediumAnimTimeconfig_shortAnimTime</code></pre><p>but the actual values identified by these constants don't make sense as milliseconds.  I'm sure they get compiled into useful values, and I can determine them with code, but I'm sure someone else knows the answer - and, more to the point, I'm sure other people will be looking for them.  So please post the actual values as an answer and save everyone a little bit of time.</p>","82118","","","","","2010-07-26 18:24:22","What are the actual ms time values for Android's animTime constants?","<android><animation><constants>","1","0","6","",""
"3337558","1","","","2010-07-26 17:58:55","9","1606","<p>I've written a class that is using <code>Context</code>, a third party library and <code>SharedPreferences</code> from <code>PreferenceManager</code>. </p><p>It's possible to mock <code>Context</code>, the third party library can be mocked using some mocking framework, but what to do with <code>PreferenceManager</code>?</p><p>I have two methods:</p><pre><code>public void saveString(ThirdPartyObject obj) {    SharedPreferences appPreferences =         PreferenceManager.getDefaultSharedPreferences(mContext);    SharedPreferences.Editor editor = appPreferences.edit();    editor.putString(mContext.getString(        R.string.preferences_string_name), obj.getString());    editor.commit();}</code></pre><p>and corresponding, that loads preferences.</p>","296427","","356895","","2014-02-19 10:51:54","2014-02-19 10:51:54","How to mock PreferenceManager in Android?","<android><unit-testing><mocking><android-preferences>","1","2","1","",""
"3337567","1","3338156","","2010-07-26 18:00:21","7","1872","<p>I have an android app with links (made by linkify) that lead into other screens of my app.  I'm wondering what's the best approach to close all of the 'child' activities and go back to the first activity that was originally launched.</p><p>in otherwords something like this:</p><p>HomeScreenActivity => Screen1 (via Linkify-link) => Screen2 => Screen3 => click home => (close screens 1, 2 &amp; 3) => HomeScreenActivity</p>","372405","","","","","2010-07-26 19:14:41","android go back to first screen","<android><navigation><activity><android-intent>","2","0","2","",""
"3337637","1","","","2010-07-26 18:08:41","0","1179","<p>this is what I am trying to achive</p><p>1) My main application/activity starts a thread to listen to network messages (tcp). But I want this thread to listen to network messages (on tcp socket) as well as messages from main activity. I am exploring if I can use socket for network messages and Looper for internal messages. I dont think it will work as Looper is blocking.</p><p>In unix, we used Select to poll sockets to listen to messages on different sockets. Please advice how I can achieve Select like capability in Android?</p><p>Thanks!Manu</p>","402597","","","","","2011-02-17 23:33:42","Android - Inter thread communication and network socket","<android><sockets><select><looper>","2","0","","2012-11-29 12:49:26",""
"3337924","1","3338116","","2010-07-26 18:46:00","0","536","<p>I am not able to display the rectangles after a certain delay in code. Here is what I am doing</p><p>DashPathEffect dashPath =new DashPathEffect(new float[]{1,0}, 1);</p><pre><code>        paint.setPathEffect(dashPath);        paint.setStrokeWidth(300);        final int  size =300;</code></pre><p>canvas.drawLine(0, size ,100 , size, paint);</p><p>try {</p><pre><code>            Thread.sleep(4000, 0);        } catch (InterruptedException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }</code></pre><p>canvas.drawLine(110, size ,200 , size, paint);</p><hr><p>I am not able to notice any delay between these two rectagles in the mobile screen. Both appear at the same time. All I am trying to do is, draw the rectangles one after other with some delay in between. What this code is rather doing is, waiting for 4 seconds and then displaying both rectangles at same time.  Thank you. </p>","357349","","357349","","2010-07-26 18:52:18","2010-07-26 19:08:17","Thread.sleep in Canvas","<java><android>","1","0","","",""
"3337948","1","3337993","","2010-07-26 18:48:44","3","1134","<p>I'd like to display a text with a linebreak in an Alert Message:</p><pre><code>private void showAbout() {        AlertDialog.Builder builder = new AlertDialog.Builder(context);        String message = ""&lt;b&gt;Rechtlicher Hinweis:&lt;/b&gt;\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a dolor sapien. Etiam arcu erat, lobortis sed vestibulum ut, adipiscing et enim. Nulla vestibulum volutpat dolor, non pellentesque purus imperdiet vitae. Aenean et elit vel erat consectetur pulvinar. Sed semper, ante vel elementum aliquet, dui urna scelerisque tortor, eu auctor lorem nunc adipiscing velit. Praesent eget libero diam, eget imperdiet sem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae.\n"" + getVersionInfo();        builder.setMessage(Html.fromHtml(message));        builder.setCancelable(false);        builder.setPositiveButton(""Close"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int id) {                dialog.cancel();            }        });        builder.setTitle(""About"");         builder.setIcon(R.drawable.icon);         AlertDialog alert = builder.create();         alert.show();     }</code></pre><p>However this works more or less fine, the linebreaks </p><blockquote>  <p>\n</p></blockquote><p>aren't displayed at all. I already tried to replace <code>\n</code> by <code>\\n</code> or even <code>&lt;\br&gt;</code> but nothing worked. Any hints how to do this?</p>","","anon","34088","","2010-07-26 18:54:19","2014-02-26 15:13:13","Html.fromHtml(String) + Linebreak Problem","<java><html><android>","3","0","","",""
"3338004","1","3347516","","2010-07-26 18:55:58","0","2066","<p>I am trying to set the value of a global variable from Android code.</p><pre><code>               mWebView.loadUrl(""javascript:(function() { "" +                         ""loginID = '""+nicu_app.urlSelected+""'; "" +                         ""})()"");  </code></pre><p>but when I load the webpage in a webview and check to see if this variable has been set by the Android code, I don't see any positive results.</p><p>Any help will be appreciated.</p><p>Thanks,Sana.</p>","402637","","","","","2011-02-07 22:48:04","How to set a Javascript-HTML variable from a Android code","<javascript><android>","2","1","1","",""
"3338235","1","","","2010-07-26 19:24:23","10","13191","<p>I am using the previewCallback from the camera to try and grab images. Here is the code I am using</p><pre><code>private Camera.PreviewCallback mPrevCallback = new Camera.PreviewCallback() {        public void onPreviewFrame( byte[] data, Camera Cam ) {                Log.d(""CombineTestActivity"", ""Preview started"");                Log.d(""CombineTestActivity"", ""Data length = ""                         + data.length );                currentprev = BitmapFactory.decodeByteArray( data, 0,                         data.length );               if( currentprev == null )                   Log.d(""CombineTestActivity"", ""currentprev is null"" );                Log.d(""CombineTestActivity"", ""Preview Finished"" );        }};</code></pre><p>the length of the data always comes otu the same as 576000. </p><p>Also I have tried changing the parameters of the camera so the image comes back as different formats. Here is what it looks like when I do that.</p><pre><code>mCamera = Camera.open();camParam = mCamera.getParameters();camParam.setPreviewFormat( ImageFormat.RGB_565 );mCamera.setParameters( camParam );    mCamera.setPreviewCallback( mPrevCallback );</code></pre><p>However both when I change the preview format and when I leave it as its default of NV21, BitmapFactory.decodeByteArray comes back as null. I have also tried changing the preview format to JPEG type. I even get a debug statement in the ddms, this is what I get</p><p>""D/skia    (14391): --- SkImageDecoder::Factory returned null""</p>","379220","","243782","","2010-07-27 11:00:56","2013-10-31 08:42:43","BitmapFactory.decodeByteArray() is returning NULL","<java><android><image><format><camera>","5","1","3","",""
"3338251","1","","","2010-07-26 19:26:38","0","10875","<p>I have a custom layout that draws a transparent rounded rectangle beneath its children. The problem is when I try to add it to my xml file, it doesn't show up. Also, when I try to add parameters to it (i.e. <code>android:layout_width</code>) the popup shows that none of them are available. The same thing happens to any child views I add. Can anyone help?</p><pre><code>public class RoundRectLayout extends LinearLayout {  private RectF shape; public RoundRectLayout(Context context) {  super(context);  LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);  layoutInflater.inflate(R.layout.settings, this);  shape = new RectF(); } public RoundRectLayout(Context context, AttributeSet attrs) {  super(context, attrs);  LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);  layoutInflater.inflate(R.layout.settings, this);  shape = new RectF(); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) {  shape = new RectF(0, 0, w - 5, h - 5);  super.onSizeChanged(w, h, oldw, oldh); } @Override protected void dispatchDraw(Canvas canvas) {  Paint temp = new Paint();  temp.setAlpha(125);  canvas.drawRoundRect(shape, 10f, 10f, temp);  super.dispatchDraw(canvas); }}</code></pre>","402666","","12388","","2010-08-10 18:00:47","2011-11-25 12:10:56","Writing custom LinearLayout for android","<android><android-layout>","3","0","","",""
"3338277","1","3425788","","2010-07-26 19:29:53","2","82","<p>Anyone knows how to build errors like that shown in <a href=""http://i.stack.imgur.com/NtOdW.png"" rel=""nofollow"">Androffice</a> screenshots on AppBrain ([http://www.appbrain.com/app/android.androffice][2])?   </p><p>I think that I saw errors like that before. Is that built in Android SDK?</p><p><img src=""http://i.stack.imgur.com/NtOdW.png"" alt=""enter image description here""></p>","202602","","202602","","2012-02-23 16:56:15","2012-02-23 16:56:15","how to build errors like that shown in Androffice screenshots","<android><validation>","2","0","1","",""
"3338347","1","3338388","","2010-07-26 19:38:05","0","3019","<p>I add a RadioButton in my layout. </p><p>It is unchecked to begin with. And when I click on it , it becomes checked (as shown in emulator). But when when i click on it again, it does not become unchecked again?</p><pre><code>&lt;RadioButton android:checked=""false""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:id=""@+id/option1""/&gt;</code></pre>","286802","","114066","","2010-07-27 07:33:40","2013-07-05 23:37:33","Radio Button does not toggle its state","<android>","4","1","","",""
"3338381","1","","","2010-07-26 19:43:27","1","1600","<p>I want to create a <code>Cursor</code>, which later I will pass via <code>CursorAdapter</code> to <code>AutoCompleteTextView</code> for autocompletion suggestions. The problem is that my SQL statement needs to select 2 different result sets from the same table, just sorted by different criteria. At the same time these result sets must not overlap - otherwise I would have multiple same suggestions. On MySQL, this would be quite easy: </p><pre><code>(SELECT field3 FROM table ORDER BY field1 ASC LIMIT 5)UNION(SELECT field3 FROM table ORDER BY field2 DESC LIMIT 10)LIMIT 10</code></pre><p>In this case I would have always up to 10 unique values. On SQLite, unfortunately, this is not the case - I cannot have limits on particular selects, just on the whole result set, which makes then UNION not useful for this case at all...</p><p>To solve this problem I've thought about making 2 queries separately: iterating through <code>Cursor</code> from 1st query and putting values into an <code>Array</code>, then iterating over <code>Cursor</code> from 2nd query and also putting values into the same array while checking and skipping already existing values in <code>Array</code> to avoid the duplicates. Then use <code>ArrayAdapter</code> to pass values to <code>AutoCompleteTextView</code>.</p><p>Theoretically this would work - but what I don't like that everything becomes more complex and much more code to write to solve such a simple task...</p><p>Is there maybe a better and easier way to do it?</p>","283037","","","","","2010-08-22 12:28:44","SQLite on Android: Union with limits alternative","<android><arrays><sqlite><cursor><union>","2","0","1","",""
"3338457","1","","","2010-07-26 19:52:19","0","189","<p>I have a tabhost with a number of tabs that all need access to the same service through out the life of the application. 'Best practice' suggests that you unbind services when pausing an activity, but this would mean disconnecting from the service, only to reconnect on selection of the next tab, which is daft (not least because my service maintains a connection to a server). I could store a reference to the service in the tabhost, but I don't know how to get a reference to the tabhost from its child activities. The alternative is to extend the <a href=""http://developer.android.com/reference/android/app/Application.html"" rel=""nofollow"">Application</a> class and manage the service there.</p><p>Does anyone have any better ideas or reasons why I shouldn't do either of the above?</p><p>Thanks</p>","146588","","","","","2010-07-27 10:54:58","Managing Android services in tabhosts or custom contexts?","<android>","1","0","","",""
"3338468","1","","","2010-07-26 19:54:10","1","213","<p>I defined a splashscreen the following way:</p><pre><code>/** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        ExceptionHandler.register(this);        setFullscreen();        splashScreen();    }private void splashScreen() {        runOnUiThread(new Runnable() {            @Override            public void run() {                setContentView(R.layout.splashscreen);                splash = (ImageView) findViewById(R.id.splashscreenLayer);                startSplashTime = new Date();            }        });        new LoadingThread().start();     }private class LoadingThread extends Thread {        @Override        public void run() {            checkNetwork();        }    }</code></pre><p>Somewhere at specific conditions in the checkNetwork() method, the stopSplash method is called:</p><pre><code>public void stopSplash() {        Message msg = new Message();        msg.what = STOPSPLASH;        Date endSplashTime = new Date();        long time = endSplashTime.getTime() - startSplashTime.getTime();        System.out.println(""Time Splashscreen was displayed: "" + time);        if (time &lt; SPLASH_MIN_TIME) {            long delay = SPLASH_MIN_TIME - time;            System.out.println(""Delay Splashscreen for: "" + delay);            try {                Thread.sleep(delay);            } catch (InterruptedException e) {                e.printStackTrace();            }            splashHandler.sendMessage(msg);        } else {            System.out.print(""Show Splashscreen now"");            splashHandler.sendMessage(msg);        }    }private Handler splashHandler = new Handler() {        @Override        public void handleMessage(Message msg) {            switch (msg.what) {                case STOPSPLASH:                    splash.setVisibility(View.GONE);                break;            }            super.handleMessage(msg);        }    };</code></pre><p>The problem is, sometimes (maybe 1 of 10) if I started the app directly from Eclipse, the Splashscreen isn't showed, but instead just a black screen.</p><p>Other problem: if i restart the app, e.g. after onDestroy() was called after clicking the back button on the device, the Splashscreen is almost never shown.</p><p>Any hints why?</p><p>My assumption: could it be, that the LoadingThread starts ""faster"" than the Runnable, and so the network staff is done before the Splashscreen is set?</p>","","anon","","anon","2010-07-26 20:08:26","2010-11-07 11:54:10","Splashscreen is only showed sometimes","<java><android>","2","0","1","",""
"3338516","1","3338701","","2010-07-26 20:00:05","7","4141","<p>I tried using this code to start multiple Activities from a parent activity:</p><pre><code>for (int i=0; i&lt;NUM_ACTIVITIES; i++) {    Intent intent = new Intent(this, MyActivity.class);    startActivity(intent);}</code></pre><p>However, according to my log in <code>MyActivity.onCreate()</code>, only 1 Activity was actually created. Is this behavior expected? If so, what's the proper way to launch multiple Activities?</p>","440093","","","","","2010-07-28 16:20:09","Android: Possible to start multiple instances of an Activity in same task?","<android>","1","1","1","",""
"3338577","1","4001922","","2010-07-26 20:07:13","4","3463","<p>When using <code>border-radius</code> on my android emulator I am seeing ugliness like this:</p><p><img src=""http://beautifulpixel.com/assets/5554_FastAndSmall-20100726-130326.png"" alt=""ugly border radius""></p><p>Is there anyway to get Android to display rounded corners via <code>-webkit-border-radius</code> in a more pleasing way?  Most modern desktop browsers and Mobile Safari seem to antialias their corners, but not Android's renderer.</p><p>I'm really hoping I don't have to do this with images, and there is some awesome trick to get pretty corners with only a border radius css declaration.</p>","62076","","","","","2012-08-22 17:05:09","Android WebView border-radius aliasing","<css><android><webview>","2","0","4","",""
"3338677","1","3339032","","2010-07-26 20:21:28","1","604","<p>I am making a time sheet program where a user inputs his in- and out-punches. I have a ListView that I am populating from an array of calendar objects. I would like each row to show the day and date then on a new line the time, but I only want to display the day and date if it is different from the previous element.</p><p>Currently, I am setting visibility in the BaseAdapter based on comparisons using position vs position-1 (which are used as indices to the array). This only works if the whole list fits on the screen. If it extends beyond the screen and the user scrolls around the results are unpredictable.</p><p>To further confuse things, I am setting the color of the times, based on the position, to alternate between green and red (in/out) and it works as expected, scrolling or not.</p><p><strong>How does Android handle the ListView position when scrolling or what could I do differently to show/hide the day and date?</strong></p><pre><code>public class TimeSheetActivity extends Activity {SQLiteDatabase timesDatabase;Cursor punchCursor;private static Calendar[] allPunches;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.timesheet);} //end onCreate()@Overridepublic void onResume() {    super.onResume();    //Open database    timesDatabase = openOrCreateDatabase(            ""times_database.db"",            SQLiteDatabase.CREATE_IF_NECESSARY,            null);    timesDatabase.setLocale(Locale.getDefault());    timesDatabase.setLockingEnabled(true);    timesDatabase.setVersion(1);    punchCursor = timesDatabase.query(""Timepunches"", null, null, null, null, null, ""punch ASC;"");    updateTimeSheet();} //end onResume()@Overridepublic void onPause() {    super.onPause();    timesDatabase.close();} //end onResume()private static class  EfficientAdapter extends BaseAdapter {    private LayoutInflater mInflater;    public EfficientAdapter(Context context) {        mInflater = LayoutInflater.from(context);    }    public int getCount() {        return allPunches.length;    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        ViewHolder holder;        if (convertView == null) {            convertView = mInflater.inflate(R.layout.time_list_row, null);            holder = new ViewHolder();            holder.text1 = (TextView) convertView.findViewById(R.id.day_textview);            holder.text2 = (TextView) convertView.findViewById(R.id.date_textview);            holder.text3 = (TextView) convertView.findViewById(R.id.times_this_day_textview);            convertView.setTag(holder);        }        else {            holder = (ViewHolder) convertView.getTag();        }        String dayNames[] = new DateFormatSymbols().getWeekdays();        //Initialize first list element        if (position &lt; 1) {            holder.text1.setText(dayNames[allPunches[position].get(Calendar.DAY_OF_WEEK)]);            holder.text2.setText(formatDate(allPunches[position]));        }        else {            holder.text1.setText(dayNames[allPunches[position].get(Calendar.DAY_OF_WEEK)]);            holder.text2.setText(formatDate(allPunches[position]));            holder.text1.setVisibility(View.VISIBLE);            holder.text2.setVisibility(View.VISIBLE);            //Hide day and date if same as last            if (formatDate(allPunches[position]).contentEquals(formatDate(allPunches[position-1]))) {                holder.text1.setVisibility(View.GONE);                holder.text2.setVisibility(View.GONE);            }        }        holder.text3.setText(formatTime(allPunches[position], true) + "" "" + position);        //Color in/out punches        if (position%2 == 0) {            holder.text3.setTextColor(Color.GREEN);        }        else {            holder.text3.setTextColor(Color.RED);        }        return convertView;    } //end getView()    static class ViewHolder {        public TextView text1;        TextView text2;        TextView text3;    }} //end EfficientAdapterpublic void updateTimeSheet() {    punchCursor = timesDatabase.query(""Timepunches"", null, null, null, null, null, ""punch ASC;"");    allPunches = new Calendar[punchCursor.getCount()];    int i = 0;                  //for indexing allPunches    Calendar nextDay = Calendar.getInstance();    nextDay.setLenient(true);    //populate allPunches    for (punchCursor.moveToFirst(); !punchCursor.isAfterLast(); punchCursor.moveToNext()) {        allPunches[i] = Calendar.getInstance();        allPunches[i].setTimeInMillis(punchCursor.getLong(0));        ++i;    } //end for    final ListView timeSheetListView = (ListView)findViewById(R.id.timesheet_listview);    timeSheetListView.setAdapter(new EfficientAdapter(this));    timeSheetListView.setOnItemClickListener(new OnItemClickListener() {...}); //end click listener for list item} //end updateTimeSheet()public static String formatTime(Calendar thisTime, boolean showAMPM) {...}public static String formatDate(Calendar thisDate) {    String formattedDate = """";    formattedDate += thisDate.get(Calendar.MONTH) +""-""+ thisDate.get(Calendar.DAY_OF_MONTH) +""-""+ thisDate.get(Calendar.YEAR);    return formattedDate;} //end formatDate()</code></pre><p>} //end TimeSheet Activity</p>","402682","","402682","","2010-07-27 19:05:59","2010-07-27 19:05:59","Dynamic display of ListView elements partially working","<java><android><listview>","2","0","0","",""
"3338753","1","3342823","","2010-07-26 20:32:46","0","329","<p>I have seen few apps having exact same UI when you access the app through stand alone app or through their mobile website. What are the pros and cons of both approaches while developing the app? </p><p>Edit - This is a general question. Not necessarily android. Iphone apps are also in similar categories. </p>","203018","","203018","","2010-07-26 20:47:40","2013-03-11 10:09:01","Mobile app and accessing app through mobile website in browser","<iphone><android><mobile>","3","0","","",""
"3338791","1","","","2010-07-26 20:38:18","1","457","<p>I'm working on a game that in some ways is similar to Tetris (imagine a 2D array of colored squares that sometimes move around)</p><p>I am trying to animate the individual squares so they will smoothly slide down from coordinate to the next. Since I wanted to use Android's built-in tweening feature, the animation has to apply to the whole View (rather than parts of it). This doesn't work well for me because I only want some of the colored squares to slide down, and the rest of them to stay still.</p><p>The (theoretical) solution I came up with to resolve this is to make 2 Views, layered directly on top of each other. The top view is for animating squares when they need to move, and the bottom layer is for the static squares. The animation-layer is transparent until I am ready to animate something. I then simply turn on the colored square in the animation-layer, tween it to the new location, and turn it back off when done. In the same time span, the static-layer just turns squares on and off at the right time to make the whole thing look seamless to the end user.</p><p>The proposed solution is just a theory, since I haven't been able to make it work correctly yet. Since I have been having trouble, I was wondering if this is even the best way to solve the problem? Perhaps there is a more elegant solution that I am over looking? Anyone know of a better way?</p>","135820","","","","","2010-07-26 21:55:19","How to animate views?","<android>","1","0","1","",""
"3338841","1","3338928","","2010-07-26 20:44:07","2","2780","<p>Support App starts activity A, then A starts activity B and finishes itself. After that activity B starts activity C.</p><p>Now the stack contains B and C, with C at the top. </p><p>Then I click a button in activity C, and want it to clear B and C and start activity A, i.e. I want activity A to be the only activity in the stack. How can I make it?</p><p>Thanks!</p><p>Edit: I made a test to use FLAG_ACTIVITY_CLEAR_TOP. But it didn't work in my case, because activity A is not running when button in activity C is clicked.</p>","256239","","256239","","2010-07-26 21:03:05","2010-07-26 21:11:13","How to clear current activities in the stack?","<android>","1","0","","",""
"3338887","1","3747874","","2010-07-26 20:49:19","2","880","<p>I would send two or more files using ACTION_SEND on Android as an excerpt below:</p><blockquote>  <p>Intent(android.content.Intent.ACTION_SEND);  emailIntent.setType(""plain/text"");   emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,  ""pokus"");   emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,  ""t"" );   emailIntent.putExtra(android.content.Intent.EXTRA_STREAM,</p>    <p><strong>emailIntent.putExtra(android.content.Intent.EXTRA_STREAM,  Uri.parse(""file:///sdcard/file1.jpg""));</strong></p>    <p><strong>emailIntent.putExtra(**android.content.Intent.EXTRA_STREAM,  Uri.parse(""file:///sdcard/file2.jpg""));</strong></p>    <p>startActivity(Intent.createChooser(emailIntent,  ""Send mail...""));</p></blockquote><p>But that code does not work with GMail, it attaches only the last file. Please helpThanks</p>","301132","","301132","","2010-07-26 20:58:42","2010-09-19 23:18:45","How to attach two or more files to SEND action on Android","<android><email>","1","0","1","",""
"3338952","1","3339648","","2010-07-26 20:57:53","0","1024","<p>Is there any way to start developing and working with the framework without getting access from Google ? </p>","302707","","302707","","2013-12-23 17:49:07","2013-12-23 17:49:07","Access to Android Cloud to Device Messaging android?","<android><cloud>","2","0","","",""
"3339390","1","5075891","","2010-07-26 22:12:59","7","2215","<p>I'm using a similar codesnippet as shown below to add an application shortcut on the homescreen:</p><pre><code>    Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);    shortcutIntent.setClassName(this, this.getClass().getName());    shortcutIntent.putExtra(EXTRA_KEY, ""ApiDemos Provided This Shortcut"");    // Then, set up the container intent (the response to the caller)    Intent intent = new Intent();    intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);    intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.shortcut_name));    Parcelable iconResource = Intent.ShortcutIconResource.fromContext(            this,  R.drawable.app_sample_code);    intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);    // Now, return the result to the launcher    setResult(RESULT_OK, intent);</code></pre><p>There is no problem with creating the shortcut, but when uninstalling the app, the shortcut remains on the homescreen. When uninstalling other apps they all seem to also remove their corresponding homescreen shortcuts. This is what i try to achive with my ""created-by-code-shortcut-icon""</p><p><strong>Does any of you Android experts here on Stackoverflow know whats needed to remove the app shortcut from the homescreen when the app is uninstalled ?</strong></p><p>I found some related threads, but they do not provide me the solution for my problem, but please feel free to catch up: </p><p>[0] <a href=""http://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/app/LauncherShortcuts.html"">http://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/app/LauncherShortcuts.html</a></p><p>[1] <a href=""http://stackoverflow.com/questions/972933/remove-application-from-launcher-programatically-in-android"">http://stackoverflow.com/questions/972933/remove-application-from-launcher-programatically-in-android</a></p><p>[2] <a href=""http://stackoverflow.com/questions/2131690/how-to-remove-application-shortcut-from-home-screen-on-uninstall-automaticaly"">http://stackoverflow.com/questions/2131690/how-to-remove-application-shortcut-from-home-screen-on-uninstall-automaticaly</a></p>","133858","","133858","","2010-07-26 22:25:41","2013-04-03 07:01:21","Application launcher icon is not deleted from Home screen when uninstalling android app","<android><icons><uninstall>","2","3","4","",""
"3339409","1","3368067","","2010-07-26 22:16:31","4","359","<p>What's the minimum memory needed to run a RAR decompression algorithm?</p><p>I want to port a RAR decompression algorithm to mobiles (iPhone, Android and BlackBerry) and want to know if there's a bare minimum of memory needed before starting. I've heard that RAR decompression requires much more memory than ZIP decompression.</p>","143378","","143378","","2010-07-26 23:36:19","2010-08-05 00:55:10","Minimum memory for RAR decompression","<iphone><android><memory><blackberry><rar>","3","0","2","",""
"3339449","1","","","2010-07-26 22:26:27","0","5060","<p>I would like to define a theme for my first Android app. I use Eclipse and I follow <a href=""http://www.androidengineer.com/2010/06/using-themes-in-android-applications.html"" rel=""nofollow"">this tutorial</a> but have problems. </p><p>Steps:</p><p>A. I create the values/styles.xml file with content</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;  &lt;style name=""default_splashScreen""&gt;    &lt;item name=""android:background""&gt;@drawable/bg&lt;/item&gt;  &lt;/style&gt;&lt;/resources&gt;</code></pre><p>B. I create the values/themes.xml file with content</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;  &lt;style name=""Theme"" parent=""android:Theme""&gt;    &lt;item name=""SplashScreen""&gt;@style/default_splashScreen&lt;/item&gt;  &lt;/style&gt;&lt;/resources&gt;</code></pre><p>Now Eclipse always complains about the item name=""SplashScreen"" node with the message ""No resource found..."". I just want SplashScreen to call default_splashScreen style.</p><p>What is wrong?Thx!</p>","132257","","","","","2010-07-27 09:56:29","Android creating themes and styles","<android><eclipse><themes><styles><styling>","2","1","1","",""
"3339691","1","3651110","","2010-07-26 23:22:44","1","1022","<p>I have a small test app on Android that is meant to test tracking multitouch input, but I am only ever getting two touches at the same time on my Evo.  Does anyone know if this is a limitation to Android or the hardware?</p><p>By the way, here's my test class so you can try it out yourself.</p><pre><code>import java.util.HashMap;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Paint.Style;import android.view.MotionEvent;import android.view.View;public class PressureView extends View{    private HashMap&lt;Integer, Spot&gt; mSpots = new HashMap&lt;Integer, Spot&gt;();    private final int[] mColors;    private final Paint mPaint;    public PressureView(Context context)    {        super(context);        mPaint = new Paint();        mPaint.setStyle(Style.FILL);        mColors = new int[]{Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW, Color.MAGENTA};    }    @Override    protected void onDraw(Canvas canvas)    {        super.onDraw(canvas);        canvas.drawColor(Color.WHITE);        for(int id : mSpots.keySet())        {            Spot spot = mSpots.get(id);            mPaint.setColor(spot.Color);            canvas.drawCircle(spot.X, spot.Y, spot.Pressure*500, mPaint);        }    }    @Override    public boolean onTouchEvent(MotionEvent event)    {        System.out.println(""************************** "" + event.getPointerCount() + "" Pointers"");        for(int i = 0; i &lt; event.getPointerCount(); i++)        {            int id = event.getPointerId(i);            Spot spot = null;            if(mSpots.containsKey(id))            {                spot = mSpots.get(id);            }            else            {                spot = new Spot();                spot.Color = mColors[mSpots.size()];            }            if(event.getAction() == MotionEvent.ACTION_UP) spot.Pressure = 0;            else spot.Pressure = event.getPressure(id);            spot.X = event.getX(id);            spot.Y = event.getY(id);            mSpots.put(id, spot);        }        invalidate();        return true;    }    private class Spot    {        public float X, Y, Pressure;        public int Color;    }}</code></pre>","236136","","","","","2010-09-06 11:36:58","Limit to number of touches on Android?","<android><multi-touch>","1","1","1","",""
"3339858","1","3340070","","2010-07-27 00:06:41","0","1607","<p>I'm new to this android world and I'm finding that eclipse 3.5.2 is crashing constantly.  There is no real rhyme or reason that I can see.  Sometimes the crash occurs with the layout manager, sometimes when I try to search, other times when I attach a debugger.</p><p>I thought that there might be log files that could help me track down the problem.  </p><p>Are there such things?</p><p>eclipse 3.5.2 with the latest android sdk.</p>","69983","","","","","2010-07-27 02:51:21","with eclipse 3.5.2 - android sdk - where are the log files from a crash","<android><eclipse><logging>","3","0","","",""
"3339870","1","3339974","","2010-07-27 00:11:35","10","11452","<p>I want to store some small but critical piece of information such as AES keys in my Android application. What would be the recommended way to do this? I do not want to hardcode keys as part of my application.</p><p>I look at <a href=""http://developer.android.com/reference/java/security/KeyStore.html"">KeyStore</a> but it does not really solve my problem. It can store my keys given that I can provide a password. Then I need to find a secure place to store this password which is same as my original problem.</p><p>Is there a built in Android class to perform this task? Or should I look for third party libraries? Using NDK is also acceptable for me.</p><p>Update:</p><p>I was hoping to find an Android API for storage such that guarantees that only the application that stored some information can retrieve it back. Android OS could have enforced this based on signing signatures of the application. This way my application can generate a random key on first run and store it in secure storage for later use. Are there any API for this?</p>","33885","","33885","","2010-07-27 03:09:27","2012-11-26 22:52:11","Android Secure Storage","<android><key-management>","2","1","3","",""
"3339875","1","3340260","","2010-07-27 00:13:29","1","320","<p>I have a simple app that allows the user to push a button that brings up the list of contacts.  They select the contact and the application then puts the phone number into an edit text control.  This all works like a charm.  </p><p>However, I notice that the phone number that is retrieved has 'punctuation' marks in it: 123.456.7890 or 123-456-7890 is returned verbatim with the dots and dashes included.</p><p>Is there a simple way to strip out non-numeric entry before displaying back to the user?</p>","69983","","","","","2010-07-27 01:55:59","With the android editText control is there a simple way to display only numbers?","<android><contacts><edittext>","1","0","","",""
"3339971","1","3340267","","2010-07-27 00:39:23","0","865","<p>So I have a simple socket server on an android emulator. When I'm only sending data to it, it works just fine. But then if I want to echo that data back to the python script, it doesn't work at all. Here's the code that works:</p><p>android:</p><pre><code>try {                serverSocket = new ServerSocket(port);            } catch (IOException e1) {                // TODO Auto-generated catch block                e1.printStackTrace();            }            while (checkingForClients) {                try {                    clientSocket = serverSocket.accept();                    out = new PrintWriter(clientSocket.getOutputStream(), true);                    in = new BufferedReader(new InputStreamReader(                            clientSocket.getInputStream()));                    line = null;                    while ((line = in.readLine()) != null) {                        Log.d(""ServerActivity"", line);                        /* THIS IS THE LINE THAT DOESN'T WORK*/                        //out.println(line);                        handler.post(new Runnable() {                            @Override                            public void run() {                                if(incomingData == null){                                    Log.e(""Socket Thingey"", ""Null Error"");                                }                                //out.println(line);                                incomingData.setText(""Testing"");                                incomingData.setText(line);                            }                        });                    }                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }</code></pre><p>python:</p><pre><code>import socket host = 'localhost' port = 5000size = 1024 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host,port)) s.send('Hello, World!') # data = s.recv(size) THIS LINE CAUSES PROBLEMSs.close() print 'Received:' , data</code></pre><p>So there are 2 commented lines. Without those lines, it works perfectly. But if I add in <code>s.recv(size)</code> in python it just freezes and I assume waits for the received data. But the problem is that the android code never gets the sent data. So I have no idea what to do.</p><p>Keep in mind I'm new to python and to sockets.</p>","375874","","","","","2011-11-24 15:41:07","python receiving from a socket","<java><python><android><sockets>","3","0","","",""
"3340104","1","3340204","","2010-07-27 01:14:23","1","4047","<p>Using DDMS I took a downloaded APK off my phone and unzipped it.</p><p>The PNGs look great, but when I try to read the XMLs their encoding is such that none of my text editors can read it (Word, Notepad, Visual Studio etc)</p><p>Is there something done to the XMLs in a APK that prevents us from reading them?</p>","172861","","","","","2013-06-09 20:09:50","Android XML Extracted from APK - Bad Encoding","<android><apk>","4","0","1","",""
"3340288","1","3340405","","2010-07-27 02:02:55","3","1117","<p>I was wondering if it is possible to customize the icon used for the More menu option (displayed when there are more than 6 menu options)? With the stock vanilla Android UI it appears as a disclosure-type arrow and on HTC Sense UI it's an ellipsis icon. Curious if these are fixed icons only defined in the Android resources or if there is a way to programmatically set them?</p><p>Any insight would be greatly appreciated!</p><p>Thanks!</p><p>Justin   </p>","182651","","","","","2010-07-27 02:38:47","Customizing the More menu button icon","<android><menu>","1","0","","",""
"3340446","1","3340583","","2010-07-27 02:58:19","1","1848","<p>My <code>main.xml</code> looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Since the root element is a <code>LinearLayout</code>, which extends <code>ViewGroup</code>, why does <code>main.xml</code> get turned into a <code>View</code> instead of a <code>ViewGroup</code>? For example, in my main <code>Activity</code> class, I try to get the number of subviews that the <code>LinearLayout</code> contains like this:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ViewGroup vg = (ViewGroup) findViewById(R.layout.main);    Log.v(""myTag"", ""num children: "" + vg.getChildCount());</code></pre><p>but it crashes when i call <code>vg.getChildCount()</code>.</p><p>What is the right way of doing it?</p>","316146","","","","","2010-07-27 03:42:31","Does /res/layout/main.xml describe a View or a ViewGroup?","<java><android><layout><view>","1","1","1","",""
"3340496","1","","","2010-07-27 03:15:11","3","460","<p>I have a native android library (.so) I am bundling with some application. In the native code I want to verify the signer/package name of the calling application.</p><p>The reason is, currently anyone can open up the .apk file take my .so file and use it to built their own applications.</p><p>Is there a way to securely identify the calling application from Java side? This could be package name, signature or anything else that can identify the Android application in a unique way.</p>","33885","","881229","","2014-03-18 22:59:25","2014-03-18 22:59:25","Identify Calling Application in Android NDK","<android><authentication><android-ndk>","1","0","","",""
"3340512","1","3340556","","2010-07-27 03:21:40","0","290","<p>My app force closes when I try to launch the same MapActivity from the HelloGoogleMaps tutorial. I am launching it from my main activity which is just a list:</p><pre><code>@Override    protected void onListItemClick(ListView l, View v, int position, long id) {        super.onListItemClick(l, v, position, id);        Intent i = new Intent(this, HelloGoogleMaps.class);        startActivity(i);    }</code></pre><p>HelloGoogleMaps works fine by itself and the class is in my manifest. I tried tracing the problem with the debugger and it crashes somewhere when create my Intent. Any ideas?</p><p>Thanks.</p>","398607","","","","","2010-07-27 03:31:37","Problem launching a MapActivity","<android>","1","1","","",""
"3340552","1","3340782","","2010-07-27 03:29:52","2","490","<p>I'm writing a custom ContentProvider that serves up content consisting of a single, constant string which I represent as a one-row table having columns _id = 0 and value = ""SomeString"".  This string is not stored in a database, so I developed a subclass of CrossProcessCursor that has does everything required to behave like what I described above.</p><p>The documentation for CrossProcessCursor is very sparse and doesn't really explain what the fillWindow() method should be doing beyond the obvious.  Based on the descriptions of CursorWindow's methods, I put the following together, which I thought should cover it:</p><pre><code>public class MyCursor implements CrossProcessCursor {  ...  public void fillWindow(int pos, CursorWindow window) {        if (pos != 0) {  // There's only one row.            return;        }        window.clear();        window.allocRow();  // TODO: Error check, false = no memory        window.setNumColumns(2);        window.setStartPosition(0);        window.putLong(0, 0, 0);        window.putString(""SomeString"", 0, 1);    }}</code></pre><p>As expected, it gets called with pos = 0 when a client application requests the content, but the client application throws an exception when it tries to go after the first (and only) row:</p><pre><code>Caused by: java.lang.IllegalStateException: UNKNOWN type 48     at android.database.CursorWindow.getLong_native(Native Method)     at android.database.CursorWindow.getLong(CursorWindow.java:380)     at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:108)     at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:194)     at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:248)     at android.database.CursorWrapper.moveToFirst(CursorWrapper.java:86) ...(Snipped)...</code></pre><p>Could anyone shed some light on what this method should be doing to return a correct-looking row to the client?</p><p>Thanks.</p>","180674","","180674","","2010-07-27 03:48:39","2010-07-27 04:40:23","What to do in custom ContentProvider's fillWindow() method?","<android><android-contentprovider>","1","0","1","",""
"3340557","1","","","2010-07-27 03:31:39","2","478","<p>Why does code within a fully qualified tag lack auto-completion in Eclipse? </p><p>For example, within the following code (where the comment is) nothing I type is provided auto completion for member names / tag names. </p><pre><code>&lt;android.gesture.GestureOverlayView   android:id=""@+id/gesturePage01""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:layout_weight=""1.0""&gt;  &lt;!-- All code entered here lacks code completion --&gt;&lt;/android.gesture.GestureOverlayView&gt;</code></pre><p>Autocompletion works fine on my other code which is not embedded within a tag which is fully qualified...</p>","268803","","","","","2011-07-20 19:09:52","No code completion in XML code within fully qualified tag","<android><xml><eclipse><layout>","2","1","2","",""
"3340631","1","","","2010-07-27 03:52:34","1","309","<p>When I compile my app with Level 8 API and SDK 6, my app icon cannot not be found and the default android icon is shown instead. However, once I use level 4 API, i can see my icon on the screen. Does anyone know the solution? </p>","278528","","","","","2010-07-27 03:52:34","Android SDK v6 Level 8 API icon","<android><sdk><icons>","0","1","","",""
"3340666","1","","","2010-07-27 04:02:50","2","434","<p>I want to automate some of my functional test cases on android , can I use Android scripting environment and use Python / Perl to automate my functional test cases?</p><p>Thanks</p><p>AD</p>","402939","","","","","2010-10-30 13:37:14","Can we use android scripting environment for functional test automation?","<android><automation><ase>","0","2","","",""
"3340721","1","3378367","","2010-07-27 04:23:33","8","1283","<p>I am opening a facebook login page in <code>WebView</code> when user select login field soft keyboard appears. I would like to have a done key button on the soft keyboard, how to do it?</p><p>I know we can add the done button by the following code attached with edit field</p><pre><code>ediText.setImeOptions(EditorInfo.IME_ACTION_DONE);</code></pre><p>But it is HTML form in <code>WebView</code> any clue how to do that?</p>","216431","","244296","","2010-07-31 13:54:53","2010-08-13 03:10:16","Android HTML form 'done' button sofkeyboard","<android><softkeys>","1","2","3","",""
"3340781","1","","","2010-07-27 04:40:00","6","521","<p>I want to check if my application is set as the default application for the Intents I'm handling inside my App. </p><p>As an example ff more than one application supports to open a specified file format. I need to make my application as a default application from my code. How it possible to make my application a default (from the code)? Can anyone help me? </p><p>At least I would like to check this on startup of my app and redirect the user to fill in some information if my App is not set as the default on the device. </p>","380019","","114066","","2010-07-27 09:24:14","2012-06-05 06:50:01","How to check if my application is set default or not in android?","<android>","2","3","2","",""
"3340847","1","","","2010-07-27 04:57:16","2","2843","<p>I have subclassed the SurfaceView and instantiating it in onCreate of the Activity. The preview is generated but the control never enters onDraw() which is overriden in the subclass of SurfaceView. Why is that?</p><pre><code>class ActivityClass extends Activity{    onCreate(){        mPreview = new Preview(this);        setContentView(mPreview);    }    public void startPreview(){        rec = new MediaRecorder();        rec.setVideoSource();.......        rec.setPreviewDisplay(mPreview.getSurfaceHolder.getSurface());    } }class Preview extends SurfaceView implements SurfaceHolder.Callback{    SurfaceHolder mHolder;    public Preview(Context context){        super(context);        mHolder = getHolder();             mHolder.addCallback(this);              mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);         bringToFront();//this is not        invalidate();//making a difference    }    SurfaceHolder getSurfaceHolder(){        return mHolder;    }    //Surface callback methods implemented here}</code></pre><p>Before drawing the preview on the Surface, shouldn't the control be given to the onDraw callback if it is implemented? </p><p>Because onDraw callback says to the Android framework 'you don't draw the view. I will draw it since I have been implemented'. Am I right? </p><p>Why then, is the control failing to enter onDraw()? Please help.</p>","381699","","802724","","2011-07-24 19:35:20","2014-02-10 05:53:28","subclassing SurfaceView and overriding onDraw() to change SurfaceView parameters to generate preview of desired size","<android><view><preview><surfaceview><ondraw>","3","0","1","",""
"3340931","1","3341033","","2010-07-27 05:16:31","2","877","<p>I'm having difficulty getting my main View's onKey event to trigger.  I'm not sure what I'm doing wrong, I have correctly implemented the onClick event but cannot seem to figure out the onKey event.</p><p>Here's the relevant code:</p><pre><code>public class MyActivity extends Activity {    private RelativeLayout main;    private ApplicationToolbar toolbar;    public void onCreate(Bundle savedInstanceState) {        ...        this.main = (RelativeLayout) this.findViewById(R.id.main);        this.toolbar = new ApplicationToolbar(this);        //  toolbar is added to main later on in the code...        this.main.setOnClickListener(mClickListener);        this.main.setOnKeyListener(mKeyListener);    }    private OnClickListener mClickListener = new OnClickListener() {        public void onClick(View v) {            toolbar.setVisibility(View.VISIBLE);    // Works correctly.        }    };    private OnKeyListener mKeyListener = new OnKeyListener() {        public boolean onKey(View v, int keyCode, KeyEvent event) {            toolbar.setBackgroundColor(0xFF0000FF);    //  Does not work.            return true;        }    };}</code></pre><p>In fact, no matter what code I put within mKeyListener it does not execute, which leads me to believe that the event itself is never being triggered, even when I pressed a bunch of keys on my physical keyboard (Motorola Droid, Android 2.1).</p>","384386","","119895","","2010-07-27 05:38:47","2010-07-27 05:44:05","Trouble triggering onKey event with Android","<java><android><key><listener>","1","0","","",""
"3340942","1","","","2010-07-27 05:19:35","5","3496","<p>I am trying to generate Javadoc html pages for my Android project in Eclipse. I have tried using the <code>-linkoffline</code> argument, as <a href=""http://stackoverflow.com/questions/2818204/how-to-generate-links-to-the-android-classes-reference-in-javadoc"">suggested here</a>, as well as using the <code>-classpath</code> argument pointing to my android.jar file. Neither of these worked, as I still get <code>package android.app does not exist</code> (and other) warnings. I have also tried running the javadoc tool from the command line, rather than using Eclipse.</p><p>Ideally I would like to have my own generated pages for my classes, with all android.* and java.* classes linking to the online pages. I am using Mac OS 10.6 with Java version 1.6.0_20.</p>","2359478","user370382","2359478","","","2011-09-13 15:17:55","Javadoc on Android (Eclipse)","<java><android><eclipse><osx><javadoc>","2","0","1","",""
"3341002","1","","","2010-07-27 05:35:52","1","736","<p>I have an <code>AbsoluteLayout</code> xml:</p><pre><code>&lt;AbsoluteLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/MeasureAbsLayout""    android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;    &lt;ImageView android:id=""@+id/MeasureImageView""        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""&gt;    &lt;/ImageView&gt;    &lt;RelativeLayout    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;        &lt;Button android:text=""Previous""             android:layout_height=""wrap_content""             android:id=""@+id/MeasurePrev""                       android:layout_alignParentBottom=""true""            android:layout_width=""wrap_content""&gt;        &lt;/Button&gt;        &lt;Button android:text=""Result""            android:layout_height=""wrap_content""             android:id=""@+id/MeasureResult""                     android:layout_alignParentRight=""true""            android:layout_alignParentBottom=""true""            android:layout_width=""wrap_content""&gt;        &lt;/Button&gt;    &lt;/RelativeLayout&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>I want to implement <code>AbsoluteLayout</code>'s <code>onScrollChanged</code> in my <code>Activity</code> class.</p><p>How can I implement this?</p>","385343","","119895","","2010-07-27 06:16:10","2010-07-27 06:16:10","Implement onScrollChanged Event","<android>","0","2","1","",""
"3341014","1","","","2010-07-27 05:39:33","0","3605","<p>How can installed Adobe flash player 10.1 on Android simulator 2.2?</p>","402987","","53212","","2010-07-27 06:13:56","2012-11-18 21:48:47","Install Adobe flash player 10.1 on Android 2.2","<android><android-emulator><flash-player><android-sdk-2.2>","2","0","","",""
"3341028","1","3341051","","2010-07-27 05:42:56","3","654","<p>I have a Button that I am using 13 times in my Android application's main.xml file. I would like to have the XML for it defined once, so that I can make changes in one place instead of 13. Each of the 13 instances needs to have its own ID, though. What should I do to simplify my XML? I've tried using <code>&lt;include&gt;</code> but it hasn't worked for me. I must have been doing something wrong. I'd appreciate it if anyone could show me how to do it correctly. Thanks.</p><p>Here's the XML for the button that I'd like to reuse:</p><pre><code>&lt;Button  android:width=""70dp""   android:layout_marginLeft=""10dp""  android:layout_marginRight=""10dp"" /&gt;</code></pre>","65180","","1470567","","2012-07-19 15:49:52","2012-07-19 15:49:52","How can I reuse this Android button?","<android><xml><button>","1","2","1","",""
"3341078","1","3341140","","2010-07-27 05:56:29","7","3542","<p>I have an application that sends messages to a specified contact. Right now I use</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(""smsto:"" + phoneNumber));</code></pre><p>to send messages, and it works great on the emulator and on my N1. I got complaints from users with HTC incredible that they get force close from android.mms application when they use it. I did more digging and I see there are many ways for sending messages. For example</p><pre><code>Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse(""smsto:"" + phoneNumber));</code></pre><p>And also</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);intent.putExtra(""address"", phoneNumber);intent.setType(""vnd.android-dir/mms-sms"");</code></pre><p>They all seem to work exactly the same on the emulator and on my device, and I could not find anything official about the correct, generally supported way. Any ideas?</p>","329611","","","","","2012-02-08 14:59:58","what is the difference between ACTION_SENDTO and ACTION_VIEW when sending sms?","<android>","2","2","1","",""
"3341111","1","","","2010-07-27 06:04:57","0","3112","<p>I want to parse REST Webservices with the help of JSON. Plz help me by giving sample code how to parse the rest webservices xml in android through JSON</p>","403007","","21234","","2011-04-22 13:53:14","2011-04-22 13:53:14","sample code to parse data through JSON in android","<android><json>","2","0","2","2013-12-03 11:47:51",""
"3341176","1","3341315","","2010-07-27 06:22:54","3","588","<p>Some Android devices don't have Android Market, like Korea, etc. </p><p>Is it possible to detect the existence of Android Market at runtime? </p><p>I know I can try to open a market uri first to see if there is any exception thrown. But I don't think this is a wise approach.</p>","372859","","","","","2011-01-06 22:08:55","How to detect the existence of Android Market on devices?","<android><google-play>","2","0","3","",""
"3341311","1","3341775","","2010-07-27 06:56:37","5","7849","<pre><code>&lt; RelativeLayout    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;        &lt; Button android:text=""Previous""             android:layout_height=""wrap_content""             android:id=""@+id/MeasurePrev""                       android:layout_alignParentBottom=""true""            android:layout_width=""wrap_content""&gt;        &lt; / Button&gt;&lt; / RelativeLayout &gt;</code></pre><p>Can anyone tell me how can i do this using Java code or in activity class?I do not know how to set android:layout_alignParentBottom=""true"".I want to implement whole view via java code.</p>","385343","","114066","","2010-07-27 07:23:06","2010-07-27 08:17:43","How to position a Button in a RelativeLayout through code?","<android><layout>","1","0","3","",""
"3341336","1","3341394","","2010-07-27 07:00:39","4","739","<p>Say I have two Activities in an Android application, <code>EditPerson</code> and <code>EditEmployee</code>. </p><p>It would seem natural to have the <code>EditPerson</code> Activity be a base class for the <code>EditEmployee</code> Activity and define methods that marshal data to and from the Views defined in the layout. The <code>EditPerson</code> Activity's implementation would push (for example) the ""Name"" field to and from an <code>EditText</code> element. The <code>EditEmployee</code> versions would call the base class version, and then marshal its own specialized fields (say a tax id, etc.).</p><p>To facilitate the shared code, both activities would have to have a layout resource that defines one or more pairs of <code>EditText</code> elements that share the same id. i.e. in <code>layout\edit_person.xml</code> there would be:</p><pre><code>&lt;EditText android:id=""@+id/name_editor"" /&gt;</code></pre><p>And then in <code>layout\edit_employee.xml</code>there would be something like:</p><pre><code>&lt;EditText android:id=""@+id/name_editor"" /&gt;&lt;EditText android:id=""@+id/tax_id_editor"" /&gt;&lt;!-- etc. --&gt;</code></pre><p>Since the ""Employee"" is a ""Person"", and there are fields in common (marshaled via inheritance), it would seem as if the id assigned (""name_editor"" in the above example) only has to be unique within the scope of an activity (or layout?). </p><p>From my testing, this appears to work, but I am paranoid that there would be a unintentional side effect to this approach and use of ambiguous layout element ids. Can anyone confirm that this is a safe practice and/or point out how it will eventually blow up my application? Has anyone ever done similar things?</p>","8668","","","","","2010-07-27 07:09:44","Can an Android View's id be safely shared across multiple Activities?","<android><inheritance><layout><view><ambiguity>","1","0","","",""
"3341455","1","","","2010-07-27 07:20:15","0","671","<p>I'm working on an Android app that requires the use of two (or more) ListView's positioned next to each other. I am at the moment using Android 1.6 and running in an emulator. I was able to successfully implement the basics with two ListView's as shown in the first image:</p><p><img src=""http://i27.tinypic.com/2h7i7v9.png"" alt=""alt text""></p><p>However I need some help in the navigation (with the directional keys) across the lists. The default behavior is that if I am for example in the 4th item in the first list (as seen in first the image) and I move to the right, my 'expected position' in the second list would be the 4th item as well. It does this fine but it will always scroll that item until it's the first visible child of the list (see second image).</p><p>Is there a way to prevent ListView from automatically scrolling the list? I still want it to focus on the row closest to the selected row in the previous list.</p>","245642","","","","","2010-07-27 07:20:15","Navigating Two (or More) ListView's Next to Each Other","<android><listview><scrolling><focus>","0","4","","",""
"3341463","1","","","2010-07-27 07:21:43","1","1412","<p>I want to read the phone number and name using Android. I used the following code. It can only read phone name. How can I read phone number. I am very new in Android. Could any one hlep plz.</p><pre><code>ContentResolver cr = getContentResolver();Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);if (cur.getCount() &gt; 0) {   while (cur.moveToNext())     {       String id = cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID));       String name = cur.getString(  cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));                      if (Integer.parseInt(cur.getString(cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0)    {          Cursor pCur = cr.query( ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID +"" = ?"", new String[]{id}, null);            while (pCur.moveToNext())             {               String lnumber = cur.getString( cur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));            }         pCur.close();    }                      }</code></pre><p>Thanks in advance.</p>","403066","","12388","","2010-07-27 07:28:53","2012-01-24 13:34:02","How to read contact number using Android","<android>","2","1","1","2012-06-25 11:38:18",""
"3341489","1","3342020","","2010-07-27 07:26:57","2","1307","<p>How can i close the browser once i got redirected to my app. Is there any way to do this?</p>","196579","","114066","","2010-07-27 07:30:45","2010-07-28 09:12:48","How to close android browser after redirecting to my app?","<android>","3","1","","",""
"3341702","1","3341753","","2010-07-27 08:07:13","16","11897","<p>My IM app has to support emoticons. They are GIFs and have textual representations, which are used in the input box if the user selects one of them. But I'd like to display them as images after they have been sent.Currently my custom array adapter displays the sent message in a TextView of a row.</p><p>What is the proper method to display images dynamically based on the occurrence of their textual representation? Do I have to search for emoticon texts, and if one found, remove the TextView from the layout (relativeLayout fits most?) and add a TextView with the beginning of the IM, an ImageView with the emoticon and another TextView. If more emoticons sent simultaneously it can be messy.</p><p>Is there an easier and more logical way?</p>","387484","","194894","","2013-09-13 13:15:31","2013-09-13 13:15:31","Displaying emoticons in Android","<android><dynamic><imageview><emoticons>","2","1","25","",""
"3342564","1","","","2010-07-27 10:12:29","3","2106","<p>I have a transparent listview with a image as background. Now, i want the scrollbar as transparent too, i.e I must be able to see the background image through this scrollbar too. Pls help!!!</p>","403241","","","","","2012-06-02 08:40:59","How to create a transparent scrollbar in android?","<android>","3","0","","",""
"3342633","1","4334663","","2010-07-27 10:24:50","1","5137","<p>I reuse an AlertDialog box in my android app. </p><p>I create a dialog in the onCreateDialog() method and in the onPrepareDialog() method, I try to change the text of the positiveButton using the following code.</p><pre><code>alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, this.getString(R.string.add), new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dialog, int id) {          //Handler code    }}</code></pre><p>The onclick listener is getting changed, but the button text is not changed.</p><p>Is it a bug in Android or am I doing something wrong?</p>","24949","","","","","2010-12-02 11:52:49","Android - Change the text of the positive button of an AlertDialog","<android><alertdialog>","2","0","","",""
"3342655","1","","","2010-07-27 10:29:23","2","1491","<p>From my application i have to open a another one application.Is there any possibility to open like this?</p>","398981","","","","","2012-06-29 13:37:51","Open another one application from our application?","<android>","3","1","1","",""
"3342739","1","3343050","","2010-07-27 10:40:07","49","63066","<p>I currently have an Android project in Eclipse.</p><p>I created it with a target build of 1.5 (sdk 3).</p><p>Now I want to change it so that it has a minSdk of 3 and targetSdk of 8.</p><p>To do this I see that I must build against the newest SDK (2.2)</p><p>To do this in Eclipse I right click on my project, go to properties, click on Android and change the project build target to Android 2.2 and click apply and then ok.</p><p>However this appears to have no affect and when I try it again the target build is set back at Android 1.5.</p><p>Am I missing a step or something?</p>","243999","","","","","2014-02-07 21:53:35","How to change target build on Android project?","<android><build><target>","9","0","14","",""
"3342818","1","3342901","","2010-07-27 10:49:24","7","3907","<p>I have 2 android applications that share 95% of their resources, layouts, strings etc. only a few jpg's are different.</p><p><strong>How can I share resources between the different Eclipse Android projects, so as to avoid resource duplication ?</strong></p>","77115","","243782","","2010-07-27 11:04:37","2012-09-24 17:31:30","How can I share resources between the different Eclipse projects, so as to avoid duplication?","<java><android><eclipse>","3","0","4","",""
"3342939","1","","","2010-07-27 11:06:26","0","1071","<p>hello frenz   i wanted to use android for developing mobile app.i have installed eclipse an java jdk and jre according to the steps given on android.developer site but i cant see the hello world application on emulator.I hav tried ample of ways but its not wrkin.I have vista home 32 bitPlease help me.</p>","403289","","","","","2010-07-27 11:12:13","Android app not running on emulator","<android>","2","3","","",""
"3343202","1","","","2010-07-27 11:40:29","0","895","<p>I want to filter the ListView which containing both contact name and phone number...</p><p>how do i filter the list.....please provide me the code(mainly for the filtering code)</p>","403322","","","","","2010-09-18 18:30:10","Filtering The ListView(containing contact name and phone number)","<android>","1","1","","",""
"3343223","1","3343491","","2010-07-27 11:43:07","0","411","<p>Is it possible to display tab buttons at bottom, rather than top? I need to port an application, which was originally designed on iPhone, where the default ""tab"" buttons are at the bottom.</p>","403324","","263521","","2010-07-27 14:33:28","2010-07-27 14:33:28","TabWidget buttons","<android><tabwidget>","1","0","","",""
"3343432","1","3343531","","2010-07-27 12:08:42","5","8899","<p>I want to launch a specif application. I know how to do Intents but I want to avoid the selection menu if there are multiple apps that can handle the intent, i want to go directly to a particular app. Hope this makes sense. </p>","329034","","","","","2012-06-29 13:42:06","How do I programmatically launch a specific application in Android?","<android>","4","1","1","",""
"3343490","1","3343505","","2010-07-27 12:16:02","1","2574","<p>I have a little problem, I hope U can help me;)</p><p>Trouble is, that ProgressDialog show only after loading run(), but I need to show it on start and showing it while loading some data. I put: ""dialog = ProgressDialog.show(CategoriesListActivity.this,""Working..."",""Loading data"", true);"" in method run(), but the same. I print in Log.i() some info (int i++) and put title of ProgressDialog. Method work correctly, but don't show ProgressDialog. I have read some info that some thread block another thread (my created), that's why doesn't show progressDialog, but can't do anything. Thx.</p><pre><code>    public void run() {        /** getting there long execution **/        handler.sendEmptyMessage(0);    }    private Handler handler = new Handler() {        @Override        public void handleMessage(Message msg) {            // stop and hide dialog            dialog.dismiss();        }    };    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.list_        dialog = ProgressDialog.show(CategoriesListActivity.this, ""Working..."",                ""Loading data"", true);        // start new thread where get long time execution        Thread thread = new Thread(this);        thread.start();        //wait while data is loading, 'cause I need use variable from calculation                // in ""EfficientAdapter"" later        try {            thread.join();        } catch (InterruptedException e) {            e.printStackTrace();        }        ListView l1 = (ListView) findViewById(R.id.list);        l1.setAdapter(new EfficientAdapter(this));    }</code></pre>","403340","","403340","","2010-07-27 16:35:49","2011-02-03 10:19:08","ProgressDialog working in thread on android","<java><android>","2","0","","",""
"3343542","1","","","2010-07-27 12:23:08","2","3270","<p>i am new to android and need simple http connection codes for client server(local server in the network) communication in android application.the connection starts when the application is started and if there is any update in the server it should be notified on the client and the server response must be based on the client request.please help.thanks</p>","402980","","","","","2010-12-29 11:19:51","need server client connection code in android application","<android>","1","0","4","",""
"3343794","1","3343932","","2010-07-27 12:54:23","2","1429","<p>The following is giving me triangles not squares, anyone know why??</p><pre><code>    //Defining as...        addcube(2,-2, 1, -1, 10);        addcube(float lx, float hx, float ly, float hy, floathz){            final float array1[] = new float[] {            //Front face            lx, ly, hz,            lx, hy, hz,            hx, hy, hz,            hx, ly, hz    }; }    //Drawing as...    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;</code></pre><p>I've attempted adding <code>gl.glDisable(GL10.GL_CULL_FACE);</code> but that just puts the remaining square in the foreground. I've included the draw methods...</p><pre><code>public void onDrawFrame(GL10 gl) {    onDrawFrameCounter++;    gl.glEnable(GL10.GL_TEXTURE_2D);    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    bindCameraTexture(gl);    System.out.println(Global.bearing);    float bear = Global.bearing;    gl.glLoadIdentity();    gl.glNormal3f(0,0,1);    System.out.println(""ARRAY!: "" + GLCamTest.array.length);    p = 0;    gl.glRotatef(bear, 1, 0, 0);    int e = 0;      for(int q=0; q &lt; Global.cubes;q++){    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;    }}public void onSurfaceChanged(GL10 gl, int width, int height) {    gl.glViewport(0, 0, width, height);    float ratio = (float) width / height;    gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glLoadIdentity();    gl.glFrustumf(-ratio, ratio, -1, 1, 1, 20);    gl.glMatrixMode(GL10.GL_MODELVIEW);}public void onSurfaceCreated(GL10 gl, EGLConfig config) {    gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);    gl.glClearColor(0, 0, 0, 0);    gl.glDisable(GL10.GL_CULL_FACE);    gl.glShadeModel(GL10.GL_SMOOTH);    gl.glEnable(GL10.GL_DEPTH_TEST);    cubeBuff = makeFloatBuffer(GLCamTest.array);    texBuff = makeFloatBuffer(camTexCoords);                    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, cubeBuff);    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, texBuff);    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);}</code></pre>","358438","","358438","","2010-07-27 13:04:50","2012-09-29 19:38:57","Rendering a square","<android><opengl-es>","3","0","1","",""
"3343880","1","","","2010-07-27 13:04:14","0","781","<p>I have a customized <code>Cursor</code> based adapter for my <code>ListView</code>.  Each <code>Cursor</code> has a few columns of data, sorted by the priority column.</p><p>I know you can create a disabled list item to act as a sort of header, like in the Market app (the little green labels).</p><p>What I would like to do is display a header for each group of items with a different priority.  They are already sorted by priority.</p><p>Example data:</p><pre><code>title, prioritynote1, highnote3, highnote2, lownote4, low</code></pre><p>Example of what I want in <code>ListView</code>:</p><pre><code>===High Priority====-note1-note3===Low Priority=====-note2-note4</code></pre><p>Any ideas on how I could do this?</p>","131871","","","","","2011-09-01 11:11:12","How to create ListView disabled item labels for sections of list items?","<android><database><listview>","2","1","","",""
"3343912","1","","","2010-07-27 13:08:34","12","11645","<pre><code>&lt;LinearLayout android:id=""@+id/svLL"" android:orientation=""horizontal""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;ScrollView android:id=""@+id/sv""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        xmlns:android=""http://schemas.android.com/apk/res/android""&gt;        &lt;!--            &lt;TextView android:layout_width=""match_parent""            android:layout_height=""wrap_content""            android:text=""@string/scrollbar_2_text"" /&gt;        --&gt;        &lt;com.mypackage.MyDrawableView            android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre><hr><pre><code>public class MyDrawableView extends View {    Context thisContext;    public MyDrawableView(Context context, AttributeSet attr) {        super(context);        thisContext = context;    }    @Override    protected void onDraw(Canvas canvas) {        super.onDraw(canvas);        final Paint paint = new Paint();        paint.setColor(Color.BLUE);        paint.setTextSize(12);        canvas.drawText(""Blah blah"", 0, 100, paint);    }}</code></pre><hr><pre><code>public class MyActivity extends Activity {    // Your member variable declaration here    // Called when the activity is first created.    @Override    public void onCreate(Bundle savedInstanceState) {        // Your code here super.onCreate(savedInstanceState);        setContentView(R.layout.xmllayout);        LinearLayout svll = (LinearLayout) findViewById(R.id.svLL);        svll.setLayoutParams(new LinearLayout.LayoutParams(300, 300));    }} </code></pre><p>I am putting a breakpoint, but breakpoint is never hit inside <code>onDraw()</code> method, what's wrong ?</p>","384185","","905906","","2012-05-06 07:56:07","2013-01-29 08:14:18","Custom onDraw() method not called","<android><drawing>","6","6","3","",""
"3344205","1","3344805","","2010-07-27 13:38:24","0","770","<p>I am following an example project ""Sky"" by Jeff Sharkey using styles in my layout.  It is working out quite well, however, I cannot determine how to specify the font type-face using the styles.  Without this, I will have to apply the font explicitly to every TextView, EditView, etc., whereas I want to control where and when it is applied throughout my application.</p>","157804","","","","","2011-09-12 18:47:10","Can one specify the fontType in android styles xml?","<android><styles><font-face>","2","0","","",""
"3344256","1","","","2010-07-27 13:44:23","11","4844","<p>I'm using addJavascriptInterface within my Android application to allow JavaScript to invoke functions I've created in my native Java application.</p><p>This worked well in Android 2.1, however in Android 2.2 I receive the error message ""Error calling method on NPObject!""</p><p>When I instrument the method call the internals of the native method are getting called, however the exception is being throw in JavaScript.</p>","2723","","","","","2013-05-30 14:35:42","Error calling method on NPObject! in Android 2.2","<android><android-webview>","6","1","1","",""
"3344401","1","3344724","","2010-07-27 14:01:03","2","1392","<p>I have built an activity to handle gestures in my Android game and want it to respond to a gesture anywhere on the screen but I am getting this error on the Log:</p><pre><code>07-27 13:55:07.268: ERROR/AndroidRuntime(751): java.lang.NullPointerException07-27 13:55:07.268: ERROR/AndroidRuntime(751):     at android.app.Activity.findViewById(Activity.java:1637)07-27 13:55:07.268: ERROR/AndroidRuntime(751):     at com.darius.android.distractions.DistractionsView$DistractionsThread$GestureActivity.onCreate(DistractionsView.java:282)07-27 13:55:07.268: ERROR/AndroidRuntime(751):     at com.darius.android.distractions.DistractionsView$DistractionsThread.doStart(DistractionsView.java:559)07-27 13:55:07.268: ERROR/AndroidRuntime(751):     at com.darius.android.distractions.DistractionsView$DistractionsThread.doKeyDown(DistractionsView.java:829)07-27 13:55:07.268: ERROR/AndroidRuntime(751):     at com.darius.android.distractions.DistractionsView.onKeyDown(DistractionsView.java:1278)</code></pre><p>I understand I need to allocate a view to the activity and as you will see in my XML, a view called gestures will serve this purpose but I keep getting Inflation errors when trying to inflate the view. Before when this happened to me it was a misspelling of the view name in the XML but that's not it this time I don't think. </p><p>How would I properly assign the 'gesture' view to this activity to prevent the errors?</p><p>I do hope someone knows the answer and can help me!! Many thanks</p><p>I have defined my activity in my code like this:</p><pre><code>public class GestureActivity extends Activity implements GestureOverlayView.OnGesturePerformedListener{        public void onCreate(Bundle savedInstanceState){        GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures);        gestures.addOnGesturePerformedListener(this);            Log.w(getClass().getName(), ""GESTURE ACTIVITY CREATED"");                // Load the gesture library                Log.w(getClass().getName(), ""LOADING GESTURE LIBRARY"");                mLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures);                if(!mLibrary.load()){                    finish();                }            /*          GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures);        gestures.addOnGesturePerformedListener(this);        Log.w(getClass().getName(), ""GESTURE ACTIVITY CREATED"");        */        }        public void onStart(){            //I replicated the code here from onCreate but will change this!!GestureOverlayView gestures = (GestureOverlayView) findViewById   (R.id.gestures);            gestures.addOnGesturePerformedListener(this);            Log.w(getClass().getName(), ""GESTURE ACTIVITY CREATED"");                // Load the gesture library                Log.w(getClass().getName(), ""LOADING GESTURE LIBRARY"");                mLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures);                if(!mLibrary.load()){                    finish();                }        }        public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture){ ...} }</code></pre><p>I have created the activity in the main thread in it's doStart() method by saying:</p><pre><code>GestureActivity mGestureActivity = new GestureActivity();mGestureActivity.onCreate(null);</code></pre><p>And my XML layout looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""match_parent""android:layout_height=""match_parent""&gt;&lt;com.darius.android.distractions.DistractionsView  android:id=""@+id/distractions_layout""  android:layout_width=""match_parent""  android:layout_height=""match_parent""/&gt;&lt;android.gesture.GestureOverlayViewxmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/gestures""android:layout_width=""match_parent""android:layout_height=""match_parent""android:gestureStrokeType=""multiple""android:eventsInterceptionEnabled=""true""/&gt;&lt;RelativeLayout    android:layout_width=""match_parent""    android:layout_height=""match_parent"" &gt;    &lt;TextView      android:id=""@+id/text""              android:text=""Hello""              android:visibility=""visible""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:layout_centerInParent=""true""      android:gravity=""center_horizontal""      android:textColor=""#88ffffff""      android:textSize=""24sp""/&gt; &lt;TextView  android:layout_height=""wrap_content""             android:layout_width=""wrap_content""             android:text=""@string/concentration_bar""            android:textColor = ""#EB0000""            android:textSize=""10sp""            android:id=""@+id/conbartext""             android:visibility=""visible""                        &gt;&lt;/TextView&gt;&lt;/RelativeLayout&gt;</code></pre><p></p>","300037","","","","","2011-10-26 13:23:59","Null Pointer Exception when assigned a View to an Activity?","<android><activity><nullpointerexception>","1","0","","",""
"3344403","1","4580439","","2010-07-27 14:01:30","0","744","<p>For some reason, and only on my Dell Vostro 1000 laptop, the Android emulator keeps thinking I have the = key pressed and continually emits a string of ""====="" equal signs.  This happens no matter what I'm doing in the emulator.  It responds to my manual keypresses as well, interspersing them.  It happens no matter which version of the Android system I run (2.1, 2.2, etc.) </p><p>Strangely, it happens even running the Android emulator via a remote desktop session where the remote desktop client is the laptop and the server is another PC running the emulator.  If I run the emulator on the other PC locally (not remote desktop,) the emulator functions fine!  </p><p>This problem didn't occur when I first installed the SDK and as far as I know no other software has been installed since then.  I tried clicking the ""clear user data"" from the emulator launcher and still no effect.  I have also tried deleting the SDK directory and reinstalling it, but the effect is still there.</p><p>Update: I found another application that exhibits this behavior. ScummVM when opening a dialog to save the game also receives these phantom keypresses.  It persists in Windows 7.</p><p>Has anyone seen this?</p>","403455","","403455","","2012-10-08 16:57:43","2012-10-08 16:57:43","Android Emulator Stuck Equals (=) Phantom Keypress","<android><eclipse><android-emulator>","1","1","0","",""
"3344405","1","","","2010-07-27 14:01:46","0","138","<p>I am working on a search app and since I am a beginner, I decided to start from the searchable dictionary sample, which is quite similar to what I'm trying to achieve. Got it to work, but I have a problem: the sample loads a blank page initially, telling the user to press on the search button to start performing a search. Once search is pressed, a new page loads with a search field and button on top, allowing the user to start searching for stuff. </p><p>What I want to do is get rid of that intermediary page, so that the search field and button are loaded from the beginning, on the very first screen the app loads when started. Any ideas on how to do this? Detailed instructions/examples would be greatly appreciated, as I am a beginner in Android programming. </p><p>Thanks a lot!</p>","403459","","","","","2010-08-03 14:51:25","How to Get Rid if Intermediary Page in Searchable Dictionary-Like App","<android><search><dictionary><sample><searchable>","1","0","","",""
"3344453","1","6413310","","2010-07-27 14:06:14","2","1152","<p>I have the following piece of code in my Android application that looks up a contacts ID, I have just changed the target from 1.5 to 2.2 but with a min SDK of 3 (1.5) so that I can use the ContactsContract Uri in 2.2 and the People Uri in 1.5.</p><p>However the code leads to the following error when run on 1.5 devices:</p><pre><code>07-27 15:02:53.382: WARN/dalvikvm(12656): VFY: unable to resolve static field 25 (CONTENT_URI) in Landroid/provider/ContactsContract$Contacts;</code></pre><hr><p>From google I have garnered that I need to use reflection in this case to allow the application run on both versions of Android?</p><p>I have seen example's of how to use reflection to use methods of multiple/different versions but how can I use it in mycase where I want to use the ContactsContract Uri?</p><p>Here is my code:</p><hr><pre><code>findViewById(R.id.contactimage).setOnClickListener(new OnClickListener() {                public void onClick(View v) {                    String sdk = android.os.Build.VERSION.SDK;                    Uri contactUri;                    Log.d(""CDA"", ""Contact ID Button pressed = "" + contactId);                    if(sdk.equals(""8"")){                        contactUri = ContentUris.withAppendedId                        (ContactsContract.Contacts.CONTENT_URI, contactId);                        Intent intent = new Intent(Intent.ACTION_VIEW, contactUri);                        startActivity(intent);                    }                    else{                    contactUri = ContentUris.withAppendedId                    (People.CONTENT_URI, contactId);                    Intent intent = new Intent(Intent.ACTION_VIEW, contactUri);                    startActivity(intent);                    }                    dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.FLAG_SOFT_KEYBOARD));                    dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK));                }        });</code></pre><hr><p>EDIT:</p><p>Here is an example of how its done:</p><pre><code>private static Uri CONTENT_URI=null;private static String NAME_URI=null;private static String ID_URI=null;private static String NUMBER_URI = null;private static Uri PHONE_LOOKUP = null;static int sdk; static {     sdk=new Integer(Build.VERSION.SDK).intValue();     if (sdk&gt;=5) {     try {     Class clazz=Class.forName(""android.provider.ContactsContract$CommonDataKinds$Phone"");     Class clazz_phonelookup=Class.forName(""android.provider.ContactsContract$PhoneLookup"");     NAME_URI=(String)clazz.getField(""DISPLAY_NAME"").get(clazz);     ID_URI=(String)clazz.getField(""_ID"").get(clazz);     NUMBER_URI=(String)clazz.getField(""NUMBER"").get(clazz);     PHONE_LOOKUP =(Uri)clazz_phonelookup.getField(""CONTENT_FILTER_URI"").get(clazz);     }     catch (Throwable t) {     Log.e(""reflection"", ""Exception when determining CONTENT_URI"", t);     }     }     else {     CONTENT_URI=Contacts.People.CONTENT_URI;     NAME_URI=People.NAME;     ID_URI=People._ID;     NUMBER_URI=People.NUMBER;     PHONE_LOOKUP = null;     }     }</code></pre>","243999","","243999","","2010-07-30 15:13:08","2011-06-20 15:04:00","How to code ContactsContract so that it runs in 2.2 and doesn't crash 1.5?","<android><cross-platform><contactscontract>","1","1","1","",""
"3344551","1","","","2010-07-27 14:16:32","3","27706","<p>I am saving details in out.txt file which has created a text file in data/data/new.android/files/out.txt.I am able to append information to the text, however, I am unable to read this file. I used the following procedures to read the file : </p><pre><code>File file = new File( activity.getDir(""data"", Context.MODE_WORLD_READABLE), ""new/android/out.txt""); BufferedReader br = new BufferedReader(new FileReader(file));</code></pre><p>Can anyone please help me out to fix this issue ?</p><p>Regards,Sunny.</p>","403485","","243782","","2010-07-27 14:23:54","2013-11-07 10:11:31","How to read text file in Android?","<android>","3","2","3","2013-11-07 17:45:33",""
"3344618","1","3347327","","2010-07-27 14:24:46","0","2375","<p>I am attempting to build Google's Android v2.2 (Froyo) from source on an Asus A3E laptop (512MB ram) running Ubuntu Netbook 10.04.</p><p>I have followed the instructions on <a href=""http://source.android.com/source/download.html"" rel=""nofollow"">http://source.android.com/source/download.html</a> and set java to version 5 with using:</p><pre><code>sudo update-java-alternatives -s java-1.5.0-sunjava -version gives me: 1.5.0_018 </code></pre><p>Thus allowing Android's prebuild check to work.I have also set my ~/.bashrc to export the java home directory and set it to the android java home. I have also:</p><pre><code>repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo repo sync</code></pre><p>Then I just simply:</p><pre><code>make</code></pre><p>This goes for about a minute then I get a long pause at:</p><pre><code>target Dex: core</code></pre><p>Then:</p><pre><code>make: *** [out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.dex] Killed</code></pre><p>and I'm back to a prompt.I suspect that it's a memory issue as it crashes any browser instances that I have open at the same time.Does anyone know a solution/workaround or at least a good path to start debugging.</p><p>Cheers,Stu</p>","255816","","255816","","2010-07-27 21:07:17","2011-12-11 16:29:07","Building Froyo fails - make: *** [.../classes.dex] Killed","<java><android><make>","2","0","1","2012-12-05 13:28:43",""
"3344818","1","3359850","","2010-07-27 14:46:43","0","74","<p>How can I link like the Checkbox and larger TextView to external data? Should I use a SimpleCursorAdapter? Or create my own adapter? Should it extend ArrayAdapter or BaseAdapter? <br/>  My list item UI:</p><p><img src=""http://i31.tinypic.com/2liwz60.jpg"" alt=""The list item UI""></p>","200477","","200477","","2010-07-27 16:01:05","2010-07-29 06:04:35","Link up UI elements to data in complicated link item?","<java><android><adapter><listitem>","1","0","","",""
"3344831","1","","","2010-07-27 14:47:44","0","496","<p>I have a two application. <strong>ApplicationA</strong> and <strong>ApplicationB</strong> .From the ApplicationA I have to open the ApplicationB.At the same time i need to send some detail to ApplicationB .How to do this?</p>","389404","","","","","2012-04-11 15:33:36","At the time of button click open another one application?","<android>","2","0","","",""
"3344884","1","3345020","","2010-07-27 14:54:03","0","149","<p>In my application, I start an activity, that is in another application (Eclipse project) the following way:</p><pre><code>Intent intent = new Intent();intent.setAction(game.getLaunch());intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);startActivityForResult(intent, game.getId());</code></pre><p>If this second application is finished, I call:</p><pre><code>MySecondApplication.this.setResult(getGameId());MySecondApplication.this.finish();</code></pre><p>This works fine if the second application is terminated normally. But I would like to catch any uncaught exception in the second application and notify the first application that the second application has failed. Therefore I tried to use a UncaughtExceptionHandler in my second application:</p><pre><code>Thread.setDefaultUncaughtExceptionHandler(handler);</code></pre><p>This works fine, in the method</p><pre><code>@Overridepublic void uncaughtException(Thread thread, Throwable ex) { System.out.println(""Exception in my second application"");}</code></pre><p>However, I can't do there anything more, than making a sysout. If I tried to do something more complex like e.g. an alert dialog, or somehow alert the first application, all this isn't called. I think this is because the second application was already terminate because of the exception. But how can I then notify my first application that the second has terminated unforeseenly? Any hints?</p><p>EDIT #1:</p><p>With the help of pentium10 i was able to notify the first application that the second has crashed by sending a broadcast to the first application in the uncaugthExceptionHandler.It wasn't necessary to do this process id stuff in the question he linked.</p><p>However, my problem isn't yet solved completely: I can notify my first application, but my second application where the exception happened is not really ""terminated"". It is just a black screen. So how can i solve this?</p><p>EDIT #2:</p><p>I was able to close the second activity by calling:</p><pre><code>((Activity) context).finish();</code></pre><p>where context is the second activity. However, now it takes a long time until the broadcast intent from the second activity is received by the first activity. Approximately it takes 30 or even more seconds. Why does this take so long?</p>","","anon","","anon","2010-07-28 07:34:47","2010-07-28 07:34:47","How can I notify another application that my application has failed?","<java><android>","1","0","","",""
"3344903","1","","","2010-07-27 14:56:47","4","3216","<p>Hi I just installed the android SDK along with Eclipse 3.5 on my i686 Thinkpad T60 running Ubuntu 10.04 (Lucid).  (Eclipse was installed via synaptic, i.e. a package from the repository.) I installed the eclipse add on and everything on the Eclipse end seems fine.  I also put the android-sdk tools directory on my user PATH.  Now launching tools/android without any arguments is supposed to bring up the SDK and AVD manager GUI, but instead I get the following error:</p><pre><code>Exception in thread ""main"" java.lang.UnsatisfiedLinkError: no swt-gtk-3550 or swt-gtk in swt.library.path, java.library.path or the jar file    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)    at org.eclipse.swt.internal.C.&lt;clinit&gt;(Unknown Source)    at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)    at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)    at org.eclipse.swt.widgets.Display.&lt;clinit&gt;(Unknown Source)    at com.android.sdkmanager.Main.showMainWindow(Main.java:265)    at com.android.sdkmanager.Main.doAction(Main.java:249)    at com.android.sdkmanager.Main.run(Main.java:94)    at com.android.sdkmanager.Main.main(Main.java:83)</code></pre><p>The strange thing is I definitely have all the prerequisites installed, sun-java6-jdk, and open-java6-jdk and have tried switching between them.  Also if I look in synaptic I have libswt-gtk-3.5java installed.  Also he AVM/SDK manager launches fine when I launch it with eclipse.</p><p>(You may wonder why i care, but I like working from the command line, and considering using emacs as my IDE rather than Eclipse.)</p><p>If anyone knows how i can fix this please let me know.</p>","403516","","","","","2013-08-09 12:57:53","Problem launching android AVM/SDK gui using the tools/android executable in the android SDK. Ubuntu 10.04, i686","<java><android><ubuntu-10.04>","5","1","1","",""
"3344981","1","3345036","","2010-07-27 15:05:32","1","657","<p>I've got an onTouchEvent boolean on a Surfaceview, I've got openGL objects drawn on the view and I'm wondering is there anyway to detect where on the screen the onTouch happened? e.g (x,y) co-ordinates.</p>","358438","","","","","2013-07-02 10:16:52","detect where on the screen onTouchevent happened","<android><glsurfaceview>","2","0","","",""
"3345026","1","3345942","","2010-07-27 15:08:44","2","2914","<p>Is it possible to load my main.xml layout file in onCreate() and then later in the app, switch to a new XML layout?  I've tried placing setContentView() later on in the app but that seems to not actually set the new View because my references to objects in the newly set xml layout file are returning as null.  I've tried doing some layout inflating using the LayoutInflater but I'm having no luck (I'm probably doing something wrong)...</p><p>So is there any other way to swap layout xml layouts at runtime?Thanks!</p>","107459","","","","","2013-12-17 04:07:15","Is it possible to swap XML layouts during runtime in Android?","<android><xml><layout>","3","0","","",""
"3345084","1","3462089","","2010-07-27 15:14:12","34","23685","<p>I currently have a view in my Android app and the view is playing a frame animation.  I want to animate the view to increase its size to 150%.  When I apply a scale animation to it, and the scale animation is completed, I want the view to stay at that new size for the rest of the activities life cycle.  Unfortunately right now when the scale up animation is complete, the view snaps back to the original size.  How can I get it to keep the new animated tranformation?</p><p>I'm using </p><pre><code>myView.startAnimation(AnimationUtils.loadAnimation(mContext,R.anim.scaleUp150));</code></pre><p>Thanks!</p>","107459","","492624","","2012-01-31 18:21:14","2013-03-10 08:51:05","How can I animate a view in Android and have it stay in the new position/size?","<android><animation>","6","0","14","",""
"3345144","1","3364978","","2010-07-27 15:20:30","2","2800","<p>Is it possible to configure android.app.DatePickerDialog so that it is localized for the European format easily (exchange day and month and exchange the english button names with localized ones) ?</p>","343482","","","","","2010-10-10 10:23:36","Localize Android DatePickerDialog","<android><datepicker>","2","0","1","",""
"3345189","1","3345413","","2010-07-27 15:24:46","5","8750","<p>I'm constructing TableLayout dynamically. And I need TableRow has a gap in certain column position. </p><p>For example, I need row has ImageView on 3 and 5 position, next row has ImageView on 1, 2, 4 position. I try to use:</p><pre><code>   TableRow row1 = new TableRow(this);     row1.addView(new ImageView(this), 2);     row1.addView(new ImageView(this), 4);     mTable.addView(row1);   TableRow row2 = new TableRow(this);     row2.addView(new ImageView(this), 0);     row2.addView(new ImageView(this), 1);     row2.addView(new ImageView(this), 3);   mTable.addView(row2);</code></pre><p>but I got IndexOfBoundException at Runtime.<br>ERROR/AndroidRuntime(771): Caused by: java.lang.IndexOutOfBoundsException: index=2 count=0  </p><p>Any suggestions would be appreciated.<br>Thank you.</p>","403562","","","","","2012-06-05 18:23:02","Android TableRow - How to add View dynamically to certain postion?","<android><tablelayout><tablerow>","2","0","2","",""
"3345476","1","3346445","","2010-07-27 15:54:46","1","1656","<p>I am trying to upload an image but I am getting some out of memory errors if the image file is over ~2 megs on an Android device.</p><pre><code>File file = new File(&lt;my image file&gt;);FileInputStream fis = new FileInputStream(file);HttpClient client = new HttpClient(); PutMethod method = new PutMethod(myUrl); RequestEntity requestEntity = new InputStreamRequestEntity(fis);method.setRequestEntity(requestEntity); client.executeMethod(method); </code></pre><p>The out of memory error happens on the executeMethod line.  How can I change this to read the stream as it goes along instead of reading the entire stream into memory and causing a crash?</p><p>Sample of hte DDMS output:</p><pre><code>07-27 10:46:24.334: DEBUG/dalvikvm(26576): GC freed 6787 objects / 522592 bytes in 119ms07-27 10:46:24.374: DEBUG/dalvikvm(26576): GC freed 1738 objects / 196752 bytes in 33ms07-27 10:46:24.374: INFO/dalvikvm-heap(26576): Grow heap (frag case) to 5.184MB for 253968-byte allocation07-27 10:46:24.414: DEBUG/dalvikvm(26576): GC freed 0 objects / 0 bytes in 45ms07-27 10:46:24.464: DEBUG/dalvikvm(26576): GC freed 3 objects / 122992 bytes in 48ms07-27 10:46:24.474: INFO/dalvikvm-heap(26576): Grow heap (frag case) to 5.558MB for 516112-byte allocation07-27 10:46:24.524: DEBUG/dalvikvm(26576): GC freed 0 objects / 0 bytes in 57ms07-27 10:46:24.574: DEBUG/dalvikvm(26576): GC freed 3 objects / 254056 bytes in 46ms07-27 10:46:24.754: INFO/dalvikvm-heap(26576): Grow heap (frag case) to 6.308MB for 1040400-byte allocation07-27 10:46:24.824: DEBUG/dalvikvm(26576): GC freed 3 objects / 516168 bytes in 63ms07-27 10:46:24.894: INFO/dalvikvm-heap(26576): Grow heap (frag case) to 7.808MB for 2088976-byte allocation07-27 10:46:24.994: DEBUG/dalvikvm(26576): GC freed 0 objects / 0 bytes in 101ms07-27 10:46:25.034: DEBUG/dalvikvm(26576): GC freed 3 objects / 1040456 bytes in 34ms07-27 10:46:25.084: INFO/dalvikvm-heap(26576): Grow heap (frag case) to 10.808MB for 4186128-byte allocation07-27 10:46:25.154: DEBUG/dalvikvm(26576): GC freed 0 objects / 0 bytes in 63ms07-27 10:46:25.434: DEBUG/dalvikvm(26576): GC freed 3 objects / 2089032 bytes in 58ms07-27 10:46:25.714: INFO/dalvikvm-heap(26576): Grow heap (frag case) to 16.808MB for 8380432-byte allocation07-27 10:46:25.784: DEBUG/dalvikvm(26576): GC freed 0 objects / 0 bytes in 70ms07-27 10:46:26.204: DEBUG/dalvikvm(26576): GC freed 3 objects / 4186184 bytes in 65ms07-27 10:46:26.204: INFO/dalvikvm-heap(26576): Forcing collection of SoftReferences for 16769040-byte allocation</code></pre>","242904","","","","","2010-07-27 18:00:48","Uploading Image using InputStreams = Out Of Memory error","<java><android>","2","0","","",""
"3345579","1","3346501","","2010-07-27 16:07:01","2","802","<p>I have checked the design guidelines from the Android developers recently and found the recommendation to use at least 4 states for interactive ui elements.</p><p>default, disabled, focused, pressed</p><p>see <a href=""http://www.slideshare.net/AndroidDev/android-ui-design-tips"" rel=""nofollow"">http://www.slideshare.net/AndroidDev/android-ui-design-tips</a>, slide 13</p><p>On the other hand in slide 10 it is said to make the right things visible. </p><p>Now I am trying to figure out when to disable controls and when to hide them. I tend to think that if a control is not applicable at the moment, it should not be visible to reduce ui clutter.</p><p>On the other hand it kind of makes sense to me, to disable the zoom button when no more zooming is possible. Only kind of though. Maybe hiding would work even better. </p><p>I am not sure. Has anybody found any other references that might help on when to hide and when to mere disable a control. What factors do you need to take into account when you decide for one or the other?</p><p>Is there any Android or mobile application specific recommendation due to screen size or whatever?</p>","136445","","136445","","2010-07-27 18:31:24","2010-07-27 18:31:24","Disabling or hiding controls design guideline?","<android><design><user-interface>","1","0","","",""
"3345783","1","3348068","","2010-07-27 16:32:14","2","10279","<p>I want to design a TableLayout with some big buttons with icon and text embbeded. I have found some similar question but not the same <a href=""http://stackoverflow.com/questions/1532876/android-combining-text-image-on-a-button-or-imagebutton"">1</a>. My simplified XML layout is:</p><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TableRow android:id=""@+id/TableRow01"" android:gravity=""center""&gt;&lt;Button android:text=""@string/telephone"" android:drawableTop=""@drawable/phone"" android:id=""@+id/button_phone""&gt;&lt;/Button&gt;&lt;Button android:text=""@string/help"" android:src=""@drawable/help"" android:id=""@+id/button_help""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>The icon images are a little big, so I want to Android resizes them but the android:height parameter resizes the button, not the embedded image. Do you any idea to get an Button with Text and Image ""resizeable""?</p>","403616","","","","","2010-07-29 16:25:20","Getting resized images inside Android buttons","<android><image><button>","1","0","1","",""
"3345798","1","3417826","","2010-07-27 16:34:53","-1","166","<p>I am going to transform my website to mobile phone supported. My website consists of lots of java script and ajax stuffs so looked for a specific JS framework to support all the mobile os (android,ios,windows and blackberry).I googled and found some frame works like phonegap, sencha touch,JQTouch and appcelerator titanium. Can you people help me to find out the right one which will be suitable for my needs. </p>","276149","","","","","2010-08-05 18:18:42","need a specific JS framework to support all mobile os","<iphone><android><ios4><mobile-phones><phonegap>","1","0","","",""
"3345817","1","3345892","","2010-07-27 16:36:56","2","1992","<p>I've created an openGL square like so..</p><pre><code>            final float array1[] = new float[] {            //Front face            lx, ly, hz,            lx, hy, hz,            hx, ly, hz,            hx, hy, hz    };</code></pre><p>I've also got a Ray. I'd now like to put bounding boxes around every  square I draw so that I can check if they intersect. How would I go about doing this?</p><p>Thanks.</p>","358438","","","","","2010-07-27 16:46:02","creating bounding box around openGL objects","<android><opengl-es>","2","0","","",""
"3345922","1","","","2010-07-27 16:50:19","0","95","<p>In android 2.0 Contact application, under the 'Favorites' tab, there is a 'Frequently contacted' title bar. Can you please tell me how can I construct that myself?</p><p>I would like what is the font size, font color , back ground color that they use.</p>","286802","","","","","2010-07-27 21:21:42","How can I construct the Contact application title bar","<android>","1","0","","",""
"3346063","1","5343518","","2010-07-27 17:09:41","3","196","<p>I develop mobile applications for a variety of platforms, notably iPhone and Android.</p><p>Each of these applications has a way to ""phone home"" with fatal crash stack traces.  Up to now, we've been inspecting these by hand as needed.</p><p>What I'm looking for is a piece of software that can somewhat accurately ""aggregate"" or ""coalesce"" all these stack traces into bug reports.  Output format doesn't really matter, I'm sure we can pipe it into our bug tracker.</p><p>So if we get 1000 stack traces that represent the same bug, it would create one ticket even if their stacks vary slightly.</p><p>It would be nice if there was a package that was capable of handling stack traces from a variety of platforms (iphone/android/etc), but if not I'd like recommendations for specific platforms too.</p><p>Thanks</p>","205192","","","","","2011-03-17 18:27:23","Stack trace bug aggregation software","<iphone><android><mobile><stack-trace>","1","3","2","",""
"3346080","1","3346136","","2010-07-27 17:12:33","8","4282","<p>I've <a href=""http://developer.android.com/resources/articles/avoiding-memory-leaks.html"">read</a> that it is a mistake and a source of memory leaks in Android application to keep a long-lived references to a Context.</p><p>But I don't understand if it is ok to create an class that looks like this one:</p><pre><code>public class HelperClass {    private Context context;    public HelperClass(Context context) {        this.context = context;    }    public void myHelperMethod() {        // uses this.context    }}</code></pre><p>And call it from an Activity:</p><pre><code>public class MyActivity extends Activity {    public void onCreate(Bundle savedInstanceState) {        HelperClass h = new HelperClass(this);        h.myHelperMethod();    }    ...}</code></pre>","12388","","","","","2010-07-27 17:42:22","Android : References to a Context and memory leaks","<android><android-context>","2","0","8","",""
"3346215","1","","","2010-07-27 17:29:13","1","1764","<p>Please advice how to set fixed heigh (in dip) for the child view of ListView component?</p><p>I am using relative layout as root layout for the child view</p><p>when I set backgoround image to relative layout it becomes very height (maybe because backgoround picture is large) and I want to set precisely the height in dp.</p>","390323","","","","","2012-09-13 04:49:39","Android: ListView fixed height of child view","<java><android>","2","1","","",""
"3346236","1","3531843","","2010-07-27 17:31:28","10","6530","<p>Because of the <a href=""http://code.google.com/p/android/issues/detail?id=9199"">lack of Unicode support on the embedded SQLite database in Android</a></p><p>I am mostly interested in performance and stability of <a href=""http://www.h2database.com/"">H2 Database</a> vs Android <a href=""http://www.sqlite.org/"">SQLite</a></p><p>Are you guys using it?Should I be aware of any H2 database shortcomings?</p>","229414","","49246","","2010-07-28 19:47:28","2011-03-18 22:52:54","H2 Database vs SQLite on Android","<android><database><sqlite><embedded-database><h2>","3","0","5","",""
"3346530","1","","","2010-07-27 18:10:06","0","220","<p>I have a gesture activity class that listens out for when a gesture is performed on screen, which is connected to a GestureOverlayView which covers the entire screen. I have a main game thread DistractionsThread that is launched from the Distractions menu file. The thread deals with the physics and do draw methods that play the game so once created, control is passed to it until it exits or is interrupted.</p><p>My question is, how can I have both the gesture activity and DistractionsThread running at the same time so that the game listens out for gestures whilst continuing to play, as opposed to waiting for one activity to finish before the other resumes.</p><p>I imagine this will involve a second thread but am unsure how to implement this correctly? The gesture activity has to be an activity type I assume by virtue of it using a view?</p>","300037","","","","","2010-07-27 18:10:06","use an Android GestureOverlayView seperate from the game thread execution?","<android><multithreading><activity><gesture>","0","2","","",""
"3346874","1","5211441","","2010-07-27 18:49:59","7","4899","<p>I have a widgetProvider . I also have a service class that does the calculation for the widget.</p><p>The widget runs fine when initialized. I'm getting an error when I try to call the service from within the onReceive method after a broadcast event that I want to react on (time change).</p><p>How can I update the widget from onReceive after receiving a broadcast event?</p><p>Here is my widget</p><pre><code>public class HijriWidget extends AppWidgetProvider{...        @Override         public void onReceive(Context context, Intent intent) {            if(Intent.ACTION_TIME_CHANGED.equals(intent.getAction())||Intent.ACTION_DATE_CHANGED.equals(intent.getAction())){                //THE CODE BELOW LEADS TO AN EXCEPTION. HOW CAN I UPDATE THE WIDGET HERE?                RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.widget);                AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);                int appWidgetId = intent.getExtras().getInt(AppWidgetManager.EXTRA_APPWIDGET_ID);                appWidgetManager.updateAppWidget(appWidgetId, remoteView);            }               super.onReceive(context, intent);        }        @Override        public void onUpdate(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds) {            for (int appWidgetId : appWidgetIds) {                PendingIntent updatepending = HijriWidget.makeControlPendingIntent(context,RefreshService.UPDATE, appWidgetId);                pi = updatepending;                try {                    updatepending.send();                } catch (CanceledException e) {                  e.printStackTrace();                }                            setAlarm(context, appWidgetId, 5*60*1000);            }                super.onUpdate(context, appWidgetManager, appWidgetIds);        }        public static PendingIntent makeControlPendingIntent(Context context, String command, int appWidgetId) {            Intent active = new Intent(context,RefreshService.class);            active.setAction(command);            active.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);            //this Uri data is to make the PendingIntent unique, so it wont be updated by FLAG_UPDATE_CURRENT            //so if there are multiple widget instances they wont override each other            Uri data = Uri.withAppendedPath(Uri.parse(""hijriwidget://widget/id/#""+command+appWidgetId), String.valueOf(appWidgetId));            active.setData(data);            return(PendingIntent.getService(context, 0, active, PendingIntent.FLAG_UPDATE_CURRENT));        }        public static void setAlarm(Context context, int appWidgetId, int updateRate) {            PendingIntent newPending = makeControlPendingIntent(context,RefreshService.UPDATE,appWidgetId);            AlarmManager alarms = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);            Calendar calendar = Calendar.getInstance();         calendar.add(Calendar.DAY_OF_YEAR, 1);         calendar.set(Calendar.HOUR_OF_DAY, 0);         calendar.set(Calendar.MINUTE, 0);         calendar.set(Calendar.SECOND, 0);            if (updateRate &gt;= 0) {                alarms.set(  AlarmManager.RTC, calendar.getTimeInMillis(),  newPending);                //alarms.setRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), updateRate, newPending);            } else {                // on a negative updateRate stop the refreshing                alarms.cancel(newPending);            }        }</code></pre><p>}</p><p>and here is my service</p><pre><code>public class RefreshService extends Service {@Overridepublic void onStart(Intent intent, int startId) {    int appWidgetId = intent.getExtras().getInt(AppWidgetManager.EXTRA_APPWIDGET_ID);    RemoteViews remoteView = new RemoteViews(getApplicationContext() .getPackageName(), R.layout.widget);    AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(getApplicationContext());    final Calendar c = Calendar.getInstance();    int mYear = c.get(Calendar.YEAR);    int mMonth = c.get(Calendar.MONTH);    int mDay = c.get(Calendar.DAY_OF_MONTH);    int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);    mMonth++;    HijriCalendar hc =new HijriCalendar( mYear,mMonth,mDay);    remoteView.setTextViewText(R.id.TextView02,hc.getHijriMonth()+""/""+hc.getHijriDay());    remoteView.setTextColor(R.id.TextView02, Color.BLACK);    remoteView.setTextViewText(R.id.TextView01, hc.getHijriYear()+"""");    remoteView.setTextColor(R.id.TextView01, Color.WHITE);    appWidgetManager.updateAppWidget(appWidgetId, remoteView);    super.onStart(intent, startId);}@Overridepublic IBinder onBind(Intent intent) {    // TODO Auto-generated method stub    return null;}</code></pre><p>Any help will be appreciated. Thanks.</p><p>UPDATE:</p><p>I've found the problem. Check my answer below.</p>","403733","","403733","","2011-03-06 15:41:50","2011-03-06 15:41:50","Android Widget onReceive can't call Service class?","<android><widget>","2","4","3","",""
"3346970","1","3347588","","2010-07-27 19:04:54","10","8164","<p>I just ordered an Android smartphone and want to start playing around with creating my own applications. Now the question is which language to use, the native Java or Python using SL4A (former ASE).</p><p>I tend to Python, as I know it much better than Java, but I'm wondering what I would be missing using a ""second class"" language on Android. On the SL4A website it is also stated to be alpha quality software, which is not exactly encouraging.</p><p>I'm also not quite sure what the limitations of the scripting environment are and if they would be problematic.</p>","347857","","","","","2013-09-21 08:30:08","Starting with Android: Java or Python (SL4A)","<java><python><android><sl4a>","5","0","8","",""
"3347065","1","","","2010-07-27 19:16:57","0","678","<p>Is there anyway to bypass 'Unknown sources' setting without having the application actually downloadable in the market? Signing up for the market is fine but I do not want the application actually available via the market due to partner restrictions. However, installation should be smooth without requiring the user to allow installation of application from non-market applications.</p>","403785","","","","","2013-11-18 05:49:14","Is there anyway to bypass 'Unknown sources' setting without having the application actually downloadable in the market?","<android>","2","2","","",""
"3347247","1","3347405","","2010-07-27 19:35:53","0","5236","<p>*<em>Updated: (See below)</em>*I have been looking around for couple of days and can't find a straight answer to this. Some say it possible to some say to accomplish some say it's not. I am getting crazy on this. </p><p>What I want is just to have the AsyncTaskTask showing a progressbar an external class. To do this I am passing the context as you can see in the main class. But whatever I try I get <code>NullPointerException</code>.</p><p>Working code examples is appreciated. Thank you</p><p>Using Android 2.2 by the way.</p><p>main:</p><pre><code>import android.app.Activity;import android.os.Bundle;public class AsyncDemo extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        new AsyncClass(this).execute();    }}</code></pre><p>AsyncClass.java</p><pre><code>import android.app.ProgressDialog;import android.content.Context;import android.os.AsyncTask;import android.os.SystemClock;public class AsyncClass extends AsyncTask&lt;Void, String, Void&gt; {    private Context context;    ProgressDialog dialog = new ProgressDialog(context);    public AsyncClass(Context cxt) {        context = cxt;    }    @Override    protected void onPreExecute() {        dialog.setTitle(""Please wait"");        dialog.show();    }    @Override    protected Void doInBackground(Void... unused) {        SystemClock.sleep(2000);        return (null);    }    @Override    protected void onPostExecute(Void unused) {        dialog.dismiss();    }}</code></pre><p><strong>Update:</strong> I have a follow up question: Using the above code, is it possible to return a value from the onPostExecute method back to the main class, somehow? (Sorry about beeing noobish)I have tried something like this:</p><pre><code>String result = new AsyncClass(this).execute();</code></pre><p>and then a method that return back a string. But I can't do that because i got:</p><pre><code>Type mismatch: cannot convert from AsyncTask&lt;String,Void,Void&gt; to String</code></pre><p>What can I do to tackle this problem? Thanks.</p>","215088","","231716","","2012-02-23 13:13:13","2014-01-29 07:50:18","External AsyncTask class with ProgressDialog [Update: and returning back?]","<java><android><android-asynctask><progressdialog>","3","1","3","",""
"3347261","1","3350787","","2010-07-27 19:37:16","0","788","<pre><code>public void onCreate(Bundle savedInstanceState){  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  mSurfaceView01 = (SurfaceView) findViewById(R.id.mSurfaceView1);   mSurfaceHolder01 = mSurfaceView01.getHolder();  mSurfaceHolder01.addCallback(EX10_04.this);  mButton02 = (Button)findViewById(R.id.buttonObj);  mButton02.setOnClickListener( new Button.OnClickListener(){    public void onClick(View arg0) {        Intent intent = new Intent( Intent.ACTION_GET_CONTENT );        intent.setType(""audio/*"");                  Intent destIntent = Intent.createChooser( intent, ""select audio"" ); //pick up an audio file        startActivityForResult( destIntent, 0 );    }  }); }protected void onActivityResult(int requestCode, int resultCode, Intent data) {super.onActivityResult(requestCode, resultCode, data);if ( resultCode == RESULT_OK ){    Uri uri = data.getData();    if( uri != null )    {        DrawO();//It will draw a circle    }    else    {      e.printStackTrace();    }}</code></pre><p>The circle not show.....but when i put the DrawO() next to</p><pre><code>  mSurfaceHolder01.addCallback(EX10_04.this);</code></pre><p>It draw a circle !</p><p>if i want to draw a circle in the onActivityResult event</p><p>what shuld i do ?</p><p>or if i can pass uri to onClick function ?</p><pre><code>public void DrawO(){Canvas mCanvas01 = mSurfaceHolder01.lockCanvas(null);mCanvas01.drawColor(getResources().getColor(R.drawable.white)); Paint mPaint01 = new Paint();mPaint01.setStyle(Paint.Style.FILL);mPaint01.setColor(getResources().getColor(R.drawable.red));mPaint01.setStrokeWidth(1.0F);...............}</code></pre>","403797","","","","","2010-07-28 07:33:24","Can i pass uri value from onActivityResult() to onClick()?","<android>","1","0","","",""
"3347366","1","3348155","","2010-07-27 19:50:18","0","157","<p>Is there an equivalent Android class to the BlackBerry's DateTimeUtilities?  What I really need is DateTimeUtilities.copyCal(source, dest), and I can write it myself, but I really hate writing functions like this only to find it already exists but I just didn't know.  I am aware of clone(), but what I really need is to be able to easily change the timezone of a date without having to worry about DST etc myself.</p>","177202","","243782","","2010-07-27 20:31:08","2010-07-27 21:28:39","Android equivalent for BlackBerry DateTimeUtilities","<java><android><blackberry>","2","0","","",""
"3347425","1","3347669","","2010-07-27 19:57:31","0","1458","<p>I have a class that creates a view to gather data via a function <code>getView()</code> that provides a view with an EditText.</p><p>This class has also has variable <code>answer</code>.When the user chances the EditText I want to store the content of the EditText in <code>answer</code>.</p><p>If I would use an onKeyListener I fear that the answer will probably get stored before the last letter is entered.</p><p>Is there a good way to handle this in the <code>getView()</code> function via some other listener?</p>","25282","","","","","2011-10-04 02:43:02","Copy String from an android from EditText into String variable on Android","<android>","1","0","","",""
"3347529","1","3347617","","2010-07-27 20:11:39","0","726","<p>How do I figure out, if an app is loaded for the first time after it has been downloaded. I mean when the app is first bought/downloaded from market, how will I figure it that this is the first time(never has been run on this phone) this is going to run hence I can throw up some registration activity?</p><hr><p>yeah, I thought of declaring a table which is checked to see if it has any rows. If there were rows then this was because it had been loaded and we inserted a row.</p><p>But I want to avoid this, is their any API which can tell me that the user had used this app before on this phone?</p>","402637","","1288","","2011-08-30 03:27:49","2011-08-30 03:27:49","How do I know that an Android app has been loaded for the first time?","<android>","5","0","1","",""
"3347549","1","","","2010-07-27 20:13:57","0","99","<p>I have  a single activity with multiple views that represent different steps in a wizard. I have gotten code working that will save and restore the wizard to the correct screen, but after a save/restore cycle I cannot seem to get setContentView to work. The code executes without throwing any exceptions but the view isn't actually updated. Why would this be happening?</p><p>edit:SOLVED I was using a handler to change screens, but on restore I wasn't using the newly constructed one, so messages were being sent to a handler that didn't have control of the screen.</p>","344151","","344151","","2010-07-28 15:30:26","2010-07-28 15:30:26","Odd Orientation Change Behaviour in Android","<android>","1","0","","",""
"3347569","1","3354754","","2010-07-27 20:16:42","3","8431","<p>New Android developer here. I'm following a tutorial at <a href=""http://www.vogella.de/"" rel=""nofollow"">http://www.vogella.de/</a>. The first applications (does temperature conversion) works. The second (does preferences and uses a menu) one never shows up. I've tried using both Helios and Galileo. I've tried re-installing Android SDK. I've tried removing the test device and re-creating it. Others say this tutorial works.</p><p>When the other app works, it doesn't get the two lines ""No Launcher activity found!"" and ""The launch will only sync the application packages on the device.""</p><p>What I see:</p><pre><code>------------------------------...] Android Launch!...] adb is running normally....] No Launcher activity found!...] The launch will only sync the application package on the device!...] Performing sync...] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'TestDevice'...] Uploading de.vogella.android.preferences.apk onto device 'emulator-5554'...] Installing de.vogella.android.preferences.apk......] Success!...] \de.vogella.android.preferences\bin\de.vogella.android.preferences.apk installed on device...] Done!</code></pre><p><strong>UPDATE:</strong> here is the text from my Android manifest file</p><pre><code>&lt;manifest     xmlns:android=""schemas.android.com/apk/res/android"";    package=""de.vogella.android.preferences""     android:versionCode=""1""     android:versionName=""1.0""&gt;     &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;         &lt;activity android:name="".HelloPreferences"" android:label=""@string/app_name""&gt;        &lt;/activity&gt;         &lt;activity android:label=""Preferences"" android:name=""Preferences""&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt;</code></pre>","339736","","866450","","2012-07-18 20:01:54","2012-07-18 20:01:54","Android sample app not showing up","<android-emulator><android>","1","4","","",""
"3347766","1","3354725","","2010-07-27 20:40:31","0","1068","<p>How can I add/delete/modify values in ""default.properties"" for Android.</p><p>Any examples?</p><p>Thanks,Sana.</p>","402637","","","","","2010-07-28 15:50:07","add/delete/modify values in ""default.properties""","<android>","3","2","","",""
"3348082","1","3368638","","2010-07-27 21:18:16","0","1963","<p>My main dev phone is a Nexus 1 running 2.2. I have successfully been streaming live video to this device from a Wowza server for several weeks now.</p><p>I have now taken my application (without modifications) and put it on a Sony Ericsson Xperia running 1.6. The video will not play. I get the following errors:</p><pre><code>MediaPlayer: Couldn't open file on client side, trying server side...MediaPlayer: info/warning (1/26)PlayerDriver: Command PLAYER_INIT completed with an error or info PVMFFailureMediaPlayer: Error:(1,-1)VideoView: Error: 1,-1</code></pre><p>I've been googling around, but just can't seem to get a clear answer. Does anyone know if live streaming just doesn't work on some versions of Android?</p>","259645","","259645","","2010-07-27 21:25:15","2012-08-10 10:09:52","Does RTSP live streaming just not work on Android 1.5/1.6?","<android><rtsp>","2","3","0","",""
"3348091","1","3348121","","2010-07-27 21:19:34","0","1099","<p>In my android application, I am using the tab view and so I have two tabs: parameters and results.</p><p>the user enters the various parameters on the first tab and then switches to the second tab to view the results.</p><p>i have a service that performs some long-running calculations.  the user enters parameters on the first tab and hits 'calculate'.  They can make adjustments and hit 'recalculate' and the service is updated with the new parameters.</p><p>As these calculations progress, I want the user to be able to switch to the results tab to view the results of the latest calculation.  They would then view the results and be able to switch back to the parameters tab to make adjustments.</p><p>I can think of two approaches:</p><p>-register the 'results tab' with the service and when the service reaches a milestone, it calls directly to the 'results tab'.</p><p>-have a timer running in the 'results tab' and have it query against the bound service on a regular interval and update accordingly.</p><p>Do people have comments or recommendations for these two approaches?</p>","69983","","69983","","2010-07-27 21:59:52","2011-04-12 15:24:39","how to display progress of service in android","<android><service><activity>","2","1","1","",""
"3348225","1","7272202","","2010-07-27 21:39:02","6","1699","<p>Currently in my design I've got a base abstract class that all of my activities extend from, however I discovered recently that in order to use a MapView you need to make your activity extend MapActivity.  Since Java does not have multiple inheritance I was wondering if there is any way I can use a MapView without having to recreate my design for my application.</p><p>Thanks in advance for any help!</p><p>Regards, celestialorb.</p>","384386","","","","","2011-09-01 14:57:11","Is it possible to use a MapView without having to extend MapActivity?","<java><android><inheritance><map><activity>","2","1","5","",""
"3348238","1","3348274","","2010-07-27 21:40:03","1","622","<p>I'm using an sqlite database in my app.  I have this dbhelper class in a services class like so.</p><pre><code>    public class MushroomService {        private int downloadprogress;        private int databasesize;        private DataBaseHelper myDbHelper;    }    public MushroomService(Context context)    {        myDbHelper = new DataBaseHelper(context);        downloadprogress = 0;    }</code></pre><p>The services class is a member of my application class like so:</p><pre><code>public class fungifieldguideapplication extends Application {    public MushroomService service = new MushroomService(this);}</code></pre><p>In my activity classes I access and keep this application as a local variable like so:</p><pre><code>public class Cat_Genus extends Activity {    fungifieldguideapplication appState;    ListView list_Genus;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.cat_genus);        appState = ((fungifieldguideapplication)this.getApplication());        Cursor cursor_genuslist = appState.service.GetGenusList(this);        startManagingCursor(cursor_genuslist);    }}</code></pre><p>and my service call looks like this:</p><pre><code>public Cursor GetGenusList(Context context)    {        myDbHelper = new DataBaseHelper(context);        Cursor cursor;        try         {            myDbHelper.openDataBase();            SQLiteDatabase db = myDbHelper.myDataBase;            cursor = db.query(true, ""Mushrooms"", GenusListColumns, null, null, ""Genus"", null, ""Genus ASC"", null);        }        catch(SQLException sqle)        {            throw sqle;        }        return cursor;    }</code></pre><p>I've added these overrides in to try to get rid of my memory leaks.</p><pre><code>@Override    public void onDestroy() {        list_Genus.setAdapter(null);        appState.service.CloseDB();        super.onDestroy();    }    @Override    public void onPause() {        appState.service.CloseDB();        super.onPause();    }    @Override    public void onResume() {        appState.service.OpenDB();        super.onResume();    }</code></pre><p>But I can't get my memory leaks to stop.  Could somebody help me figure out how to rid myself of these memory leaks?  These leaks are of the type:</p><pre><code>07-27 17:38:44.613: ERROR/Database(26175): Leak found07-27 17:38:44.613: ERROR/Database(26175): java.lang.IllegalStateException: /data/data/net.daleroy.fungifieldguide/databases/Mushrooms.db SQLiteDatabase created and never closed07-27 17:38:44.613: ERROR/Database(26175):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1695)07-27 17:38:44.613: ERROR/Database(26175):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:739)07-27 17:38:44.613: ERROR/Database(26175):     at net.daleroy.fungifieldguide.data.DataBaseHelper.openDataBase(DataBaseHelper.java:79)07-27 17:38:44.613: ERROR/Database(26175):     at net.daleroy.fungifieldguide.services.MushroomService.GetSpeciesListByGenus(MushroomService.java:113)07-27 17:38:44.613: ERROR/Database(26175):     at net.daleroy.fungifieldguide.activities.Cat_Species.onCreate(Cat_Species.java:46)07-27 17:38:44.613: ERROR/Database(26175):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)07-27 17:38:44.613: ERROR/Database(26175):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)07-27 17:38:44.613: ERROR/Database(26175):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)07-27 17:38:44.613: ERROR/Database(26175):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)07-27 17:38:44.613: ERROR/Database(26175):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)07-27 17:38:44.613: ERROR/Database(26175):     at android.os.Handler.dispatchMessage(Handler.java:99)07-27 17:38:44.613: ERROR/Database(26175):     at android.os.Looper.loop(Looper.java:123)07-27 17:38:44.613: ERROR/Database(26175):     at android.app.ActivityThread.main(ActivityThread.java:4363)07-27 17:38:44.613: ERROR/Database(26175):     at java.lang.reflect.Method.invokeNative(Native Method)07-27 17:38:44.613: ERROR/Database(26175):     at java.lang.reflect.Method.invoke(Method.java:521)07-27 17:38:44.613: ERROR/Database(26175):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)07-27 17:38:44.613: ERROR/Database(26175):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)07-27 17:38:44.613: ERROR/Database(26175):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","1491425","","","","","2010-07-27 22:03:47","Need help with Database Access in Android","<java><android><database><sqlite><memory-leaks>","2","0","","",""
"3348587","1","","","2010-07-27 22:39:50","0","47","<p>According to the SDK we should be able to read the bootloader and radio versions, but Eclipse is freaking out about it.</p><p>I can read any other Build.ITEM fine.</p><p>Any idea?</p>","403951","","","","","2010-07-27 22:39:50","Eclipse spazzing over Build.BOOTLOADER and Build.RADIO","<java><android><build>","0","2","","",""
"3348639","1","3350291","","2010-07-27 22:49:30","5","1081","<p>I have an Android project that contains a class that uses JNI to pull a value from a C function. The C function was built into a library using NDK. The value returned from the C function is in turn used to initialize a variable inside a class when its first loaded. This works fine. However, I also want it to work when the library is missing by providing a default value. So Im using something like this:</p><pre><code>static native String getstring();static {        try {                System.loadLibrary(""library"");                NAME = getstring();        }        catch (Exception e) {                NAME = ""Default"";        }}</code></pre><p>Despite the catch, Im still getting a UnsatisfiedLinkError when I try to run this code with the library missing. Why am I not catching the exception? What am I doing wrong?</p>","246793","","","Roger Pate","2010-10-27 04:05:55","2010-10-27 04:05:55","How to catch UnsatisifiedLinkError when using NDK-built library in an Android app?","<android><linker><jni><android-ndk>","1","0","","",""
"3348643","1","","","2010-07-27 22:49:50","5","14849","<p>How can I programatically read the SD Card's CID register, which contains a Serial Number and other information?   Can I do it through Android Java, or Native code?</p><p>Thanks in advance,Eric</p>","403960","","","","","2012-06-14 17:57:04","How to read the SD Card ID number?","<android>","9","0","5","",""
"3348648","1","","","2010-07-27 22:51:25","3","1615","<p>Is there any possibility to do a block of text in a justify layout?</p>","","anon","","","","2012-08-30 01:21:30","Justified text layout in Android?","<java><android>","1","0","1","",""
"3348931","1","","","2010-07-28 00:04:04","3","617","<p>I'm using notifications in my simple timer app (early testing stage), and found that maybe 5% to 20% of the times I fired a notification, the sound did not play. The notification appeared correctly in all other respects, including LED flash, but was silent. I have confirmed with temporary extra log lines that the sound URIs I'm using are sensible, and are in fact identical in cases that work and cases that don't. I'll summarise the code setting up the notification, in case I'm doing something monumentally stupid:</p><pre><code>// in a place called from onReceive()...NotificationManager notifications = ...;Notification n = new Notification(R.drawable.icon, text, nextMillis);n.setLatestEventInfo(...);n.flags = Notification.FLAG_NO_CLEAR | FLAG_SHOW_LIGHTS;n.ledOnMS = 250; n.ledOffMS = 1250; n.ledARGB = 0xff2222ff;n.audioStreamType = AudioManager.STREAM_ALARM;n.sound = myUri;notifications.notify((int)id, n);</code></pre><p>Here's <a href=""http://github.com/chrisboyle/timer/blob/master/src/name/boyle/chris/timer/Timer.java#L117"" rel=""nofollow"">the real thing</a>. The only common factor I've found is that in the problematic cases, the phone was asleep (screen off for more than 30 seconds). The notification is <a href=""http://github.com/chrisboyle/timer/blob/master/src/name/boyle/chris/timer/Receiver.java#L76"" rel=""nofollow"">requested from a BroadcastReceiver</a>, having been woken up from an <a href=""http://github.com/chrisboyle/timer/blob/master/src/name/boyle/chris/timer/Timer.java#L56"" rel=""nofollow"">RTC_WAKEUP alarm</a>. The failure mode that comes to mind is that the device goes back to sleep too early, but nothing in logcat suggests this. In fact I can't see any difference in logcat between success and a missing sound. In an attempt to work around sleep issues, if there are any, I have added (in <a href=""http://github.com/chrisboyle/timer/commit/09e88ec59c320561b01c72a0a508cb8a974371d4"" rel=""nofollow"">this commit</a>) this WakeLock temporarily:</p><pre><code>+ PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, ""Timer"");+ wl.acquire();+ Log.d(TimerActivity.TAG, ""Got wake lock"");  notifications.notify((int)id, n);  Log.d(TimerActivity.TAG, ""Notified!"");+ try {+     Thread.sleep(1000);+ } catch (InterruptedException e) { e.printStackTrace(); }+ Log.d(TimerActivity.TAG, ""Released wake lock"");+ wl.release();</code></pre><p>...and the problem has not been seen since I added this, but that might be coincidence, and this is obviously an ugly hack that I'd rather avoid when I actually release this project (currently only one other person uses it that I know of).</p><p>This has been seen on two Nexus Ones running Android 2.2 (Froyo). It was not seen on 2.1, but wasn't used much on that version, and was not seen on 1.6 on a G1, where it was used for a few months. It has been seen at all times of day, <strong>with sounds from the SD card only</strong> <strike>and from internal storage</strike>. <strong>As of January 2011 on Android 2.2.1 it is only occurring with ringtones from the SD card.</strong> I've also searched the <a href=""http://code.google.com/p/android/issues"" rel=""nofollow"">Android bug tracker</a> a bit, to no avail.</p><p>Filed it <a href=""https://github.com/chrisboyle/timer/issues/14"" rel=""nofollow"">in my app's issue tracker</a> but it now seems like it might be an OS bug. I'm doing nothing different when the tone is from the SD card; it's just a URI as far as the app's concerned.</p>","6540","","6540","","2011-01-06 20:39:39","2011-01-06 20:39:39","Why are my notifications sometimes silent with ringtone from SD card?","<android><audio><notifications>","1","0","2","",""
"3349056","1","3349100","","2010-07-28 00:29:47","2","446","<p>I'm getting unexpected behavior in my Android 1.5 application under the Windows emulator and debugging with Eclipse.  Here's a generalization of what the code is doing:</p><pre><code>if (someCondition) {    System.out.println(""got here"");    return ""a"";}if (someOtherCondition)    return ""b""return ""c"";</code></pre><p>If I step through this code with the debugger, if <code>someCondition</code> is true it outputs ""got here"" but then <em>jumps to the final return statement</em> as if it's going to execute that line.  From what I can tell, it is returning ""a"" but it's confusing because it seems like it is going to return ""c.""</p><p>If <code>someCondition</code> is false, and <code>someOtherCondition</code> is true, the debugger steps to the <code>return ""b""</code> line - it doesn't jump to the final return statement and then leaves the method as expected.</p><p>As I mentioned, it seems like it is always returning the expected behavior but the fact that the debugger jumps to the wrong line had me chasing phantom bugs.  A full rebuild, restarting Eclipse and restarting Windows each didn't address the problem - it's fully re-createable.</p><p>Any ideas?</p>","164874","","","","","2010-07-28 00:40:06","Why is the Android emulator skipping my return statement?","<android><eclipse><debugging>","2","0","","",""
"3349121","1","4401227","","2010-07-28 00:49:33","57","36418","<p>I want to restrict the chars to 0-9, a-z, A-Z and spacebar only.  Setting inputtype I can limit to digits but I cannot figure out the ways of Inputfilter looking through the docs.</p>","293565","","","","","2014-04-03 21:15:00","How do I use InputFilter to limit characters in an EditText in Android?","<android><edittext>","9","0","20","",""
"3349199","1","","","2010-07-28 01:11:07","1","263","<p>the precondition: I'm working on the android automated test, so we can not touch the source code of app, but just test it.</p><p>the question:  How to get the instance of the dialog after it pop up?   After we get the instance of it, it will be so convenient for the further operation, like directly set the value of it, instead of send the key event to the activity so many times. </p><p>Thanks.</p>","402068","","","","","2011-08-20 16:22:48","How to get the instance of the dialog (like DatePickerDialog, ProgressDialog, TimePickerDialog) after it pop up","<android><dialog><automated-tests>","2","0","","",""
"3349208","1","","","2010-07-28 01:13:13","0","289","<p>I have some pretty simple Soundboard applications on the Android Market that work flawless on an LG Ally, the Motorola Droid, and the Nexus One, but I recently received an e-mail from a user with the Motorola DroidX claiming that most of the sounds do not work.  I've exchanged a few e-mails with him.  He claims the Soundboard is the only application running, and he's double checked to make sure that the Media Volume wasn't set to minimum.  I'm kind of stumped as to why it would just fine on other phones, but not the DroidX.  I really don't have access to one either to play around with.  The application isn't doing anything cosmic to play the sounds.  Below is a code snippet.  Any insights into what might be causing the hang up are greatly appreciated.</p><pre><code>public void play(Sample sample) {  Log.v(TAG, ""Playing: "" + getString(sample.getButtonTextResId()) + "" (""    + sample.getSoundResId() + "")"");  if (mPlayer != null) {   mPlayer.stop();   mPlayer.release();  }  MediaPlayer player = MediaPlayer.create(this, sample.getSoundResId());  mPlayer = player;  if (player != null) {   player.setVolume(1.0f, 1.0f);   player.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {    @Override    public void onCompletion(MediaPlayer mp) {     mp.release();     mPlayer = null;    }   });   player.start();  } }</code></pre>","388695","","","","","2010-08-06 00:46:38","MediaPlayer not playing sounds on DroidX","<android><media-player>","1","0","","",""
"3349352","1","","","2010-07-28 01:53:46","3","1165","<p>Is there a way to route requests made through the web browser on an Android device through Fiddler? I would like to debug web requests that my device is making when I load a web page, and the equivalent emulator not necessarily giving me the same results.</p><p>Thanks,</p><p>Dave Morris</p>","255311","","","","","2011-12-28 02:47:20","Debugging Web Requests on an Android Device","<android><debugging><fiddler>","1","1","","",""
"3349366","1","3349519","","2010-07-28 01:57:16","0","393","<p>I got a event log information</p><p><strong>I/battery_level( 1147): [0,3200,420]</strong></p><p>I look up event-log-tags and find:</p><p><strong>2722 battery_level (level|1|6),(voltage|1|1),(temperature|1|1)</strong></p><p>I find the follow information in the file for the format.</p><p><strong>Optionally, after the tag names can be put a description for the value(s) of the tag.</strong> </p><p><strong>Description are in the format</strong></p><pre><code>(&lt;name&gt;|data type[|data unit])</code></pre><p>Multiple values are separated by commas.</p><p>The data type is a number from the following values:</p><p>1: int</p><p>2: long</p><p>3: string</p><p>4: list</p><p>The data unit is a number taken from the following list:</p><p>1: Number of objects</p><p>2: Number of bytes</p><p>3: Number of milliseconds</p><p>4: Number of allocations</p><p>5: Id</p><p>6: Percent</p><p><em>So my question is who know the means about the temperature value and explain to me the real information?</em> </p><p>Form my log information, we know the temperature is a int type and the value is number of objects. I totally miss understand the means about the value, 420. I can assertion 420 isn't Fahrenheit/Celsius temperature.</p>","404046","","","","","2010-07-28 02:40:06","what does mean about battery_level in event log","<android>","1","0","","",""
"3349389","1","3349752","","2010-07-28 02:04:15","1","250","<p>How can use in my raw(html file) to webview?</p>","389389","","","","","2010-07-28 04:01:15","Android:how use to my file","<android>","2","0","","",""
"3349400","1","","","2010-07-28 02:07:50","3","860","<p>Please Help me in making real time call log...</p><p>I want to create real time log for incoming/outgoing/missed calls in my phone but i am unable to do this as it seems impossible to have account of running calls.</p><p>i am getting last call in call history but not the running one.</p><p>Please suggest some method to implement this.I need help urgent.</p><p>Thanks..</p>","404052","","53212","","2010-07-28 02:27:26","2011-02-06 02:30:47","How to make real time log for incoming/outgoing/missed calls on phone","<android>","1","1","1","",""
"3349447","1","3357869","","2010-07-28 02:24:23","3","3775","<p>I have three <code>ListView</code> widgets in the same <code>LinearLayout</code>. Something like this (I'm omitting XML elements that are not relevant in this example):</p><pre><code>&lt;LinearLayout&gt;    &lt;ListView      android:layout_width=""fill_parent""      android:layout_height=""360dp""/&gt;    &lt;ListView      android:layout_width=""fill_parent""      android:layout_height=""360dp""/&gt;    &lt;ListView      android:layout_width=""fill_parent""      android:layout_height=""360dp""/&gt;&lt;/LinearLayout&gt;</code></pre><p>This forces the list to have a height of 360 dip. Of course, that will be its height even if there are few list items. So, my question is how can make the lists have an automatic height? What I want is that the <code>ListView</code> height takes the exact size of the sum of all its list items.</p>","244296","","","","","2011-01-19 11:31:50","How to configure ListView to automatically change its height?","<android><gui><listview>","3","2","3","",""
"3349464","1","","","2010-07-28 02:29:27","2","685","<p>I am creating an Android widget. This widget has a ImageView on it. I would like to rotate the image in the ImageView - is there any way to do this (without manually creating new images in a desktop photo editor such as Photoshop and including them in the app)?</p>","764272","","","","","2011-10-21 13:45:40","Rotate image in RemoteViews?","<android><imageview>","1","3","","",""
"3349693","1","3349938","","2010-07-28 03:25:25","11","6482","<p>I am going to make a grid of images and I am trying to figure out whether to use an array adaptor or a baseadaptor. While the <a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"">GridView example</a>, stores the data in an array, it uses a BaseAdapter rather than a ArrayAdaptor. I am curious why this is. One thing I noticed about an ArrayAdapter, is that its constructor takes a <code>textViewResourceId</code> for some unknown reason - although the documentation say the getView can be used to make it work with other kinds of views as well. So, if I want a fixed grid of images for a menu, which class would you recommend choosing?</p>","165495","","","","","2010-07-28 04:23:27","BaseAdapter or ArrayAdaptor - Android","<android>","1","0","5","",""
"3349718","1","3359807","","2010-07-28 03:30:33","0","3322","<p>From the previous question I asked, I am still having the same question. I do not know how to use database (SQLite) to 'sync' with my application to log in or register </p><pre><code> package log1.log2;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;public class Login extends Activity { UserDB db = new UserDB(this);/** Called when the activity is first created. */ private EditText etUsername; private EditText etPassword; private Button btnLogin; private Button btnRegister; private TextView lblResult;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);     // Get the EditText and Button References        etUsername = (EditText)findViewById(R.id.usernametxt);        etPassword = (EditText)findViewById(R.id.passwordtxt);        btnLogin = (Button)findViewById(R.id.btnLogin);        btnRegister = (Button)findViewById(R.id.btnRegister);        lblResult = (TextView)findViewById(R.id.msglbl);        //Cursor c = (Cursor) db.getAllTitles();        //Button btnArrival = (Button) findViewById(R.id.btnRegister);     //btnArrival.setOnClickListener(this);    // Set Click Listener        btnRegister.setOnClickListener(new OnClickListener() {         @Override         public void onClick(View v) {          Intent intent=new Intent(Login.this,Register.class);            startActivity(intent);         }        });    btnLogin.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {  db.open();  // Check Login  String username = etUsername.getText().toString();  String password = etPassword.getText().toString();  if(username.equals(""select username from Users"")){   if(password.equals(""select password from users where username = username""))   {     Intent intent=new Intent(Login.this,Test.class);     startActivity(intent);   }   else   {    lblResult.setText(""Wrong password"");   }  } else {   lblResult.setText(""Username does not exist. Please register."");  }  db.close(); }});  }}</code></pre><p>Should I use the 'select' 'from' 'where' statement? Or there is another way? </p>","380770","","","","","2010-07-29 05:56:29","SQLite android login and register","<sql><android>","1","0","","",""
"3349779","1","","","2010-07-28 03:47:20","0","240","<p>I want to access contacts in my app and don't want to start the native app, but write my own contacts listview  and processing filter is too much tricky.</p><p>So is it possible to embed the contactslistview into my application?</p>","404101","","","","","2011-05-08 20:28:34","How to embed android contact to MY application","<android>","1","0","","",""
"3349818","1","","","2010-07-28 03:57:31","0","2905","<p>I have a xml file with info inside. I want to convert the xml file to sqlite database without using a SD card in android platform(Java Language). Does anyone have any idea how to do it?</p>","404105","","114066","","2010-07-28 10:54:41","2012-10-30 13:21:30","How to convert xml to sqlite database in android platform?","<android><xml><sqlite>","2","2","1","",""
"3349860","1","3349910","","2010-07-28 04:06:24","1","1621","<p>I want to be able to make an iphone and android app using php. I have looked at phonegap and appcelerator and it seems like only html and javascript can be used. These frameworks want to make it easy to make apps using web technologies and PHP i would argue is one of the biggest web technologies, but I'm not seeing much (if any) support. I am new, so I could be wrong on multiple levels. So please enlighten me and let me know if what I am trying to achieve is possible.</p><p>Thanks in advance.</p>","394988","","","","","2010-07-28 04:17:48","Is it possible to create a php based iphone/android app with PhoneGap or Appcelerator?","<php><javascript><iphone><android><phonegap>","2","0","","",""
"3350015","1","3350149","","2010-07-28 04:51:05","2","1568","<p>I supply a cursor to a ListActivity like this:  My question is how/when should I close my cursor when I am done?</p><pre><code>Cursor cursor = getContentResolver().query(uri, null, null, null, null);        if (cursor != null) {            mCursorAdapter = new CursorAdapter(this, cursor);            setListAdapter(mCursorAdapter);        }</code></pre><p>Thank you.</p>","286802","","","","","2010-07-28 05:28:04","When should I close the cursor that I supply to ListView","<android>","1","0","1","",""
"3350020","1","","","2010-07-28 04:51:52","1","2070","<p>Can anybody help me to create a tooltip in android ?</p>","397969","","61974","","2010-07-28 20:31:30","2010-12-16 01:42:22","tooltip in android","<android><tooltip>","1","1","","",""
"3350034","1","3350214","","2010-07-28 04:57:23","0","136","<p>I want to take an Android based tablet - <em>not</em> a phone, I need a large screen and I don't need 3G.</p><p>The guy with the tablet will attach a web cam to it and a s/w application in the Adnroid tablet will stream the cameras feed to a web page (there may later be a need to stream video back to the Android tablet - tbd).</p><p>Additionally, I need 2 way Voice over IP.</p><p>I may (tbd) need to use a TCP interace to a device which might, or might not, be achieved through the Andoid.</p><p>With so much open: is there any open source that can handle that, either as a grooup or individually, or should I code my own? Since I don't normally do this kinds of stuff what's the best approach, in terms of protocols, etc</p><p>I'd like to demo something in a month or so.  Sorry that this is vague - but so is the person asking for it (which might make me lean towards roll your won simply because of shifting requirements. But I might roll my own around off the shelf building block, for instance if I can find off the shelf open source VoiP, etc)</p>","192910","","52444","","2012-08-17 08:38:24","2012-08-17 08:38:24","Off the shelf or roll my own?","<android><video-streaming><voip>","3","0","","",""
"3350079","1","","","2010-07-28 05:10:10","4","597","<p>Does android 2.2 have support for Zeroconf and MDNS related APIs ?</p>","404135","","","","","2011-08-12 21:30:49","Is Zeroconf API available in Android?","<android>","1","0","1","",""
"3350139","1","4844352","","2010-07-28 05:26:19","10","2308","<p>I like the title bar style from the Android preference category.</p><p>In my Activity (not a <code>PreferenceActivity</code>) How can I use the same style?</p>","251434","","403455","","2012-08-30 17:29:16","2012-08-30 17:29:16","Emulate android preference category look/feel","<android><gui><android-preferences>","2","0","5","",""
"3350154","1","3350164","","2010-07-28 05:29:08","2","149","<p>For programming the Android, which Eclipse do I need ? (I means Eclipse for c++ or java or ...)</p>","379683","","12895","","2010-07-28 05:38:49","2010-07-28 10:12:17","Which type of Eclipse","<android><eclipse>","3","0","","",""
"3350198","1","3350220","","2010-07-28 05:41:56","1","1010","<p>I got a code for connecting the web page but it shows always </p><blockquote>  <p>""Connection failed; Host is  unresolved: www.streetcar.org:80""</p></blockquote><p>The code is as follows.</p><pre><code>package myapp.httpdwnd;import android.app.Activity;import java.io.InputStream;  import android.os.Bundle;  import android.widget.LinearLayout;  import android.widget.TextView;  import java.io.IOException;  import java.io.BufferedReader;  import java.io.InputStreamReader;  import org.apache.http.HttpEntity;  import org.apache.http.HttpResponse;  import org.apache.http.client.HttpClient;  import org.apache.http.client.methods.HttpGet;  import org.apache.http.impl.client.DefaultHttpClient;  import org.json.JSONArray;  import org.json.JSONException;  import org.json.JSONObject;  public class httpdwndActivity extends Activity{      TextView txt;    @Override  public void onCreate(Bundle savedInstanceState)   {    super.onCreate(savedInstanceState);     LinearLayout rootLayout = new LinearLayout(getApplicationContext());               txt = new TextView(getApplicationContext());               rootLayout.addView(txt);               setContentView(rootLayout);               txt.setText(""Connecting..."");                        txt.setText(connect(""http://www.streetcar.org/mim/cable/images/cable-01.jpg""));   }    private String connect(String url){                 // Create the httpclient                 HttpClient httpclient = new DefaultHttpClient();                 // Prepare a request object                 HttpGet httpget = new HttpGet(url);                  // Execute the request                 HttpResponse response;                 // return string                 String returnString = null;                 try {                     // Open the webpage.                     response = httpclient.execute(httpget);                     if(response.getStatusLine().getStatusCode() == 200){                         // Connection was established. Get the content.                          HttpEntity entity = response.getEntity();                         // If the response does not enclose an entity, there is no need                         // to worry about connection release                         if (entity != null) {                             // A Simple JSON Response Read                             InputStream instream = entity.getContent();                             // Load the requested page converted to a string into a JSONObject.                             JSONObject myAwway = new JSONObject(convertStreamToString(instream));                             // Get the query value'                             String query = myAwway.getString(""query"");                             // Make array of the suggestions                             JSONArray suggestions = myAwway.getJSONArray(""suggestions"");                             // Build the return string.                             returnString = ""Found: "" + suggestions.length() + "" locations for "" + query;                             for (int i = 0; i &lt; suggestions.length(); i++) {                                 returnString += ""\n\t"" + suggestions.getString(i);                             }                             // Close the stream.                             instream.close();                         }                     }                     else {                         // code here for a response other than 200.  A response 200 means the webpage was ok                         // Other codes include 404 - not found, 301 - redirect etc...                        // Display the response line.                         returnString = ""Unable to load page - "" + response.getStatusLine();                     }                 }                 catch (IOException  ex) {                     // thrown by line 80 - getContent();                     // Connection was not established                    returnString = ""Connection failed; "" + ex.getMessage();                 }                 catch (JSONException ex){                     // JSON errors                     returnString = ""JSON failed; "" + ex.getMessage();                 }                 return returnString;           }             private static String convertStreamToString(InputStream is) {                 /*                 * To convert the InputStream to String we use the BufferedReader.readLine()                 * method. We iterate until the BufferedReader return null which means                 * there's no more data to read. Each line will appended to a StringBuilder                 * and returned as String.                 */                 BufferedReader reader = new BufferedReader(new InputStreamReader(is));                 StringBuilder sb = new StringBuilder();                 String line = null;                 try {                     while ((line = reader.readLine()) != null) {                         sb.append(line + ""\n"");                     }                 } catch (IOException e) {                     e.printStackTrace();                 } finally {                     try {                         is.close();                     } catch (IOException e) {                         e.printStackTrace();                     }                 }                 return sb.toString();             } }</code></pre><p>What may be the mistake in this?</p><p>Please help.</p><p>Thanks.</p>","402980","","379693","","2010-10-30 08:51:50","2011-09-28 02:44:58","Not Connecting To Web Page On Android","<android><android-emulator><manifest><android-manifest>","3","1","","",""
"3350283","1","3350332","","2010-07-28 06:02:12","10","21972","<p>Is there any way to run terminal commands on my application and then access the data on my UI? Specifically <code>top</code>.</p>","393459","","309308","","2010-07-30 01:56:31","2013-09-18 21:21:11","Any way to run shell commands on android programmatically?","<android><linux>","4","0","16","",""
"3350408","1","3362595","","2010-07-28 06:30:26","31","12259","<p>i have done SQLite database programming for Android, but i dont know anything aboutContent-Provider except this: ""As i have referred <a href=""http://developer.android.com/guide/topics/providers/content-providers.html"">Android Developer page </a>, Android SDK explained about ""Content-provider"" as it is used to store and retrieve data."" </p><p>But then, </p><ol><li>What is the exact difference between ""Content-Provider"" and ""SQLite Database""?</li><li>Which is best to store data, when ?</li></ol><p>Any example or helps !!</p>","379693","","379693","","2010-07-30 07:05:35","2014-03-01 04:22:50","Exact Difference between ""Content-Provider"" and ""SQLite Database""","<android>","7","0","11","",""
"3350423","1","3350800","","2010-07-28 06:32:59","0","1648","<p>may i know is there any way to generate external log file?</p>","196579","","","","","2010-07-28 07:37:16","How to generate external logfile in android app?","<android><android-emulator>","1","2","1","",""
"3350602","1","","","2010-07-28 07:05:02","0","492","<p>I have 2 nested tabactivities - TopTabActivity and EmbeddedTabActivity. I want to pass some information from TopTab Activity to EmbeddedTabActivity when OnTabChanged Event is triggered in TopTabActivity. Both activities are initialized in the beginning of the appln. The problem is when I use Intent to pass the information from TopTabActivity to the existing EmbeddedTabActivity using startActivity() functionality, it starts a new instance of the EmbeddedTabActivity. I dont wish to have this behaviour. My wish is to take some action in the existing instance of the EmebeddedTabActivity when Intent is sent from the TopTabActivity.</p><p>How can I accomplish this ?</p>","404193","","","","","2010-07-28 07:08:12","Nested TabActivities and Intent based Communication","<android><android-intent><tabactivity>","1","0","","",""
"3350880","1","","","2010-07-28 07:52:06","0","202","<p>My device Firmware version is 1.6 and whenever I run my application on Device I got an error :</p><p>ERROR/AndroidRuntime(834): java.lang.VerifyError:dalvikvm(834): VFY: unable to resolve static field 966 (CONTENT_URI) in Landroid/provider/ContactsContract$CommonDataKinds$Phone;</p><p>I think I am getting this error because of ""android.provider.ContactsContract"" class to build my application? because it's API level is 5 .</p><p>So can any body help me to resolve the issue and how can I run a single build on 1.5 and 1.6 and 2.0 - above sdk ?</p><p>ThanksInAdvance</p>","286919","","","","","2010-07-28 08:18:40","VerifyError in run app on device","<android>","1","0","","",""
"3350895","1","3352722","","2010-07-28 07:54:56","3","3975","<p>Trying the following tutorial</p><p><a href=""http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html"" rel=""nofollow"">http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html</a></p><p>i am having trouble understanding callback URL</p><p>my twitter app name is ""faisal-android"" and my call back url i defined in code is </p><p>myapp://wozzon-android</p><p>and having entry in xml file as</p><pre><code>           &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.VIEW"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;                &lt;data android:scheme=""myapp"" android:host=""faisal-android"" /&gt;            &lt;/intent-filter&gt;</code></pre><p>m i way to defining callback url is correct ??</p><p>when i run the code it gives me error ""Authorization failed (server replied with a 401). This can happen if the consumer key was not correct or the signatures did not match""</p><p>my twitter app account settings as following<img src=""http://www.freeimagehosting.net/uploads/a0c2689c73.png"" alt=""alt text""></p>","216431","","","","","2014-01-06 17:06:00","android twitter outh tutorial callback problem","<android><twitter-api>","3","0","1","",""
"3350954","1","","","2010-07-28 08:03:07","3","2744","<p>I've got the URL of a .png image, that needs to be downloaded and set as a source of an ImageView. I'm a beginner so far, so there are a few things I don't understand:1) Where do I store the file?2) How do I set it to the ImageView in java code?3) How to correctly override the AsyncTask methods?</p><p>Thanks in advance, will highly appreciate any kind of help.</p>","404329","","","","","2011-06-08 11:57:03","Android: How to download a .png file using Async and set it to ImageView?","<android><png><android-asynctask>","2","0","4","",""
"3351387","1","3351976","","2010-07-28 09:07:44","0","1020","<p>I have set image in AbsoluteLayout but it'll not display in full screen on G1 but when i run the same application in Nexus it is working properly.</p><p>I have set setContentView(new Test(this)) in my activity class. Test is my AbsoluteLayout class.</p><p>My code looks like :</p><pre><code>public class Test extends AbsoluteLayout {public Test(Context context) {   super(context);   final RelativeLayout rl = new RelativeLayout(context);    final android.widget.RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(            LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);    rl.setLayoutParams(params);    this.addView(rl, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,            LayoutParams.FILL_PARENT));    ImageView mImageView = new ImageView(context);mImageView.setImageBitmap(((DataStorage)context.getApplicationContext()).getImage());    this.addView(mImageView);   }}</code></pre><p>Can anyone tell me that why i am not getting full image on G1 mobile screen?</p>","385343","","851273","","2012-06-13 04:29:40","2012-06-13 04:29:40","How to set full image in Absolute Layout in android","<android><android-layout>","1","2","1","",""
"3351447","1","","","2010-07-28 09:16:27","0","1927","<p>I am working on android 2.2, I developed an application which is having an Image View and a button view.In HVGA both the image and button are visible, but in QVGA I could see only the image. Rest of the buttons that are present under the image view is not visible.</p><p>How do I manage multi-screen resolutions in Android ?Is there any thing like maintaining Aspect Ratio of the image to adjust the size as well maintain clarity.</p><p>I tried placing the buttons above the image view and it worked properly for HVGA and QVGA. Please let me know how can I handle the situation by placing the buttons below the image view.</p><p>I have done it in relative layout</p><p>Image width and height is fill_parent and wrap_contentButton width and height is wrap_content and wrap_content.</p>","404322","","21234","","2010-07-28 09:23:58","2010-07-28 09:36:17","How To Create Screen Size Independent Android Applications","<android><layout>","2","0","","",""
"3351545","1","","","2010-07-28 09:30:23","2","3156","<p>I am learning android. I am trying to upadate contact number programmatically. Could anyone help me please how can I do that.</p><p>My effort is:</p><pre><code>String lNumber = pCur.getString( pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));   ContentValues values = new ContentValues();Uri lPhoneUri = Uri.withAppendedPath(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, ContactsContract.CommonDataKinds.Phone.NUMBER);                      values.put(ContactsContract.CommonDataKinds.Phone.NUMBER, ""45323333""));getContentResover().update(lPhoneUri, values, ContactsContract.CommonDataKinds.Phone.NUMBER+""=?"", new String[] { lNumber });        </code></pre>","404333","","243782","","2010-07-28 10:03:22","2013-08-03 08:12:23","How to update contact number using Android","<android>","2","0","1","",""
"3351553","1","3351594","","2010-07-28 09:31:05","7","10841","<p>I have an Activity A, and there is a button B in the view. If somebody presses B then I want a pop-up which can take some part of screen making the A invisible in that area but rest of A is visible but not active. How can I achieve this?</p>","195802","","","","","2012-10-19 07:00:33","How to show an Activity as pop-up on other Activity?","<android><activity>","2","0","2","",""
"3351650","1","3351717","","2010-07-28 09:46:23","2","359","<p>In my application i have two screen. Screen1 and screen2 . If i am in screen2 when i click the back button it shows the screen1. I need to close application at the time of clicking back button in the screen2 . How to do this???</p>","398981","","","","","2010-07-28 10:01:26","don't go to previous screen in android?","<android>","2","0","","",""
"3351742","1","","","2010-07-28 09:58:09","0","3462","<p>I want to upload files on a web server in my android app.Currently i am able to upload files around 5mb from the device but more than this gives a outofmemory exception and also makes app very unstable.</p><p>i am looking for a method using which we can upload the data in the app background plus of bigger size. Any tutorials/ code is highly appreciated.</p><p>thanks in advance.</p>","152867","","","","","2011-01-09 12:14:25","Upload large files on the web server on android","<android><upload>","1","1","1","",""
"3351804","1","","","2010-07-28 10:06:00","0","914","<p>I have a service MyService.java in Application ""ServiceDemo"". The manifest of this application looks like this</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.moto.dev""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Sample""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;service android:enabled=""true""                  android:name="".MyService""                  android:permission=""syh.permission.STARTMYSERVICE""&gt;        &lt;/service&gt;      &lt;/application&gt;       &lt;permission        android:protectionLevel=""normal""        android:label=""Start My Receiver""        android:description=""@string/startMyActivityDesc""         android:name=""syh.permission.STARTMYSERVICE""&gt;       &lt;/permission&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>I have another application ""CallerService"" manifest looks like this</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.moto.dev""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".CallerService""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-permission android:name=""syh.permission.STARTMYSERVICE""&gt;&lt;/uses-permission&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;""src/com/moto/dev/Sample.java""&lt;/manifest&gt; </code></pre><p>I have an activity from where I m trying to start the service on the click of the button</p><pre><code>Intent intent = new Intent();//path where my service is located in application ""ServiceDemo""intent.setClassName(""com.moto.dev"",""com.moto.dev.MyService"");startService(intent);</code></pre><p>This fails to work. Says ""unable to start service intent""May I know where I am going wrong.</p>","404356","","","","","2012-12-02 11:49:33","How to execute a remote service","<android><android-service>","2","0","","",""
"3351862","1","3359791","","2010-07-28 10:13:59","0","161","<p>Yesterday google released a new service regarding the android market. A new way to check the licensing of your applications. See the <a href=""http://android-developers.blogspot.com/2010/07/licensing-service-for-android.html"" rel=""nofollow"">blog</a> for more informations.</p><p>Has anybody updated her/his app already? How is it working for you? Are there any problems with it? Would you wait some days to see if there are severe bugs left that won't be found until the mass of apps hits the licensing server?</p>","114066","","","","","2010-10-03 12:00:56","Has somebody tried the new Licensing service already?","<android><piracy-prevention>","1","0","","",""
"3351929","1","3352073","","2010-07-28 10:23:21","2","4256","<p>I have method to find the DHCP address and host address.how to find the dynamic ip address assigned to my device.I am able get the address from <a href=""http://www.ip2location.com/default.aspx"" rel=""nofollow"">http://www.ip2location.com/default.aspx</a></p><p>how to get this IP in device?</p>","286831","","137350","","2010-07-28 10:36:22","2012-01-05 23:17:59","Android How to find Dynamic IP from device?","<android><networking>","3","0","","",""
"3352014","1","3352026","","2010-07-28 10:36:59","3","3033","<p>If possible, how can I get (and post) data from a mysql database using javascript? I know I can use php and other languages, but I just need to know if this is possible with javascript?</p><p>Thanks in advance.</p>","394988","","","","","2010-08-03 10:38:59","How to get data from a mysql database using javascript?","<php><javascript><iphone><mysql><android>","7","1","","",""
"3352031","1","3352070","","2010-07-28 10:39:35","2","5801","<p>basically i have one time  </p><pre><code>currentTime = DateFormat.getTimeInstance().format(new Date());</code></pre><p>and i want to calculate how much time has past since currentTime.any ideas?</p>","366659","","","","","2010-07-28 10:46:10","Calculate time between two times Android","<android><time>","1","0","1","",""
"3352097","1","3352103","","2010-07-28 10:51:08","5","1394","<p>Hello Guys I simply want to ask that is it possible to deploy <strong>Silverlight</strong> Apps on Android.</p>","395661","","","","","2011-04-15 12:15:45","Is is Poossible To Deploy Silverlight Apps on Android?","<c#><android><silverlight>","3","1","","",""
"3352274","1","","","2010-07-28 11:15:51","0","199","<p>I wanted to know if there is a way to save the state of an activity before starting another test case and start the next test case from this state</p>","1170953","","","","","2011-07-16 01:06:56","ActivityInstrumentationTestCase2<axtivity>","<android>","1","0","","",""
"3352279","1","","","2010-07-28 11:17:17","1","273","<p>I'm creating a game for Android and i want to add click event on some game objects/images in my game. The problem is that the object/images is created programatically in a Thread, so i don't know how to add a click event to them. My code structur looks like this:</p><p>-> Main.xml</p><p>-> Main.class</p><p>--> MainView.class</p><p>---> MainThread.class</p><p>And the objects is created in the MainThread class. How would i add click event to them?</p><p>Im create the object like this, in MainThread class:</p><pre><code>protected Bitmap image;image = BitmapFactory.decodeResource(resources, resources.getIdentifier(filename, ""drawable"", ""com.example.android.jetboy""));</code></pre>","155035","","155035","","2010-07-28 22:14:50","2010-07-28 22:14:50","Android: click event on game object","<android>","0","3","","",""
"3352360","1","","","2010-07-28 11:28:49","5","713","<p>I am using Eclipse to program for the Android OS. I use a real device to test my application on.</p><p>To test my application I click on run, then the target project i wanna run and then the Android Device Chooser pops up, where I can choose the device or emulator that I want to run the application. (like probably every programmer here).</p><p>But sometimes when my app crashes because of some exception, the Android Device Handler gets some weired behavior. Now everytime I connect my device to the computer via USB a new device shows up in the Android Device Chooser, but all them (which are the same) are ""unknown"", so I cant use my device for testing anymore.</p><p><img src=""http://a.yfrog.com/img51/1387/androiddeviceshooser.png"" alt=""alt text""></p><p>The only way to solve this is by restarting my computer. Isnt there any other way to solve the problem? Am I missing something? </p>","351723","","559850","","2011-07-26 14:52:11","2012-09-24 06:30:11","Android: Within Android Device Chooser the same device shows up several times","<device><android>","2","1","3","",""
"3352424","1","3360055","","2010-07-28 11:38:18","17","25040","<p>I know this issue should be fixed with System.setProperty(""http.keepAlive"", ""false""); before openConnection, but that didn't work to me. First try on this code works, second one fails. Even if i try this request after less than 5 seconds, it also works. If i wait more than that, it fails again</p><p>This is my code:</p><pre><code>    System.setProperty(""http.keepAlive"", ""false"");  HttpURLConnection conn = (HttpURLConnection) mURL.openConnection();  conn.setUseCaches(false);   conn.setRequestProperty(""Connection"",""Keep-Alive"");   conn.setRequestProperty(""User-Agent"", useragent);  conn.setConnectTimeout (30000) ;   conn.setDoOutput(true);         conn.setDoInput(true);   consumer.sign(conn);  InputSource is = new InputSource(conn.getInputStream());</code></pre><p>I get the exception on last line:</p><pre><code>java.io.IOException: Write error: I/O error during system call, Broken pipeW/System.err( 2164):  at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativewrite(Native Method)W/System.err( 2164):  at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.access$600(OpenSSLSocketImpl.java:55)W/System.err( 2164):  at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:583)W/System.err( 2164):  at java.io.OutputStream.write(OutputStream.java:82)W/System.err( 2164):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.sendRequest(HttpURLConnectionImpl.java:1332)W/System.err( 2164):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.doRequestInternal(HttpURLConnectionImpl.java:1656)W/System.err( 2164):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.doRequest(HttpURLConnectionImpl.java:1649)W/System.err( 2164):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1153)W/System.err( 2164):  at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:253)</code></pre><p>Does someone have an idea about what's wrong here?. Thanks!</p>","367029","","1265885","","2012-10-11 05:35:51","2014-03-12 17:38:28","HttpUrlConnection.openConnection fails second time","<android><httpurlconnection>","6","0","14","",""
"3352496","1","3379536","","2010-07-28 11:47:28","0","388","<p>Actualy the question in subject... How to configure ListView of ListActivity via xml, for example padding, dividerHeight etc...</p>","390323","","","","","2010-07-31 19:35:58","Android: is it possible to configure ListView of ListActivity via xml","<android><listview>","2","0","","",""
"3352592","1","5030084","","2010-07-28 12:02:01","29","8563","<p>I'm building a webservice and would like to use the user's google account credentials.</p><p>The service runs on GAE and will have a web client and an Android native client.</p><p>This is my first attempt of something like this and I've been reading about OpenID and the Android AccountManager library.</p><p>I'm still not sure what are my options in terms of storing the users in my Datastore. What Identifier should I use ? Is it possible to use OpenID on a native Android application ?</p><p>Any help and/or pointers would be appreciated. Thanks.</p>","404464","","","","","2012-12-18 17:16:05","Webservice credentials - OpenID/Android AccountManager?","<android><openid><gae-datastore><accountmanager>","4","0","23","",""
"3352601","1","3355639","","2010-07-28 12:02:55","0","365","<p>In an Android application I have a ListActivity. After creating it I have a broadcast receiver which has to disable some items in the list. So I have a pice of code ike this one:</p><pre><code>View child = getListView().getChildAt(i);child.setEnabled(false);</code></pre><p>It works in the way it changes the color of the disabled views to gray. But I need to avoid this items can be clicked. So I've tried to call </p><pre><code>child.setFocusable(false);</code></pre><p>or </p><pre><code>child.setClickable(false);</code></pre><p>but in both cases onListItemClick is called after pressing on a disabled option.</p><p>How can I avoid that onListItemClick method is called when these textviews are clicked?</p><p>Thanks.</p>","249699","","131871","","2010-07-28 17:30:46","2010-07-28 17:30:46","Disabling focus in TextView","<java><android><textview><android-listview>","1","0","","",""
"3352723","1","","","2010-07-28 12:19:31","2","3439","<p>I want to reboot targeted phone by SMS.  Is it possible?  How can we implement this?</p>","404052","","286204","","2010-07-28 12:45:52","2010-08-17 00:41:21","How to boot android phone programmatically?","<android><sms><reset>","4","4","3","",""
"3352734","1","3353144","","2010-07-28 12:20:45","0","181","<p>I want to know about the configuing process of Google Map in an Android Application.</p><p>Thanks,john</p>","384176","","","","","2011-03-09 09:56:10","Google Map with Android Application","<android>","2","0","","",""
"3352829","1","3403940","","2010-07-28 12:31:41","0","1566","<p>I would like to set the zoomlevel on my WebView (WebChromeClient).</p><p>According to the <a href=""http://developer.android.com/reference/android/webkit/WebSettings.ZoomDensity.html"" rel=""nofollow"">API</a> WebSettings holds a static method ZoomDensity that should do the trick but I just can't make it work. It looks like WebSettings does not have the method, Content Assistant does not suggest it or show it to me..</p><p>Neither the Webview or the WebSettings hold any other method to set the zoomlevel - so I'm stuck.</p><p>Ideas anyone?</p>","270273","","1140748","","2012-05-06 16:45:13","2012-05-06 16:45:13","Android Webview Zoom Density","<android><webview>","1","0","","",""
"3352848","1","3514604","","2010-07-28 12:33:23","1","1243","<p>I would like to make a service that runs in the background and monitors the quality. I have thought of a separate service that exposes an aidl interface to an activity, the aidl would have some monitor related functions that an activity can call. To give an example of how my service should work think of the ebuddy application that runs in the background and waits for incoming calls (I believe this is done by a service).  </p><ol><li>Is this a correct approuch to my problem?</li><li>I am currently able to create my service and use the aidl interface but when i close the activity(when I press the back button) the service is destroyed too! How to avoid that?</li><li>I would like to make a persistent notification much like ebuddy, how to do it? I have tried with notification manager but no luck, I have only managed to add at the notification section.</li></ol>","234898","","12707","","2010-07-28 15:18:28","2010-08-18 16:58:09","android service running in the background","<android><service>","1","2","","",""
"3352864","1","3853570","","2010-07-28 12:35:28","0","584","<p>I had a problem with an app, i.e., when I am moving to the previous window the control goes to the splash screen of my app because the previous activity is killed by the Android runtime. </p><p>How do I keep the previous activity alive, or how can I create the activity again and access it from the present activity.</p>","400942","","646382","","2011-08-18 13:47:59","2011-08-19 23:31:06","How to go to previous activity if the activity is killed by Android runtime?","<android>","2","0","1","",""
"3352916","1","","","2010-07-28 12:41:38","3","318","<p>When a progress dialog is displaying and we press search hard key it closes and moves to search bar of phone, even if if the progress Dialog setcancellable value is set false.</p><p>how can we avoid this?</p>","404510","","114066","","2010-07-28 13:13:07","2011-03-04 00:56:07","regarding search hard key behaviour with progress bar (android)","<android>","3","0","","",""
"3352928","1","","","2010-07-28 12:42:56","1","234","<p>If I purchase a mobile which comes with Android 1.5, will I be able to update it to Android 2.2 or does this depend on the mercy of the vendor? Basically, if I purchase a Netbook, e.g. with Ubuntu 9.10, I can update it without problems to Ubuntu 10.04.</p>","209706","","","","","2010-07-28 12:52:43","Android: free to update version?","<android>","2","1","1","2010-07-28 22:25:45",""
"3352957","1","3352978","","2010-07-28 12:46:03","3","2237","<p>The following code does not work, and throws a RuntimeException caused by NullPointerException</p><pre><code>public class ListFilteredActivity extends Activity {    LinearLayout typeSelector = new LinearLayout(this) ;    @Override    public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         ScrollView sv = new ScrollView(this);         this.setContentView(sv);         //this.typeSelector = new LinearLayout(this);         this.typeSelector.setOrientation(LinearLayout.VERTICAL);         sv.addView(this.typeSelector);     }</code></pre><p>When I moved the initialization of <code>this.typeSelection</code> inside onCreate() it works great.</p><pre><code>    @Override    public void onCreate(Bundle savedInstanceState) {       ...       this.typeSelector = new LinearLayout(this);       ...    }</code></pre><p>Why is the null pointer error? The inline declaration in the first piece of code happens as soon as constructor is called, and then the onCreate() has access to the object, isn't it?</p>","229106","","","","","2010-07-28 12:49:26","Why does not this work - Android - onCreate()","<android><initialization><activity>","1","0","","",""
"3352979","1","","","2010-07-28 12:49:29","2","4013","<p>I have a lengthy string in my Android program.What I need is, I need to split each word of that string and copy that each word to a new String Array.For eg: If the string is ""I did android program"" and the string array is named my_array then each index should contain values like:</p><pre><code>my_array[0] = Imy_array[1] = didmy_array[2] = Androidmy_array[3] = Program</code></pre><p>A part of program which I did looks like this:</p><pre><code>StringTokenizer st = new StringTokenizer(result,""|"");Toast.makeText(appointment.this, st.nextToken(), Toast.LENGTH_SHORT).show();while(st.hasMoreTokens()){String n = (String)st.nextToken();services1[i] = n;Toast.makeText(appointment.this, st.nextToken(), Toast.LENGTH_SHORT).show();}</code></pre><p>Can any one please suggest some ideas..</p>","397969","","166712","","2010-07-28 12:50:23","2010-07-28 13:58:28","Android String Array Manipulation","<android>","3","1","","",""
"3352991","1","3353030","","2010-07-28 12:50:43","1","928","<p>I am currently developing a simple info app on various uni campuses. I want the app to operate predominantly in an offline state thus I want to store all my information locally. The data within the app will not be subject to any change  thus I was wondering what the best (practice) method was to store such data? Basically should I be storing the info in a SQLite db, java file or xml?</p>","397085","","114066","","2010-07-28 13:03:29","2010-07-28 13:05:02","Storage of Static data within android app","<android><database><data>","3","0","0","",""
"3353023","1","3353053","","2010-07-28 12:55:50","4","15489","<p>In my application, sometimes the following exception is thrown:</p><pre><code>07-28 14:49:25.398: ERROR/AndroidRuntime(8097):java.lang.IllegalStateException: The content of the adapter has changedbut ListView did not receive a notification. Make sure the content ofyour adapter is not modified from a background thread, but only from theUI thread. [in ListView(2131099717, class android.widget.ListView) withAdapter(class ch.uzh.csg.games4blue.gamebase.view.UserView$UserAdapter)]07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.ListView.layoutChildren(ListView.java:1432)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.AbsListView.onLayout(AbsListView.java:1113)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.view.View.layout(View.java:6831)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.LinearLayout.layoutVertical(LinearLayout.java:998)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.LinearLayout.onLayout(LinearLayout.java:918)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.view.View.layout(View.java:6831)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1108)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.LinearLayout.onLayout(LinearLayout.java:920)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.view.View.layout(View.java:6831)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.FrameLayout.onLayout(FrameLayout.java:333)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.view.View.layout(View.java:6831)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.LinearLayout.layoutVertical(LinearLayout.java:998)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.LinearLayout.onLayout(LinearLayout.java:918)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.view.View.layout(View.java:6831)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.LinearLayout.layoutVertical(LinearLayout.java:998)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.LinearLayout.onLayout(LinearLayout.java:918)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.view.View.layout(View.java:6831)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.FrameLayout.onLayout(FrameLayout.java:333)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.view.View.layout(View.java:6831)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.widget.FrameLayout.onLayout(FrameLayout.java:333)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.view.View.layout(View.java:6831)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.view.ViewRoot.performTraversals(ViewRoot.java:996)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.view.ViewRoot.handleMessage(ViewRoot.java:1633)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.os.Handler.dispatchMessage(Handler.java:99)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.os.Looper.loop(Looper.java:123)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atandroid.app.ActivityThread.main(ActivityThread.java:4338)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atjava.lang.reflect.Method.invokeNative(Native Method)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atjava.lang.reflect.Method.invoke(Method.java:521)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atcom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)07-28 14:49:25.398: ERROR/AndroidRuntime(8097):     atdalvik.system.NativeStart.main(Native Method)</code></pre><p>It's difficult to find the error, because in the stacktrace none of my methods is listed. So, does anyone know when this exception is thrown? Thanks for any hints.</p>","","anon","6391","","2010-07-28 14:27:27","2012-02-10 08:59:21","Android: IllegalStateException - When is it thrown?","<java><android><gui><listview><layout>","6","0","1","",""
"3353080","1","4215331","","2010-07-28 13:02:37","0","1458","<p>I made an application that is using Android SDK 2.1. This application uses bluetooth to connect to multiple devices.</p><p>I have 3 HTC Dreams (Google G1) as test devices. The application is running really fine on them. They are rooted and Android 2.1 is running on them.</p><p>If I join with my HTC Desire (Android 2.1 Update 1), the streams that read from the bluetooth socket are always closed if there is more than 1 bluetooth connetion open. The exception that is thrown is a IOException and a CorruptedStreamException.</p><p>A similar problem is, that sometimes I can't connect with my HTC Desire to the other devices, while the connection other way round is working perfectly well.</p><p>Are there any know issues with the HTC Desire in combination with Bluetooth and Android 2.1 Update1?</p>","","anon","","","","2011-12-28 08:01:34","Android 2.1 & HTC Desire: Is there a bluetooth problem? (CorruptedStreamException)","<java><android><exception><bluetooth>","2","0","","",""
"3353091","1","3353114","","2010-07-28 13:04:06","2","2101","<p>Please can anyone give me links or code or concept for Running an activity in hidden mode.. That is, it has to run in background without disturbing the user.. It should not display any window or layout.</p>","365184","","114066","","2010-07-28 13:05:05","2010-07-28 13:15:47","Running activity in hidden(stealth mode)","<android><activity><hidden>","2","0","","",""
"3353176","1","3353998","","2010-07-28 13:15:13","1","274","<p>Ok, my problem is, I have got n-TextViews and they will be added programmatically into a TableLayout. It totally doesnt matter, how I style these TextViews or the TableLayout, everytime I add something, it adds the TextView on the bottom after the other TextViews.These Views have got a variable width, which is calculated out of their textlength and some pixels (WRAP_CONTENT just made 100% width...).</p><pre><code>It is like this right now:------------------------------------------[TextView 1][TextView 2][TextView 3][TextView 4]------------------------------------------And it should be like:------------------------------------------[TextView 1] [TextView 2] [TextView 3][TextView 4]------------------------------------------</code></pre><p>Actually I dont need a TableLayout. I still can change it in whatever you want. Of course it would be even better if those TextViews can get WRAP_CONTENT as width.</p><p>EDIT:Btw. a LinearLayout with orientation=""horizontal"" adds the TextViews at first corret, but on the end it doesn't wrap to the next line, it just adds them to the right side and it will be splitted, like:</p><pre><code>------------------------------------------[TextView 1] [TextView 2] [TextView 3] [Te                                       [xt                                       Vie                                       w 4                                       ]------------------------------------------</code></pre>","381036","","381036","","2010-08-06 12:48:53","2010-08-06 12:48:53","Adding TextViews to a TableLayout ""stackable""","<android><layout><tablelayout>","2","0","0","",""
"3353242","1","3355736","","2010-07-28 13:22:40","2","3654","<p>I see that as of API Level 8, you can request a handle to special directories with <code>Environment.getExternalStoragePublicDirectory()</code>. This takes a type such as <code>DIRECTORY_MUSIC</code>, <code>DIRECTORY_PICTURES</code>, etc.</p><p>I'm looking for an equivalent directory for other media types such as documents (Word docs, PDFs, etc.). My HTC Desire has a <code>/sdcard/My Documents/</code> folder which looks like exactly what I want, but it has no <code>DIRECTORY_</code> specifier for use with the above method. Is this a standard Android directory which I can rely on?</p><p>If I can't use <code>getExternalStoragePublicDirectory()</code>, I have to use <code>getExternalStorageDirectory()</code> instead which just points me to the root of the SD card. I can explicitly check for the presence of <code>My Documents</code> under the root and use it if it's there.</p><p>This is what I have:</p><pre><code> // default document save location File defaultSaveDir = Environment.getExternalStorageDirectory(); File myDocs         = new File(defaultSaveDir, ""My Documents""); if (myDocs.exists() &amp;&amp; myDocs.isDirectory())     defaultSaveDir = myDocs;</code></pre><p>Is there a better way?</p>","385478","","385478","","2012-11-27 13:07:19","2012-11-27 13:07:19","Android special directories","<android><directory><storage><external>","1","0","0","",""
"3353311","1","3353651","","2010-07-28 13:30:14","3","3932","<p>Can anyone please give me code or links or concept for running an android application on android device automatically.. whenever the device is switched on, application should start on its own, with out the interference of the user.</p><p>Thank you..</p>","365184","","","","","2010-07-28 14:03:54","How to autorun an application when the Phone is switched ON","<android><activity><autorun>","1","0","1","",""
"3353644","1","3353686","","2010-07-28 14:03:21","4","709","<p>I have a city simulation game and try to find a way to check the flow of our power system.The basics:The map for the city is based on tiles (30 by 30 tiles = 900 tiles).Now i start at a power plant and do a recursive neighbor check (top, left, right, bottom) to check if there is something that will transport the power. If there is something, I start checking this tiles for neighbors, too.To prevent double checks and/or infinite recursive calls, I fill a ArrayList with processed tiles and check if a new tile was already processed and added to the ArrayList...</p><p>Recursively started:</p><pre><code>public void updatePowerEnvironment(int id, ArrayList&lt;Integer&gt; elements) {    Log.w(""GT"", ""update env for id: "" + id);    int newId = id - GameMap.mMapSize;    if (newId &gt;= 0 &amp;&amp; GameMap.mMapCells.get(newId).mPowerEnabled            &amp;&amp; !elements.contains(newId)) {        elements.add(newId);        updatePowerEnvironment(newId, elements);    }    newId = id + GameMap.mMapSize;    if (newId &lt; GameMap.mMapCells.size() &amp;&amp; GameMap.mMapCells.get(newId).mPowerEnabled            &amp;&amp; !elements.contains(newId)) {        elements.add(newId);        updatePowerEnvironment(newId, elements);    }    newId = id - 1;    if (newId &gt;= 0 &amp;&amp; GameMap.mMapCells.get(newId).mPowerEnabled            &amp;&amp; !elements.contains(newId)) {        elements.add(newId);        updatePowerEnvironment(newId, elements);    }    newId = id + 1;    if (newId &lt; GameMap.mMapCells.size()            &amp;&amp; GameMap.mMapCells.get(newId).mPowerEnabled            &amp;&amp; !elements.contains(newId)) {        elements.add(newId);        updatePowerEnvironment(newId, elements);    }}</code></pre><p>If I can trust the log output, no tile was tried to processed twice. That means, that I have no errors in the recursive calls. Which also means, the stack is simply too small.</p><p>Does someone have an idea how to avoid the stack limit?</p><p><strong>[Update and my code as a result of Erics answer]</strong></p><pre><code>public void updatePowerEnvironment(int id, ArrayList&lt;Integer&gt; elements) {    Stack&lt;Integer&gt; toProcess = new Stack&lt;Integer&gt;();    toProcess.push(id);    int mapSize = GameMap.mMapCells.size();    while (!toProcess.empty()) {        id = toProcess.pop();        Log.e(""GT"", ""id to process: "" + id);        if (elements.contains(id)) {            continue;        }        int[] neighborIds = computeNeighbors(id);        for (int neighbor : neighborIds) {            if (neighbor &lt; 0 || neighbor &gt;= mapSize) {                continue;            }            if (!GameMap.mMapCells.get(neighbor).mPowerEnabled) {                continue;            }            toProcess.push(neighbor);        }        elements.add(id);    }}private int[] computeNeighbors(int id) {    return new int[] {id + GameMap.mMapSize, id - GameMap.mMapSize, id + 1, id - 1};}</code></pre>","180538","","180538","","2010-07-29 21:42:13","2010-07-29 21:42:13","recursive + 900 elements + neighbor check = causes stackoverflow","<android><stack><arraylist><stackoverflow>","5","4","2","",""
"3353691","1","3354062","","2010-07-28 14:08:48","1","635","<p>I am creating an Android application that connects to the Fogbugz XML API (sends a request to the API, receives back an XML file). Right now, I am creating a service that will handle these requests, and parse each in order to access usable information. What would be the best way to do this? If I am getting an inputStream, should I use the SAX parser?</p><pre><code>        DefaultHttpClient httpclient = new DefaultHttpClient();     HttpGet httpget = new HttpGet(""My URL THAT RETURNS AN XML FILE"");     HttpResponse response;    try {            response = httpclient.execute(httpget);            HttpEntity entity = response.getEntity();             InputStream stream =  entity.getContent();            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(stream));             String responseString = """";            String temp;            while ((temp=bufferedReader.readLine()) != null)            {                responseString += temp;            }            if (entity != null) {                 entity.consumeContent();             }    } catch (ClientProtocolException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } </code></pre>","381508","","381508","","2010-07-28 15:30:10","2010-07-28 15:34:05","How to parse XML (Fogbugz XML API)?","<android><xml><fogbugz>","1","3","","",""
"3353696","1","3482547","","2010-07-28 14:09:11","23","4708","<p>I'm implementing a face tracker on Android, and as a literature study, would like to identify the underlying technique of Android's FaceDetector.</p><p>Simply put: I want to understand how the <code>android.media.FaceDetector</code> classifier works.</p><p>A brief Google search didn't yield anything informative, so I thought I'd take a look at the code.</p><p>By looking at the Java source code, <a href=""https://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=media/java/android/media/FaceDetector.java""><code>FaceDetector.java</code></a>, there isn't much to be learned: <code>FaceDetector</code> is simply a class that is provided the image dimensions and number of faces, then returns an array of faces.</p><p>The Android source <a href=""https://android.git.kernel.org/?p=platform/external/neven.git;a=tree"">contains the JNI code for this class</a>. I followed through the function calls, where, reduced to the bare essentials, I learned:</p><ol><li>The ""FaceFinder"" is created in <a href=""https://android.git.kernel.org/?p=platform/external/neven.git;a=blob;f=FaceRecEm/common/src/b_FDSDK/FaceFinder.c;h=b24ac111f98dd5a580849adb72c434a36479b135;hb=HEAD#l75""><code>FaceFinder.c:75</code></a></li><li>On line 90, <code>bbs_MemSeg_alloc</code> returns a <code>btk_HFaceFinder</code> object (which contains the function to actually find faces), essentially copying it the <code>hsdkA-&gt;contextE.memTblE.espArrE</code> array of the original <code>btk_HSDK</code> object initialized within initialize() (<a href=""https://android.git.kernel.org/?p=platform/external/neven.git;a=blob;f=FaceDetector_jni.cpp;h=03bd908bed10527a782b9d74770ffc9be2f4aeb4;hb=HEAD#l145""><code>FaceDetector_jni.cpp:145</code></a>) by <code>btk_SDK_create()</code></li><li>It appears that a maze of functions provide each other with pointers and instances of <code>btk_HSDK</code>, but nowhere can I find a concrete instantiation of <code>sdk-&gt;contextE.memTblE.espArrE[0]</code> that supposedly contains the magic.</li></ol><p>What I <em>have</em> discovered, is a little clue: the JNI code references a FFTEm library that I can't find the source code for. By the looks of it, however, FFT is <em>Fast Fourier Transform</em>, which is probably used together with a pre-trained neural network. The only literature I can find that aligns with this theory is <a href=""http://people.ee.ethz.ch/~bfasel/papers/avbpa_face.pdf"">a paper by Ben-Yacoub et al.</a></p><p>I don't even really know if I'm set on the right path, so any suggestions at all would undoubtedly help.</p><p><strong>Edit:</strong> I've added a +100 bounty for anybody who can give any insight.</p>","154306","","154306","","2010-11-25 11:32:52","2012-03-06 01:23:13","Underlying technique of Android's FaceDetector","<android><jni><fft><face-detection>","3","3","6","",""
"3353773","1","3377053","","2010-07-28 14:18:31","4","1005","<p>I'm trying to retrieve the permissions of the apps in my device.</p><p>The weird thing is, for some apps I do get results, and in some of them I can't retrieve any permissions.</p><p>Maybe in order to get the permissions list of an app, the app has to set some specific flag? Because if I try to get the permission list of my app in this way:</p><pre><code>PackageManager p = context.getPackageManager();PermissionInfo[] z=p.getPackageInfo(""com.test.myapp"",PackageManager.GET_PERMISSIONS).permissions);</code></pre><p><code>z</code> is <code>null</code>, but for some apps (system apps, etc..) I do get some list.</p><p>Any idea? </p><p>Thanks, moshik.</p>","273550","","20402","","2010-08-12 20:35:26","2010-08-12 20:35:26","Retrieve Permissions list","<android><permissions>","1","0","2","",""
"3353830","1","","","2010-07-28 14:23:45","2","382","<p>I have an application with a multi-instance activity. I would like eachinstance of the activity to appear in a <em>new</em> task and process.</p><p>Any suggestions on how to do this? By manipulating the manifest I cancause <em>all</em> instances of the activity to appear in a specific task andprocess, but I haven't found any way to cause each instance to appear ina <em>different</em> task and process.</p><p>(The requirement to have different tasks is that we want each instanceof the activity to appear separately in the task list; the requirementfor different processes is that each instance of the activity is backedby a chunk of native code with global state. We can't change either ofthese.)</p>","404568","","","","","2010-07-28 14:34:08","Instantiating activities into new tasks and processes","<android><android-manifest>","1","0","1","",""
"3353932","1","3371305","","2010-07-28 14:34:26","2","1054","<p>I'm still very new to Object Oriented programming and am having problems with the class inheritance and the scope of variables from one instantiated class to another.</p><p>I'm trying to build an android application that can read multiple XML feeds and save them to the phone's SQLite database. Each feed has a different name (""news"", ""audio_mixes"" etc.) and I want to use these names to save each feed's data into separate database tables - each one named after the feed title.</p><p>In diagrammatic terms this is what my classes look like:<img src=""http://baroquedub.co.uk/private/images/Main-Title_Browser.jpg"" alt=""alt text""></p><p><strong>The Main activity</strong> displays two buttons each of which starts an activity - both of which are instances of the TitlesBrowser class. Extras are used to pass different values of <strong>the_url</strong> and <strong>the_feed_type</strong> variables.</p><pre><code>@Override    public void onCreate(final Bundle icicle) {        super.onCreate(icicle);        this.setContentView(R.layout.main);        this.getNewsButton = (Button) findViewById(R.id.get_news_button);        this.getNewsButton.setOnClickListener(new OnClickListener() {            public void onClick(final View v) {                Intent doGetNews = new Intent(Main.this, TitlesBrowser.class);                doGetNews.putExtra(""the_url"", Main.this.getString(R.string.titles_url));                doGetNews.putExtra(""the_feed_type"", Main.this.getString(R.string.news_type_var));                startActivity(doGetNews);            }        });        this.getMixtapesButton = (Button) findViewById(R.id.get_mixtapes_button);        this.getMixtapesButton.setOnClickListener(new OnClickListener() {            public void onClick(final View v) {                Intent doGetMixtapes = new Intent(Main.this, TitlesBrowser.class);                doGetMixtapes.putExtra(""the_url"", Main.this.getString(R.string.titles_url));                doGetMixtapes.putExtra(""the_feed_type"", Main.this.getString(R.string.mixtapes_type_var));                startActivity(doGetMixtapes);            }        });    }</code></pre><p><strong>The TitlesBrowser class</strong>, in its onCreate method, gets the Extras and saves them to private local variables. </p><pre><code>Intent i = getIntent();private String theUrl = (String) i.getStringExtra(""the_url"");private String theFeedType = (String) i.getStringExtra(""the_feed_type"");&lt;/pre&gt;</code></pre><p>This class does two things, </p><p>1/ it creates an instance of the DatabaseHelper class, and uses a public set method in that class to pass on the value of the locally help <strong>theFeedType</strong> variable. Having done that it queries the database for any existing data (the <strong>theFeedType</strong> is the name of each table)</p><pre><code>db=new DatabaseHelper(this);db.setTableName(theFeedType);dbCursor=db.getReadableDatabase().rawQuery(""SELECT _ID, id, title FROM ""+theFeedType+"" ORDER BY id"",    null);</code></pre><p>2/ then it loads new data from the feed URL by instantiating another class HTTPRequestHelper :</p><pre><code>HTTPRequestHelper helper = new HTTPRequestHelper(responseHandler);helper.performPost(theUrl, theFeedType);</code></pre><p>The HTTP requests work fine, and depending on which of the two buttons is clicked, each of the two different activities display the appropriate XML (i.e. retrieve the correct data)- therefore I know that theUrl and theFeedType variables are local to each instance of the TitlesBrowser class.One calls:</p><pre>http://baroquedub.co.uk/get-feed.php?feed=news</pre><p>and the other one:</p><pre>http://baroquedub.co.uk/get-feed.php?feed=audio_mixes</pre><p>The problem is with <strong>the DatabaseHelper class</strong>:</p><pre><code>public class DatabaseHelper extends SQLiteOpenHelper {  private static final String DATABASE_NAME=""baroquedub.db"";  private String table_name;  public DatabaseHelper(Context context) {    super(context, DATABASE_NAME, null, 1);  }  @Override  public void onCreate(SQLiteDatabase db) {    db.execSQL(""CREATE TABLE ""+ table_name + ""(_id INTEGER PRIMARY KEY AUTOINCREMENT, "" +                ""id INTEGER, "" +                ""title TEXT, "" +                ""details TEXT, "" +                ""picture TEXT, "" +                ""viewed BOOLEAN DEFAULT '0' NOT NULL);"");  }  @Override  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {    android.util.Log.w(""Baroquedub"", ""Upgrading database, which will destroy all old data"");    db.execSQL(""DROP TABLE IF EXISTS mixtapes"");    onCreate(db);  }  public void setTableName(String theName){    this.table_name = theName;  }}</code></pre><p>I would expect it to create a new table each time it is instantiated (whether ""news"" or ""audio_mixes"" was passed from its parent TitlesBrowser class. </p><p>But it only works once - if I start the application and click on ""news"" a table called news is created and each time I return to that activity it successfully retrieves data from that same database. </p><p>But if I then start the other activity by clicking on the other button (i.e access the other feed) I get an SQL error telling me that a database of that name doesn't exist.  In other words the onCreate db.execSQL(""CREATE TABLE... method doesn't appear to get called again. </p><p>It's as if multiple copies of the DatabaseHelper class aren't being created, although there are two instances of TitlesBrowser.</p><p>--Here's a demonstration of the problem:</p><p><a href=""http://screencast.com/t/NDFkZDFmMz"" rel=""nofollow"">http://screencast.com/t/NDFkZDFmMz</a> </p><p>This has been really tricky to explain (especially for a newbie!!!) and I hope it makes some sense. I'd be very grateful for any help, advice or guidance.</p>","234548","","82118","","2010-07-28 14:43:40","2010-07-30 12:18:47","Object Oriented scope and inheritance in Android activity classes","<android><database><class><inheritance><oop>","2","0","","",""
"3354021","1","3354186","","2010-07-28 14:43:26","1","8697","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id"">Is there a unique Android device ID?</a>  </p></blockquote><p>In the licensing documentation the android developers mention an easy way to more or less securely identify an android device. They are using android.Settings.Secure.ANDROID_ID. </p><p>They say they query the system settings for this. But they don't explain this any further.</p><p>How do I obtain the android_id and do I need special permissions for doing so?</p>","114066","","","","","2012-12-06 20:01:45","How to obtain the android_id of a device?","<android><uniqueidentifier>","2","0","2","2012-12-08 17:11:13",""
"3354241","1","","","2010-07-28 15:06:38","1","3624","<p>I have a ListView activity and I want an EditText (and ultimately a button along with it) to display above it.</p><p>I believe my xml is fine, but for some reason the EditText is not displaying.  The ListView takes up the entire screen :(</p><p>Here's what my XML looks like:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;EditText        android:id=""@+id/newitemtext""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""    android:hint=""@string/add_new_item""    android:maxLines=""1""    /&gt;    &lt;ListView        android:id=""@+id/android:list""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""    /&gt;    &lt;TextView        android:id=""@+id/android:empty""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""@string/inbox_no_items""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>Any ideas?</p><p>Note:  In the layout tab of the xml file in Eclipse, the EditText shows.  When I run my application in the emulator, it does not.</p><p>Thank you for your time</p><p>Update:</p><p>Here is where I set the content view in my onCreate method</p><pre><code>m_aryNewListItems = new ArrayList&lt;MyListItem&gt;();m_Adapter = new MyListAdapter(this, R.layout.layout_list, m_aryNewListItems);setListAdapter(m_Adapter);</code></pre><p>Here is my extended ArrayAdapter:</p><pre><code>private class MyListAdapter extends ArrayAdapter&lt;MyListItem&gt; {// items in the listprivate ArrayList&lt;MyListItem&gt; m_items;// constructorpublic MyListAdapter(Context context, int textViewResourceId, ArrayList&lt;MyListItem&gt; items) {        super(context, textViewResourceId, items);        this.m_items = items;}// get specific list itempublic MyListItem getItem(int position) {    if (m_items.size() &gt; position) {        return m_items.get(position);    }    else {        return null;    }}/* * Update screen display */@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    // get the View for this list item    View v = convertView;    if (v == null) {        LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);        v = vi.inflate(R.layout.layout_list_item, null);    }    // get the next MyListItem object    MyListItem lstItem = m_items.get(position);    // set up the list item    if (lstItem != null) {        TextView txtItem = (TextView) v.findViewById(R.id.list_itemname);        TextView txtQty = (TextView) v.findViewById(R.id.list_itemqty);        TextView txtPlace = (TextView) v.findViewById(R.id.list_place);        // set item text        if (txtItem != null) {            txtItem.setText(lstItem.getItemName());        }        // set qty text        String strQtyText = ""Qty: "";        if (txtQty != null &amp;&amp; lstItem.getItemQty() != -1) {            BigDecimal bd = new BigDecimal(lstItem.getItemQty());            strQtyText += bd.stripTrailingZeros().toString();            if(lstItem.getItemQtyUnitId() != -1) {                strQtyText += "" "" + lstItem.getItemQtyUnitTextAbbrev();            }        }        else {            strQtyText += ""--"";        }        txtQty.setText(strQtyText);        // set place text        if (txtPlace != null &amp;&amp; lstItem.getPlaceName() != null) {            txtPlace.setText(lstItem.getPlaceName());        }    }    // return the created view    return v;}</code></pre><p>}</p>","404676","","404676","","2010-07-28 15:47:51","2010-07-28 15:50:31","EditText wont display above ListView","<android><listview><hidden><edittext>","1","5","","",""
"3354267","1","3356204","","2010-07-28 15:10:03","3","2805","<p>I want to launch an Activity with a webView as its content from current Activity. This new activity needs to be transparent and webview should be in the center. I looked around the web but only solutions I found were using style xmls. I want to do it using pure code i.e. no xml declarations. if anybody has come across this then please shed some light. </p>","195802","","","","","2010-07-29 09:02:26","How to create a transparent Activity programmatically?","<android><coding-style><activity><themes>","1","0","2","",""
"3354273","1","4783613","","2010-07-28 15:10:25","2","1665","<p>I've come from iPhone background and am writing an android app. </p><p>I've got a list which is cached locally, but primary is stored on the our webserver as the app is an interface to our service. What I really want is a simple way for the user to refresh the list. So I'm trying to replicate the tweetie pulldown to refresh list.</p><p>Does anybody know how to hide the ListView header row, so that android believes the top is the first list item, and it naturally stops scrolling there, but if you pull the list down more it reveals the ""refresh"" header which stays on screen until the refresh is done and then goes back up?</p>","404679","","","","","2011-01-24 15:16:24","Android: Tweetie Style List Refresh","<android><listview>","1","0","1","",""
"3354363","1","3354521","","2010-07-28 15:17:56","2","352","<p>Everywhere I look online, it seems that I must use an animation to change views dynamically (like slide in, out). Do I have to do this, or can I simple just setContentView() on each new activity?</p><p>Thanks!</p>","312390","","","","","2010-07-28 15:31:19","Do I have to use an animation to change an Android activity's view?","<java><android>","1","0","","",""
"3354405","1","3354582","","2010-07-28 15:21:38","3","278","<p>I'm working on my first Android app, and am almost to the point where I can start thinking about putting it up on the market as a paid app.</p><p>In the process of researching this step, I found out that it's basically trivial to break Google's copy protection scheme. I don't know how big of a problem this really is, or if we need to look into some other form of protection.</p><p>Obviously an obfuscater like ProGuard is a good first step, but how would you go about protecting your application from being released into the wild?</p><p>Second, other than encrypting contents (which is difficult because the decryption key has to be stored in the program too) how would you prevent someone from just dumping the contents of a sqlite3 database?</p>","356438","","","","","2010-07-28 15:44:43","Protecting An App For Market","<android><security>","4","0","2","",""
"3354424","1","","","2010-07-28 15:23:19","6","1159","<p>I have a ListAdapter with in this case contains a single item.That item produces a view that has an EditText.</p><p>When the view get displayed I want to open the soft keyboard to allow the user to edit the field.</p><p>I tried to call in the getView() function of the adapter:</p><pre><code>View edittext = view.findViewById(R.id.EditText01);edittext.requestFocus();mInputMgr.showSoftInput(edittext, InputMethodManager.SHOW_FORCED);</code></pre><p>which doesn't seem to do anything.</p><p>I also tried:</p><pre><code>View edittext = view.findViewById(R.id.EditText01);edittext.requestFocus();mInputMgr.toggleSoftInput(0, 0);</code></pre><p>That produces for some mysterious reason a loop in which the softkeyboard gets opened and closed repeatably.</p><p>When I remove the requestFocus and touch click on the EditText in the program it pops up the softkeyboard but regardles of whether requestFocus is there showSoftInput doesn't seem to work.</p><p>What do I have to do?</p><p>XML of the list element:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:orientation=""vertical""  android:layout_height=""fill_parent""  android:focusable=""true""  android:background=""@color/light_blue""  &gt;&lt;EditText android:id=""@+id/EditText01"" android:layout_height=""wrap_content"" android:text="""" android:focusable=""true""android:layout_width=""fill_parent"" android:inputType=""textShortMessage""&gt;&lt;/EditText&gt;&lt;/RelativeLayout&gt;</code></pre><p>XML that contains the ListView:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:orientation=""vertical""  android:layout_height=""fill_parent""  &gt;    &lt;Button android:text=""@+id/Button01""         android:id=""@+id/Button01""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:textAppearance=""?android:attr/textAppearanceLarge""/&gt;    &lt;ListView android:id=""@+id/ListView01""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_below=""@+id/Button01""        android:gravity=""center_horizontal""        /&gt;&lt;/RelativeLayout&gt;</code></pre><p>long getView function:</p><pre><code>@Overridepublic View getView(final int position, View convertView, ViewGroup parent) {    if (convertView != null){        return convertView;    }    if (mDialog!=null){        final Choice thisChoice = mDialog.getChoice(                position,                 mContentRes);        Log.v(TAG, ""DialogAdapter: ""+ thisChoice.toString());        View view = thisChoice.getView(                mInflater, parent, mFillInput, mDialog);        View.OnClickListener listener = new View.OnClickListener() {            public void onClick(View v) {                if (thisChoice.choiceSingleClick(mDialog)){                    Log.i(TAG,                             ""Single Click selected Choice: ""                             + thisChoice.toString());                    Log.d(TAG,                             ""getNextInputId: ""                             + Integer.toString(                                    thisChoice.getNextInputId()));                    mFillInput.renderNext(thisChoice.getNextInputId());                }                else{                    mFillInput.checkSelectedStatus();                }            }        };        view.setOnClickListener(listener);        View.OnLongClickListener longListener = new View.OnLongClickListener() {            public boolean onLongClick(View v) {                            thisChoice.choiceLongClick(mDialog);                return false;            }        };        view.setOnLongClickListener(longListener);        Log.d(TAG, ""thisChoice: "" + thisChoice);        Log.d(TAG, ""selected: "" + thisChoice.isSelected());        if((position == 0 &amp;&amp; mDialog.getSelectedCount() == 0) ||                thisChoice.isSelected()){            view.requestFocus();        }        if (thisChoice.isEnterStringChoice() &amp; position==0){            Log.d(TAG, ""Request Focus for StringChoice"");            View edittext = view.findViewById(R.id.EditText01);            edittext.requestFocus();            //edittext.dispatchTouchEvent(null);            //FillInput.mInputMgr.showSoftInput(edittext, InputMethodManager.SHOW_FORCED);            //mFillInput.mInputMgr.toggleSoftInput(0, 0);        }        return view;    }               else{        return null;    }}</code></pre>","25282","","25282","","2010-08-04 19:04:22","2012-01-09 10:23:23","Open soft keyboard for ListAdapter item with contains a view with a string","<android><android-softkeyboard>","4","4","4","",""
"3354589","1","","","2010-07-28 15:37:48","0","750","<p>I've made a ListActivity.  I have an xml file that defines the layout for this Activity.  I also have an xml file that defines the layout for an item in that list.  This item layout has 3 TextViews inside of it.  If I add the inputType=""text"" property to one of these TextViews, the onListItemClick handler no longer executes when I run my application in the emulator.</p><p>I noticed that singleLine=""true"" was deprecated, which is why I switched it out for inputType=""text"".  Does anyone know why this is happening?</p><p>Note: I'm developing against 2.1</p><p>Thanks for your help</p>","404676","","","","","2010-07-28 16:31:50","Using inputType on a TextView in a list item layout","<android><listview><listviewitem><listactivity>","1","0","","",""
"3354636","1","3354653","","2010-07-28 15:42:17","0","344","<p>i get NullPointerException at the start of the forwhere am i going wrong?</p><pre><code> public void checkzone(Location loc)  {      X = new List&lt;float[]&gt;() {    };      Y = new List&lt;float[]&gt;() {    };         X.clear();        Y.clear();      float x = (float) loc.getLatitude();      float y = (float) loc.getLongitude();     float  A1X[] = {(float) 41.992853, (float) 41.994815, (float) 41.995158, (float)  41.993065};//DOMA     float  A3X[] = {(float) 41.994594, (float) 41.994595, (float) 41.993744, (float) 41.993747};//OVIE SE TOCNI     float  A4X[] = {(float) 41.121212, (float) 41.121212, (float) 41.121212, (float) 41.121212};     float  A5X[] = {(float) 41.121212, (float) 41.121212, (float) 41.121212, (float) 41.121212};     float  A6X[] = {(float) 41.121212, (float) 41.121212, (float) 41.121212, (float) 41.121212};     float  B2X[] = {(float) 41.121212, (float) 41.121212, (float) 41.121212, (float) 41.121212};     float  C11X[] ={(float) 41.121212, (float) 41.121212, (float) 41.121212, (float) 41.121212};     float  C15X[] = {(float) 41.121212, (float) 41.121212, (float) 41.121212, (float) 41.121212};     float  C17X[] = {(float) 41.121212, (float) 41.121212, (float) 41.121212, (float) 41.121212};     float A1Y[] = {(float) 21.411527, (float) 21.411505, (float) 21.4142847, (float) 21.415116};//Doma     float A3Y[] = {(float) 21.427817, (float) 21.428015, (float) 21.427972, (float) 21.427763};//OVIE SE TOCNI     float A4Y[] = {(float) 21.122112, (float) 21.122112, (float) 21.122112, (float) 21.122112};     float A5Y[] = {(float) 21.122112, (float) 21.122112, (float) 21.122112, (float) 21.122112};     float A6Y[] = {(float) 21.122112, (float) 21.122112, (float) 21.122112, (float) 21.122112};          float B2Y[] = {(float) 21.122112, (float) 21.122112, (float) 21.122112, (float) 21.122112};     float C11Y[] = {(float) 21.122112, (float) 21.122112, (float) 21.122112, (float) 21.122112};     float C15Y[] = {(float) 21.122112, (float) 21.122112, (float) 21.122112, (float) 21.122112};     float C17Y[] = {(float) 21.122112, (float) 21.122112, (float) 21.122112, (float) 21.122112};    X.add(A1X);    X.add(A3X);    X.add(A4X);    X.add(A5X);    X.add(A6X);         X.add(B2X);    X.add(C11X);    X.add(C15X);    X.add(C17X);    X.add(A1X);    Y.add(A1Y);    Y.add(A3Y);    Y.add(A4Y);    Y.add(A5Y);    Y.add(A6Y);    Y.add(B2Y);    Y.add(C11Y);    Y.add(C15Y);    Y.add(C17Y);    Y.add(A1Y);      for(int i=0; i&lt;=X.size();i++)      {          if (pointInPolygon(X.get(i).length,X.get(i),Y.get(i),x,y))          {                switch (i) {                case 1:                    zonefoundsettexts(""A1"");                  case 2:                    zonefoundsettexts(""A3"");                    case 3:                    zonefoundsettexts(""A4"");                    case 4:                    zonefoundsettexts(""A5"");                    case 5:                    zonefoundsettexts(""A6"");                    case 6:                    zonefoundsettexts(""B2"");                case 7:                    zonefoundsettexts(""C11"");                case 8:                    zonefoundsettexts(""C15"");                case 9:                    zonefoundsettexts(""C17"");                          }            }//            else       //                 zonefoundsettexts(""nozone"");      }  };</code></pre>","366659","","","","","2010-07-28 17:02:37","Help with array in android","<android><arrays><list>","2","0","","",""
"3354764","1","3438097","","2010-07-28 15:53:19","2","877","<p>I can't seem to rotate properly an image on the entire screen. The problem is that when the image rotates, you can see the background in some areas. I want the image to fill the screen also when it rotates. Here is the layout. I've tried different scale types without success.</p><pre><code>&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;ImageView        android:id=""@+id/image""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:scaleType=""centerCrop"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>And here is the code that I am using.</p><pre><code>image = (ImageView) findViewById(R.id.image);image.setBackgroundResource(R.drawable.back_big);rot = AnimationUtils.loadAnimation(this, R.anim.rotation);image.startAnimation(rot);</code></pre><p>I start the animation in <code>onResume</code>. As I said, the image rotates but there are background areas when it does rotate. I've tried using images much bigger than the screen but still it doesn't do what I want. I don't care that outer regions of the image are not visible. I just want the rotation to fill the screen. I guess <code>ImageView</code> sets its width and height initially and then, when it rotates, it uses those dimensions. Is there a better way to do this?</p>","292263","","","","","2010-08-09 07:30:35","Rotate an image on the entire screen","<android><animation><rotation>","2","0","","",""
"3354768","1","3354808","","2010-07-28 15:53:40","2","1986","<p>I've got two activities, one of them is called <code>MyActivity</code>. I want both of them to be able to use a function located in a class othat we may call <code>MyClass</code>. In <code>MyClass</code>, I try to use an intent to launch the activity <code>AnotherActivity</code>. Since the constructor takes a context as parameter, I simply tried to store a context from the activity in the constructor, and then use it when I try to create my intent.</p><pre><code>class MyClass {  private Context cxt;  MyClass(Context cxt) {    this.cxt = cxt;  }  startIntent() {    Intent intent = new Intent(cxt, AnotherActivity.class);    startActivity(intent); // this line throws a NullPointerException  }}</code></pre><p>The code in <code>MyActivity</code> to use the class is shown below:</p><pre><code>myClassObject = new MyClass(MyActivity.this);myClassObject.startIntent();</code></pre><p>However, even thought none of the arguments are null (checked that with a simple if-statement), <code>intent</code> seems to be null and a <code>NullPointerException</code> is thrown. Why does it not work, and what can I do to solve the problem?I'm quite new to Android and Java development, so please explain it as basic as you can.</p>","404691","","404691","","2010-07-28 17:09:57","2010-07-28 17:09:57","Launching intent from a class outside an activity","<java><android><oop><android-intent>","2","0","2","",""
"3354955","1","3546419","","2010-07-28 16:15:01","41","8646","<p>I start the activity (descendant of PreferenceActivity) from my worker activity as follows:</p><pre><code>@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data){    super.onActivityResult(requestCode, resultCode, data);    if (requestCode == 1458)        loadInfo();}void showSettingsDialog(){    startActivityForResult(new Intent().setClass(this, MyConfigure.class), 1458);}</code></pre><p>MyConfigure class does NOT have any setResult() calls. In fact, MyConfigure class doesn't have any code except OnCreate where it loads preferences using addPreferencesFromResource. </p><p>Now onActivityResult is called with requestCode of 1458 prematurely, right after MyConfigure activity is run. Tested on 1.6 and 2.1 emulators as well as 2.1 device. Is there a call to setResult() buried somewhere in PreferenceActivity? Or how else can this premature call be explained? </p>","47961","","47961","","2010-08-23 09:52:02","2014-01-21 10:31:16","onActivityResult() called prematurely","<android><activity>","3","6","13","",""
"3355093","1","3355215","","2010-07-28 16:27:37","2","2443","<p>I'm facing some problems with the progress dialogs. I use a managed progress dialog to show the user that an operation is being carried out with the following code written in the onCreateDialog(int id) function:</p><pre><code>          case PROGRESS_DIALOG :            {                dialog = new ProgressDialog(this);                                                      dialog.setMessage(getResources().getString(R.string.eStrUpdating));                dialog.setCancelable(true);                dialog.setOnCancelListener(new DialogInterface.OnCancelListener()                {                    public void onCancel(DialogInterface dialogInterface)                    {                       Log.i(TAG,""progress dialog cancelled "");                    }                });                return dialog;            }</code></pre><p>When the operation completes I call dismissDialog(PROGRESS_DIALOG). The problem is that if I rotate the phone while the progress dialog is displayed then when the operation completes the dismiss call has no effect and the progress remains showing. And this I cannot understand why.</p>","284609","","","","","2011-04-11 14:40:46","Progress Dialog and orientation changed","<android>","2","0","","",""
"3355124","1","","","2010-07-28 16:30:49","4","1499","<p>Or am I going to have to write an app to do that??</p>","10168","","","","","2010-07-28 18:12:10","Is there any way to write to the clipboard from javascript, on the android browser?","<javascript><android><clipboard>","1","0","","",""
"3355219","1","","","2010-07-28 16:42:25","1","249","<p>I am working on an app that connects to a media providing site and downloads mp3 files to the user phone. I would like for the user to be unable to copy these files off the phone but only listen to them through my app.</p><p>I am currently trying to encrypt the files using DES and encryption and decrypt and play the file in bits in the app. This is however not working. Is there a better way of achieving my end goal or has anyone else implemented a similar solution?</p><p>Thanks</p><p>P</p>","404787","","","","","2010-07-28 17:05:09","How can I store music on an android phone without allowing the user to be able to download it and use it?","<android><encryption><copy-protection>","2","0","1","",""
"3355220","1","3355340","","2010-07-28 16:42:26","1","10582","<p>How can I make an array that handles some of my images so that I can use it like this?:</p><p>ImageView.setImageResource(image[1]);</p><p>I hope I explained well...</p>","404784","","","","","2010-07-28 16:57:20","Android: How can I make a Drawable array?","<android>","2","1","2","",""
"3355367","1","3356263","","2010-07-28 16:59:27","29","22333","<p>Is there a way to get the height of the statusbar + titlebar? Checking the dev forum shows the same question but no solution (that I could find).</p><p>I know we can get it after the initial layout pass, but I'm looking to get it in onCreate() of my activity.</p><p>Thanks</p>","291701","","291701","","2010-07-28 17:06:22","2014-02-11 03:18:36","Height of statusbar?","<android>","7","2","13","",""
"3355389","1","","","2010-07-28 17:01:54","0","2516","<p>I'm torn about how to implement this because Content Provider URI querys do not support the simple SQL ""DISTINCT"" query method to return a cursor to the Artists of the songs in the mediastore, removing any duplicate entries.</p><p>I can query and get a cursor to all the artists, I'm just torn as to how to remove the dupes, or simply not show them.</p><p>I've tried using matrixcursor to construct a new cursor with the dupe entries removed, but it's slow (build an array of artists, if in that array don't copy to the new matrixcursor, etc.)</p><p>Can anyone recommend a better solution, or point me in the proper direction??</p><p>I've also thought about pre-loading the information i need into an array of objects - I'm just concerned with memory overhead in my application.</p><p>Thank You for any help you may provide.</p>","404802","","","","","2011-07-01 13:41:57","Query the android Mediastore for Artist names of Music files","<android>","2","0","1","",""
"3355489","1","3355538","","2010-07-28 17:11:18","0","643","<p>I'm using textview objects to hold labels such as Score, Level etc on my game screen but they don't seem to be displayed where I want them to be. I understand about view hierarchies (parents, children) and am using the gravity tags in the XML layout file but it doesnt seem to have any effect. </p><p>Could someone just quickly provide a guide to positioning a textview object on the screen, and also linking it in the code so that its contents can be programmatically controlled (I believe this would by done via =(TextView) findViewById(r.id.resourcename))?</p><p>Many thanks</p><p>XML:    </p><pre><code>&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""match_parent""android:layout_height=""match_parent""&gt;    &lt;android.gesture.GestureOverlayView xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/gestures"" android:layout_width=""match_parent"" android:layout_height=""match_parent"" android:gestureStrokeWidth=""2.0"" android:gestureStrokeType=""multiple"" android:eventsInterceptionEnabled=""true""&gt; &lt;com.darius.android.distractions.DistractionsView  android:id=""@+id/distractions_layout""  android:layout_width=""match_parent""  android:layout_height=""match_parent""/&gt; &lt;RelativeLayout    android:layout_width=""match_parent""    android:layout_height=""match_parent"" &gt;    &lt;TextView      android:id=""@+id/text""              android:text=""Hello""              android:visibility=""visible""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:layout_centerInParent=""true""      android:gravity=""center_horizontal""      android:textColor=""#88ffffff""      android:textSize=""24sp""/&gt;      &lt;TextView      android:id=""@+id/textLevel""              android:text=""@string/level_count""              android:visibility=""visible""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:layout_centerInParent=""true""      android:gravity=""bottom""      android:textColor=""#EB0000""      android:textSize=""10sp""/&gt; &lt;TextView  android:layout_height=""wrap_content""             android:layout_width=""wrap_content""             android:text=""@string/concentration_bar""            android:textColor = ""#EB0000""            android:textSize=""10sp""            android:id=""@+id/conbartext""             android:visibility=""visible""                        &gt;&lt;/TextView&gt; &lt;/RelativeLayout&gt; &lt;/android.gesture.GestureOverlayView&gt;  &lt;/FrameLayout&gt;</code></pre>","300037","","300037","","2010-07-28 17:35:30","2010-07-28 17:35:30","Help Arranging TextView objects on screen in Android","<android><xml><textview>","2","0","","",""
"3355645","1","3355917","","2010-07-28 17:30:05","0","4702","<p>I am working on a video editing app and on my Wildfire the camera app uses a sliding drawer for image adjustments, but it doesn't only list the options (as icons) but when you tap an icon the actual functions or adjustments that you can make are also part of the sliding drawer (see image). </p><p><img src=""http://img688.imageshack.us/img688/571/img0431zz.jpg"" alt=""Sliding Drawer Android Wildfire""></p><p>I was wondering if I also could do that in my app and what I would need to do for that. If someone can help me out or maybe knows a tutorial for this, that would be great. </p><p>Thank you. </p><hr><p>I am still working on the above but I have a problem with my slider and the icons...what happens is that when I tap the slider to close the drawer again everything disappears. (see below)</p><p>Slider open: <img src=""http://img825.imageshack.us/img825/2087/screenshotslidingdrawer.png"" alt=""alt text"">Slider closed: <img src=""http://img180.imageshack.us/img180/2087/screenshotslidingdrawer.png"" alt=""alt text""></p><p>I don't really know what I may have done wrong... </p><p>This is what I have been doing so far: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent""             android:layout_height=""fill_parent""            android:background=""@drawable/shape_background_gradient""                  &gt;        &lt;VideoView            android:layout_width=""240px""            android:layout_height=""180px""            android:id =""@+id/VideoViewEdit""            android:layout_centerHorizontal=""true""            &gt;        &lt;/VideoView&gt;        &lt;ScrollView                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:layout_below=""@id/VideoViewEdit""&gt;            &lt;TableLayout                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    android:stretchColumns=""0""&gt;                &lt;TableRow                        android:background=""@drawable/shape_track_background""                        android:padding=""5px""                        &gt;                    &lt;ImageView android:layout_width=""wrap_content""                               android:layout_height=""wrap_content""                               android:src=""@drawable/ic_editor_videotrack""                               android:padding=""5px""                               android:layout_gravity=""left""/&gt;                &lt;/TableRow&gt;                &lt;TableRow                        android:background=""@drawable/shape_track_background""                        android:padding=""5px""                        &gt;                        &lt;ImageView android:layout_width=""wrap_content""                               android:layout_height=""wrap_content""                               android:src=""@drawable/ic_editor_audiotrack""                               android:padding=""5px""                               android:layout_gravity=""left""/&gt;                &lt;/TableRow&gt;                &lt;TableRow                        android:background=""@drawable/shape_track_background""                        android:padding=""5px""                        &gt;                    &lt;ImageButton android:layout_width=""wrap_content""                               android:layout_height=""wrap_content""                               android:src=""@drawable/ic_editor_add_media""                               android:padding=""5px""                               android:layout_gravity=""left""                               /&gt;                &lt;/TableRow&gt;            &lt;/TableLayout&gt;        &lt;/ScrollView&gt; &lt;SlidingDrawer     android:id=""@+id/drawer""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:orientation=""horizontal""     android:handle=""@+id/handle""     android:content=""@+id/content""&gt;     &lt;ImageView         android:id=""@id/handle""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/slider_handle""         /&gt;     &lt;LinearLayout         android:id=""@id/content""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         android:orientation=""vertical""&gt;        &lt;ImageButton             android:id=""@+id/button_exposure""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:background=""#77000000""            android:src=""@drawable/ic_slider_exposure""            android:padding=""5px""            android:layout_marginBottom=""1px""            android:layout_gravity=""left""/&gt;        &lt;ImageButton             android:id=""@+id/button_properties""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:background=""#77000000""            android:src=""@drawable/ic_slider_properties""            android:padding=""5px""            android:layout_marginBottom=""1px""            android:layout_gravity=""left""/&gt;        &lt;ImageButton             android:id=""@+id/button_special_effects""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:background=""#77000000""            android:src=""@drawable/ic_slider_special_effects""            android:padding=""5px""            android:layout_marginBottom=""1px""            android:layout_gravity=""left""/&gt;        &lt;ImageButton             android:id=""@+id/button_test1""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:background=""#77000000""            android:src=""@drawable/ic_slider_exposure""            android:padding=""5px""            android:layout_marginBottom=""1px""            android:layout_gravity=""left""/&gt;        &lt;ImageButton             android:id=""@+id/button_test2""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:background=""#77000000""            android:src=""@drawable/ic_slider_exposure""            android:padding=""5px""            android:layout_marginBottom=""1px""            android:layout_gravity=""left""/&gt;     &lt;/LinearLayout&gt; &lt;/SlidingDrawer&gt;&lt;/RelativeLayout&gt;</code></pre>","390782","","390782","","2010-07-28 20:08:39","2013-01-17 11:44:23","Sliding drawer with menu and functions","<android><menu><slidingdrawer>","2","0","","",""
"3355648","1","3355869","","2010-07-28 17:30:11","1","689","<p>Here's my problem:I've have an application with tabs.in each tab I have a list that list to an other list then to a screen with an image, clickable text etc. In one word I have Tasks inside tabs.</p><p>Question Despite long seek among forum and tutorials I still can't figure witch is the best pactice to do that : switching activity insde a tab or changing the view.</p><p>Here my code </p><pre><code>public class App extends TabActivity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Resources res = getResources(); // Resource object to get Drawables        TabHost tabHost = getTabHost();  // The activity TabHost        TabHost.TabSpec spec;  // Reusable TabSpec for each tab        Intent intent;  // Reusable Intent for each tab        // Create an Intent to launch an Activity for the tab (to be reused)        intent = new Intent().setClass(this, Activity0.class);        // Initialize a TabSpec for each tab and add it to the TabHost        spec = tabHost.newTabSpec(""0"").setIndicator(""0"",                          res.getDrawable(R.drawable.ic_tab_0))                      .setContent(intent);        tabHost.addTab(spec);        intent = new Intent().setClass(this, Activity1.class);        spec = tabHost.newTabSpec(""1"").setIndicator(""1"",                         res.getDrawable(R.drawable.ic_tab_1))                      .setContent(intent);        tabHost.addTab(spec);</code></pre><p>then I have to switch activities (Activity0 -> Activity01) inside tab 0  </p><pre><code>public class Activity0 extends Activity{..    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.mainlist);        ListView l1 = (ListView) findViewById(R.id.ListView01);        l1.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,            long arg3) {//          Toast.makeText(getBaseContext(), ""You clciked ""+parentTypes.get(arg2).getLibelle(), Toast.LENGTH_LONG).show();            /*TODO database method */            TypeEvenement parent = parentTypes.get(arg2);               if (parent.getChildren().size()!=0)            {                Intent i = new Intent(TypeParentList.this, TypeChildList.class);                int id= new Long(parentTypes.get(arg2).getId()).intValue();                i.putExtra(""typeid"", id);                View view = lam.startActivity(""TypeChildList"",i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)).getDecorView();                 setContentView(view);</code></pre><p>then go back to this activity from Activity01</p><pre><code>public class Activity01 extends Activity{        tv.setOnClickListener(new View.OnClickListener() {              public void onClick(View view) {                    Intent i = new Intent(TypeChildList.this, Activity0.class);                    LocalActivityManager lam = pa.getLocalActivityManager();                    View view2 = lam.startActivity(""Activity0"",i).getDecorView();                     setContentView(view2);              }              });</code></pre><p>After go and back I get an error java.lang.IllegalStateException The specified child already has a parent. You must call removeView() on the child's parent first.</p><p>I know it comes from my view but I can't figure out how to fix it So is this the best practice to do multiple activity in one tab ?</p><p>Please help needed </p>","384873","","236136","","2010-07-28 17:55:00","2010-07-29 05:28:16","Chaining activities inside a tab","<android>","2","0","1","",""
"3355729","1","3358718","","2010-07-28 17:41:31","0","208","<p>I have a local <code>Service</code> running together with my application. I also have a class derrived from <code>Application</code> class.</p><p>When the local service is created it gets and uses the <code>Application</code> instance using <code>getApplication</code>. </p><p>Can the app itself be terminated while my service is still running and what happens if so? Would <code>getApplication</code> return null?</p><p>Regards Henrik</p>","226342","","","","","2010-07-29 00:53:17","How does getting the application reference from a service work in Android?","<android><service><frameworks>","1","0","","",""
"3355798","1","","","2010-07-28 17:48:39","0","1549","<p>In android phone app, I use touch screen to dial a number. And then I place the phone next to my ear for the phone call. And android will show 'Double Tab to unlock' on screen to disable anything activated/touched.</p><p>Can you please tell me how can I do that in my own application?</p><p>Thank you.</p>","286802","","","","","2010-07-28 17:53:32","How to enable 'Double Tab to unlock' feature in android","<android>","1","0","","",""
"3355808","1","6539565","","2010-07-28 17:49:02","26","23864","<p>i have a relative layout like this:</p><pre><code>&lt;RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:background=""@drawable/single_row""android:padding=""12dip""&gt;&lt;ImageView    android:id=""@+id/page_image""    android:layout_marginRight=""6dip""    android:layout_width=""66dip""    android:layout_height=""66dip""    android:layout_alignParentLeft=""true""    android:src=""@drawable/no_photo"" /&gt;&lt;TextView    android:id=""@+id/page_name""    style=""@style/pulse_content""    android:layout_alignTop=""@id/page_image""    android:layout_toRightOf=""@id/page_image""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" /&gt;&lt;TextView    android:id=""@+id/page_desc""    android:layout_below=""@id/page_name""    style=""@style/pulse_content""    android:layout_alignLeft=""@id/page_name""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Principal Consultant"" /&gt;&lt;Button    android:id=""@+id/follow_button""    android:layout_below=""@id/author_image""    android:layout_marginTop=""15dip""    android:layout_alignParentBottom=""true""    android:text=""Follow""    style=""@style/follow_button"" /&gt;</code></pre><p>The issue I'm running into is that I want the follow_button to be below both the page_desc as well as the page_image.  Sometimes the page_desc content will have a height bigger than the size of the image, sometimes not.  the issue is that if i set the follow_button below either the image or the description, then the other one will get clipped.  Is there an efficient / effective way to ensure that the image or page_desc are always visible and above the button?</p>","372405","","413127","","2011-06-30 16:57:18","2014-01-03 12:58:29","android relative layout below 2 items","<android><relativelayout>","3","5","3","",""
"3355938","1","6572701","","2010-07-28 18:03:59","1","1867","<blockquote>  <p>Update: Fixed, this was due to missing properties in views and my not knowing how to work the debugger :)</p></blockquote><p>I'm really new to Android. I've just finished the Notepad tutorial and am making something similar (most of the code is exactly the same). The sequence of events I'm going through:</p><ol><li>Debug app</li><li>Click Menu, which has the correct items</li><li>Click Insert, which opens a new Activity (GoalEdit)</li><li>I hit a breakpoint on the first line of <code>GoalEdit.onCreate</code> and get these warnings:<br>a. (ActivityManager) Launch timeout has expired, giving up wake lock!<br>b. (ActivityManager) Activity idle timeout for HistoryRecord{...}</li><li>I have a breakpoint at <code>setContentView</code> in <code>GoalEdit.onCreate</code> - after this is passed:<br>a. ActivityThread.perfo: Source not found.</li></ol><p>The relevant code is below:</p><p><strong>GoalsList.java</strong></p><pre><code>/** * Add a menu to this activity */@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    menu.add(0, INSERT_ID, 0, R.string.menu_insert);    return true;}/** * Catch the menuItemSelected event */@Overridepublic boolean onMenuItemSelected(int featureId, MenuItem item) {    switch (item.getItemId()) {    case INSERT_ID:        createGoal();        return true;    }    return super.onMenuItemSelected(featureId, item);}/** * Open the Edit activity to create a new goal */private void createGoal() {    Intent i = new Intent(this, GoalEdit.class);    startActivityForResult(i, ACTIVITY_CREATE);}</code></pre><p><strong>GoalEdit.java</strong></p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mDbGoals = new GoalDbTable(this);    mDbGoals.open();    setContentView(R.layout.goal_edit);    mName = (EditText) findViewById(R.id.name);    Button finishBtn = (Button) findViewById(R.id.finish);    mRowId = (savedInstanceState == null) ? null :        (Long) savedInstanceState.getSerializable(GoalDbTable.KEY_ROWID);    if (mRowId == null) {        Bundle extras  = getIntent().getExtras();        mRowId = (extras != null) ? extras.getLong(GoalDbTable.KEY_ROWID)                                  : null;    }    populateFields();    finishBtn.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            setResult(RESULT_OK);            finish();        }    });}private void populateFields() {    if (mRowId != null) {        Cursor goal = mDbGoals.find(mRowId);        startManagingCursor(goal);        mName.setText(goal.getString(                goal.getColumnIndexOrThrow(GoalDbTable.KEY_NAME)));    }}@Overrideprotected void onResume() {    super.onResume();    populateFields();}</code></pre><p>I feel like the error is that it can't find GoalEdit (although it obviously can). Are there any obvious fubar's in my code (or other things I should check)?</p><p><strong>Edit:</strong> Figured out how to use the debugger a bit better, had to press resume a few more times to show an exception.</p><p><strong>Exceptions</strong></p><pre><code>ERROR/AndroidRuntime(741):   java.lang.RuntimeException: Unable to start activity   ComponentInfo{com.rossmasters.mygoals/com.rossmasters.mygoals.GoalEdit}:     java.lang.RuntimeException:       Binary XML file line #9: You must supply a layout_width attribute.</code></pre><p>I'm not sure which file that is referring to however, I've added <code>layout_width's</code> to each item.</p>","2025","","2025","","2010-07-28 18:16:42","2011-07-04 14:20:33","Launching another Activity creates a blank screen and crashes","<android><activity>","1","6","","",""
"3356086","1","3356149","","2010-07-28 18:19:40","1","689","<p>There is a variety of devices on the market, with different screen sizes, resolutions and pixel density.    </p><p>What are some layout preferences or tips/tricks that are generally used to make sure the app looks the same across devices?</p><p>ThanksChris</p>","400622","","","","","2010-07-28 19:02:00","Android - How to make UI look same across devices?","<android><user-interface><layout><screen><resolution>","3","0","","",""
"3356095","1","","","2010-07-28 18:20:34","11","11610","<p>I have one Android application,  when it runs a service, I want to show the notification on the status bar.  Then the user could navigate to other application by pressing HOME key. However when I try to bring the previous running application back to Front via notification icon, there is some problem with the existing activity. Even I declare it as ""Single Top"" mode (I want to run the existing activity since there is an associated service running) , somehow that activity's OnDestroy has been called before OnResume.  Here is my code of creating the notification object. Could you please point me what wrong it is. Thanks. </p><pre><code>private void showNotification (){  Intent toLaunch = new Intent(getApplicationContext(),                                          MySingleTopActivity.class);  PendingIntent intentBack = PendingIntent.getActivity(getApplicationContext(),   0,toLaunch, PendingIntent.FLAG_UPDATE_CURRENT);  notification.setLatestEventInfo(getApplicationContext(),         getText(R.string.GPS_service_name), text, intentBack);....}</code></pre>","404012","","234039","","2010-07-28 18:25:44","2011-09-18 12:07:59","How to bring Android existing activity to front via notification","<android>","3","1","1","",""
"3356138","1","3359153","","2010-07-28 18:26:16","1","237","<p>The reason: I'm trying to make Android work in a device without touch screen.</p>","287316","","","","","2010-07-29 02:49:55","Is there a way to expand the notifications with a key press, instead of touch?","<android>","2","0","1","",""
"3356193","1","3356242","","2010-07-28 18:33:39","1","1962","<p>I'm trying to figure out the correct way to create an AsyncTask to retrieve some data from the internet and then to take that data and bundle it up in an Intent and pass it to a new activity(A list display).  So in the first activity I just have an EditText and Button.  In the event of an OnClick the task should be called and when it is finished the data should be bundled inside an Intent and passed to the next Activity.  The problem is when I take the results from onPostExecute and set them to an instance variable of the main activity, that instance variable is still null when the task is complete.  Here is the barebones version of the code:</p><pre><code>public class SearchActivity extends Activity implements OnClickListener{    static final String TAG = ""SearchActivity"";    private EditText searchInput;    private Button searchBtn;    private PlacesList places;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.search_activity);        searchBtn = (Button) findViewById(R.id.button_search);          searchInput = (EditText) findViewById(R.id.search_input);        searchBtn.setOnClickListener(this);    }    public void onClick(View v) {        if(v == searchBtn)        {            String input = searchInput.getText().toString();            if(input != null &amp;&amp; input.length() != 0)            {                try {                    new TestTask().execute(input);                    Bundle bundle = new Bundle();                    bundle.putParcelable(""places"", places);                    Intent i = new Intent(this, SearchResultsActivity.class);                    i.putExtras(bundle);                    startActivity(i);                } catch(Exception ex) {                    ex.printStackTrace();                }             }        }    }    private class TestTask extends AsyncTask&lt;String, Void, PlacesList&gt;    {        private ProgressDialog dlg = new ProgressDialog(SearchActivity.this);        @Override        protected void onPreExecute()        {            dlg.setMessage(""test"");            dlg.show();        }        @Override        protected PlacesList doInBackground(String...args)        {            try             {                return new PlaceLocator().retrieveResults(args[0]);            }             catch (Exception e)             {                // TODO Auto-generated catch block                e.printStackTrace();            }            return new PlacesList();        }        @Override        protected void onPostExecute(PlacesList results)        {            SearchActivity.this.places = results;            if(dlg.isShowing())                dlg.dismiss();        }    }}</code></pre><p>When I debug the application I see onPostExecute does contain a valid PlacesList full of results, so why is the instance variable places set to null after the task is executed?  I am going about ""returning data"" from an AsyncTask incorrectly?</p>","147862","","","","","2011-09-23 09:26:33","Instance variable of Activity not being set in onPostExecute of AsyncTask or how to return data from AsyncTask to main UI thread","<java><android><multithreading><android-asynctask>","2","0","1","",""
"3356271","1","","","2010-07-28 18:44:29","0","559","<p>When I try to run the <code>SDK Setup.exe</code> in my sdk folder, it will open up fine. I then get an error for fetching so I change the https to http and proceed to (try) and download. It usually hangs around 2% and it won't go past 10% so far, I've tried to restart it at least 10 times.</p><p>Is there anyway I can ignore this program and just download the files from my browser somewhere? Is there a way to make this program work properly? </p><p>The Eclipse plugin also does the same thing, however I got to around 50% progress with it. Why is this happening?</p>","401193","","303756","","2010-07-28 18:46:25","2012-03-22 00:04:25","How to download Android SDK data without the manager (because it freezes)","<android>","1","2","","",""
"3356325","1","3358745","","2010-07-28 18:53:16","0","2733","<p>Is there anyway to intercept that a hard key was pressed by using a service in order to launch an activity?</p><p>In other words : Is it possible to handle the KeyEvents in the Service?</p>","348175","","114066","","2010-07-29 07:40:12","2011-07-01 17:05:43","How to intercept a hard key pressed in a service?","<android><service><keyevent>","2","0","1","",""
"3356684","1","3356713","","2010-07-28 19:30:03","0","270","<p>I have 2 String Operations I would need relevant in Object C</p><pre><code> // Get the newstring from mystring start at counterJava: newstring = mystring.substring(counter)  </code></pre><p>OBJ-C: ?</p><pre><code>// Get the position from searchstring in mystringJava: startpos = mystring.indexOf(searchstring)</code></pre><p>ObJ-C: ?</p><p>Would be great you can help</p><p>Thxchris</p><p>Edit: I had two other questions and found now the solution (here als for others)</p><pre><code>  // Get the Position from searchstring in mystring starting at startfrom  Java:  location = mystring.indexof(searchfor,startfrom)  OBJ-C: location = [mystring rangeOfString:searchfor options:NSCaseInsensitiveSearch range:NSMakeRange(startfrom, mystring.length-startfrom)].location;  // Get the newstring from mystring start at x and end at y  Java: newstring = mystring.substring(x,y)   OBJ-C: newstring = [mystring substringWithRange:NSMakeRange(x,y-x)];</code></pre>","355372","","355372","","2010-07-28 20:53:01","2010-07-28 20:53:01","iPhone Java String Code to Object C","<java><iphone><android><string>","1","0","","",""
"3356754","1","","","2010-07-28 19:37:51","0","1537","<p>I want to get the color of one pixel of screen </p>","404946","","29407","","2010-07-28 19:40:26","2011-04-26 14:01:49","Extract the color of a pixel of screen please","<android>","2","5","","",""
"3357204","1","3357250","","2010-07-28 20:26:28","0","469","<p>I have an activity 'A' which is called from Main activity every second until timer ends. </p><p>A is called to draw pulses until timer ends</p><pre><code>public class A extends Activity{    *some code*       public class NestedView extends View      {            public void onDraw(Canvas canvas)          {              * draw pulses         }             }    }</code></pre><p>I want to display the ""pulses view"" in main.xml which already has some buttons and scrollers, text boxes etc. How can I reserve a portion of screen for this pulses to be displayed. I cannot redo the xml file because the above pulses are dynamic and the image has a red line traversing across x axis for user defined time.</p>","357349","","234039","","2010-07-28 20:28:29","2010-07-28 21:01:10","Display view defined inside activity","<android>","1","0","","",""
"3357302","1","13111395","","2010-07-28 20:39:38","13","13801","<p>On the soft keyboard in Android you can set the soft keyboard to show the numbers instead of a-z keyboard using <code>android:inputType=""numberDecimal""</code>. However, what do I do if I only want to show the top number row <code>1 2 3 4 5 6 7 8 9 0</code> and not the following rows starting with <code>@ # $ % ...</code>?</p><p>Thanx for listening!</p>","286244","","","","","2012-10-28 17:50:46","Only show number buttons on Soft Keyboard in Android?","<android><android-softkeyboard>","4","0","3","",""
"3357398","1","","","2010-07-28 20:51:57","4","685","<p>I have application which works only in landscape orientation . I set that in xml layout. When I'm starting application it works ok . But when the application is started and next if I lock the phone and then unlock, the application first 1-2 seconds is in  portrait mode and then in landscape. Is it possible to skip theese 2 seconds?</p>","345602","","345602","","2010-07-28 21:22:22","2010-07-31 01:40:39","Android orientation issue","<android><orientation><landscape><portrait>","5","0","2","",""
"3357477","1","3359003","","2010-07-28 21:04:52","152","18330","<p>I have investigated this problem for months now, came up with different solutions to it, which I am not happy with since they are all massive hacks. I still cannot believe that a class that flawed in design made it into the framework and no-one is talking about it, so I guess I just must be missing something.</p><p>The problem is with <code>AsyncTask</code>. According to the documentation it </p><blockquote>  <p>""allows to perform background  operations and publish results on the  UI thread without having to manipulate  threads and/or handlers.""</p></blockquote><p>The example then continues to show how some exemplary <code>showDialog()</code> method is called in <code>onPostExecute()</code>. This, however, seems <strong>entirely contrived</strong> to me, because showing a dialog always needs a reference to a valid <code>Context</code>, and an AsyncTask <em>must never hold a strong reference to a context object</em>.</p><p>The reason is obvious: what if the activity gets destroyed which triggered the task? This can happen all the time, e.g. because you flipped the screen. If the task would hold a reference to the context that created it, you're not only holding on to a useless context object (the window will have been destroyed and <em>any</em> UI interaction will fail with an exception!), you even risk creating a memory leak.</p><p>Unless my logic is flawed here, this translates to: <code>onPostExecute()</code> is entirely useless, because what good is it for this method to run on the UI thread if you don't have access to any context? You can't do anything meaningful here.</p><p>One workaround would be to not pass context instances to an AsyncTask, but a <code>Handler</code> instance. That works: since a Handler loosely binds the context and the task, you can exchange messages between them without risking a leak (right?). But that would mean that the premise of AsyncTask, namely that you don't need to bother with handlers, is wrong. It also seems like abusing Handler, since you are sending and receiving messages on the same thread (you create it on the UI thread and send through it in onPostExecute() which is also executed on the UI thread).</p><p>To top it all off, even with that workaround, you still have the problem that when the context gets destroyed, you have <em>no record</em> of the tasks it fired. That means that you have to re-start any tasks when re-creating the context, e.g. after a screen orientation change. This is slow and wasteful.</p><p>My solution to this (as <a href=""https://github.com/mttkay/droid-fu/"">implemented in the Droid-Fu library</a>) is to maintain a mapping of <code>WeakReference</code>s from component names to their current instances on the unique application object. Whenever an AsyncTask is started, it records the calling context in that map, and on every callback, it will fetch the current context instance from that mapping. This ensures that you will never reference a stale context instance <em>and</em> you always have access to a valid context in the callbacks so you can do meaningful UI work there. It also doesn't leak, because the references are weak and are cleared when no instance of a given component exists anymore.</p><p>Still, it is a complex workaround and requires to sub-class some of the Droid-Fu library classes, making this a pretty intrusive approach.</p><p><strong>Now I simply want to know:</strong> Am I just massively missing something or is AsyncTask really entirely flawed? How are your experiences working with it? How did you solve these problem?</p><p>Thanks for your input.</p>","127013","","249690","","2013-09-12 06:31:34","2013-09-12 06:31:34","Is AsyncTask really conceptually flawed or am I just missing something?","<android><concurrency><handler><android-asynctask>","10","3","144","",""
"3357484","1","5664450","","2010-07-28 21:06:15","1","427","<p>In android, what is the simplest way to determine the duration of an audio file (assume I have an URI of the file on the phone)?  </p><p>Do I need to create and prepare an media player for each file I want to determine the duration of the file?</p><p>Thank you.</p>","125440","","","","","2011-04-14 14:03:54","Is there a way to determine the duration of an audio file","<android>","1","0","","",""
"3357529","1","3357653","","2010-07-28 21:11:20","0","460","<p>Does anyone happen to know if Google's MapActivity will eat up extra resources if an Activity does not use Google's MapView?  The reason I ask it because I'd like to have a base activity class (which would extend MapActivity) for my activities in my application, but I don't want my resources to be eaten up when the user is in an activity that doesn't utilize Google's MapView.</p><p>Thanks in advance for any help!</p><p>Regards, celestialorb.</p>","384386","","","","","2010-07-28 21:28:27","Resource usage in Google's MapActivity for Android","<java><android><google-maps><android-mapview>","1","0","1","",""
"3357563","1","3367001","","2010-07-28 21:16:07","1","1143","<p>I get this series of messages about once every six or so seconds from my Android emulator's LogCat output. I haven't noticed a cause, and it doesn't always happen, but when it does, it doesn't stop until I kill the emulator. Here's the repeated message:</p><pre><code>07-28 20:53:00.763: DEBUG/AndroidRuntime(2756): Shutting down VM07-28 20:53:00.763: DEBUG/dalvikvm(2756): Debugger has detached; object registry had 1 entries07-28 20:53:00.802: INFO/AndroidRuntime(2756): NOTE: attach of thread 'Binder Thread #3' failed07-28 20:53:01.682: DEBUG/AndroidRuntime(2766): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;07-28 20:53:01.692: DEBUG/AndroidRuntime(2766): CheckJNI is ON07-28 20:53:02.023: DEBUG/AndroidRuntime(2766): --- registering native functions ---07-28 20:53:05.083: DEBUG/AndroidRuntime(2766): Shutting down VM</code></pre><p>Does anyone have a clue WTF is going on here?</p>","136790","","","","","2010-07-29 21:13:08","AndroidRuntime thrashing","<android><logcat>","1","2","1","",""
"3357648","1","","","2010-07-28 21:28:09","2","905","<p>I'm able to add a Contact with ContactsContract to one of the user's accounts (a difficult feat in itself!), but I still haven't been able to add it to a group that will show up. I know that the user can go to their contact options and check a ""Show All (Other) Contacts"" box in their account, but not only is this is an extra step for the user that many of them don't know about, I tried it on an HTC EVO and I'm not sure that it's even possible with Sense. </p><p>So at minimum, I'm looking for a ContactsContract equivalent to addToMyContactsGroup. On a broader level, I'm looking for more detail on: </p><ul><li>How to best go about adding the contact to a group, depending on the account they choose to add the contact to.</li><li>How to avoid stacking up multiple Raw Contacts for the same person in case the user presses my ""Add to Contacts"" button multiple times (all Raw Contacts are visible and separately editable in Android when you edit a contact). </li><li>Basically how to make adding a contact as user friendly as possible without using <code>Intents.Insert</code></li></ul><p>Thanks pros!</p>","304742","","","","","2011-06-28 13:59:34","Adding a contact usefully with ContactsContract","<android><contactscontract>","1","0","1","",""
"3357747","1","","","2010-07-28 21:43:13","0","1041","<p>I have a widget with an ImageView on it. I set this ImageView to a Bitmap created from a 9-patch PNG resource. The image is set correctly but is not stretched correctly - i.e. the whole image is stretched instead of just part like defined in my 9-patch PNG. If I just set the 9-patch image as a resource, it works. How can I fix this?</p><pre><code>// Does not work (9-patch does not display correctly)Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.someNinePatch);remoteViews.setImageViewBitmap(R.id.someImageView, bitmap);// Works (9-patch displays correctly)remoteViews.setImageViewResource(R.id.someImageView, R.drawable.someNinePatch);</code></pre>","764272","","","","","2010-07-29 01:57:18","9-patch bitmap on a widget using RemoteViews","<android><bitmap><nine-patch>","1","0","","",""
"3357769","1","3357929","","2010-07-28 21:45:34","5","3499","<p>I am getting an error , when I try to access the <code>shared preference</code> from within class that extends <code>View</code>.</p><p>The Error : ""<code>The method getSharedPreferences(String, int) is undefined for the type ViewforRed</code>"" ,</p><p>where ViewforRed is my class</p><p>Here is the sample code</p><pre><code> public class ViewforRed extends View {       public final String PREFS_NAME = ""GRAPHICS"";       SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);           public ViewforRed(Context context)             {                super(context);             }         public void onDraw(Canvas canvas)                {                 Paint paint = new Paint();                 float  p0,p1,p2,p3,p4,p5,p6,p7,p8,p9;   }   }</code></pre>","357349","","1321640","","2012-12-27 05:21:53","2012-12-27 05:21:53","Unable to use shared preference within a class that extends View","<android>","1","0","","",""
"3357816","1","3679828","","2010-07-28 21:49:46","2","2812","<p>I'm trying to backport an android 1.6+ application to android 1.5.</p><p>Following the advice here...</p><ul><li><a href=""http://comments.gmane.org/gmane.comp.handhelds.android.devel/97051"" rel=""nofollow"">http://comments.gmane.org/gmane.comp.handhelds.android.devel/97051</a></li><li><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/ff22f6e42a4a46d2/4201a20aaa23069d"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/ff22f6e42a4a46d2/4201a20aaa23069d</a></li><li><a href=""http://stackoverflow.com/questions/2923823/android-2-2-sdk-breaks-compatibility-with-older-phones"">http://stackoverflow.com/questions/2923823/android-2-2-sdk-breaks-compatibility-with-older-phones</a></li><li><a href=""http://developer.android.com/intl/fr/guide/topics/resources/providing-resources.html#ScreenCompatibility"" rel=""nofollow"">http://developer.android.com/intl/fr/guide/topics/resources/providing-resources.html#ScreenCompatibility</a></li></ul><p>... I have done the following:</p><ol><li>Modify AndroidManifest.xml to set minSdkVersion to 3</li><li>Move all of my files that were previously in drawable-mdpi/ to drawable/</li><li>Rename drawable-hdpi/ to drawable-hdpi-v4/</li></ol><p>It seems to me that this should ensure that 1.5 devices use the files in drawable/ while 1.6 and later devices use the files in drawable/ and drawable-hdpi-v4/ as appropriate.  The drawable/ and drawable-hdpi-v4/ directories are the only drawable directories in my res folder.</p><p>However, after I compile, install, and run the resulting binary on the 1.5 emulator, I get the following error:</p><pre><code>E/AndroidRuntime( 1096): Caused by: java.lang.reflect.InvocationTargetExceptionE/AndroidRuntime( 1096):    at android.widget.ImageView.&lt;init&gt;(ImageView.java:103)E/AndroidRuntime( 1096):    at java.lang.reflect.Constructor.constructNative(Native Method)E/AndroidRuntime( 1096):    at java.lang.reflect.Constructor.newInstance(Constructor.java:446)E/AndroidRuntime( 1096):    at android.view.LayoutInflater.createView(LayoutInflater.java:499)E/AndroidRuntime( 1096):    ... 26 moreE/AndroidRuntime( 1096): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/bg.png from drawable resource ID #0x7f02002eE/AndroidRuntime( 1096):    at android.content.res.Resources.loadDrawable(Resources.java:1641)E/AndroidRuntime( 1096):    at android.content.res.TypedArray.getDrawable(TypedArray.java:548)E/AndroidRuntime( 1096):    at android.widget.ImageView.&lt;init&gt;(ImageView.java:113)E/AndroidRuntime( 1096):    ... 30 moreE/AndroidRuntime( 1096): Caused by: java.io.FileNotFoundException: res/drawable/bg.pngE/AndroidRuntime( 1096):    at android.content.res.AssetManager.openNonAssetNative(Native Method)E/AndroidRuntime( 1096):    at android.content.res.AssetManager.openNonAsset(AssetManager.java:392)E/AndroidRuntime( 1096):    at android.content.res.Resources.loadDrawable(Resources.java:1634)E/AndroidRuntime( 1096):    ... 32 more</code></pre><p>For reasons I don't understand, 1.5 devices are not able to see the bg.png image file, a version of which is in both the drawable/ and drawable-hdpi-v4/ directories.</p><p>Running the same binary works fine on 1.6.</p><p>Why won't 1.5 devices see my res/drawable/bg.png image with this setup?</p><p><strong>UPDATE:</strong> As described in <a href=""http://developer.android.com/intl/fr/guide/topics/resources/providing-resources.html#ScreenCompatibility"" rel=""nofollow"">Providing screen resource compatibility for Android 1.5</a>, I'm using Android SDK r6 and have put my mdpi resources in the drawable/ directory.  Also, I've verified that the problem isn't isolated to bg.png.  If I remove the reference to the broken drawable in my xml, the app breaks on the next and each subsequent graphic during setContentView().</p>","82156","","82156","","2010-08-02 20:34:48","2010-09-09 19:19:34","NotFoundException and FileNotFoundException when running app on Android 1.5","<android>","3","0","3","",""
"3357888","1","3358173","","2010-07-28 22:00:04","0","131","<p>My code is working and so, but I don't understand one thing.I've started game programming and now works my whole SurfaceView and so on. I have draw a background so it all works.</p><p>When I created this I followed a tutorial, so know I'm commenting on my own language. :)When I now started to comment some things; I can't get rid of this, can someone tell me why my constructor for my view has the Context parameter and AttributeSet paramater? What makes it necessary to have these and why do I need to set the localContext value to my GameView context?</p><p><strong>Game</strong></p><pre><code>public class Game extends Activity{@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(new GameView(this, null));}</code></pre><p>}</p><p><strong>GameView</strong></p><pre><code>    public GameView(Context localContext, AttributeSet attrSet){    super(localContext, attrSet);    context=localContext;    InitView();}</code></pre><p>The InitView(); just initialize every objects and variables I created; if this stuff is needed in order to explain the constructor-thing to me; I will post it.</p><p>Thanks!</p>","386562","","","","","2010-07-28 22:49:58","Don't understand the constructor of my View","<java><android>","1","0","","",""
"3357905","1","3358934","","2010-07-28 22:01:20","0","295","<p>In android media player has  getCurrentPosition() which tell me how long that media has been played (in second).  But why there is no equivalent for media recorder? How can I find out how long has elapsed when recoding an audio?</p>","286802","","","","","2010-07-29 01:54:56","getCurrentPosition() equivalent for Audio recorder","<android>","1","0","","",""
"3357923","1","3376420","","2010-07-28 22:03:53","0","2046","<p>My first post here. This website has been very useful for learning Android programming, thanks to everyone.</p><p>I have a simple app that loads an MP3 stream and plays it. It works fine on 1.6 and 2.1 but on 2.2 it doesn't quite work right. It seems my service is having a problem starting, it's giving my an ANR and the dialog where I have to tap ""Wait"", and then finally the service starts. Why is the service taking a long time to start up?</p><p>Here's my simple code that sets the source and plays the audio:</p><pre><code>    public class MyActivityService extends Service { MediaPlayer player = new MediaPlayer(); @Override public IBinder onBind(Intent intent) {  return null; } @Override public void onCreate() {    super.onCreate();     try {   player.setDataSource(""URL OF MUSIC FILE"");  } catch (IllegalArgumentException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IllegalStateException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }  try {   player.prepare();   player.setVolume(1, 1);      player.setLooping(true);                 player.start();                      Toast.makeText(getApplicationContext(), ""Audio Service Started."", Toast.LENGTH_SHORT).show();}</code></pre><p><strong>ADDENDUM:</strong></p><p>Turns out it wasn't my service not starting, it's the audio that's not starting quickly enough in 2.2...</p><p>I got rid of the ANRs when my service started and stopped by putting the <code>onCreate()</code> and <code>onDestroy()</code> methods of my service in their own threads, which is probably how it should have been from the beginning? Sorry, just learning.</p><p>But the delay that's the real problem remains, to clarify --</p><p>For example, my code, as it is right now, works fine and dandy and just how I want it to in 2.1 AND 2.2 when I set the data source to an MP3 file like this: <strong>http://dl.dropbox.com/u/6916184/TestSongStream.mp3</strong></p><p>BUT when I set the data source to an audio stream location like this: <strong>http://d.liveatc.net/kjfk_twr</strong> or this: <strong>http://relay.radioreference.com:80/192236577</strong> it works correctly ONLY in 2.1. </p><p>In 2.2 the sound does start playing eventually, but it takes ""StagefrightPlayer"" about 25 seconds or so after setting the data source until the audio starts as shown here:</p><pre><code>07-31 02:54:30.176: INFO/StagefrightPlayer(34): setDataSource('http://relay.radioreference.com:80/192236577')07-31 02:54:55.228: INFO/AwesomePlayer(34): calling prefetcher-&gt;prepare()07-31 02:54:56.231: INFO/Prefetcher(34): [0x2cc28] cache below low water mark, filling cache.07-31 02:54:56.337: INFO/AwesomePlayer(34): prefetcher is done preparing07-31 02:54:56.347: DEBUG/AudioSink(34): bufferCount (4) is too small and increased to 1207-31 02:54:57.337: ERROR/AwesomePlayer(34): Not sending buffering status because duration is unknown.</code></pre><p>It also takes the same amount of time, about 25 seconds, to stop the media player after <code>player.stop()</code> is called in the <code>onDestroy()</code> method of my service, and the <code>onDestroy()</code> method continues on to Toast a message and cancel a notification.</p><p>Is that just the way it is with 2.2? If so, I can work around the delays, that's not a problem. Or more likely is it something I am doing wrong? But it works exactly as I want in 1.6 and 2.1!</p><p>Would posting more code help? </p><p>My code is very simple. There are no audio controls or anything like that. Simply a start audio button and stop audio button that start and stop a service that plays an audio stream.</p><p>Thank you for any help!</p>","403146","","995926","","2012-05-05 13:40:12","2012-05-05 13:40:12","Stagefright media delay in 2.2 after setting data source?","<android><service><media><android-2.2-froyo>","1","3","","",""
"3358230","1","3358522","","2010-07-28 23:03:07","1","4542","<p>I'm hoping this is more of an issue with code than anything else and I'm hoping that someone out there can help track down the issue.</p><p>I have other code that starts the service with startService() and I can verify that the service is started as the debugger hits the onCreate() function of DecoderService.</p><p>However, the bindService never binds to the running service.  Is this an asynchronous call and I have to wait for something to complete?</p><pre><code>public class ResultsActivity extends Activity {protected void onResume() {    // TODO Auto-generated method stub    super.onResume();    Intent decoderIntent = new Intent(this,DecoderService.class);    _isBound = bindService(decoderIntent,mConnection,Context.BIND_AUTO_CREATE);    _textView.start(_mBoundService);}private boolean _isBound = false;private DecoderService _mBoundService;private ServiceConnection mConnection = new ServiceConnection() {    public void onServiceConnected(ComponentName className, IBinder service) {        _mBoundService = ((DecoderService.LocalBinder)service).getService();    }    public void onServiceDisconnected(ComponentName className)        _mBoundService = null;    }};}    public class DecoderService extends Service {protected void onHandleIntent(Intent intent) {    // TODO Auto-generated method stub    _numCompleted = 5;    _numTotal = 100;}protected int _numCompleted = 0;protected int _numTotal = 0;public void onCreate() {    onHandleIntent(null);}@Overridepublic IBinder onBind(Intent intent) {    return mBinder;}// This is the object that receives interactions from clients.  See// RemoteService for a more complete example.private final IBinder mBinder = new LocalBinder();public class LocalBinder extends Binder {    DecoderService _ref = null;    public LocalBinder()    {        _ref = DecoderService.this;    }    DecoderService getService() {        return DecoderService.this;    }}}</code></pre>","69983","","","","","2010-07-29 01:53:54","How to bind to running android service?","<android><service><activity>","2","1","2","",""
"3358307","1","3358919","","2010-07-28 23:16:51","0","245","<p>I have two XML files located in res/xml/. One file is a normal XML file located in that directory called myfile.xml and I can access it normally as <code>R.xml.myfile</code>.</p><p>Eclipse allows you to link files in from other locations. I have another XML file that is linked in from another drive. No matter what I do, i can not access this file by <code>R.xml.newfile</code>. I've even tried a DTD file, and isn't available via R either.</p><p>Am I doing something wrong, or is this some kind of bug?</p>","386680","","","","","2010-07-30 16:25:15","Why won't R update for a linked XML file?","<android><xml><resources>","3","2","","",""
"3358333","1","","","2010-07-28 23:21:24","0","327","<p>I created two layouts - one for portrait, one for landscape.  All else is the same.</p><p>There are two layout folders in the project the second one (for landscape) was created using the layout-view in Eclipse and using the 'create' button for the layout after I designed it.</p><p><strong>One folder</strong> (the default, created for the project) is: <em>res/layout</em>.</p><p><strong>The other folder</strong> (automatically generated when I pressed the Create button for the landscape) is: <em>res/layout-land-160dpi-etc, etc</em> and a few other things defining it.</p><p><strong>Running in the emulator:</strong> flipping the screen toggles correctly between the two layouts.</p><p><strong>Running on the device (htc Aria):</strong> only the portrait layout is correct - when I flip the device it uses the same portrait layout, not the correct one.</p><p>Almost sounds like it's 'how the device handles it'...  After reading several posts I'm a good bit confused now (and, 'yes', I have read the screens/layout info at the Android Dev site).</p><p>So, why would it work correctly on the emulator but not on device?Is there an issue with the name of the folder (mentioned above)?</p><p>Thanks in advance...</p><p>** Edited ** Yesss, I renamed it as suggested by Issiac and it works.  I can't access the Add Comment button - it's buried under links to other solutions... what's with that?  <strong>Thanks</strong> again!</p>","382200","","382200","","2010-07-28 23:47:10","2010-07-28 23:47:10","Multiple Layouts - Works in Emulator, Not on Device","<android><layout>","0","2","","",""
"3358523","1","3362815","","2010-07-29 00:03:46","0","521","<p>i have a default activity that starts first (Activity A), and from there the user can go to another activity (Activity B). In B after some work the user sets a sharedpreference. the next time the app starts i want to check in A if sharedpreference is null to go to B. and i put this if just under </p><pre><code> public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);</code></pre><p>and it encapsulates the whole onCreate. when the app starts it skips A and on B i shows the layout and the FC with NullPointerException.</p><p>Any one got experience with this?</p><p>OR</p><p>any one got a better idea on skipping A?</p>","366659","","","","","2012-01-10 09:11:00","How to skip an activity? android","<android><activity><skip>","2","0","","",""
"3358846","1","","","2010-07-29 01:33:13","0","517","<p>In most Android apps, when you press the Home button to ""minimize"" the application and then open the application again, you will be taken to the screen you were last on in that Application.</p><p>I've read the following:</p><blockquote>  <p>When launched via icon on the home  screen, Android will always start the  activity with the  android.intent.action.MAIN filter in  your AndroidManifest.xml, <strong>unless the  application is already running (in  which case it will obviously restore  the activity on top of the stack).</strong></p></blockquote><p>but this is not happening.  When I launch the application a second time, it takes me to the main Activity.  The application isn't being terminated.  If I then navigate to the screen I was last on, all the data and such is there.</p><p>How do I make it do what I want?  The related questions all seem to pose the same answer (the one I quoted above), but this is not holding true.</p>","404676","","","","","2010-07-29 01:41:56","Return to last Activity","<android><activity><launch>","1","0","","",""
"3358852","1","3639629","","2010-07-29 01:34:11","0","608","<p>I've seen this question asked before but it seems that the answer may be outdated. </p><p>I'm pulling a numeric value off of a spinner and storing it in a sqlite database as a string.I have an imageview placed into the row xml file. I'm sure creating some sort of adapter is involved.</p><p>How do i change the imageview source based on the value of the string from my database?</p><p>here is what i have now. the imageview src is static and the id is located in the xml layout.</p><p>``</p><p>private void fillData() {</p><pre><code>        String journalId = ((resource) this.getApplication()).getjournalId();        Cursor notesCursor = mDbHelper.fetchAllPlaces(journalId);        startManagingCursor(notesCursor);          String[] from =  new String[]{journalDbAdapter.KEY_JOURNAL_NAME, journalDbAdapter.KEY_PLACE                  , journalDbAdapter.KEY_DATE};       int[] to = new int[]{R.id.placedetail1, R.id.placedetail2, R.id.placedetail3};             SimpleCursorAdapter notes =             new SimpleCursorAdapter(this, R.layout.placedetailrow, notesCursor, from, to);        setListAdapter(notes);    }``</code></pre><p>i have an additional field KEY_TEMP, it will have a value if a string (0 OR 1 OR 2 OR 3).i want to change the imageview src on each case.</p>","393328","","","","","2013-04-27 18:28:44","On changing imageview src based on sqlite string field","<android><sqlite><adapter><imageview>","1","0","","",""
"3358931","1","","","2010-07-29 01:54:23","1","752","<p>I am retro-fitting a Maven project around a set of Android projects (written using Eclipse). Some of the Android projects are libraries of common code and resources. Since the Android library projects have resources, they have their own R, which I reference from within the common library code. Following the instructions in the <a href=""http://www.sonatype.com/books/mvnref-book/reference/android-dev-sect-dependencies.html"" rel=""nofollow"">Maven: Complete Reference, chapter 14</a>, I have got mostly everything working. The library sources are included and compiled from the projects that reference the library. However, compilation fails, since the generated library R is not included in the library sources. How do I get the Maven compilation to work?</p>","100856","","","","","2011-03-21 10:36:53","Android Maven build, with dependencies on library R fails","<android><maven-2>","1","0","","",""
"3358984","1","3359002","","2010-07-29 02:06:43","2","2730","<p>I am following sample code for sending an update notification every 10'seconds.  The code follows and it is in an ""UpdateService"" for an AppWidgetProvider.  If I put a Thread.sleep(10*1000); I can see the expected behavior of my servicing loop.  I obviously have something fundamentally wrong that is triggering immediately.  It is supposed to be a PendingIntent of an alarm that will broadcast update to my listener.</p><pre><code>long nextUpdate = 10*1000;Log.d(TAG, ""Requesting next update in "" + nextUpdate + "" msec."" );Intent updateIntent = new Intent(ACTION_UPDATE_ALL);updateIntent.setClass(this, UpdateService.class);PendingIntent pendingIntent = PendingIntent.getService(this, 0, updateIntent, 0);// Schedule alarm, and force the device awake for this updateAlarmManager alarmManager = (AlarmManager)getBaseContext().getSystemService(Context.ALARM_SERVICE);alarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(),     nextUpdate, pendingIntent);</code></pre>","157804","","23897","","2010-07-29 02:17:54","2010-07-29 02:17:54","Why is my android alarm manager firing instantly?","<android><alarmmanager><appwidget><android-pendingintent>","2","0","1","",""
"3359055","1","3359248","","2010-07-29 02:25:37","1","1228","<p>Im trying to get an object form my SQLite database in my Android application. I know that the contact is in the database because when I add it and try finding by ID, it returns the object. When I try finding by first and last name, though, it throws an exception and Im left with a null reference. Here is the query: </p><pre><code>cursor = mDb.query(DB_CONTACTS_NAME,    new String[] {KEY_ID, KEY_LAST_NAME, KEY_FIRST_NAME, KEY_EMAIL_ADDRESS,                 KEY_ORGANIZATION_NAME, KEY_LABEL, KEY_LABEL_POSITION},    KEY_FIRST_NAME + ""="" + first + "" AND "" + KEY_LAST_NAME + ""="" + last,    null, null, null, null);</code></pre><p>Ive also tried to find just by first name and just by last name. Same result as above.</p><p>Edit: The exception is an SQLite exception</p><pre><code>no such column: aurelius: , while compiling: SELECT _id, last_name, first_name,email_address, organization_name, label, label_position FROM contacts WHEREfirst_name=marcus AND last_name=aurelius</code></pre><p>And also happens when trying to select just first or last name</p><pre><code>no such column: marcus: , while compiling: SELECT _id, last_name, first_name,email_address, organization_name, label, label_position FROM contacts WHEREfirst_name=marcus</code></pre>","360921","","135152","","2011-05-25 03:12:43","2011-05-25 03:12:43","SQLite query throwing exception in Android","<java><android><sqlite>","2","2","","",""
"3359066","1","3359254","","2010-07-29 02:27:07","0","124","<p>Specifically, I'm curious about how they did the phone number entry part, where they can add additional phone numbers fields when the user clicks the little add button.  I initially thought that was done with a ListView, and I got a ListView to work, but the ListView scrolls independently of the rest of the screen, which looks bad.</p><p>So I was wondering what the best approach for something like that is?  Am I on the right track with the ListView and just missing something allowing me keep it from behaving like it's own scrollable container?  Perhaps a custom AdapterView or maybe just with a TableLayout dynamically adding rows?  I'm just not sure what would work the best.</p>","382437","","","","","2010-07-29 03:15:59","How Create a View Like the Default Android EditContact View?","<android>","2","0","","",""
"3359069","1","3359134","","2010-07-29 02:27:18","1","1248","<p>Before I start to reinvent the axle ... what's the best source of Android FOSS?</p><p>Is it the Android marketplace? There appear to be some projects on SourceForge ... anywhere else?</p>","192910","","","","","2011-03-18 03:21:28","What's the best source of Android FOSS?","<android><foss>","2","0","1","2011-09-13 12:39:32",""
"3359323","1","","","2010-07-29 03:38:11","0","367","<p>I am trying to refer to a custom View in the helloWorld XML layout but I get the following exception: Error inflating class acme.my.MyTextView.  </p><p>However, I am able to instantiate the view and add it to the main content view manually. The custom View is built from it's own XML layout. How do I get this to work?</p><pre><code>public class MyTextView extends LinearLayout {   MyTextView(Context context){  super(context);  LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);  layoutInflater.inflate(R.layout.my_text_view,this); } MyTextView(Context context, AttributeSet attrs){  super(context, attrs);  LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);  layoutInflater.inflate(R.layout.my_text_view,this); }}&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;  &lt;view class = ""acme.my.MyTextView"" android:id=""@+id/myView""  android:orientation=""vertical""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""            /&gt;</code></pre>","21906","","67097","","2012-05-30 07:35:29","2012-05-30 07:35:29","Trouble referring to a custom View in a layout XML","<android><android-layout><custom-view>","2","3","","",""
"3359413","1","3359439","","2010-07-29 04:04:43","4","4894","<p>I'm getting started with Android development, but the emulator performance on my machine leaves much to be desired. In all fairness, my machine is not a powerhouse by any stretch of the imagination.</p><p>Short of upgrading my hardware or spending $$$, are there any good tips for improving Android emulator performance?</p>","404854","","","","","2012-03-20 08:14:59","How to Improve Performance of the Android Emulator","<android>","2","5","1","",""
"3359414","1","","","2010-07-29 04:05:08","37","22962","<p>I'm having trouble with something that works in the Notepad example.Here's the code from the NotepadCodeLab/Notepadv1Solution:</p><pre><code>String[] from = new String[] { NotesDbAdapter.KEY_TITLE };int[] to = new int[] { R.id.text1 };SimpleCursorAdapter notes = new SimpleCursorAdapter(this,R.layout.notes_row, c, from, to);</code></pre><p>This code seems to work fine.  But just to be clear, I ran the <a href=""http://android-dls.com/wiki/index.php?title=ADB"">ADB</a>utility and run SQLite 3. I inspected the schema as follows:</p><p>sqlite> .schemaCREATE TABLE android_metadata (locale TEXT);CREATE TABLE notes (_id integer primary key autoincrement, title textnot null, body text not null);</p><p>All seems good to me.</p><hr><p>Now on to my application, which, as far as I can see, is basically the same witha few minor changes.  I've simplified and simplified my code, but theproblem persists.</p><pre><code>String[] from = new String[] { ""x"" };int[] to = new int[] { R.id.x };SimpleCursorAdapter adapter = null;try{    adapter = new SimpleCursorAdapter(this, R.layout.circle_row, cursor, from, to);}catch (RuntimeException e){    Log.e(""Circle"", e.toString(), e);}</code></pre><p>When I run my application, I get a RuntimeException and the following printsin LogCat from my <code>Log.e()</code> statement:</p><p>LogCat Message:</p><blockquote>  <p>java.lang.IllegalArgumentException: column '_id' does not exist</p></blockquote><p>So, back to SQLite 3 to see what's different about my schema:</p><p>sqlite> .schemaCREATE TABLE android_metadata (locale TEXT);CREATE TABLE circles (_id integer primary key autoincrement, sequenceinteger, radius real, x real, y real);</p><p>I don't see how I'm missing the '_id'.</p><p>What have I done wrong?</p><p>One thing that's different between my application and the Notepad example isthat I started by creating my application from scratch using theEclipse wizard while the sample application comes already put together.  Isthere some sort of environmental change I need to make for a new applicationto use a SQLite database?</p>","405251","","63550","","2011-05-07 19:44:23","2013-09-12 22:38:58","Android column '_id' does not exist?","<android><listview><sqlite3>","7","2","9","",""
"3359478","1","","","2010-07-29 04:26:51","0","1509","<p>I am try'g to create an Simple application in Android. In one of my module I have to call the <strong>options menu</strong> that appears underneath the screen, when I click the <strong>menu button</strong> in the Android emulator.</p><p>Since I have to invoke a new activity, when one of my menu items in option menu is tapped, I put <code>@Override</code> before the method <code>onOptionsSelectedItem(MenuItem menuitem)</code> in order to implement my own definition instead of calling the parent activity.</p><p>Once I put the annotation <code>@Override</code> before <code>onOptionsSelectedItem(MenuItem menuitem)</code> method, its showing the following error...(in compile time itself)</p><p>The method <code>onOptionsitemSelected(MenuItem)</code> of type <code>SingleShooterRecordShots</code> (MyClass) must override a superclass method....</p>","384193","","356895","","2013-03-21 08:40:59","2013-03-21 08:40:59","onOptionsitemSelected(MenuItem) of Type Appname(XXX) must override a superclass method","<android><android-optionsmenu><method-overriding>","1","3","","","2010-07-29 04:27:41"
"3359510","1","3359593","","2010-07-29 04:37:10","32","57477","<p>Does anyone have any dialogs that will allow a user to pick a number within a certain range? It seems like this would be a fairly common need, but I can't find a common dialog for it and I'd rather not have to spend the time creating my own.</p><p>Any help?</p>","118241","","","","","2012-11-06 21:50:37","Android Number Picker Dialog","<android><dialog><numbers>","6","0","6","",""
"3359511","1","3359572","","2010-07-29 04:37:34","2","3712","<p>I want to display the grid view elements in only one row that means i want horizontal scrolling in grid view.Each time i want to display only 5 elements only in one row.For this give me some suggestions.Thanks in advance. below is the my layout code</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;ImageView android:id=""@+id/ImageViewlarge"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;&lt;TextView  android:id=""@+id/TextViewImageName""  android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:layout_gravity=""center_horizontal""   android:editable=""false""&gt;  &lt;/TextView&gt;&lt;LinearLayoutandroid:layout_width=""fill_parent""android:orientation=""horizontal"" android:gravity=""bottom"" android:layout_height=""fill_parent""&gt;&lt;ImageView                       android:id=""@+id/ImageViewLeft""                       android:clickable=""true""                       android:focusable=""true""                       android:layout_alignParentLeft=""true""                         android:src=""@drawable/leftarrow"" android:layout_height=""50sp"" android:layout_width=""30sp"" android:layout_gravity=""bottom|left""&gt;       &lt;/ImageView&gt;&lt;GridView android:id=""@+id/GridView01"" android:scrollbars=""horizontal""     android:layout_height=""wrap_content""     android:fadingEdge=""horizontal""     android:scrollbarAlwaysDrawHorizontalTrack=""true""     android:scrollbarAlwaysDrawVerticalTrack=""false""      android:numColumns=""5"" android:layout_gravity=""center_horizontal"" android:layout_width=""260sp""&gt; &lt;/GridView&gt; &lt;ImageView                      android:id=""@+id/ImageViewRight""                      android:clickable=""true""                     android:focusable=""true""                                        android:src=""@drawable/rightarrow"" android:layout_width=""30sp"" android:layout_height=""50sp"" android:layout_gravity=""right""/&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>in that above code now i want to remove the that 2 image view and set the horizontal scroll to that grid view elements.For this give me some suggestions,Thanks in advance</p>","454808","","948041","","2012-09-25 10:43:50","2012-09-25 10:43:50","display the elments in grid view in only one row","<android><gridview>","1","1","","",""
"3359629","1","3359794","","2010-07-29 05:13:36","3","1481","<p>Hopefully this is just something easy since I'm still wet behind the ears with programming for android. My issue is that i have a couple EditText boxes at the bottom of my layout. When in the emulator they work as expected, you touch the edittext and the screen scrolls up so you can see the content. However when i try it on my droid inc the edittext is covered by the keyboard. </p><p>See screen captures at links (can't post them since I'm new...)</p><p><a href=""http://www.revta.com/Stack%20Overflow/device.png"" rel=""nofollow"">Droid Screen capture</a></p>","405288","","","","","2010-07-29 05:53:18","Android layout - Screen wont move up to allow input in EditText at the bottom","<android>","1","0","","",""
"3359692","1","3359857","","2010-07-29 05:28:56","12","9206","<p>I'm trying to redirect the log of my app to the sdcard file. But i failed to do so. I'm trying something like this.</p><pre><code>String cmd= ""logcat -v time   ActivityManager:W  myapp:D  *:* &gt;\""""+file.getAbsolutePath()+""\"""";Runtime.getRuntime().exec(cmd);</code></pre><p>I tried the -f option also but it is not working either.</p>","196579","","114066","","2010-07-29 07:36:40","2014-03-07 09:49:34","How to redirect my log output from logcat to the SD-Card on an android device?","<android><logging>","5","0","11","",""
"3359709","1","3359848","","2010-07-29 05:32:02","0","1247","<p>hi want to specify in  code to move to specific activity after pressing back button on android key pad how i can accomplish this, frnds help me </p><p>now i got the solution with the help of our friends </p><p>hi got the solutin to my prob onBackPressed() works after 1.6 version for previous versions we need use public boolean onKeyDown(int keyCode, KeyEvent event)method </p><p>my code for this solved prob is</p><p>@Override    public boolean onKeyDown(int keyCode, KeyEvent event)  {        if (android.os.Build.VERSION.SDK_INT &lt; android.os.Build.VERSION_CODES.CUR_DEVELOPMENT                &amp;&amp; keyCode == KeyEvent.KEYCODE_BACK                &amp;&amp; event.getRepeatCount() == 0) {            // Take care of calling this method on earlier versions of            // the platform where it doesn't exist.            onBackPressed();        }</p><pre><code>    return super.onKeyDown(keyCode, event);}//@Overridepublic void onBackPressed() {    // This will be called either automatically for you on 2.0    // or later, or by the code above on earlier versions of the    // platform.    Intent i=new Intent(AgesWebViewIndex.this,TabCls.class);    i.putExtra(""age"", ""agepage"");    startActivity(i);    return;}</code></pre>","400942","","400942","","2010-07-30 05:07:03","2010-07-30 05:07:03","how to move to specific ativity after pressing back in android key pad (android)","<android>","2","0","1","",""
"3359786","1","3365466","","2010-07-29 05:50:19","2","604","<p>I have created a custom View that is essentially a Gallery object that can be hidden and shown (using View.VISIBLE and View.GONE) by clicking on a TextView.</p><p>The images I place in this gallery have a custom background StateListDrawable selector.  Everything works fine except the state of the images in the gallery seems to get lost when the gallery goes from View.GONE to View.VISIBLE, and that the selector that is drawn is the default drawable (translucent_box).</p><p>These are the items in my selector XML:</p><pre>&lt;item android:drawable=""@drawable/red_box"" android:state_pressed=""true"" /&gt;&lt;item android:drawable=""@drawable/orange_box"" android:state_selected=""true"" android:state_focused=""true"" /&gt;&lt;item android:drawable=""@drawable/blue_box"" android:state_selected=""true"" /&gt;&lt;item android:drawable=""@drawable/translucent_box"" /&gt</pre><p>The strangest thing is that after returning from a call to startActivity, the state gets restored and everything displays fine until I hide and show the gallery again.</p><p>I have tried playing around with adding different states in the selector and programmatically trying to refresh the view... to no avail.</p><p>Any ideas?  I'm sure it has got to be something trivial...</p><p>Thanks in advance!</p>","249412","","","","","2011-02-15 19:19:54","View State lost with click","<android><view><onclick><state>","2","2","","",""
"3359908","1","3359976","","2010-07-29 06:17:43","0","937","<p>The following is the overriden dispatchDraw in a subclass of SurfaceView. I'm trying to change the parameters of the Surface(getting only a subsection of the video preview.</p><p>@Override </p><pre><code>       public void dispatchDraw (Canvas canvas) {        Log.d(TAG,""**************inside dispatchDraw************"");        int VIEW_WIDTH = canvas.getWidth();         int VIEW_HEIGHT = canvas.getHeight();        Log.d(TAG,""**************inside dispatchDraw************"" + Integer.toString(VIEW_WIDTH) + "" ,"" + Integer.toString(VIEW_HEIGHT));        int newWidth = 400;          int newHeight = 240;         float scaleWidth = ((float) newWidth) / VIEW_WIDTH;          float scaleHeight = ((float) newHeight) / VIEW_HEIGHT;          Matrix matrix = new Matrix();          matrix.postScale(scaleWidth, scaleHeight);          canvas.setMatrix(matrix);        super.dispatchDraw(canvas);        Log.d(TAG,""**************inside dispatchDraw-after super************"");    }</code></pre><p>Why does the above code not alter the dimensions of the SurfaceView at all?</p>","381699","","","","","2010-07-29 06:31:33","using dispatchDraw(Canvas) to obtain subsection of video preview","<android><video><canvas><matrix><preview>","1","0","","",""
"3360007","1","3360095","","2010-07-29 06:36:16","0","2269","<p><br/>I am trying to parse a json object using gson in Android application ,the test passed quite gracefully in emulator ,while i used the actual device ,the problems started I am getting the exception as follows<br/></p><pre><code>.....: com.google.gson.JsonParseException: Failed parsing JSON source: java.io.BufferedReader@44848f38 to Json......: print stack Failed parsing JSON source: java.io.BufferedReader@44848f38 to Json.......:com.google.gson.JsonParseException: Failed parsing JSON source: java.io.BufferedReader@44848f38 to Json.......:    at com.google.gson.JsonParser.parse(JsonParser.java:59)........:    at com...xx..allmenus.DiningDetail$3.run(DiningDetail.java:361)........: Caused by: com.google.gson.ParseException: Encountered "" &lt;IDENTIFIER_SANS_EXPONENT&gt; ""HTTP """" at line 1, column 1.07-29 11:33:55.186: WARN/System.err(2110): Was expecting one of:07-29 11:33:55.186: WARN/System.err(2110):     &lt;EOF&gt; 07-29 11:33:55.186: WARN/System.err(2110):     &lt;DIGITS&gt; ...07-29 11:33:55.186: WARN/System.err(2110):     ""null"" ...07-29 11:33:55.186: WARN/System.err(2110):     ""NaN"" ...07-29 11:33:55.194: WARN/System.err(2110):     ""Infinity"" ...07-29 11:33:55.194: WARN/System.err(2110):     &lt;BOOLEAN&gt; ...07-29 11:33:55.194: WARN/System.err(2110):     &lt;SINGLE_QUOTE_LITERAL&gt; ...07-29 11:33:55.194: WARN/System.err(2110):     &lt;DOUBLE_QUOTE_LITERAL&gt; ...07-29 11:33:55.202: WARN/System.err(2110):     "")]}\'\n"" ...07-29 11:33:55.210: WARN/System.err(2110):     ""{"" ...07-29 11:33:55.210: WARN/System.err(2110):     ""["" ...07-29 11:33:55.217: WARN/System.err(2110):     ""-"" ...07-29 11:33:55.217: WARN/System.err(2110):     07-29 11:33:55.217: WARN/System.err(2110):     at   com.google.gson.JsonParserJavacc.generateParseException(JsonParserJavacc.java:705)......:   at com.google.gson.JsonParserJavacc.jj_consume_token(JsonParserJavacc.java:587)......:     at com.google.gson.JsonParserJavacc.parse(JsonParserJavacc.java:62)......:    at com.google.gson.JsonParser.parse(JsonParser.java:54).....:     ... 1 more</code></pre><p>Please suggest a solution ,I am using gson 1.4 version.The code i use is </p><pre><code>            URLsource = new URL(""http://.........);      in = new BufferedReader(new UnicodeReader(URLsource.openStream(), ""UTF-8""));       jse = new JsonParser().parse(in);    in.close();             JsonArray info = jse.getAsJsonObject().getAsJsonArray(""info"");</code></pre><p>the o/p of the url as in the browser is <br/></p><pre><code>    {""info"":[{""restaurant_id"":"""",""name"":""Vie de France"",""campus_id"":"""",""address"":""600 Maryland Ave SW"",""city"":""WASHINGTON"",""state"":""DC"",""neighborhood"":"""",""neighborhood_urlname"":"""",""zipcode"":""20024"",""average_entree"":""6.29"",""chain_id"":""994"",""phone"":""(202) 554-7870"",""is_voicestar"":""0"",""menu_type"":""1"",""url"":"""",""logo"":"""",""details"":"""",""latitude"":""38.886877"",""longitude"":""-77.019913"",""properties"":""rmwa"",""reviews"":""y"",""yelp_phone"":""2025547870"",""reservation_id"":"""",""reservation_url"":"""",""price"":"""",""cross_street"":"""",""public_transit"":"""",""restaurant_description"":"""",""payment_methods"":"""",""hours"":"""",""next_open"":"""",""restaurant_status"":"""",""is_preorder"":"""",""citysearch_hours"":"" "",""minimum_order"":"""",""minimum_order_2"":"""",""delivery_rate"":"""",""delivery_time"":"""",""delivery_info"":"""",""misc_info"":"""",""delivery_charge"":"""",""delivery_charge_2"":"""",""is_pickup"":"""",""is_delivery"":"""",""minimum_tip_amount"":"""",""minimum_tip_percent"":"""",""restaurant_account_id"":"""",""urlname"":""\/dc\/washington\/239256-vie-de-france\/"",""facebook_fan_page"":"""",""twitter_page"":"""",""is_dz"":""0"",""loyalty"":"""",""delivery_hours"":""""}],""cuisines"":[{""mastercuisineid"":""143"",""cuisine"":""American"",""urlname"":""american""},{""mastercuisineid"":""90"",""cuisine"":""Bakery &amp; Pastries"",""urlname"":""bakery-pastries""},{""mastercuisineid"":""57"",""cuisine"":""French"",""urlname"":""french""}]}</code></pre><p>thanks</p>","286044","","157882","","2010-08-11 21:59:44","2010-08-11 21:59:44","com.google.gson.JsonParseException: Failed parsing JSON source: java.io.BufferedReader to Json - perplexed with this problem","<android><gson>","2","0","","",""
"3360114","1","3360259","","2010-07-29 06:53:02","0","993","<p>I want to use the Google Maps API in my Project.I signed up and got the API key also.</p><p>When I run my application now  I'm getting an error ""Error generating final archive: Invalid keystore"" I m really fed up. It is very difficult to use Maps in an application.</p><p>Do you know what the problem is in this case?</p>","383597","","114066","","2010-07-29 07:56:03","2010-07-29 07:56:03","Invalid keystore with Google Maps API","<android><google-maps>","2","0","","",""
"3360140","1","3360539","","2010-07-29 06:59:13","0","221","<p>I got problem with register. I use an if-else statement to check whether the user left any blank. If there is any blank, an error message will appear. The problem is, even with no blanks, all filled up, the error message still appears and thus prevents user from registering. I can't find any error. </p><p>Please help me spot my error.</p><pre><code>package log1.log2;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;import android.widget.Toast;public class Login extends Activity { DBAdapter db = new DBAdapter(this);/** Called when the activity is first created. */ private EditText etUsername; private EditText etPassword; private Button btnLogin; private Button btnRegister; private TextView lblResult;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // Get the EditText and Button References        etUsername = (EditText)findViewById(R.id.usernametxt);        etPassword = (EditText)findViewById(R.id.passwordtxt);        btnLogin = (Button)findViewById(R.id.btnLogin);        btnRegister = (Button)findViewById(R.id.btnRegister);        lblResult = (TextView)findViewById(R.id.msglbl);        //Cursor c = (Cursor) db.getAllTitles();        //Button btnArrival = (Button) findViewById(R.id.btnRegister);     //btnArrival.setOnClickListener(this);    // Set Click Listener        btnRegister.setOnClickListener(new OnClickListener() {         @Override         public void onClick(View v) {          Intent intent=new Intent(Login.this,Register.class);            startActivity(intent);         }        });    btnLogin.setOnClickListener(new OnClickListener() { @Override public void onClick(View v)  {  db.open();  Cursor c = (Cursor) db.getAllUser();  c.moveToFirst();  // Check Login  String username = etUsername.getText().toString();  String password = etPassword.getText().toString();  if(username.equals("""") || password.equals(""""))  {   Context context = getApplicationContext();   int duration = Toast.LENGTH_LONG;   Toast toast = Toast.makeText(context, ""FILL IN ALL FIELDS"", duration);   toast.show();  }  else  {   if(username.equals(c.getString(1)))   {    if(password.equals(c.getString(2)))    {     Context context = getApplicationContext();     int duration = Toast.LENGTH_LONG;     Toast toast = Toast.makeText(context, ""LOGIN SUCCESS"", duration);     toast.show();     long id;                 id = db.insertTransaction(      new String(etUsername.getText().toString()));     Intent intent=new Intent(Login.this,Test.class);        startActivity(intent);    }    else    {     Context context = getApplicationContext();     int duration = Toast.LENGTH_LONG;     Toast toast = Toast.makeText(context, ""LOGIN FAIL"", duration);     toast.show();    }   }   else   {    Context context = getApplicationContext();    int duration = Toast.LENGTH_LONG;    Toast toast = Toast.makeText(context, ""LOGIN FAIL"", duration);    toast.show();   }  }  db.close(); }});  }}</code></pre><p>Thank you very much.</p>","380770","","56338","","2010-07-29 07:01:58","2010-07-29 08:13:23","Register not able to be done due to error checking in the if..else statement","<android>","2","4","","",""
"3360177","1","3360433","","2010-07-29 07:07:56","1","399","<p>There is an error when i run my android program.</p><p>My Booking.java</p><pre><code>package one.two;import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.widget.SimpleCursorAdapter;import android.widget.Spinner;public class Booking extends ListActivity{    private DBAdapter db;     /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        db = new DBAdapter(this);        db.open();        setContentView(R.layout.main);        long id;         id = db.insertTime(        new String(""08:00""));         Cursor spinnerCursor = db.getSpinnerData();         startManagingCursor(spinnerCursor);        Spinner colourSpinner = (Spinner) findViewById(R.id.spinner);        /*Create an array to specify the fields we want to display in the list (only the 'colourName' column in this case) */        /*  String[] from = new String[]{DBAdapter.KEY_ARRIVAL};         /* and an array of the fields we want to bind those fields to (in this case just the textView 'tvDBViewRow' from our new db_view_row.xml layout above)         int[] to = new int[]{R.id.bookingtxt1};         Now create a simple cursor adapter..         SimpleCursorAdapter colourAdapter =        new SimpleCursorAdapter(this, R.layout.booking, spinnerCursor, from, to);        colourSpinner.setAdapter(colourAdapter);*/    }}</code></pre><p>DBAdapter.java</p><pre><code>    package one.two;    import java.io.IOException;    import android.content.ContentValues;    import android.content.Context;    import android.database.Cursor;    import android.database.SQLException;    import android.database.sqlite.SQLiteDatabase;    import android.database.sqlite.SQLiteException;    import android.database.sqlite.SQLiteOpenHelper;    import android.util.Log;    public class DBAdapter {           private static String DB_PATH = ""/data/data/one.two/databases/"";         private static String DB_NAME = ""irsyad"";        //values for the login table        public static final String KEY_ROWID = ""_id"";        public static final String KEY_USERNAME = ""Username"";        public static final String KEY_PASSWORD = ""Password"";        public static final String KEY_LNAME = ""LastName"";        public static final String KEY_FNAME =""FirstName"";        public static final String KEY_ROWID2 = ""_id"";        public static final String KEY_STATUS = ""status"";        public static final String KEY_DESTINATION = ""destination"";        public static final String KEY_ARRIVAL = ""arrival"";        public static final String KEY_FERRY =""ferry"";        private static final String TAG = ""DBAdapter"";        //declare Database name, tables names        private static final String DATABASE_NAME = ""irsyad"";        private static final String DATABASE_TABLE = ""User"";        private static final String DATABASE_TABLE_2 = ""port"";        private static final int DATABASE_VERSION = 1;        //declares the rules for the database tables        private static final String DATABASE_CREATE =            ""create table user (_id integer primary key autoincrement, ""            + ""Username text not null, Password text not null,""
            + ""LastName text not null, FirstName text not null);"";        private static final String DATABASE_CREATE_2 =            ""create table port (_id integer primary key autoincrement, ""            + ""status text not null, destination text not null,""
            + ""arrival text not null, ferry text not null);"";        private final Context context;         private DatabaseHelper DBHelper;        private SQLiteDatabase db;        public DBAdapter(Context ctx) {            this.context = ctx;            DBHelper = new DatabaseHelper(context);        }        private static class DatabaseHelper extends SQLiteOpenHelper {            DatabaseHelper(Context context) {                super(context, DATABASE_NAME, null, DATABASE_VERSION);            }            //Create the tables with the rules we set.            @Override            public void onCreate(SQLiteDatabase db) {                db.execSQL(DATABASE_CREATE);                db.execSQL(DATABASE_CREATE_2);            }            //OnUpgrade is only for use when u changed the database's version to 2 etc.            @Override            public void onUpgrade(SQLiteDatabase db, int oldVersion,             int newVersion) {                Log.w(TAG, ""Upgrading database from version "" + oldVersion                         + "" to ""                        + newVersion + "", which will destroy all old data"");                db.execSQL(""DROP TABLE IF EXISTS port"");                onCreate(db);            }        }            //---opens the database---        public DBAdapter open() throws SQLException {            db = DBHelper.getWritableDatabase();            return this;        }        //---closes the database---            public void close() {            DBHelper.close();        }        //Method for inserting login details, can be used in other java files when DBAdapter is        //declared in the java file. e.g. DBAdapter db = new DBAdapter(this);        public long insertUser(String Username, String Password, String LastName, String FirstName) {            ContentValues initialValues = new ContentValues();            initialValues.put(KEY_USERNAME, Username);            initialValues.put(KEY_PASSWORD, Password);            initialValues.put(KEY_LNAME, LastName);            initialValues.put(KEY_FNAME, FirstName);            return db.insert(DATABASE_TABLE, null, initialValues);        }        //---deletes a particular title---        public boolean deleteUser(long rowId) {            return db.delete(DATABASE_TABLE, KEY_ROWID +                     ""="" + rowId, null) &gt; 0;        }        public long insertTime(String arrival) {            ContentValues initialValue = new ContentValues();            initialValue.put(KEY_ARRIVAL, arrival);            return db.insert(DATABASE_TABLE_2, null, initialValue);         }        //method for retrieving all the inputs from database        public Cursor getAllUser() {            return db.query(DATABASE_TABLE, new String[] {                    KEY_ROWID,                     KEY_USERNAME,                    KEY_PASSWORD,                    KEY_LNAME,                    KEY_FNAME,},                    null,                     null,                     null,                     null,                     null);        }           public Cursor getAllData() {            return db.query(DATABASE_TABLE_2, new String[] {                    KEY_ROWID2,                     KEY_STATUS,                    KEY_DESTINATION,                    KEY_ARRIVAL,                    KEY_FERRY,},                    null,                     null,                     null,                     null,                     null);        }           //---retrieves a particular title---        public Cursor getUser(long rowId) throws SQLException {            Cursor mCursor =                    db.query(true, DATABASE_TABLE, new String[] {                            KEY_ROWID,                            KEY_USERNAME,                             KEY_PASSWORD,                            KEY_LNAME,                            KEY_FNAME,},                             KEY_ROWID + ""="" + rowId,                             null,                            null,                             null,                             null,                             null);            if (mCursor != null) {                mCursor.moveToFirst();            }            return mCursor;        }        public Cursor getSpinnerData() throws SQLException {            Cursor mCursor =                    db.query(DATABASE_TABLE_2, new String[] {                                           KEY_ARRIVAL,},                             null,                            null,                             null,                             null,                             null);            if (mCursor != null) {                mCursor.moveToFirst();            }            return mCursor;        }        //---updates a title---        public boolean updateUser(long rowId, String Username, String Password, String LastName, String FirstName) {            ContentValues args = new ContentValues();            args.put(KEY_USERNAME, Username);            args.put(KEY_PASSWORD, Password);            args.put(KEY_LNAME, LastName);            args.put(KEY_FNAME, FirstName);            return db.update(DATABASE_TABLE, args,                              KEY_ROWID + ""="" + rowId, null) &gt; 0;        }        private boolean checkDataBase() {            SQLiteDatabase checkDB = null;            try {                String myPath = DB_PATH + DB_NAME;                checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);            }            catch(SQLiteException e) {                //database does't exist yet.            }            if(checkDB != null) {                checkDB.close();            }            return checkDB != null ? true : false;        }        public void createDataBase() throws IOException {            boolean dbExist = checkDataBase();            if(dbExist) {                //do nothing - database already exist            }            else {                 db.execSQL(DATABASE_CREATE);                 db.execSQL(DATABASE_CREATE_2);            }        }    }</code></pre><p>Error log</p><pre><code>08-29 07:01:55.966: ERROR/Database(994): Error inserting arrival=08:0008-29 07:01:55.966: ERROR/Database(994): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed08-29 07:01:55.966: ERROR/Database(994):     at android.database.sqlite.SQLiteStatement.native_execute(Native Method)08-29 07:01:55.966: ERROR/Database(994):     at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:66)08-29 07:01:55.966: ERROR/Database(994):     at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1313)08-29 07:01:55.966: ERROR/Database(994):     at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1173)08-29 07:01:55.966: ERROR/Database(994):     at one.two.DBAdapter.insertTime(DBAdapter.java:126)08-29 07:01:55.966: ERROR/Database(994):     at one.two.Booking.onCreate(Booking.java:22)08-29 07:01:55.966: ERROR/Database(994):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)08-29 07:01:55.966: ERROR/Database(994):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)08-29 07:01:55.966: ERROR/Database(994):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)08-29 07:01:55.966: ERROR/Database(994):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)08-29 07:01:55.966: ERROR/Database(994):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)08-29 07:01:55.966: ERROR/Database(994):     at android.os.Handler.dispatchMessage(Handler.java:99)08-29 07:01:55.966: ERROR/Database(994):     at android.os.Looper.loop(Looper.java:123)08-29 07:01:55.966: ERROR/Database(994):     at android.app.ActivityThread.main(ActivityThread.java:3948)08-29 07:01:55.966: ERROR/Database(994):     at java.lang.reflect.Method.invokeNative(Native Method)08-29 07:01:55.966: ERROR/Database(994):     at java.lang.reflect.Method.invoke(Method.java:521)08-29 07:01:55.966: ERROR/Database(994):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)08-29 07:01:55.966: ERROR/Database(994):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)08-29 07:01:55.966: ERROR/Database(994):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","358218","","114066","","2010-07-29 07:28:02","2010-07-29 07:58:05","Error with spinner","<android><eclipse><sqlite><spinner>","1","0","1","",""
"3360242","1","3391694","","2010-07-29 07:19:01","1","705","<p>I'm writing an app-widget that displays some numbers, each with label in front of it.</p><p>The layout looks like this:</p><pre><code>.-----------------------------.| Label1       |  AAAAAAAAAAA || LongerLabelLabel2 | BBBBBBB || LongLabel3    | CCCCCCCCCC  |'-----------------------------'</code></pre><p>There is one outer (vertical) LinearLayout, and each row is a horizontal LinearLayout with two TextViews.</p><p>The problem is that the <em>numbers</em> get ellipsized if the width of the label and the number is too wide for the widget. I want the <em>labels</em> to get ellipsized.</p><p>The above situation for instance, would end up like this:</p><pre><code>.-----------------------------.| Label1    |     AAAAAAAAAAA || LongerLabelLabel2 | BBBB... || LongLabel3 |    CCCCCCCCCC  |'-----------------------------'</code></pre><p>instead of the desired</p><pre><code>.---------------------------.| Label1     |  AAAAAAAAAAA || LongerLabelL... | BBBBBBB || LongLabel3  | CCCCCCCCCC  |'---------------------------'</code></pre><p>I can't for my life figure out how to solve this. Any help is appreciated.</p><hr><p>My current layout is the following:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/widget""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:padding=""0dip""    android:orientation=""vertical""    style=""@style/WidgetBackground""&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""               android:id=""@+id/ROW1""              android:layout_width=""fill_parent""              android:layout_height=""wrap_content""              android:paddingTop=""7dip""              android:paddingBottom=""0dip""              android:paddingRight=""10dip""              android:paddingLeft=""10dip""              android:orientation=""horizontal""&gt;        &lt;TextView android:id=""@+id/NAME1"" android:singleLine=""true"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:ellipsize=""end"" style=""@style/Text.account"" /&gt;        &lt;TextView android:id=""@+id/BAL1""  android:singleLine=""true"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" android:gravity=""right"" style=""@style/Text.balance"" /&gt;    &lt;/LinearLayout&gt;... (more similar rows in the outer layout)&lt;/LinearLayout&gt;</code></pre>","276052","","276052","","2010-08-02 20:08:41","2010-08-02 20:58:47","Android AppWidget layout troubles with ellipsize","<android><layout><appwidget>","1","3","1","",""
"3360268","1","","","2010-07-29 07:23:00","0","1185","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon"">Quitting an application - is that frowned upon?</a>  </p></blockquote><p>How to exit the current application on a click of any button when I am in the middle of my application?</p><p>finish() will only finish the current activity not all the activities.</p>","405388","","114066","","2010-07-29 08:01:07","2012-02-13 09:21:34","How to close an Application?","<android><exit>","2","0","","2012-10-18 12:49:30",""
"3360312","1","","","2010-07-29 07:32:34","1","45","<p>Before I start to develop an application I really want to know that we can only use android Sdk on Android phones or can we use the android Sdk to develop other things like iPad, iPhone also etc?</p>","366916","","114066","","2010-07-29 07:38:45","2010-07-29 07:38:45","Android and field of useage","<android>","1","0","","",""
"3360349","1","4469593","","2010-07-29 07:39:15","8","7021","<p>I wanna build one app into 2 version, one paid, one free, and I know aapt have a option ""--rename-manifest-package"" should help, but I don't know How to use it in build.xml.I find 2 place I may modify:</p><pre><code> &lt;!-- first --&gt; &lt;target name=""-resource-src"" depends=""-dirs""&gt;    &lt;echo&gt;Generating R.java / Manifest.java from the resources...&lt;/echo&gt;    &lt;exec executable=""${aapt}"" failonerror=""true""&gt;        &lt;arg value=""package"" /&gt;        &lt;arg line=""${v.option}"" /&gt;        &lt;arg value=""-m"" /&gt;        &lt;arg value=""-J"" /&gt;        &lt;arg path=""${gen.absolute.dir}"" /&gt;        &lt;arg value=""-M"" /&gt;        &lt;arg path=""AndroidManifest.xml"" /&gt;        &lt;arg value=""-S"" /&gt;        &lt;arg path=""${resource.absolute.dir}"" /&gt;        &lt;arg value=""-I"" /&gt;        &lt;arg path=""${android.jar}"" /&gt;           &lt;/exec&gt;&lt;/target&gt; &lt;!-- sencod --&gt; &lt;target name=""-package-resources""&gt;    &lt;echo&gt;Packaging resources&lt;/echo&gt;     &lt;aaptexec executable=""${aapt}""            command=""package""            manifest=""AndroidManifest.xml""            resources=""${resource.absolute.dir}""            assets=""${asset.absolute.dir}""            androidjar=""${android.jar}""            outfolder=""${out.absolute.dir}""    basename=""${ant.project.name}"" &gt;&lt;/aaptexec&gt;&lt;/target&gt;</code></pre><p>this article( <a href=""http://blog.uncommons.org/2010/07/19/building-two-versions-of-the-same-android-app/"">http://blog.uncommons.org/2010/07/19/building-two-versions-of-the-same-android-app/</a> ) said I should adding  ""--rename-manifest-package"" at the second place, but How?</p>","361010","","","","","2013-10-10 18:29:26","Custom Android build.xml for rename manifest package","<android>","4","2","6","",""
"3360477","1","","","2010-07-29 08:05:26","1","94","<p>I am new to android.I want to know what all the devices that works on android OS.please help me out and thanks in advance.</p>","366916","","","","","2010-07-29 13:06:23","Android OS and application","<android>","3","1","","",""
"3360573","1","","","2010-07-29 08:17:56","6","1280","<p>I wanted to build an application related to Bluetooth in Android . Is there any way by which I can set the PIN from my application in Android other than using system dialog box to enter PIN which pops out . I checked for API's given by Android for bluetooth, but I could not locate any API for setting keys for bluetooth as provided in WiFi manager e.g. wificonfig.presharedkey = xyz.</p><p>Thanks in Advance</p>","383347","","","","","2010-12-06 07:14:31","Can I set the PIN for Bluetooth from my application in Android","<android><bluetooth>","1","0","0","",""
"3360605","1","3360905","","2010-07-29 08:24:07","7","8762","<p>the error in my logcat is such</p><p>Logcat</p><pre><code>08-29 08:20:57.961: ERROR/AndroidRuntime(1766): java.lang.RuntimeException: Unable to start activity ComponentInfo{one.two/one.two.Booking}: java.lang.IllegalArgumentException: column '_id' does not exist08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.os.Handler.dispatchMessage(Handler.java:99)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.os.Looper.loop(Looper.java:123)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.app.ActivityThread.main(ActivityThread.java:3948)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at java.lang.reflect.Method.invokeNative(Native Method)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at java.lang.reflect.Method.invoke(Method.java:521)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at dalvik.system.NativeStart.main(Native Method)08-29 08:20:57.961: ERROR/AndroidRuntime(1766): Caused by: java.lang.IllegalArgumentException: column '_id' does not exist08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:314)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.widget.CursorAdapter.init(CursorAdapter.java:111)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.widget.CursorAdapter.&lt;init&gt;(CursorAdapter.java:90)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.widget.ResourceCursorAdapter.&lt;init&gt;(ResourceCursorAdapter.java:47)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.widget.SimpleCursorAdapter.&lt;init&gt;(SimpleCursorAdapter.java:85)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at one.two.Booking.onCreate(Booking.java:34)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)08-29 08:20:57.961: ERROR/AndroidRuntime(1766):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)</code></pre><p>Part of my DBAdapter.java</p><pre><code>public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        db = new DBAdapter(this);        db.open();        setContentView(R.layout.booking);        /*long id;         id = db.insertTime(        new String(""08:00"")); */        Cursor spinnerCursor = db.getSpinnerData();         startManagingCursor(spinnerCursor);        Spinner colourSpinner = (Spinner) findViewById(R.id.spinner);</code></pre><p>Creation of DB</p><pre><code>package one.two;import java.io.IOException;import android.content.ContentValues;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteException;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;public class DBAdapter {       private static String DB_PATH = ""/data/data/one.two/databases/"";     private static String DB_NAME = ""irsyad"";    //values for the login table    public static final String KEY_ROWID = ""_id"";    public static final String KEY_USERNAME = ""Username"";    public static final String KEY_PASSWORD = ""Password"";    public static final String KEY_LNAME = ""LastName"";    public static final String KEY_FNAME =""FirstName"";    public static final String KEY_ROWID2 = ""_id"";    public static final String KEY_STATUS = ""status"";    public static final String KEY_DESTINATION = ""destination"";    public static final String KEY_ARRIVAL = ""arrival"";    public static final String KEY_FERRY =""ferry"";    private static final String TAG = ""DBAdapter"";    //declare Database name, tables names    private static final String DATABASE_NAME = ""irsyad"";    private static final String DATABASE_TABLE = ""User"";    private static final String DATABASE_TABLE_2 = ""port"";    private static final int DATABASE_VERSION = 1;    //declares the rules for the database tables    private static final String DATABASE_CREATE =        ""create table user (_id integer primary key autoincrement, ""        + ""Username text not null, Password text not null,""
        + ""LastName text not null, FirstName text not null);"";    private static final String DATABASE_CREATE_2 =        ""create table port (_id integer primary key autoincrement, ""        + ""status text null, destination text null,""
        + ""arrival text null, ferry text null);"";    private final Context context;     private DatabaseHelper DBHelper;    private SQLiteDatabase db;    public DBAdapter(Context ctx)     {        this.context = ctx;        DBHelper = new DatabaseHelper(context);    }    private static class DatabaseHelper extends SQLiteOpenHelper     {        DatabaseHelper(Context context)         {            super(context, DATABASE_NAME, null, DATABASE_VERSION);        }        //Create the tables with the rules we set.        @Override        public void onCreate(SQLiteDatabase db)         {            db.execSQL(DATABASE_CREATE);            db.execSQL(DATABASE_CREATE_2);        }        //OnUpgrade is only for use when u changed the database's version to 2 etc.        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion,         int newVersion)         {            Log.w(TAG, ""Upgrading database from version "" + oldVersion                     + "" to ""                    + newVersion + "", which will destroy all old data"");            db.execSQL(""DROP TABLE IF EXISTS port"");            onCreate(db);        }    }        //---opens the database---    public DBAdapter open() throws SQLException     {        db = DBHelper.getWritableDatabase();        return this;    }    //---closes the database---        public void close()     {        DBHelper.close();    }    //Method for inserting login details, can be used in other java files when DBAdapter is    //declared in the java file. e.g. DBAdapter db = new DBAdapter(this);    public long insertUser(String Username, String Password, String LastName, String FirstName)     {        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_USERNAME, Username);        initialValues.put(KEY_PASSWORD, Password);        initialValues.put(KEY_LNAME, LastName);        initialValues.put(KEY_FNAME, FirstName);        return db.insert(DATABASE_TABLE, null, initialValues);    }   /* public long insertTime(String arrival)     {     ContentValues initialValue = new ContentValues();     initialValue.put(KEY_ARRIVAL, arrival);     return db.insert(DATABASE_TABLE_2, KEY_ARRIVAL, initialValue);     }*/    //---deletes a particular title---    public boolean deleteUser(long rowId)     {        return db.delete(DATABASE_TABLE, KEY_ROWID +                 ""="" + rowId, null) &gt; 0;    }    //method for retrieving all the inputs from database    public Cursor getAllUser()     {        return db.query(DATABASE_TABLE, new String[] {                KEY_ROWID,                 KEY_USERNAME,                KEY_PASSWORD,                KEY_LNAME,                KEY_FNAME,},                null,                 null,                 null,                 null,                 null);    }       public Cursor getAllData()     {        return db.query(DATABASE_TABLE_2, new String[] {                KEY_ROWID2,                 KEY_STATUS,                KEY_DESTINATION,                KEY_ARRIVAL,                KEY_FERRY,},                null,                 null,                 null,                 null,                 null);    }       //---retrieves a particular title---    public Cursor getUser(long rowId) throws SQLException     {        Cursor mCursor =                db.query(true, DATABASE_TABLE, new String[] {                        KEY_ROWID,                        KEY_USERNAME,                         KEY_PASSWORD,                        KEY_LNAME,                        KEY_FNAME,},                         KEY_ROWID + ""="" + rowId,                         null,                        null,                         null,                         null,                         null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    public Cursor getSpinnerData() throws SQLException     {        Cursor mCursor =                db.query(DATABASE_TABLE_2, new String[] {                                       KEY_ARRIVAL,},                         null,                        null,                         null,                         null,                         null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    //---updates a title---    public boolean updateUser(long rowId, String Username, String Password, String LastName, String FirstName)    {        ContentValues args = new ContentValues();        args.put(KEY_USERNAME, Username);        args.put(KEY_PASSWORD, Password);        args.put(KEY_LNAME, LastName);        args.put(KEY_FNAME, FirstName);        return db.update(DATABASE_TABLE, args,                          KEY_ROWID + ""="" + rowId, null) &gt; 0;    }    private boolean checkDataBase()    {        SQLiteDatabase checkDB = null;        try        {            String myPath = DB_PATH + DB_NAME;            checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);        }        catch(SQLiteException e)        {            //database does't exist yet.        }        if(checkDB != null)        {            checkDB.close();        }        return checkDB != null ? true : false;    }    public void createDataBase() throws IOException    {        boolean dbExist = checkDataBase();        if(dbExist)        {            //do nothing - database already exist        }        else        {             db.execSQL(DATABASE_CREATE);             db.execSQL(DATABASE_CREATE_2);        }    }}</code></pre>","358218","","358218","","2010-07-29 08:56:56","2010-07-29 09:08:38","column _id does not exist","<android><database><eclipse><sqlite>","2","0","","",""
"3360648","1","3551829","","2010-07-29 08:31:00","15","6225","<p>I am trying to get working R.java generation to project in gen folder. Actually, the application builds, when using maven build, however eclipse finds error, because it can't resolve R.java file (which actually is being put in /target/generated-sources/r/R.java location after each build). What is the suggested way to solve the problem?</p>","403324","","","","","2013-09-25 07:21:45","Maven with Android - R.java file generation (Eclipse)","<android><maven-2>","4","1","7","",""
"3360711","1","","","2010-07-29 08:41:05","0","842","<p>I've two String Arrays like that , </p><pre><code>String[] htmlArray = {      ""file:///android_asset/Pinocchio/OPS/chapter-001.xml"",      ""file:///android_asset/Pinocchio/OPS/chapter-002.xml"",      ""file:///android_asset/Pinocchio/OPS/chapter-035.xml"",      ""file:///android_asset/Pinocchio/OPS/chapter-035.xml"" };String[] htmlArray1 = {      ""file:///android_asset/Harry_Potter/OEBPS/part1.xhtml"",      ""file:///android_asset/Harry_Potter/OEBPS/part2_split_000.xhtml"",      ""file:///android_asset/Harry_Potter/OEBPS/part18_split_000.xhtml"",      ""file:///android_asset/Harry_Potter/OEBPS/part18_split_001.xhtml"", };</code></pre><p>then, I put two ImageView in another class, </p><pre><code>private void init() {    pino_cover = (ImageView) findViewById(R.id.pino_cover);    pino_cover.setOnClickListener(new View.OnClickListener() {      @Override      public void onClick(View v) {        Intent reader=new Intent(instance,ReaderScreen.class);        reader.putExtra(""pino"",true);        startActivity(reader);      }    });    harry_cover=(ImageView) findViewById(R.id.harry_cover);    harry_cover.setOnClickListener(new View.OnClickListener() {      @Override      public void onClick(View v) {        Intent reader=new Intent(instance,ReaderScreen.class);        reader.putExtra(""harry"",true);        startActivity(reader);      }    });  }</code></pre><p>Then, if I click the Pino Image, I could get the data through htmlArray . </p><pre><code>Intent i=getIntent();      Bundle b = i.getExtras();       String newText = b.       String setext=b.getString(""harry"");      if (newText==""pino"")            pages = htmlArray;          else        pages = htmlArray1;</code></pre><p>but if I click the Harry Image, it'd been taken to get the data through the <code>htmlArray</code> too. I want to get <code>htmlArray1</code>. How could I get ? </p>","2438460","","2438460","","2010-07-29 09:03:25","2010-07-29 09:49:22","Passing data through Intents from a class to another class and can't catch it?","<android><android-intent>","2","0","","",""
"3360881","1","","","2010-07-29 09:04:38","1","1458","<ul><li><p>I wish to know how in java I should receive these parameters.</p></li><li><p>I do know how to deliver parameters via adb shell am start command but I still have a<br>problem to get them in java (android) code.  </p></li></ul><p>My class extends InstrumentationTestCase and not Activity class!!!</p><p>So I cannot perform: this.getIntent(). </p><p>I anderstand that I need to create intent doing: Intent intent = new Intent(Intent.someAction); </p><p>Can you help me to find out what action should I use here.</p><p>I also read that there are secondary attributes: category, type, component, extras. I know that I also need to update the manifest file accordingly. Sorry for so many q/a.</p><p>Thanks a lot for your assist. </p>","268121","","","","","2012-06-14 15:44:55","Deliver test params using adb shell am start command","<android><shell><adb>","2","0","1","",""
"3360926","1","3383145","","2010-07-29 09:12:47","7","6313","<p>For retrieving the accounts (information) in Android versions since 2.0 you can use the AccountManager that has been introduced in Android 2.0.</p><p>But now I have the problem I want to maintain compatibility with atleast Android 1.6, is there any way to retrieve account information in Android 1.6?</p>","174868","","","","","2010-09-20 21:18:01","Get main gmail account username in Android < 2.0","<android><gmail>","1","0","6","",""
"3360957","1","3361567","","2010-07-29 09:17:31","10","27806","<p>This is my code.</p><p>I got Http 400 error, can someone help me?</p><pre><code>HttpClient   httpClient;HttpPost     httpPost;HttpResponse response;HttpContext  localContext;FileEntity   tmp = null;   String       ret = null;httpClient = new DefaultHttpClient( );httpClient.getParams().setParameter( ClientPNames.COOKIE_POLICY, CookiePolicy.RFC_2109) ;httpPost = new HttpPost(url);tmp      = new FileEntity( data,""UTF-8"" );httpPost.setEntity( tmp );httpPost.setHeader( ""Content-Type"", ""multipart/form-data"" );httpPost.setHeader( ""access_token"", facebook.getAccessToken( ) );httpPost.setHeader( ""source"",       data.getAbsolutePath( ) );httpPost.setHeader( ""message"",      ""Caption for the photo"" );localContext = new BasicHttpContext( );response     = httpClient.execute( httpPost,localContext );</code></pre><hr><p>bobince, thanks this is my new id, I will try put OAuth to my connection header.</p><p>And this is my old code, I will update it soon.</p><pre><code>private void uploadPicture( ) throws ParseException, IOException {    HttpClient httpclient = new DefaultHttpClient();    httpclient.getParams( ).setParameter( CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1 );    HttpPost httppost = new HttpPost( ""https://graph.facebook.com/me/photos"" );    File file = new File( sdpicturePath );    // DEBUG    Log.d( ""TSET"", ""FILE::"" + file.exists( ) ); // IT IS NOT NULL    Log.d( ""TEST"", ""AT:"" + fbAccessToken ); // I GOT SOME ACCESS TOKEN    MultipartEntity mpEntity  = new MultipartEntity( );    ContentBody cbFile        = new FileBody( file, ""image/png"" );    ContentBody cbMessage     = new StringBody( ""TEST TSET"" );    ContentBody cbAccessToken = new StringBody( fbAccessToken );    mpEntity.addPart( ""access_token"", cbAccessToken );    mpEntity.addPart( ""source"",       cbFile        );    mpEntity.addPart( ""message"",      cbMessage     );            httppost.setEntity( mpEntity );    // DEBUG    System.out.println( ""executing request "" + httppost.getRequestLine( ) );    HttpResponse response = httpclient.execute( httppost );    HttpEntity resEntity = response.getEntity( );    // DEBUG    System.out.println( response.getStatusLine( ) );    if (resEntity != null) {      System.out.println( EntityUtils.toString( resEntity ) );    } // end if    if (resEntity != null) {      resEntity.consumeContent( );    } // end if    httpclient.getConnectionManager( ).shutdown( );} // end of uploadPicture( )</code></pre>","406900","","178082","","2011-05-19 01:09:40","2011-05-19 01:09:40","How use multipart/form-data upload picture/image on Android","<android><facebook><upload><multipartform-data>","1","2","9","",""
"3360985","1","3361947","","2010-07-29 09:21:23","10","3604","<p>The Logcat in Eclipse has colors ofr errors, warning, debug, ...<br>How can I do to get the same result on Linux (Ubuntu) when I run the command 'adb -e logcat' in a terminal to get it colored?</p>","263521","","","","","2013-06-21 13:59:35","color the lines of logcat on Linux [android]","<android><linux><colors><terminal><logcat>","3","1","4","",""
"3361110","1","3361142","","2010-07-29 09:40:38","3","8671","<p>I want to know which Eclipse IDE to use for android development.</p><p>The following url <a href=""http://www.eclipse.org/downloads/"" rel=""nofollow"">http://www.eclipse.org/downloads/</a> shows  a lot of option.</p><p>Right now i am using Mac OS X v 10.6.4.</p>","159997","","","","","2014-03-18 15:06:43","Which Eclipse IDE to use for android development?","<android><eclipse>","4","0","","",""
"3361130","1","3395307","","2010-07-29 09:43:03","0","2821","<p>Is it possible in Android to get a callback when a Frame Animation (AnimationDrawable) has completed playing its frame sequence?  I know when a Tween Animation has completed, it calls  onAnimationEnd(), but is there something similar for frame by frame animations?</p>","107459","","107459","","2010-07-29 10:49:30","2010-08-03 09:44:30","Frame Animation callback when animation is complete in Android","<android><animation><frame>","1","0","","",""
"3361168","1","3361228","","2010-07-29 09:46:41","0","1136","<p>I have a little problem. I have class</p><pre><code>private static class EfficientAdapter extends BaseAdapter {        private LayoutInflater mInflater;        public EfficientAdapter(Context context) {            mInflater = LayoutInflater.from(context);        }        // return size of elements        public int getCount() {            return BridgeJSON.listFromJSON.getItem().size();        }        public Object getItem(int position) {            return position;        }        public long getItemId(int position) {            return position;        }        public View getView(int position, View convertView, ViewGroup parent) {            ViewHolder holder;            if (convertView == null) {                position_move = 0;                convertView = mInflater.inflate(R.layout.row, null);                holder = new ViewHolder();                holder.txt_description = (TextView) convertView                        .findViewById(R.id.description_event);                ......                convertView.setTag(holder);            } else {                holder = (ViewHolder) convertView.getTag();            }            if (listFromJSON.getItem().get(position).isViewed() == false) {                convertView.setBackgroundColor(Color.RED);                this.notifyDataSetChanged();            } else {                // get text for description                String txt_for_description = listFromJSON.getItem().get(                        position - position_move).getDescr();                ..........            }            return convertView;        }        static class ViewHolder {            TextView txt_description;            TextView txt_time;            TextView txt_title;            TextView txt_place;        }    }</code></pre><p>When I do that, method convertView.setBackgroundColor(Color.RED) work great, what I needImage is there: dl.dropbox.com/u/866867/stack/device2.png</p><p>but when I want to remove that item, I can't do it. I add there convertView.setVisibility(View.GONE); , but have empty item, beside hide it. I read that parameter View.INVISIBLE won't hide layout, but View.GONE have, but in my code, doesn't(((</p><p>And that image:<a href=""http://dl.dropbox.com/u/866867/stack/device.png"" rel=""nofollow"">http://dl.dropbox.com/u/866867/stack/device.png</a></p>","403340","","","","","2010-07-29 09:59:13","BaseAdapter don't hide layout with setVisibility(View.GONE)","<java><android>","1","0","","",""
"3361230","1","3796451","","2010-07-29 09:54:21","2","3972","<p>I am developing an application and during my testing on a real device I have found that it will crash and cause the phone to reboot (worrying I know...)</p><p>Is there any way I retrieve the logcat from before the phone rebooted as the logcat seems to reset when the phone boots up.</p><p>Thanks in advance.</p>","315998","","","","","2012-06-09 15:59:08","Android: Retrieve logcat before crash (reboot) on a real device","<android><logcat>","4","2","1","",""
"3361270","1","3362940","","2010-07-29 09:59:08","0","1081","<p>Android twitter Trying the following tutorial for Oauth based authentication and updating user status.</p><p><a href=""http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html"" rel=""nofollow"">http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html</a></p><p>When i run It has successfully authenticate but when it tries to update the status following error occur.</p><p>""twitter4j.TwitterException: SSL handshake failure: Failure in SSL library, usually a protocol errorerror:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:585 0xaf589f78:0x00000000)""</p><p>any idea whats goin wrong ?</p>","216431","","","","","2010-09-25 15:45:23","android twitter Oauth based authentication and update status SSL error","<android><jtwitter>","2","1","","",""
"3361281","1","3361335","","2010-07-29 10:00:09","1","1949","<p>I need to invoke a key press event in android .Any suggestions ?????</p>","405521","","","","","2010-07-29 10:08:46","Invoke keypress event in android?","<android><keypress>","2","1","2","",""
"3361348","1","","","2010-07-29 10:09:00","4","587","<p>I've a quick question.</p><p>I'm trying to animating a child view to make it disappear. That part is easy, but, during the animation, the parent view is not resized. How can I do to make the parent view automtically resize during the animation?</p><p>Here is my current code:</p><pre><code>    AnimationSet set = new AnimationSet(true);    Animation fade = new ScaleAnimation(1.f, 1.f, 1.f, 0);            Animation fade2 = new AlphaAnimation(1, 0);    set.addAnimation(fade);    set.addAnimation(fade2);    set.setDuration(2000);    set.setFillAfter(true);            bgColor.startAnimation(set);</code></pre><p>bgColor is the View I'm making disappear. Here is the final result :<a href=""http://img31.imageshack.us/img31/9876/devicez.png"" rel=""nofollow"">Result</a></p><p>You can see the gap after the animation.</p><p>Any ideas?</p><p>Thanks in advance!</p>","405509","","","","","2012-08-28 10:06:51","How to animate a child view and having the parent view to automatically resize?","<android>","1","1","1","",""
"3361423","1","3362910","","2010-07-29 10:17:20","3","9745","<p>Is there a way to get ListViewItem height in code, when there is no actual items in list?</p><p>My ListViewItem layout:  </p><pre><code>&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""?android:attr/listPreferredItemHeight""&gt;...&lt;/LinearLayout&gt;  </code></pre><p>I have tried to get it using Inflater:  </p><pre><code>View convertView = LayoutInflater.from( this )    .inflate( R.layout.mail_list_row, null );int itemHeight = convertView.getHeight();</code></pre><p>But it's return 0;</p><p>Thanks!</p>","67407","","","","","2014-01-06 00:20:32","Android - Get ListView item height?","<android><gui><listview><layout><listviewitem>","3","2","1","",""
"3361744","1","","","2010-07-29 11:00:17","2","534","<p>I've connected to OBDKey and obtained data. I want immediately close my program when the vehicle is powered down(ignition turned off) How can I check that ignition is turned off?</p>","366494","","58074","","2012-10-05 13:01:44","2012-10-05 13:01:44","OBD2 How can I check that ignition is turned off","<android><obd-ii>","1","1","","",""
"3361754","1","3362560","","2010-07-29 11:01:53","2","174","<p>I have some xml files, and I keep them in <code>raw</code> folder. Now, the problem is that I have to use them with <code>variable name</code> according to my application condition. But I don't know how to fetch them. The main thing is that I am not getting that how to give the path of my xml file in application. </p><p>For example:</p><p>My file <code>application.xml</code> is stored in the <code>raw</code> folder and I have to access it with a variable name.</p><pre><code>String xmlName= application.xml;</code></pre><p>How can I fetch my xml through <code>xmlName</code> variable?</p>","304961","","75801","","2010-07-29 12:59:58","2010-07-29 12:59:58","xml parsing problem ","<android><xml>","2","0","","",""
"3361885","1","","","2010-07-29 11:16:41","5","6499","<p>I can see the sd card in the file explorer with d--rwxr-x permission. When i tried adding any file to it it shows Failed to push the items. It is not adding even very small files.</p><p>Can you guys suggest how to fix this?</p>","405594","","114066","","2010-07-29 12:48:12","2013-11-11 21:09:32","Can't add data to Android sdcard on the emulator","<android><sd-card>","2","3","","",""
"3361896","1","3426572","","2010-07-29 11:17:49","3","2560","<p>I have a simple HelloWorld Activity that I try to test with an Android JUnit test. The application itself runs like it should but the test fails with an </p><p>""java.lang.RuntimeException: Unable to resolve activity for: Intent { action=android.intent.action.MAIN flags=0x10000000 comp={no.helloworld.HelloWorld/no.helloworld.HelloWorld} }at no.helloworld.test.HelloWorldTestcase.setUp(HelloWorldTestcase.java:21)""</p><p>This is my activity class:</p><blockquote>  <p>package no.helloworld;</p>    <p>import android.app.Activity; import</p>    <p>android.os.Bundle;</p>    <p>public class HelloWorld extends  Activity {</p>    <p>@Override</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);} }</code></pre></blockquote><p>And the test:</p><blockquote>  <p>public class HelloWorldTestcase extends ActivityInstrumentationTestCase2 {</p><pre><code>private HelloWorld myActivity;private TextView mView;private String resourceString;</code></pre></blockquote><pre><code>public HelloWorldTestcase() {    super(""no.helloworld.HelloWorld"", HelloWorld.class);}@Overrideprotected void setUp() throws Exception {    super.setUp();    myActivity = this.getActivity();    mView = (TextView) myActivity.findViewById(no.helloworld.R.id.txt1);    resourceString = myActivity            .getString(no.helloworld.R.string.helloworld);}public void testPreconditions() {    assertNotNull(mView);}public void testText() {    assertEquals(resourceString, (String) mView.getText());}protected void tearDown() throws Exception {    super.tearDown();}</code></pre><p>Why does the test fail? The activity is (of course) defined in AndroidManifest.xml and the application runs as it should.</p>","270273","","","","","2010-08-06 18:18:20","Runtime Exception in Android JUnit testing","<android><exception><junit><activity><android-intent>","1","0","1","",""
"3361921","1","3362898","","2010-07-29 11:20:58","1","308","<p>I am implementing Localytics.com useage statistics in my Android app.I am still just testing.</p><p>I note that just starting my app and then immediately exiting will register two sessions (as they are called by Localytics) in the live statistics.</p><p>I have followed the guidelines in <a href=""http://wiki.localytics.com/doku.php?id=android_integration"" rel=""nofollow"">Android Integration</a>.</p><p>My app consists of a main Class of the TabActivity type. This TabActivity holds two tabs in which I display two other activities. Like this:</p><pre><code>  setContentView(R.layout.main);  mTabHost = getTabHost();  Context ctx = getApplicationContext();  Intent addTodo = new Intent(ctx, AddTodo.class);  Intent listTodos = new Intent(ctx, ListTodos.class);  mTabHost.addTab(mTabHost.newTabSpec(""tab_1"").setIndicator(""New note"").setContent(addTodo));  mTabHost.addTab(mTabHost.newTabSpec(""tab_2"").setIndicator(""Saved notes"").setContent(listTodos));  mTabHost.setCurrentTab(0);</code></pre><p>I instantiate the Localytics object in all three Activities like this:</p><pre><code>     this.localyticsSession = new LocalyticsSession(                    this.getApplicationContext(),                     ""identifier"");     this.localyticsSession.open();</code></pre><p>So, the above code lines are repeated in each of the three Activities.</p><p>In the TabHost Activity (only in this Activity) I then follow the instantiation with a </p><pre><code>     this.localyticsSession.upload();</code></pre><p>And then (only in the TabHost Activity) I have these to finish things off:</p><pre><code> public void onPause() {     this.localyticsSession.close();     super.onPause(); } public void onDestroy()  {     this.localyticsSession.upload();     super.onDestroy(); }</code></pre><p>Any suggestions on how to make my code generate just one session per app-launch?</p>","401236","","","","","2010-07-29 13:22:19","How come I get 2 sessions registered in Localytics per app-launch?","<android><analytics>","1","0","","",""
"3362076","1","3362087","","2010-07-29 11:40:45","0","1054","<p>I have an Android activity running with a custom view in it.  When something happens within that custom view, I want to tell the currently running activity by changing one of the Activity member variables.  <strong>Is there a way to access the current running activity member variables from within a custom view class besides passing the activity into the view class though a function arg?</strong></p><p>Thanks</p>","107459","","","","","2010-07-29 11:42:34","How can I access a member variable of the current running Activity in Android?","<android><variables><activity>","1","0","","",""
"3362282","1","","","2010-07-29 12:12:00","0","1191","<p>Has anybody meet such a problem? when using the  bluetooth chat sample  , itsays could not connected! i have tested the sample with two android2.1 mobile phone!anyone who meet such a problem can share the solution?the code just go to the  socket.accept then it block,could not go !</p>","165273","","","","","2010-07-29 13:06:04","Android official bluetooth chat sample cannot connect","<android>","1","0","","",""
"3362325","1","","","2010-07-29 12:17:46","1","197","<p>I am confused about where Android services run. I know services marked 'remote' run in their own processes, but what about ordinary local services? </p><p>The reason I ask is I want two local services to cooperate but not be blocked by each other. So for example, Service1 manages a network connection and receives packets. On receipt of a packet, I need that service to hand-off the packet to Service2 that processes the information and takes some action, including possibly sending a return message. I need the receipt, hand-off and processing to happen asynchronously, so the network service can continue to receive packets whilst the application service processes them. How do I ensure this happens?</p><p>I know one solution is to broadcast Intents, but how do I include custom data objects (i.e. packets) in an Intent? I don't want to implement the parcelable interface (overkill for local services) but I really need to be able to hand-off complex data objects between the services.</p><p>Thanks</p>","146588","","","","","2011-06-12 23:38:39","How to create two cooperating but non-blocking services in Android?","<android>","1","0","","",""
"3362384","1","3362619","","2010-07-29 12:25:43","0","1193","<p>Can I use progress bar in android, without the thread?</p><p>HERE IS CODE OF MY CURRENT WAY OF IMPLEMENTING PROGRESS DIALOG</p><pre><code>            //              Adding Progress bar            String[][] data;    //Global variable</code></pre><p>//called on onCreate() or onItemSelected</p><pre><code>            final ProgressDialog myProgressDialog;            myProgressDialog = ProgressDialog.show(ListingPage.this,""Please Wait"", ""Loading Date"", true);            new Thread() {                public void run() {                    try{                        setSelected();                        sleep(5000);                    } catch (Exception e) { }                    myProgressDialog.dismiss();                }            }.start();            populateList(Split.splitToTwoDimArray(data));   // populates the list view</code></pre><p>HOPE ABOVE HELPS, IF USING THREAD THE LIST IS NOT BEING POPULATED.</p>","328518","","328518","","2010-07-30 12:44:39","2010-07-30 13:57:41","Progressbar in Android","<android><multithreading><progress-bar>","1","1","","",""
"3362549","1","3362629","","2010-07-29 12:45:06","0","1714","<p>when I add a ViewFlipper, the UI thread seems to wait for the onCreate() method in the activity to be finished. Then it shows the second view. Why does it happen?</p><p>My current code is:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main_menu);        viewFlipper = (ViewFlipper) findViewById(R.id.ScreenSwitch);    viewFlipper.setInAnimation(AnimationUtils.makeInAnimation(this, true));    viewFlipper.setOutAnimation(AnimationUtils.makeOutAnimation(this, true));    //do the necessary loading, when the splash screen persists     doSomeLoading();    viewFlipper.showNext();}</code></pre><p>Actually, the doSomeLoading consists of a for loop counting to ten millions and doing nothing. Now it just waits for loop to be done and shows the second view.</p><p>I would really appreciate a solution without having to create a separate Thread, because it seems to be pointless, invalidate() doesn't help there.</p>","403324","","","","","2010-07-30 10:17:53","ViewFlipper - how to force it to show the first View?","<android>","1","0","","",""
"3362565","1","3363217","","2010-07-29 12:46:54","3","2716","<p>Right now I'm trying to restart android wifi service after stopping it. I stop the service with the following code:</p><pre><code>WifiManager wifiManager = ...;wifiManager.setWifiEnabled(false);</code></pre><p>This disables wifi when there's no lock on the wifi connection. But how do I restart the wifi service? My first approach was the following:</p><pre><code>wifiManager.setWifiEnabled(true);</code></pre><p>It seems like wifi is enabled after this call but the wifi service doesen't connect to available / in range WLANs. So my question is: What do I have to do to restart the wifi ""autoconnect"" feature?</p><p>Is it enough to just start a scan?</p><pre><code>wifiManager.startScan();</code></pre>","404522","","","","","2010-07-29 13:54:22","starting android wifi service","<android><android-wifi>","1","0","1","",""
"3362683","1","4044057","","2010-07-29 13:00:08","2","13018","<p>Hi all, do we have page flip/turn animation in android?I have several images, and i want to flip images on button click. With page turn/flip animation.Please guide me to achieve it.</p>","1497488","","944657","","2012-12-28 08:23:10","2013-08-30 03:12:13","Page turn/flip animation in Android?","<android>","3","4","4","",""
"3362749","1","","","2010-07-29 13:07:00","0","198","<p>I have written a simple android application for auto-replying to SMS messages. It starts a service for monitoring incoming messages, then replies to them.</p><p>It works fine using the Elipse AVD as well as the 3 Motorola phones I have installed it on. I have been having problems with it causing problems with ""com.android"" processes on the 2 HTC phones it is installed on. The processes are random but will display an alert box with a ""Force Close"" button.</p><p>Can anyone help with this?Is there something special about the HTC OS I have to account for in my application? </p>","405696","","","","","2010-07-29 13:46:10","HTC problems with android application","<android>","1","1","","",""
"3362773","1","","","2010-07-29 13:10:04","0","4003","<p>i have an object that is used for calling callback functions:</p><pre><code>static jobject o;</code></pre><p>i have assigned the callback function to that object through a pointer:</p><pre><code>o=env-&gt;NewGlobalRef(callback);</code></pre><p>The same pointer, <code>env</code>, points towards the function <code>CallVoidMethod</code> that uses JNI to reach to the java code.</p><pre><code>env-&gt;CallVoidMethod(o, methodId, pDeviceId, deviceStatus, statusReason, connectionProgressInfo);</code></pre><p>However on calling this function, the system is getting crashed, and VM says that it's an invalid reference to static jobject o and then it crashes.</p><p>My code is as follows :</p><pre><code>static jint android_net_wimax_subscribeDeviceStatusChange(JNIE nv* env, jobject clazz, jobject jdeviceId, jobject callback){//  LOGD("" android_net_wimax_subscribeDeviceStatusChange() -&gt;D1"");o = env-&gt;NewGlobalRef(callback);//o = callback;//   LOGD("" android_net_wimax_subscribeDeviceStatusChange() -&gt;D2"");return (jint)::SubscribeDeviceStatusChange(deviceId, fun_IndDeviceStatusUpdate);}void fun_IndDeviceStatusUpdate(WIMAX_API_DEVICE_ID_P pDeviceId, WIMAX_API_DEVICE_STATUS deviceStatus,WIMAX_API_STATUS_REASON statusReason, WIMAX_API_CONNECTION_PROGRESS_INFO connectionProgressInfo){JNIEnv *env = NULL; int nResult = -1; //  LOGD("" AttachCurrentThread() -&gt;D1"");nResult = g_jVM-&gt;AttachCurrentThread(&amp;env, NULL);//  LOGD("" AttachCurrentThread() -&gt;D2-%d"",nResult);if ((nResult != 0) || (env == NULL)){ LOGD("" AttachCurrentThread() failed"");} else{//   LOGD("" AttachCurrentThread() -&gt;D3"");if(o == NULL){LOGD("" o is NULL "");}else{LOGD("" o is not NULL "");}jclass cls = env-&gt;GetObjectClass(o);//   LOGD("" AttachCurrentThread() -&gt;D4"");jmethodID methodId = env-&gt;GetMethodID(cls, ""callback"", ""(Landroid/net/wimax/structs/DeviceId;III)V"");//  LOGD("" AttachCurrentThread() failed-&gt;D5"");if (methodId) {env-&gt;CallVoidMethod(o, methodId, pDeviceId, deviceStatus, statusReason, connectionProgressInfo);}if (g_jVM-&gt;DetachCurrentThread() != JNI_OK) {LOGE(""%s: DetachCurrentThread() failed"", __FUNCTION__);}}//   LOGD(""JNI-&gt;CALLBACK-&gt;D3"");}</code></pre><blockquote>  <p>&lt;&lt;&lt; D/wimax   ( 1673): before CallVoidMethod() W/dalvikvm( 1673): JNI WARNING: 0x48e31dec is not a valid JNI reference</p>    <p>W/dalvikvm( 1673): in Ldalvik/system/NativeStart;.run ()V (CallVoidMethodV)</p>    <p>I/dalvikvm( 1673): ""Thread-55"" prio=5 tid=45 RUNNABLE</p>    <p>I/dalvikvm( 1673):   | group=""main"" sCount=0 dsCount=0 s=N obj=0x43b6c930 self=0x306370</p>    <p>I/dalvikvm( 1673):   | sysTid=2000 nice=0 sched=0/0 cgrp=unknown handle=3194272</p></blockquote><p>Kindly help me out</p>","373049","","712294","","2012-03-08 15:23:13","2013-11-17 18:07:07","Invalid reference during callback","<android><callback><jni><android-2.2-froyo>","2","0","","",""
"3362850","1","3362921","","2010-07-29 13:17:50","1","641","<p>Why is this button changing color to orange when clicked:  </p><pre><code>&lt;Button android:background=""@android:drawable/btn_plus"" ...&gt;</code></pre><p>but this one is not?   </p><pre><code>&lt;Button android:background=""@drawable/ic_btn_round_plus"" ...&gt;   </code></pre><p>Edit:<br>Found another type of button (text and image) that changes color to orange when clicked<br>without having to create a selector:  </p><pre><code>&lt;Button android:text=""List"" android:drawableTop=""@drawable/list"" ...&gt;       </code></pre>","77115","","77115","","2010-07-30 06:24:24","2011-06-05 06:45:53","What makes a button change color on mouseclick?","<android>","1","0","3","",""
"3362871","1","","","2010-07-29 13:19:38","0","803","<p>I have android:screenOrientation=""portrait"" set for my activity. Creating an AVD with resolution 800x480 and running my activity, the GLSurfaceView is created with dimensions 800x480 (ie. not rotated and width > height). I would expect it to be created with dimensions 480x800 and be rotated 90 degrees.</p><p>Is this a bug in the emulator or am I wrong in my interpretation of android:screenOrientation?</p>","17424","","44729","","2010-07-29 14:19:20","2010-07-30 16:15:13","Android emulator - screenOrientation ignored","<android><opengl-es><screen><orientation>","1","0","","",""
"3363021","1","9253770","","2010-07-29 13:36:01","29","4958","<p>I'm looking into creating a widget that supports animation, ideally via the android.view.animation framework, otherwise by setting properties on the remote views in code triggered from a background service.</p><p>Does anyone have any experience with either of these approaches, and is what I'm trying doable, or am I heading up a blind alley?</p>","39368","","","","","2012-03-16 21:42:23","Android homescreen widget animations","<android><animation><android-widget>","5","3","5","",""
"3363114","1","3572440","","2010-07-29 13:43:20","1","595","<p>I've read on Reto Meier's <a href=""http://blog.radioactiveyak.com"" rel=""nofollow"">blog</a> that he doesn't recommend the use of modal ""Loading..."" dialogs in Android applications. Is this a general consensus among developers? </p><p>If I have a login screen what should I display when the user tries to sign in? Until now, I have used a ""Signing in..."" indeterminate progress dialog. Should I use the application's progress bar? Should I use a Toast?</p><p>And, in the general case, when should I use dialogs and when not to?</p>","292263","","","","","2010-08-26 06:07:58","Modal ""Loading..."" dialogs not good UI decision?","<android><dialog><ui-guidelines>","1","0","","",""
"3363117","1","3363283","","2010-07-29 13:43:29","0","1418","<p>Before I added my ListView, along with changing my TableLayout height to ""wrap_content"" as opposed to ""fill_parent"", my ScrollView displayed properly.  Here is my XML:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" &gt; &lt;TableLayout android:id=""@+id/details""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:layout_alignParentBottom=""true""  android:stretchColumns=""1""&gt;  &lt;TableRow&gt;   &lt;TextView android:text=""Restaurant Name: "" /&gt;   &lt;EditText android:id=""@+id/name"" /&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;   &lt;TextView android:text=""Address: "" /&gt;   &lt;EditText android:id=""@+id/addr"" /&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;   &lt;TextView android:text=""Type:"" /&gt;   &lt;ScrollView    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""&gt;   &lt;RadioGroup android:id=""@+id/types""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""    android:orientation=""vertical""&gt;    &lt;RadioButton android:id=""@+id/fastfood""     android:text=""Fast-Food"" /&gt;    &lt;RadioButton android:id=""@+id/family""     android:text=""Family"" /&gt;    &lt;RadioButton android:id=""@+id/casual_dining""     android:text=""Casual Dining"" /&gt;    &lt;RadioButton android:id=""@+id/fine_dining""     android:text=""Fine Dining"" /&gt;    &lt;RadioButton android:id=""@+id/cafe""     android:text=""Cafe"" /&gt;    &lt;RadioButton android:id=""@+id/cafeteria""     android:text=""Cafeteria"" /&gt;    &lt;RadioButton android:id=""@+id/coffeehouse""     android:text=""Coffeehouse"" /&gt;    &lt;RadioButton android:id=""@+id/pub""     android:text=""Pub"" /&gt;    &lt;RadioButton android:id=""@+id/greasy_spoon""     android:text=""Greasy Spoon"" /&gt;    &lt;RadioButton android:id=""@+id/chain""     android:text=""Chain"" /&gt;    &lt;RadioButton android:id=""@+id/truck_stop""     android:text=""Truck Stop"" /&gt;    &lt;RadioButton android:id=""@+id/smorgasbord""     android:text=""Smorgasbord"" /&gt;   &lt;/RadioGroup&gt;   &lt;/ScrollView&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;   &lt;TextView android:text="""" /&gt;   &lt;Button android:id=""@+id/save""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""Save"" /&gt;  &lt;/TableRow&gt; &lt;/TableLayout&gt; &lt;ListView android:id=""@+id/restaurants""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:layout_alignParentTop=""true""  android:layout_above=""@id/details"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>I get no ScrollView when I have ""wrap_content"" and my display is askew!  Any ideas?</p>","2186261","","13531","","2011-07-25 17:19:12","2011-07-25 17:19:12","ScrollView embedded in TableLayout embedded in RelativeLayout with ListView outside Not Working","<android><listview><scrollview><tablelayout>","1","0","","",""
"3363214","1","","","2010-07-29 13:54:11","5","7039","<p>I've been trying to get this to work for a few days without success.   Basically, I'm writing a small test app to make the phone report it's position as somewhere else using addTestProvider and setTestProviderLocation etc.  Basically it looks fine and appears to report its location as having changed, however Google Maps etc. seems to still be querying the real GPS provider.  Does anyone have any ideas how to get around this?</p><p>This isn't an app that will actually be used for anything, it's just really to satisfy my own curiosity and gain an understanding.</p><p>Thanks in advance.</p>","405745","","","","","2012-06-09 15:34:12","Spoof or fake location on Android phone","<android><location><spoofing><spoof>","1","5","4","",""
"3363245","1","3363268","","2010-07-29 13:59:35","16","15559","<p>whats the deal with</p><pre><code> CharSequence contentTitle = R.string.value;</code></pre><p>Error cannot convert from int to CharSequence. Is there a way around this or am i missing something?i tried</p><pre><code>String s = R.string.value + """";CharSequence contentTitle = s;</code></pre><p>it returns integers values.Any help?</p>","366659","","","","","2013-10-30 12:12:41","R.string.value Help android notification","<android><int><charsequence>","4","0","3","",""
"3363332","1","","","2010-07-29 14:08:33","0","436","<p>it's possible to hook process in Android?</p><p>for example we can hook process in windows:</p><p>""trap events that will occur, either in your own process or in other processes. By ""hooking"", you tell Windows about a function, filter function also called hook procedure, that will be called everytime an event you're interested in occurs""</p><p>Please advise , Thanks.</p>","315264","","","","","2010-07-29 22:46:42","Can I hooks and trap events that will occur in android process?","<android>","1","0","","",""
"3363429","1","","","2010-07-29 14:18:12","1","1360","<p>I am a beginner android developer and I had followed the instructions in the Quick Start and SDK Setup.  After following all the steps I attempted to run the Hello World sample application and when I run the project, I get the standard ""emulator.exe has encountered a problem and needs to close."" box.  I tried running the avd that I created in the AVD manager with the same results.  I also tried running the AVD from the command line, using ""emulator.exe @my_avd"".  I've tried 2.1 and 2.2 platforms.  I using Eclipse 3.5 SR2 with the android plug-in.  I am running Windows XP SP3, 512MB RAM, Intel Core 2 Quad on a virtual machine using VM-Ware.  My machine running the virtual machine has the 3GB max ram for a 32-bit machine.</p><p>Thanks in Advance,Mark</p><hr><p>In response to comments:</p><p>Android console says:[2010-07-29 10:39:20 - HelloAndroid] ------------------------------[2010-07-29 10:39:20 - HelloAndroid] Android Launch![2010-07-29 10:39:20 - HelloAndroid] adb is running normally.[2010-07-29 10:39:20 - HelloAndroid] Performing odog.andriod.example.helloandroid.HelloAndriod activity launch[2010-07-29 10:39:20 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'my_avd'[2010-07-29 10:39:20 - HelloAndroid] Launching a new emulator with Virtual Device 'my_avd'</p><p>DDMS console says nothing.</p><p>I have not tried to run the emulator on the physical machine.  I'm trying to keep the Android development machine ""clean"".  My physical machine has Visual Studio 2010, 2008, 6, Windows Platform SDKs, DirectX SDKs of various versions as well as various versions of Eclipse for micro-controller and BlackBerry programming.  Little mucky .... needs to be formatted.</p>","405779","","405779","","2010-07-29 14:52:32","2010-07-29 15:40:12","AVD Emulator Error when starting","<android><eclipse><plugins><emulator>","1","5","","",""
"3363485","1","","","2010-07-29 14:24:04","0","317","<p>Respected All.              I know how to use map in application. But i have to use map in particular table row at run time. I have used mapview in my another activity. can i use that map view (by id)to show map in that row.                                                                              Thank You                                                                            (Vikram Kadam) </p>","395627","","","","","2010-07-29 15:29:26","Addding mapview in tablelayout/tablerow at runtime","<android>","1","0","","",""
"3364003","1","","","2010-07-29 15:09:17","0","880","<p>Can we use ACTION_TIME_TICK broadcast every second?like TIME_TICKplease help </p>","399886","","","","","2011-07-21 11:25:55","ACTION_TIME_TICK broadcast every second?","<android>","1","0","","",""
"3364010","1","3364196","","2010-07-29 15:09:49","19","17814","<p>I need to create an animation - Flip a view and show another one.</p><p>The width of currently shown view is decreased slowly to zero and after that the width of the view-to-be-shown must be increased from zero.</p><p>During this time, the height goes from the currently-shown-height to slightly-decreased-height and back again.</p><p>How can I achieve this... using a ViewFlipper.</p>","332210","","","","","2013-04-22 04:40:01","Android Animation - Flip","<android><animation><flip>","1","0","22","",""
"3364104","1","","","2010-07-29 15:17:45","2","6156","<p>I'm venturing into startActivityForResult for the first time and I'm running into a problem.</p><p>Activity A (ActivityMyList) launches Activity B (ActivityQuickList) waiting for a result:</p><pre><code>Intent intentLaunchQuickList = new Intent(ActivityMyList.this, ActivityQuickList.class);startActivityForResult(intentLaunchQuickList, REQUEST_QUICKLIST);</code></pre><p>When a user clicks on a list item of Activity B, it returns ""ql_id"" to Activity A:</p><pre><code>@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    QuickListItem qlItem = m_Adapter.getItem(position);    if (qlItem != null &amp;&amp; qlItem.getQLId() != -1) {        Intent data = new Intent();        data.putExtra(""ql_id"", Integer.toString(qlItem.getQLId()));        if (getParent() == null) {            setResult(Activity.RESULT_OK, data);        }        else {            getParent().setResult(Activity.RESULT_OK, data);        }        finish();    }    finish();}</code></pre><p>Integer.toString(qlItem.getQLId()) evaluates to ""1"".  This is important because I am not receiving ""1""...</p><p>I have overridden the onActivityResult handler in Activity A with this:</p><pre><code>@Overridepublic void onActivityResult(int requestCode, int resultCode, Intent data) {    if (requestCode == REQUEST_QUICKLIST) {        if (resultCode == Activity.RESULT_OK) {            Bundle extras = data.getExtras();            if (extras != null) {                int id = extras.getInt(""ql_id"");            }        }    }}</code></pre><p>Unfortunately, extras.getInt(""ql_id"") evaluates to ""0"".  Why is this?  It should be ""1"".  I am clearly doing something incorrectly.</p><p>Thank you for your help</p>","404676","","","","","2010-07-29 15:26:46","onActivityResult Intent data not correct","<android><activity><android-intent><bundle>","1","1","","",""
"3364132","1","3364830","","2010-07-29 15:20:57","1","931","<p>Hey everyone. I'm not big into UI programming so this may be an easy thing I overlooked. I am trying have a screen that shows 8 TextView in a 2 column x 4 row table. And, of course, I want the TextViews, that might have different lengths, to be centered. I tried this in a table layout, for obvious reasons but I feel like this is not the way to do it because it doesn't have much control where I put everything once it is in a row. Should I be using a different combinations of layouts or is there something I overlooked. </p><p>I can post my xml file if you really need but this is really more of a concept question than a specific one.</p><p>Thanks,Jake</p>","399306","","","","","2010-07-29 21:10:14","Two column table on android","<android><textview>","2","0","","",""
"3364180","1","3364513","","2010-07-29 15:25:56","0","766","<p>I need to make an android App that when the user navigates to my webpage with the browser and clicks on a specific link my App activity gets launched.</p><p>I try to achieve this using Intent filters but without success. I followed some samples like Notepad and PhotoStream but nothing works for me.</p>","7363","","","","","2010-07-29 15:59:56","Launch an activty from the browser by clicking a webpage link","<android>","1","1","","",""
"3364222","1","3364270","","2010-07-29 15:29:52","1","472","<p>In some code we're trying out, coming from various tutorials, we end up missing <em>R.id</em>, which should be generated in <em>R.java</em>, obviously. We can add it in (by analogy with other ""first"" Android projects we've done), but as this file is auto-generated, anything we do like that just gets overwritten ultimately.</p><pre><code>public static final class id{   public static final int Button01=0x7f060004;   .   .   .}</code></pre><p>Was there a construct to put into <em>strings.xml</em>, <em>main.xml</em>, etc. that causes this to be generated?</p><p>(Yeah, we're total noobs. Sorry.)</p><p>Thanks for any help you can give,</p><p>Russ Bateman</p>","339736","","","","","2010-07-29 16:50:23","Whence construct R.id?","<android>","3","0","","",""
"3364529","1","3364732","","2010-07-29 16:01:09","1","3017","<p>As the title says, every time I put a TextView before an EditText element in a LinearLayout, the EditText does not show. When I don't, it does.</p><p>I've narrowed the problem down to the TextView's layout_width attribute. If I give it ""wrap_content"", it works, but doesn't ""block"" down, and it appears on the same line as the EditText.</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:background=""#FFFFFFFF""  &gt;&lt;TextView    android:text=""Test""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt;  &lt;EditText             android:id=""@+id/marketValLow""            android:layout_width=""fill_parent""            android:layout_height=""35px""            android:singleLine=""true""            android:layout_marginLeft=""5px""            android:layout_marginRight=""5px""            android:layout_marginTop=""5px"" /&gt; &lt;/LinearLayout&gt;</code></pre><p>Any ideas? Thanks!</p>","312390","","","","","2012-03-12 10:15:20","Placing a TextView before EditText element in Android layout XML causes EditText not to show","<java><android><xml><android-widget>","3","0","","",""
"3364574","1","","","2010-07-29 16:05:11","0","60","<p>i was wondering what state the actual tabs are after the onCreate state, the onCreate state runs when the tab is launched for the first time, when i select another tab and return back to the previously launched tab, in what state is it in ?</p>","267822","","","","","2010-07-29 16:05:11","Updating tabs after changes","<android>","0","2","","",""
"3364607","1","","","2010-07-29 16:07:47","1","662","<p>I'm wondering how to suppress the label on the tabsI want only an icon</p><pre><code>    intent = new Intent().setClass(this, Test.class);    spec = tabHost.newTabSpec(""test"").setIndicator(""test"",                     res.getDrawable(R.drawable.ic_tab_test))                  .setContent(intent);    tabHost.addTab(spec);</code></pre><p>I have an xml file for each tab describing the iconAll works perfectly except I want to have ONLY the icon, not the label</p><p>Thanx</p>","384873","","","","","2010-07-29 16:14:22","only icon on tabs","<android><android-widget>","1","0","","",""
"3364635","1","3374697","","2010-07-29 16:10:26","0","541","<p>After a successful web view is loaded, now after some processing on the HTML page, I would like to return the control to the main screen. Is this possible in Android?</p><p>The control after the webview is launched, is in the browser, so after I make some ajax calls and then get a positive server side message. I would like the control goback to my Webview Activity.</p>","402637","","402637","","2010-07-30 15:49:30","2011-01-20 17:11:24","from WebView in android back to a ListView","<android>","2","4","1","",""
"3364904","1","","","2010-07-29 16:38:38","0","6202","<p>I am trying to download an Android APK file that is output by a php page.  I have the following and it works on firefox but not on the phone.</p><p>Firefox downloads with an apk extension but has a little firefox icon next to it.</p><p>The phone downloads the file with a .html extension, why is this?</p><p>UPDATE: Full source</p><pre><code> function display($tpl = null) {  //SETUP  $appId = JRequest::getInt('id', '0');  $model = &amp;$this-&gt;getModel();  $app = $model-&gt;getApplication($appId);  if( !$app )   JError::raiseError(500, ""Invalid Application ID"");  if( empty($app-&gt;apk_file) )   JError::raiseError(500, ""No APK file found in the database"");  $result = $model-&gt;newDownload($appId);  //Update the database  if( !$result )   JError::raiseError(500, ""Unable to increment download count for ID:"".$appId);  //Return the file  $filesFolder = JPATH_COMPONENT_ADMINISTRATOR .DS. 'uploads' .DS. $appId;  //Output the file contents  $sanitizedFolder = JFolder::makeSafe($filesFolder);  $sanitizedFile = JFile::makeSafe($app-&gt;apk_file);  $path = $sanitizedFolder .DS. $sanitizedFile;  if( !JFile::exists($path) ) {   JError::raiseError(500, 'File does not exist');  }  else {   header('Content-type: application/vnd.android.package-archive');   header('Content-Disposition: attachment; filename=""'.$sanitizedFile.'""');   readfile($path);  } }</code></pre><h2>My setup:</h2><p>Fedora Core 10</p><p>PHP 5.2.9</p><p>Apache</p>","248521","","248521","","2010-07-30 06:41:43","2010-09-09 05:38:17","php headers for a .apk file is not working when downloading on the phone","<php><android>","1","3","0","",""
"3365036","1","","","2010-07-29 16:51:17","2","208","<p>Anyone know where I can get a CSV file of top Android Apps by category which has information like app name, developer, app category etc. Putting together a report for class and I've been combing the web...no luck. :(</p>","405951","","229106","","2010-07-29 17:12:28","2013-08-01 17:18:36","Top Android Apps","<android><marketplace>","1","0","","",""
"3365141","1","","","2010-07-29 17:02:21","1","612","<p>I've created a custom titlebar for my Android application.  All is well except I've placed a checkbox on the titlebar and I want my checkbox to be positioned farther left (so I can line it up with the checkboxes in each list item).  I can not figure out how to move it farther left.  It's almost like that's as far as it will let me put it.  Here is a screenshot of what I mean as well as my titlebar XML:</p><p><a href=""http://i28.tinypic.com/2dpfn9.png"" rel=""nofollow"">http://i28.tinypic.com/2dpfn9.png</a></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    style=""?android:attr/windowTitleBackgroundStyle""    android:layout_height=""?android:attr/windowTitleSize""    &gt;    &lt;CheckBox  android:id=""@+id/inbox_selectall""  android:text=""""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:gravity=""left|center_vertical""  android:focusable=""false""  android:background=""@drawable/checkbox_background""  android:button=""@drawable/checkbox"" /&gt; &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_centerVertical=""true""&gt;  &lt;TextView   xmlns:android=""http://schemas.android.com/apk/res/android""   style=""?android:attr/windowTitleStyle""     android:id=""@+id/inbox_title""     android:text=""@string/title_inbox""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:gravity=""center_vertical|center_horizontal""     android:background=""@null""         android:fadingEdge=""horizontal""         android:scrollHorizontally=""true"" /&gt; &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","404676","","","","","2010-07-30 02:25:59","Custom titlebar positioning","<android><layout><checkbox><position><titlebar>","1","0","","",""
"3365462","1","","","2010-07-29 17:44:15","0","875","<p>I have several Overlays drawn on a MapView with ItemizedOverlay, and an onTap that works when I first start my app.  However, if I press the Back button on the Android then start my app again the onTap does not work at all.  Other touch sensative operations work fine, like long press on the map and several face buttons.  It is also fine if I press the Home button on the phone then go back into my app, so its only on the Back button.  It will also work if I first open another app like the Maps app, then go back into my app, acting like a reset.</p><p>Overriding the onBackPressed method to move the task to the background also does not work, does anyone have any ideas what would cause this?  It happens in both the emulator and on a real device.</p><p>I don't know if it will help but here is the relevent code:</p><pre><code>public OverlayManager(MapsTest launcher) {   m_mapView = (MapView)m_activity.findViewById(R.id.mapview);  // init the list to the mapview list and clear it out  m_overlayList = m_mapView.getOverlays();  m_overlayList.clear();  // create an overlay list for each overlay type  for( OverlayTypes o : OverlayTypes.values() )  {   m_itemOverlay[o.ordinal()] = new OverlayList(m_context.getResources().getDrawable(OverlayData.getInstance().getDrawableID(o)));  }  // init the SMS sender  m_smsSender = new SMSSender();  m_mapMenu = new MapMenu(launcher, this);  m_overlayList.add(m_mapMenu);  m_mapView.invalidate(); }public class OverlayList extends ItemizedOverlay&lt;MapOverlayItem&gt;{ private ArrayList&lt;MapOverlayItem&gt; m_items = new ArrayList&lt;MapOverlayItem&gt;(); private int m_lastSelectedItem = 0; public OverlayList(Drawable d) {  super(d); }    @Override    protected boolean onTap(int index)    {     if( !ProgramState.getInstance().recentStateChange() )     {         m_lastSelectedItem = index;         OverlayData.getInstance().setLastSelectedType(m_items.get(index).getMarkerType());         InfoBalloon.show(m_items.get(index));     }     return true;    }}</code></pre>","393288","","","","","2010-07-29 18:43:17","Overlay onTap not working after Android Back button?","<android><overlay>","1","0","","",""
"3365510","1","","","2010-07-29 17:52:02","1","1199","<p>I have an android question:I've successfully created a countdown kitchen timer activity, however my goal is to have an activity that has 3 timers on it that all work independently. I created a separate layout just for the timer itself and moved the timer code into a class and I've used layoutinflater to create the views and then added them into the linear layout for the activity. I get the layouts fine, however there's no functionality. There doesn't seem to be anything that ties the class code to the activity. </p><p>How should I approach this? Can anyone point me to some working example code? </p><p>thanks in advance!</p>","405993","","","","","2010-08-24 10:26:51","Android - how to inflate a complex layout and add to another layout?","<android><layout><inflate>","2","0","","",""
"3365768","1","","","2010-07-29 18:22:56","4","879","<p>could anyone advise on the following:I'm trying to execute code from Android's help page, but it doesn't work for me:</p><pre><code>public class DownloadFilesTask extends AsyncTask&lt;String, Integer, Long&gt; {        protected Long doInBackground(String... urls) {            Log.e(""TuneWiki"", ""Exec"");            return 1l;        }        @Override        protected void onPostExecute(Long result) {            Log.e(""TuneWiki"", ""Post"");        }}</code></pre><p>when I execute task, doInBackground is invoked fine, but onPostExecute is never invoked :(</p><p>Tested on Milestone with 2.1 OS</p>","345734","","","","","2012-10-26 06:57:58","Android's AsyncTask issue","<android><android-asynctask>","2","3","2","",""
"3365923","1","3367007","","2010-07-29 18:43:23","2","152","<p>I'm working on an app that is meant to be used by fans of a sport team. In the future, I expect to use the same app but for any different team. So, what changes would be the colors, team logo, app name and the like.</p><p>So, is there any technique that allows me to build binaries for different teams without having duplicated resources?</p>","244296","","","","","2010-07-30 05:13:55","What's the best approach to build the same Android apps for different public?","<java><android><target><product>","4","0","1","",""
"3366270","1","","","2010-07-29 19:33:03","2","1145","<p>There are many questions related to how to programatically show/hide the soft keyboard.</p><p>However, as we all know the android back button will cause the keyboard to be dismissed.Is there a way to prevent the user from dismissing the keyboard with a back button press?</p><p>I tried to capture the back button, but when the keyboard is displayed onKeyDown in my activity is not invoked when the back key is pressed and soft keyboard is visible.</p><p>Any suggestions would be greatly appreciated.</p>","406099","","","","","2011-11-07 21:34:58","Prevent soft keyboard from being dismissed","<android><keyboard>","2","1","1","",""
"3366326","1","3367153","","2010-07-29 19:42:40","1","1511","<p>I have developed a small application that consists of 5 different apk files. I'm developing on a lot of PCs and have a lot of developing phones. Every time I change the PC, the signature of the generated APK file is changed and I have to uninstall the applications on the phone. This is very time consuming. So is there a possibility to write a batch/file script that i can run on the PC so that the defined applications are uninstalled on the device?</p><p>I tried to do it the following way:</p><pre><code>for %%f in (adb devices) do (adb -s %%f uninstall bla.bli.blub)</code></pre><p>But unfortunately it doesn't work correctly ;)</p>","","anon","","anon","2010-07-29 20:50:18","2010-07-29 21:37:53","Android application uninstall batch/shell script?","<android><windows><batch-file><cmd>","2","1","","",""
"3366383","1","","","2010-07-29 19:49:55","5","7579","<p>I am writing an application that requires to retrieve the android username username@gmail.com from the phone.  I have been looking at AccountManager class.  This is what I have for now in my code.</p><pre><code>    AccountManager accountManager = AccountManager.get(this);    Account[] accounts =    accountManager.getAccountsByType(""com.google"");    String email="""";    email=accountManager.getUserData(accounts[0], accountManager.KEY_USERDATA);</code></pre><p>However, I am getting a caller uid 10085 is different than the authenticator's uid exception.Anyone knows how to do it?</p><p>PS. I don't need password or authentication token, I just need the username.</p><p></p>","406116","","1063041","","2011-12-31 19:18:05","2011-12-31 19:18:05","Getting the android username stored in the phone","<android>","2","0","3","",""
"3366446","1","3375125","","2010-07-29 19:57:16","0","1173","<p>Im looking for the concept of creating Java Server to handle Client requests and respond to it , i want to use Google App engine which does not allow Socket connections , so is the client &amp; server in this case will communicate using Http requests? i'll be glad if someone could clarify the logic to me and provide a few lines of code.</p><p>Thanks </p>","302707","","","","","2011-05-11 19:43:01","Java server to handle Client requests and respond to it?","<java><android><google-app-engine><cloud>","2","0","2","",""
"3366450","1","3376021","","2010-07-29 19:57:35","1","363","<p>Am I the only Eclipse developer whose workbench quickly sputters, wheezes, crashes or hangs and makes me use Windows 7 Task Manager to hard-bounce it?</p><p>I've got dedicated, Android-only (as it were) installations of Eclipse Helios (3.6) and Galileo (3.5) with the very latest Android SDK (0.9.7.v201005071157-36220) using android-sdk_r06-windows.zip. I'm running Windows 7 Professional 64-bit, but 32-bit Eclipse (Helios and Galileo) and a 32-bit jdk1.6.0_20.</p><p>It is true that these are both Eclipse Java EE installations and not the bare-bones Java-only (non-WTP) versions. I haven't tried that yet. I followed a tutorial that said to use Helios, but said nothing about what not to include (like WTP which I ordinarily use in my work).</p><p>I can avoid much of the trouble by editing XML files using the standard Eclipse XML Editor and avoiding the Android SDK's various XML editors, but very quickly, things stop working and the whole thing caves in on itself.</p><p>I've tried bumping memory in <em>eclipse.ini</em>, -Xms128m, but that hasn't helped.</p><p>I'm looking to hear from someone who's gotten over this mess or who knows what I should have done.</p><p>Any ideas?</p><p>Thanks in advance for any and all comments.</p><p>Russ Bateman</p>","339736","","472792","","2013-05-04 21:36:59","2013-05-04 21:37:09","Android SDK plug-in appears to impact Eclipse heavily","<android><eclipse>","2","1","1","",""
"3366510","1","","","2010-07-29 20:07:19","4","625","<p>I have defined a HomeActivity with three tabs and each tab is a seperate activity.I used the example in the android developer site. <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a></p><p>Tab B's (second tab) UI conatins a text and button (named Search).When the user clicks the search button,it should contact a REST webservice and show the results as a list.</p><p>In Order to do this,inside TAB B activity,on the click of the button,i call a method which creates an intent and calls a new SearchResultsActivity(referring as SRA henceforth).Inside the SRA(extends List Activity),i have the logic for connecting to the webservice and parsing the JSON result returned which displays the results as a list.I am able to achieve this functionality.But i see some drawbacks here and my questions are:</p><ul><li><p>Is it fine to define a new activty (SRA) to handle the search results? or would it be better to have it handled in TAB B activity itself?The main reason why i went for a seperate activity is,the SRA extends ListActivity which would be needed if i want to display it as List and TabB is just extending Activity and wouldnt allowme to display teh results.So,is there a better way to do this?</p></li><li><p>Given the above implementation,when i navigate from TabB (click search button) to SRA,the tabs are not seen anymore.As TabB is calling a new activity(Intent srchIntent = new Intent(TabB.this, SearchResultActivity.class);TabB.this.startActivity(srchIntent);),the tab goes away.What could be the best solution in this case so that the tabs appear/results shown within Tab B ?</p></li><li><p>While navigating from TabB to SRA,i am trying to show a Progress dialog/Loading defined in TabB before calling StartActivity and cancel it afterwards.But the loading icon does not appear.I have tried showing the dialog and canceling in SRA as well.But the loading does not appear. </p></li></ul>","406138","","491044","","2011-03-11 07:54:58","2011-05-10 06:57:04","Android - Tab Navigation <while Spanning a new activity>","<android><android-tabhost>","2","1","1","",""
"3366512","1","","","2010-07-29 20:07:34","1","771","<p>I'm thinking this may not be possible... but I have an Android application that is using the Facebook Graph API to get some information. They can tap the view there and open up a browser with a full-fledged Facebook page, but it asks the user to log in again. </p><p>I'd like to be able to skip the initial sign in (I know the browser can remember your login). Is there a way I can use the OAuth token from the Graph API to authorize for the Facebook web page? </p><p>I did try appending ""access_token=..."" to the query string, but that was fruitless.</p>","136790","","","","","2011-07-15 08:45:20","Can I reuse Facebook OAuth token to open a Facebook page in a browser?","<android><facebook><oauth>","1","0","1","",""
"3366626","1","3366926","","2010-07-29 20:23:42","3","560","<p>I am getting contact details for a given phone number using the following code:</p><pre><code>Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNum));Cursor cursor = context.getContentResolver().query(uri,null,null,null,null);</code></pre><p>There is a case though when the cursor contains 3 records with the same phone number and display name.  </p><p>Can you please suggest an explanation or possible reason for that?</p><p>Thanks a lot.  </p>","367677","","","","","2010-07-29 21:02:32","Looking up a contact by a phone number","<android><contacts>","1","2","","",""
"3366802","1","3368384","","2010-07-29 20:47:34","4","3545","<p>Why is SQLiteOpenHelper calling onCreate() every time my application starts up. Here's my code for onCreate()</p><pre><code>@Override  public void onCreate(SQLiteDatabase db) {      Log.i(""onCreate()"", ""Enter"");      //create cards table     db.execSQL(              ""create table circles"" +      ""(""+     ""id integer primary key,""+     ""x integer not null,"" +     ""y integer not null""+     "")""     );       Log.i(""onCreate()"", ""Exit"");  }</code></pre><p>I have an outside class around my extended SQLiteOpenHelper class, and when I query, I do this:</p><pre><code>Cursor cursor = openHelper.getWritableDatabase().rawQuery(""select * from circles"", null); </code></pre><p>and skips this block because of this if statement</p><pre><code>if (cursor.moveToFirst()) {...}</code></pre><p>Here's my entire Database wrapper class:</p><p><pre>package db.main;</p><p>import java.util.ArrayList;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;import testing.main.Circle;</p><p>public class DBWrapper {</p><p>private static final String DATABASE_NAME = ""circles.db"";   private static final int DATABASE_VERSION = 1;   private static final String[] TABLES = new String[] { ""circles""};</p><p>private Context context;   private OpenHelper openHelper;</p><p>public DBWrapper(Context context) {       context.deleteDatabase(DATABASE_NAME);      this.context = context;      this.openHelper = new OpenHelper(this.context);   }</p><p>public void insertCircle(Circle c)   {       String sql = ""insert into circles (x, y) values ("" + c.getX() + "", "" + c.getY() + "")"";       Log.i(""DBWrapper::insertCircle()"", ""Executing sql: "" + sql);       openHelper.getWritableDatabase().execSQL(sql);   }</p><p>public void clearCircles()   {       String sql = ""delete * from circles"";       Log.i(""DBWrapper::clearCircles()"", ""Executing sql: "" + sql);       openHelper.getWritableDatabase().execSQL(sql);   }</p><p>public ArrayList getCircles()   {       ArrayList circles = new ArrayList();       Cursor cursor = openHelper.getWritableDatabase().query(TABLES[0], null, null, null, null, null, null);       //Cursor cursor = openHelper.getWritableDatabase().rawQuery(""select * from circles"", null);       Log.i(""DBWrapper::getCircles()"", ""move to first1"");       if (cursor.moveToFirst()) {           Log.i(""DBWrapper::getCircles()"", ""move to first"");           do {               Log.i(""DBWrapper::getCircles()"", ""Creating circle: "" + cursor.getString(1) + "", "" + cursor.getString(2));               circles.add(new Circle(Integer.parseInt(cursor.getString(1)),                                    Integer.parseInt(cursor.getString(2))));            } while (cursor.moveToNext());       }       if (cursor != null &amp;&amp; !cursor.isClosed()) {           cursor.close();       }       return circles;   }   private static class OpenHelper extends SQLiteOpenHelper {</p><code>  OpenHelper(Context context) {     super(context, DATABASE_NAME, null, DATABASE_VERSION);  }      @Override  public void onCreate(SQLiteDatabase db) {      Log.i(""OpenHelper::onCreate()"", ""Enter"");      //create cards table     db.execSQL(              ""create table circles"" +      ""(""+     ""id integer primary key,""+     ""x integer not null,"" +     ""y integer not null""+     "")""     );         Log.i(""OpenHelper::onCreate()"", ""Exit"");  }  @Override  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {     Log.w(""Example"", ""Upgrading database, this will drop tables and recreate."");     for(String s: TABLES)     {         db.execSQL(""DROP TABLE IF EXISTS "" + s);     }     onCreate(db);  }</code></pre><p>}}</p><p></p><p>Let me know if I need to post more code or anything. Thanks.</p>","368294","","368294","","2010-07-30 01:39:01","2012-02-19 10:27:17","Android database recreates everytime application is launched","<android><sqlite>","3","4","1","",""
"3366958","1","3367033","","2010-07-29 21:07:12","0","89","<p>I am building an android game where objects randomly come in from either side of the screen towards a sprite in the middle of the screen. When one passes the tripwire on the central sprite it is dealt with by my collision detection which sets the enemy objects co-ordinates to somewhere off the screen, thats desired but as this happens in my updatePhysics() method when we loop back to the doDraw() method the canvas has redrawn to an empty state (ie. without any enemy objects on it). Any objects that were on screen and not colliding with the sprite are erased too and new ones regenerated. Why is it removing all the enemy objects rather than just updating the position of the ones left in play at that point???</p><p>I will include my code to make this simpler to understand. This is the collision detection part of my updatePhysics():</p><pre><code>// COLLISION DETECTION        int n = 0,haveHidden = 0; //haveHidden is number of objects that are hidden in this current pass of CDwhile(n &lt; mCurrentDistractionsOnScreen){            switch(DistractionsArray[n].dGeneralDirection){            case LEFT_ORIGIN:                // If the X co-ordinate is past the edge of the performer sprite                if((DistractionsArray[n].ObjmX2 &gt; LEFT_TRIPWIRE) &amp;&amp; (DistractionsArray[n].ObjmX2 &lt; RIGHT_TRIPWIRE))                {                    mConcentration -= DistractionsArray[n].dDamageToInflict;                    Log.w(this.getClass().getName(), ""Object: "" + n + ""LEFT Damage: "" + DistractionsArray[n].dDamageToInflict + "" leaves "" + mConcentration);                    DistractionsArray[n].hideDistraction();                    haveHidden++;                }                break;            case RIGHT_ORIGIN:                // If the X co-ordinate is past the edge of the performer sprite                if((DistractionsArray[n].ObjmX &gt; LEFT_TRIPWIRE) &amp;&amp; (DistractionsArray[n].ObjmX &lt; RIGHT_TRIPWIRE))                {                    mConcentration -= DistractionsArray[n].dDamageToInflict;                    Log.w(this.getClass().getName(), ""Object: "" + n + ""RIGHT Damage: "" + DistractionsArray[n].dDamageToInflict + "" leaves "" + mConcentration);                    DistractionsArray[n].hideDistraction();                    haveHidden++;                }                break;            }            n++;            mCurrentDistractionsOnScreen -= haveHidden;        }</code></pre><p>This is the hideDistraction() method that is a method defined in the DistractionObjects inner class in this thread (DistractionsArray consists of these objects):</p><pre><code>public void hideDistraction(){            // Set attributes to default            this.dName = ""Default"";            this.dVelocity = 0;            this.dMaxPoints = 10;            this.dDamageToInflict = 0;            this.dOrigin = 100;            this.dGestureRequired = """";            // Can be reused again            this.isUseable = true;            Log.w(getClass().getName(), ""HIDING FROM: "" + this.ObjmX + "" "" + this.ObjmY + "" "" + this.ObjmX2 + "" "" + this.ObjmY2 + "" "");            // Position it off-screen            this.ObjmX = -150;            this.ObjmX2 = -150 + this.dDistractionObjectSprite1.getIntrinsicWidth();            this.ObjmY = -150;            this.ObjmY2 = -150 + this.dDistractionObjectSprite1.getIntrinsicHeight();            Log.w(getClass().getName(), ""HIDING TO: "" + this.ObjmX + "" "" + this.ObjmY + "" "" + this.ObjmX2 + "" "" + this.ObjmY2 + "" "");                   }</code></pre><p>And the doDraw method starts by canvas.save() and at the end does a canvas.restore. To render my objects at their new position it does this:</p><pre><code>// For each object in play, draw its new co-ordinates on the canvas                int n = 0;                while(n &lt; mCurrentDistractionsOnScreen){                    DistractionsArray[n].dDistractionObjectSprite1.setBounds((int)DistractionsArray[n].ObjmX,                            (int)DistractionsArray[n].ObjmY,                            (int)DistractionsArray[n].ObjmX2,                            (int)DistractionsArray[n].ObjmY2);                    DistractionsArray[n].dDistractionObjectSprite1.draw(canvas);                    n++;                }</code></pre><p>I am literally devoid of any ideas now after trying so many different fixes, even attempted to serialize the position of those other enemy objects on screen in an integer array that is rebuilt in the physics method but nothing!!</p><p>To summarise, I need a way of hiding the enemy object off-screen like in hideDistraction() when it passes the tripwire, but I want all the other objects to still continue on course as they are without being moved off screen and re-rendered from scratch.</p><p>If you need more details please ask....and if you can, pleaseeee help!</p><p>Many thanks</p>","300037","","","","","2010-07-29 21:18:28","Attempting to remove an object off screen moves all the objects in play?! - Android. Please Help!","<android><eclipse>","1","4","","",""
"3366992","1","","","2010-07-29 21:11:56","8","8485","<p>I'd like Activities on my application's Activity stack to only have one instance.  I have several screens which are ListActivities and I'd like to not go through the pain and suffering of updating the lists in a previous instance of the ListActivity when another instance of that ListActivity is changed (added to, edited, removed from, etc) (or is there an easy way to do this?).</p><p>Note:  I've read that singleTop will accomplish this (though it destroys the Activity if you hit the back button), but it does not work.  I have a menu and if I go to my Inbox screen, then I go to my QuickList screen, and then I go to my Inbox screen again, it creates a new Inbox Activity.</p><p>Right now, on my ListActivities, I have launchMode set to singleInstance.  The problem is: If I launch another Activity using startActivityForResult, the onActivityResult handler fires right away (before the new Activity is created).  When I perform the necessary action on the next screen to return the result, the onActivityResult handler does not fire.</p><p>What is going on?</p><p>Here is how I fire the new Activity:</p><pre><code>Intent intentLaunchQuickList = new Intent(ActivityMyList.this, ActivityQuickList.class);startActivityForResult(intentLaunchQuickList, REQUEST_QUICKLIST);</code></pre><p>Here is how I return the result:</p><pre><code>@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    QuickListItem qlItem = m_Adapter.getItem(position);    if (qlItem != null &amp;&amp; qlItem.getQLId() != -1) {        Intent data = new Intent();        data.putExtra(""ql_id"", qlItem.getQLId());        if (getParent() == null) {            setResult(Activity.RESULT_OK, data);        }        else {            getParent().setResult(Activity.RESULT_OK, data);        }    }    finish();}</code></pre><p>Here is my onActivityResult handler:</p><pre><code>@Overridepublic void onActivityResult(int requestCode, int resultCode, Intent data) {    if (requestCode == REQUEST_QUICKLIST) {        if (resultCode == Activity.RESULT_OK) {            Bundle extras = data.getExtras();            if (extras != null) {                int id = extras.getInt(""ql_id"");                if (id &gt; 0) {                    launchQLItemsThread(id);                }            }        }    }}</code></pre>","404676","","404676","","2010-07-29 21:57:42","2010-11-16 11:06:24","startActivityForResult not working properly with launchMode singleInstance","<android><activity><singleinstance>","2","0","4","",""
"3366999","1","","","2010-07-29 21:12:29","0","3331","<p>Greetings:</p><p>I am writing an Android app that includes an ImageView.  The image to be included in the view resides on the local app directory of the emulator.  The image is not being displayed in the view.  The relavent XML and method used to display the image are given below.</p><p>The image file is a ""png"" format file and is able to be opened from the local app directory.  The path returned by getFilesDir() includes the full path, ""/data/data/net.vitalrecord.android/files.""  This path designation does not exist on the development system but does exists when DDMS File Explorer is used.</p><p>Any help with this problem is greatly appreciated.</p><p>Thanks.</p><p>LAYOUT XML:    ......</p><pre><code>&lt;ImageView</code></pre><p>android:id=""@+id/picture"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""/> android:layout_x=""100px"" android:layout_y=""100px""    /></p><p>Method:public void checkFilesExists() {</p><pre><code>.....try { Context context = getApplicationContext(); FILENAME = getString(R.string.MedicalImage); fis = openFileInput(FILENAME); int size = fis.available(); byte[] buffer = new byte[size]; fis.read(buffer); fis.close(); setContentView(R.layout.medtogoimage);    ImageView iv = (ImageView)findViewById(R.id.picture);    String imagePath = context.getFilesDir() + ""/"" + FILENAME;    Drawable d = Drawable.createFromPath(imagePath);    iv.setImageDrawable(d);    medtogo.setbMedicalImageFileExists(true);} catch (IOException e) {  medtogo.setbMedicalImageFileExists(false);}</code></pre>","406199","","","","","2010-07-29 23:21:49","Android: Unable to display png image in an ImageView","<android><imageview><drawable>","2","0","","",""
"3367376","1","","","2010-07-29 22:10:46","0","2355","<p>I have a layout question. </p><p>Say I have a RelativeLayout appearing at the bottom of my screen. In this, I want to add 2 textviews, in the center, one in the top center and one in the bottom center. </p><pre><code>|--------------------------||          Text1           ||          Text2           ||--------------------------|</code></pre><p>Something like that :-)</p>","400622","","","","","2010-07-30 04:50:35","Android - Layout question - Textviews top center and bottom center","<android><layout><center><textview>","2","4","1","",""
"3367431","1","","","2010-07-29 22:19:58","2","1055","<p>Is it possible, from within my android java app, to capture an image of what is on the screen, even if it was written using native (ndk)? I do not wish to take screen shots of other apps, just my own. I can already capture and image of a canvas that I am aware of, but is there a view or canvas or something like it that always represents what is on the screen, so that a) I don't have to capture the separate views images and recompile them, and b) I can see what my native (jni) code is doing with the graphics too?</p>","406252","","","","","2011-11-16 05:02:58","Android acess to native screen buffer from Java","<android><screen><screen-capture>","2","0","","",""
"3367469","1","","","2010-07-29 22:27:08","1","150","<p>I have tried to solve this for days but now i try my luck here.</p><p>I use an lazy load to show my images in a custom adaper. i want to fade in images as they ar download loaded.</p><p>This is working BUT the Thread stops while animation is ON </p><pre><code>public void run()    {        if(bitmap!=null) {    myProgressBar.setVisibility(View.INVISIBLE);    imageView.setVisibility(View.VISIBLE);    Animation animation = new AlphaAnimation(0.0f,1.0f);    animation.setDuration(800);    imageView.startAnimation(animation);    imageView.setImageBitmap(bitmap);        }else {            myProgressBar.setVisibility(View.VISIBLE);            imageView.setVisibility(View.INVISIBLE);            imageView.setImageResource();        }</code></pre><p>what I want to do is to show next row even if the privius animaion not are finished.</p><p>Any ides?</p>","389080","","","","","2010-07-29 22:33:49","Howto show next row before animain is done","<android><animation>","1","0","","",""
"3367586","1","3367626","","2010-07-29 22:51:31","6","6265","<p>What is proper way to exchange data or objects between different Android Activities?</p><p>Welcome screen &lt;-> Main Screen &lt;-> Startup routines &lt;-> Processing data &lt;-> Settings</p><p>Is it normal/recommended to have more than one activity in Android app? in my opinion, it's somehow strange to have this model of data exchange inside application</p>","99821","","99821","","2010-07-29 23:20:04","2011-10-30 15:51:43","How to exchange data (objects) between different Android Activities?","<android>","4","1","4","",""
"3367732","1","","","2010-07-29 23:25:55","0","1220","<p>I have a site which makes SOAP requests to a separate domain using YUI's cross-domain AJAX transport. This is working wonderfully on my site, but unfortunately since mobile browsers don't support flash, I can't get it to work.</p><p>Does anyone know of a way to make cross-domain AJAX posts on mobile browsers?</p><p>Thanks!</p>","381375","","","","","2010-08-02 22:11:07","Is it possible to make a cross-domain AJAX call on Mobile Browsers?","<iphone><android><ajax><mobile><cross-domain>","2","1","","",""
"3367869","1","3368614","","2010-07-29 23:58:28","4","3340","<p>Is it possible to add an activity on top of the current activity.For example lets say i click a button, and then it adds a second activity to the current activity. And the second activity only covers a small place at the buttom of my current activity.</p>","242769","","","","","2010-08-02 17:29:42","Android ==> Sub Activity?","<android><activity><subactivity>","3","0","2","",""
"3367894","1","3368082","","2010-07-30 00:04:38","4","9166","<p><br>What is wrong on this code ?<br>I've a Raw file in my project (mp4 videofile),<br>when i do this, and then i retreive file from SDcard file are not identical so video can not be load :(<br>Do you have another way to automaticly copy a raw file to sdcard ?<br>Thanks</p><pre><code>String FICHIER_BLOW = ""blowvid4.mp4"";File f=new File(Environment.getExternalStorageDirectory(), FICHIER_BLOW);try {    if (f.createNewFile()){    FileWriter ecrivain = new FileWriter(f);    BufferedWriter bufEcrivain = new BufferedWriter(ecrivain);    BufferedInputStream VideoReader = new BufferedInputStream(getResources().openRawResource(R.raw.blow));    while( VideoReader.available() &gt; 0 ){        bufEcrivain.write(VideoReader.read());    }    bufEcrivain.close();    VideoView videoView = (VideoView) findViewById(R.id.VideoView);    MediaController mediaController = new MediaController(this);    mediaController.setAnchorView(videoView);    video =Uri.fromFile(f);    videoView.setMediaController(mediaController);    videoView.setVideoURI(video);    videoView.start();    }} catch (IOException e) {    // TODO Auto-generated catch block    e.printStackTrace();}</code></pre>","144587","","","","","2010-07-30 08:50:58","Android : Copy RawFile to Sdcard (video mp4)","<java><android><video><android-sdcard>","3","0","5","",""
"3367939","1","3368119","","2010-07-30 00:23:37","0","736","<p>I 'm opening a video file (3gp) file using code below</p><pre><code>    String url = ""rtsp://v5.cache4.c.youtube.com/CkELENy73wIaOAliq6nKYdHZZxMYESARFEIJbXYtZ29vZ2xlSARSBWluZGV4Wgl4bF9ibGF6ZXJg7sXyzsWH3ZlMDA==/0/0/0/video.3gp"";    Intent i = new Intent(Intent.ACTION_VIEW);    i.setData(Uri.parse(url));    startActivity(i);</code></pre><p>I can also play the url using MediaController and using its holder and Display. </p><p>What's the difference between the two methods. Both are available for Android 1.5 </p>","218665","","102703","","2010-07-30 01:08:48","2010-07-30 01:15:04","Difference between Intent.ACTION And Video View","<android>","1","0","1","",""
"3367953","1","3368002","","2010-07-30 00:29:18","7","3352","<p>Can you please tell me how can I create my own Preference class in andorid? with my own layout and own click listener?</p><p>Thank you.</p>","286802","","","","","2013-01-12 17:43:47","How to create my own Preference class","<android>","3","0","4","",""
"3367994","1","3368142","","2010-07-30 00:40:55","8","13336","<p>I am developing a website that relies on pulling the geolocation data of a mobile user. I am doing it the typical way via:</p><pre><code>function initialize() {   if(window.google &amp;&amp; google.gears) {        var geo = google.gears.factory.create('beta.geolocation');        geo.getCurrentPosition(useLocation, errorOnLocate);   }   else if(navigator.geolocation) {       navigator.geolocation.getCurrentPosition(useLocation, errorOnLocate);   }   else {       alert(""no geo found"");   }}function errorOnLocate(message){    alert(message);    zoomTo(-34.397, 150.644);}</code></pre><p>This always fails with [object PositionError] in to the errorOnLocate function, even if I switch the geolocation method order. </p><p>This is on an HTC Hero with android 2.1 using whatever browser is built in. My gps is on and I have instructed the browser to allow websites to view my location. The ""location"" feature on the google map native application that comes on the phone picks up my location just fine</p><p>Further more if I visit my site using FireFox 3.5 on my personal computer it will find my location correctly.(I believe it uses a combination of ip and ap data points). Either way, it uses the same javascript.</p><p>EDIT: This is html/js in a browser, not a native app. Also the exact error message is 'The last location provider was disabled'</p>","75174","","75174","","2010-07-30 01:52:18","2013-09-11 23:19:51","javascript geolocation on android doesn't work","<javascript><android><geolocation><htc-hero>","4","0","1","",""
"3368182","1","3368216","","2010-07-30 01:35:32","0","1052","<p>I have a custom <code>View</code> that I'd like to specify the layout of in an XML file rather than through code, is there anyway I can take an Android XML layout file and use it to flush out my custom <code>View</code>'s content?  I know it can be done in an <code>Activity</code> via the <code>setContentView</code> method, but there doesn't seem to be a similiar method for <code>Views</code>.</p><p>Thanks in advance for any help!</p><p>Regards, celestialorb.</p>","384386","","","","","2010-07-30 01:53:59","Anyway to use XML layout files for specific View/ViewGroups?","<android><xml><gui><view>","1","1","","",""
"3368354","1","3368398","","2010-07-30 02:28:21","7","6433","<p>Ive been trying to make a scrollable/zoomable app and everything has gone great except for drawing bitmaps. It is a very large image (6656 by 4096) that i have split into tiles. There is a rectangle array that the bitmaps are drawn to, and it detects what rectangle is in the top left corner so it can draw the bitmaps that will cover the user's viewable screen. My problem is this all lags when the app has to load the bitmaps into memory; Once they are loaded it isnt an issue. I started with 512 by 512 tiles, then went down to 128 by 128. although it helped, there still is some noticeable lag. I have been looking into surfaceView and wanted your opinions if i should stick with View, or use surfaceView to solve my lag.</p>","385051","","","","","2010-07-30 02:40:50","android view or surfaceView, which should i use?","<android><surfaceview><glsurfaceview>","1","0","4","",""
"3368561","1","3368715","","2010-07-30 03:36:04","0","263","<p>How do I build and debug the cores apps in Android source tree, like AlarmClock and Settings, located under:<code>${ROOT}/packages/apps</code>?</p>","440093","","","","","2012-01-19 06:00:39","Android: How to debug core apps like Settings","<android><command-line>","1","0","","",""
"3368609","1","3368707","","2010-07-30 03:54:10","2","656","<p>I am using the getExternalFilesDir(null) method to save to the SD card. Saving and reading from the SD card is fine. The problem I am having is that every time I edit anything in Eclipse and rerun the app the data on the SD card is deleted. I know that saving to the directory returned by getExternalFilesDir(null) will allow the files there to be deleted when my app is uninstalled but is there a way to turn it off for just app updating? Is this only cause I am doing it from Eclipse and it won't delete the data when the app is updated from the market? Thanks for any info you can give me! </p>","395256","","140328","","2011-08-18 15:47:24","2011-08-18 15:47:24","Android: Saving to SD Card always deletes on re-install","<android><save><external><sd-card>","3","0","0","",""
"3368726","1","","","2010-07-30 04:38:31","0","81","<p>I am android beginner and while running emulator in win2000 i am getting bellow error</p><p>*<strong>the procedure entry point addressinfo could not be located in the dynamic link library WS2_32.DLL*</strong></p><p>Thanks </p>","1199743","","","","","2010-07-30 04:44:29","problem in starting emulator in win2000","<android>","1","1","","",""
"3368874","1","3368973","","2010-07-30 05:22:34","0","50","<p>It will save a lot of coding if I am able to make a breaking change to my Android application. Instead, they will have to download a clean install and visit a URL to reinitialise the application data.</p><p>According to the <a href=""http://developer.android.com/guide/publishing/publishing.html#marketupgrade"" rel=""nofollow"">documentation</a>, ""if the package name and signing certificate do not match those of the existing version, Market will consider it a new application and will not offer it to users as an update."" This would allow me to publish a new version of the application without the user being able to accidentally upgrade and break the application. </p><p>If I do upload a new version of my application with a different signing certificate, will the application appear in the application store twice? If so, is there any way to prevent users from downloading the old application?</p>","165495","","","","","2010-07-30 05:52:26","Breaking upgrades in Android","<android>","1","1","","",""
"3368884","1","3368913","","2010-07-30 05:25:35","0","944","<p>Hi i want to display the images one by one that means first i am displaying the some (5) images in a single row.when i am track that view next pair is coming.and when i click on particular image that image will be dispayed as big image in layout which is above of this single row layout.For this which layout are useful that means grid view like that.Give me some suggestions.Thanks in advance</p>","454808","","454808","","2010-07-30 05:36:49","2010-07-30 05:55:54","display the images in single row","<android>","1","1","","",""
"3368936","1","3369101","","2010-07-30 05:43:10","0","525","<p>i have two bitmap images ..and i need to merge the bitmaps with precise positioning of one bitmap over other and get a resultant bitmap (which is combination of both)</p><p>and the resultant bitmap is a font character and i want that bitmap to be displayed in a edit box where i am inputting text.</p><p>is it possible. Please help.</p>","401983","","","","","2010-07-30 06:29:02","how to a display a bitmap in a editbox in android","<android><fonts><bitmap><rendering><editbox>","1","0","","",""
"3368996","1","","","2010-07-30 05:59:18","0","173","<p>first of all i declare an integer array in my strings.xml file and add 3 items to them then i use that items with</p><pre><code>private TextView Number12;Number12=(TextView)findViewById(R.id.TextView01); Resources r = getResources();        int[] bases = r.getIntArray(R.array.UserBases); for(i=0;i&lt;bases[i];i++)        {            Number12.setText(bases[i]);        }</code></pre><hr><p>I got the exception,please give me some solution how to display an array    </p><pre><code>07-30 11:30:10.020: ERROR/AndroidRuntime(657): FATAL EXCEPTION: main07-30 11:30:10.020: ERROR/AndroidRuntime(657): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.User_Interface/com.User_Interface.HelloWorld1}: android.content.res.Resources$NotFoundException: String resource ID #0x107-30 11:30:10.020: ERROR/AndroidRuntime(657):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at android.os.Handler.dispatchMessage(Handler.java:99)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at android.os.Looper.loop(Looper.java:123)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at java.lang.reflect.Method.invokeNative(Native Method)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at java.lang.reflect.Method.invoke(Method.java:521)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at dalvik.system.NativeStart.main(Native Method)07-30 11:30:10.020: ERROR/AndroidRuntime(657): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x107-30 11:30:10.020: ERROR/AndroidRuntime(657):     at android.content.res.Resources.getText(Resources.java:201)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at android.widget.TextView.setText(TextView.java:2817)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at com.User_Interface.HelloWorld1.onCreate(HelloWorld1.java:55)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)07-30 11:30:10.020: ERROR/AndroidRuntime(657):     ... 11 more</code></pre>","398721","","244296","","2010-07-30 06:05:56","2010-08-08 17:24:11","about integerarrays ina android","<android>","2","0","","",""
"3369068","1","","","2010-07-30 06:14:52","30","62763","<p>I am trying to play a sound file on the click of a button. The sound is just 1 sec long. It plays well the first few times I click the button, but after a while it gives a <code>NullPointerException</code>. Here's the code:</p><pre><code>button[i].setOnClickListener(new OnClickListener() {    public void onClick(View view) {                mp = MediaPlayer.create(Test.this, R.raw.mysound);           mp.start();    }});</code></pre><p>And here's the exception:</p><pre><code>07-29 23:07:27.690: ERROR/AndroidRuntime(10542): Uncaught handler: thread main exiting due to uncaught exception07-29 23:07:27.710: ERROR/AndroidRuntime(10542): java.lang.NullPointerException07-29 23:07:27.710: ERROR/AndroidRuntime(10542):     at com.example.mypackage.Test$3.onClick(Test.java:270)</code></pre><p>ThanksChris</p>","321927","","56285","","2014-01-27 22:18:25","2014-04-19 16:22:40","Android - play sound on button click - Null pointer exception","<android><button><audio><click><android-mediaplayer>","5","2","18","",""
"3369171","1","","","2010-07-30 06:38:01","-1","595","<p>I have a Google Map activity display problem. I have developed an Android application which uses the Google Map API and now application is working but only showing blank map. I got map key after providing MD5 certificate. I'm getting really very fed up. Not getting any solution.</p><h2>Manifest.xml</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""com.hello.map""    android:versionCode=""1""    android:versionName=""1.0""&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;    &lt;application android:icon=""@drawable/mapsicon"" android:label=""@string/app_name""&gt;        &lt;uses-library android:name=""com.google.android.maps"" android:required=""true"" /&gt;        &lt;activity android:name="".map"" android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre><h2>Main.xml</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;com.google.android.maps.MapView        android:id=""@+id/mapView""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:enabled=""true""        android:clickable=""true""        android:apiKey=""0VLe45SDuqjxrUhIc1-HWVybCFmiqzeKiz9kk0g""        /&gt;    &lt;LinearLayout android:id=""@+id/zoom""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:layout_centerHorizontal=""true""        /&gt;&lt;/RelativeLayout&gt;</code></pre><h2>Java file</h2><pre><code>package com.hello.map;import android.app.Activity;import android.os.Bundle;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;import android.os.Bundle;import android.os.Bundle;import android.view.View;import android.widget.LinearLayout;import android.widget.LinearLayout.LayoutParams;public class map extends MapActivity{    MapView mapView;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mapView = (MapView) findViewById(R.id.mapView);        LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);        View zoomView = mapView.getZoomControls();        zoomLayout.addView(zoomView,            new LinearLayout.LayoutParams(            LayoutParams.WRAP_CONTENT,            LayoutParams.WRAP_CONTENT));        mapView.displayZoomControls(true);        mapView.setSatellite(true);    }    @Override    protected boolean isRouteDisplayed() {        // TODO Auto-generated method stub        return false;    }}</code></pre><p>Please provide me the solution. </p>","383597","","243203","","2011-03-31 18:22:23","2011-03-31 18:22:23","Android Map problem in Emulator","<android>","3","2","","",""
"3369177","1","3498233","","2010-07-30 06:39:20","0","1274","<p>I use HttpCilent 4.0.1 to upload picture, but I got HTTP 400 Error, the error message like this, Plz someone help me.</p><blockquote>  <p>{""error"":{""type"":""OAuthException"",""message"":""Invalid  OAuth access token.""}}</p></blockquote><p>My code is...</p><pre><code>private void uploadPicture( ) throws ParseException, IOException {    HttpClient httpclient = new DefaultHttpClient();    httpclient.getParams( ).setParameter( CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1 );    HttpPost httppost = new HttpPost( ""https://graph.facebook.com/me/photos"" );    File file = new File( sdpicturePath );    // DEBUG    Log.d( ""TSET"", ""FILE::"" + file.exists( ) ); // IT IS NOT NULL    Log.d( ""TEST"", ""AT:"" + fbAccessToken ); // I GOT SOME ACCESS TOKEN    MultipartEntity mpEntity  = new MultipartEntity( );    ContentBody cbFile        = new FileBody( file, ""image/png"" );    ContentBody cbMessage     = new StringBody( ""TEST TSET"" );    ContentBody cbAccessToken = new StringBody( fbAccessToken );    mpEntity.addPart( ""access_token"", cbAccessToken );    mpEntity.addPart( ""source"",       cbFile        );    mpEntity.addPart( ""message"",      cbMessage     );            httppost.setEntity( mpEntity );    // DEBUG    System.out.println( ""executing request "" + httppost.getRequestLine( ) );    HttpResponse response = httpclient.execute( httppost );    HttpEntity resEntity = response.getEntity( );    // DEBUG    System.out.println( response.getStatusLine( ) );    if (resEntity != null) {      System.out.println( EntityUtils.toString( resEntity ) );    } // end if    if (resEntity != null) {      resEntity.consumeContent( );    } // end if    httpclient.getConnectionManager( ).shutdown( );} // end of uploadPicture( )</code></pre>","406900","","","","","2010-08-23 21:51:10","Android Facebook-SDK multipart/form-data upload got ""Invalid OAuth access token""","<android><upload><multipart><facebook>","1","0","2","",""
"3369196","1","3369223","","2010-07-30 06:44:00","0","5062","<p><br>I am having issue while showing a WebView in an activity in the middle of the screen.I have an activity and I want to show a webview in the center of screen. My activity is transparent so background activity will be visible. Whenever I try to create a webview and add it to activity using setContentView(webview) it always shows the view on the top left corner of the screen. Is their a way to workaround this?I am trying to do this via pure code only. Here is my code.<pre><code>protected void onCreate(Bundle savedInstance) {    //some initialization stuff    LinearLayout ll = new LinearLayout(activity);     ll.setOrientation(LinearLayout.VERTICAL);    ll.setGravity(Gravity.CENTER_HORIZONTAL);    ll.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,                         ViewGroup.LayoutParams.FILL_PARENT));    ll.setBackgroundColor(android.R.color.transparent);    ll.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); //added after suggestion    webView = new WebView(this);    webView.getSettings().setJavaScriptEnabled(true);    webView.getSettings().setBuiltInZoomControls(true);    webView.loadUrl(""http://www.google.com"");    ll.addView(webView);    webView.setBackgroundColor(android.R.color.transparent);    setContentView(ll);}</code></pre>.</p>","195802","","195802","","2010-07-30 07:18:12","2010-07-30 07:18:12","how to show a webview inside an activity in the middle of screen","<android><view><webview><screen-orientation>","1","0","","",""
"3369224","1","3369524","","2010-07-30 06:50:06","1","872","<p>I want to know how I can filter hotspots that are secured or public using Android WiFi API or Android SDK?</p>","362544","","168175","","2012-05-07 16:43:24","2012-05-07 16:43:24","Find which WiFi hotspots are public or secured using programmatically","<android><wifimanager>","1","0","1","",""
"3369413","1","3619544","","2010-07-30 07:23:14","77","19982","<p>More and more mobile platforms are being launched and sdk's are available to developers. There are various mobile platform are available:Android, iOS, Moblin, Windows mobile 7, RIM, symbian, bada, maemo etc.</p><p>And making of cross platform application is headache for developers. I am searching for common things across the platforms which will help to developers who want to port application to all platforms. Like what are the diff screen resolutions, input methods, open gl support etc.please share details that you know for the any of platform.</p><p>Or are there possibilities, by writing code in html (widget type of thing) and loading it into native application. I know about the android, in which we can add the web view into application by calling <code>setContentView(view)</code></p><p>Please share the class details where we can add the html view into native application of different type of platforms that you know.</p><p>Purpose of this thread is share common details across developers. marking as community wiki.</p><p><strong>Cross platform tools &amp; library</strong></p><ul><li><p>XMLVM, <a href=""http://www.codenameone.com/"" rel=""nofollow"">Codename One</a> and iSpectrum (cross compile Java code from an Android app or creating one from scratch</p></li><li><p><a href=""http://phonegap.com/"" rel=""nofollow"">Phone Gap</a> (cross platform mobile apps)</p></li><li><p>Titanium  (to build native mobile and desktop apps with web technologies)</p></li><li><p>Mono Touch ( C# for iphone )</p></li><li><p>rhomobile - <a href=""http://rhomobile.com/"" rel=""nofollow"">http://rhomobile.com/</a>samples are here: <a href=""http://github.com/rhomobile/rhodes-system-api-samples"" rel=""nofollow"">http://github.com/rhomobile/rhodes-system-api-samples</a></p></li><li><p>Sencha Touch - Sencha Touch is a HTML5 mobile app framework that allows you to develop web apps that look and feel native on Apple iOS and Google Android touchscreen devices. <a href=""http://www.sencha.com/products/touch/"" rel=""nofollow"">http://www.sencha.com/products/touch/</a></p></li><li><p>Corona - Iphone/Ipad / Android application cross platform library . Too awesome.<a href=""http://anscamobile.com/corona/"" rel=""nofollow"">http://anscamobile.com/corona/</a></p></li><li><p>A guide to port existing Android app to Windows Phone 7<a href=""http://windowsphone.interoperabilitybridges.com/articles/windows-phone-7-guide-for-iphone-application-developers"" rel=""nofollow"">http://windowsphone.interoperabilitybridges.com/articles/windows-phone-7-guide-for-iphone-application-developers</a></p></li><li><a href=""http://jquerymobile.com/"" rel=""nofollow"">Jquery Mobile</a>Touch-Optimized Web Framework for Smartphones &amp; Tablets</li></ul>","266097","","677056","","2014-03-16 22:53:25","2014-03-16 22:53:25","Developing cross platform mobile application","<android><windows-phone-7><blackberry><ios4><cross-platform>","5","3","57","2012-06-14 16:45:43",""
"3369423","1","3370895","","2010-07-30 07:25:22","2","1979","<p>My TabActivity contains two tabs which calls two two different activities . I want to setResult() for the TabActivity when either one of the child finishes.</p><p>Is there any method to find out when my activity inside tab finishes ?   </p><p>Thank you-Eby</p>","362088","","","","","2012-04-05 13:00:37","How to setResult() for a TabActivity which contains activity for tabs","<android><activity><tabactivity>","3","0","1","",""
"3369442","1","","","2010-07-30 07:27:53","0","356","<p>Android has Gallery and Grid widgets, what about iphone? Does those UI elements exist in IPhone or any other similar widgets?</p>","238061","","","","","2010-07-30 07:27:53","What is the corresponding UI widgets with android Gallery and Grid widgets in IPhone?","<iphone><android><widget>","0","2","","",""
"3369537","1","3369552","","2010-07-30 07:42:19","2","1067","<p>I am using SQLITE database and I store the date as a String. Now I want to compare both the string as a date. While I am using </p><p>String sqlQuery = ""SELECT title,edate FROM lookup WHERE"" + ((Date)df.parse(""?"")).getTime() + ""&lt;="" + date1.getTime();    c= db.rawQuery(sqlQuery,new String[]{""edate""});</p><p>it is giving error at run time. Please Tell me how can I compare two String as a Date.</p><p>Thank YouDeepak</p>","406494","","","","","2010-07-30 07:57:28","Comparing the Date in Android","<android>","2","1","1","",""
"3369554","1","","","2010-07-30 07:45:38","0","2749","<p>I would want to know how to launch an activity when long pressing media button.In this case, I don't want to launch the default activity : the media reader, this one must keep lauching when media button has been short pressed.</p><p>Hope, I've been explicite.</p><p>A.L.</p><p>Subsidiary question : Why some hard key, like the search button, can directly launch activity specifying it in the activity attribute of the manifest.xml , and others, like media button, are only mentioned for broadcast action ?</p>","348175","","348175","","2010-08-03 13:47:35","2011-03-28 15:52:37","How to handle long press media button, in order to launch activity?","<android><button><activity><media><launch>","1","0","1","",""
"3369680","1","3369701","","2010-07-30 08:08:38","0","82","<p>How would i make what i selected in the spinner appear in a textview when i choose that selection? The data would be taken from the database.</p><p>My Booking.java</p><pre><code>package one.two;import android.app.Activity;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.SimpleCursorAdapter;import android.widget.Spinner;import android.widget.Toast;import android.widget.AdapterView.OnItemSelectedListener;public class Booking extends Activity{    private DBAdapter db;     /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        db = new DBAdapter(this);        db.open();        setContentView(R.layout.booking);        Cursor spinnerCursor = db.getAllData();         startManagingCursor(spinnerCursor);        Spinner colourSpinner = (Spinner) findViewById(R.id.spinner);        ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(        this, R.array.array_arrival, android.R.layout.simple_spinner_item);        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        colourSpinner.setAdapter(adapter);     colourSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {        @Override        public void onItemSelected(AdapterView&lt;?&gt; parentView, View selectedItemView, int position, long id) {        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; parentView) {            // your code here        }    });    }}</code></pre><p>Thank you.</p>","358218","","","","","2010-07-30 08:16:35","Question with android","<android><database><eclipse><sqlite><spinner>","1","0","","",""
"3369702","1","3371116","","2010-07-30 08:11:30","3","1709","<p>I am making twitter application in which i open browser for user authentication and i pass call_back URL when launching authentication browser</p><p>problem is after authenticating it is calling again oncreate of TWitterShare class instead calling onNewIntent method, why is that ? my another class working fine i am unable to find difference any idea by looking at the following ocde why it is calling oncreate again ?</p><pre><code>            &lt;activity android:name="".TwitterShare""            launchMode=""singleInstance""&gt;                &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.VIEW"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;                &lt;data android:scheme=""myapp"" android:host=""oauth1"" /&gt;                &lt;/intent-filter&gt;            &lt;/activity&gt;@Override    protected void onNewIntent(Intent intent) {        super.onNewIntent(intent);  }</code></pre>","216431","","","","","2010-12-11 22:13:40","Android callback URL calling oncreate","<android><callback><jtwitter>","2","0","1","",""
"3369888","1","3369931","","2010-07-30 08:41:44","4","3810","<p>Simple enough question, but I cant find ant half-decent documentation on it. Right so I've created my SQLite db but it has two problems or one depending how you look at it! The db creates fine and I can show the data in a basic listview, however on changing the orientation of the phone/emulator the insert statements run again and duplicate all the records. Im guessing this has something to do with all the code being placed within the OnCreate() method. My main question however is how to do INSERT UNIQUE or query the db to see if the record exists? I just could find any good documentation on SQLite DB parameters on the Android platform. </p><p>Any help is much obliged !</p><p>Cheers </p>","397085","","","","","2012-11-24 16:03:06","Android SQLite insert unique","<android><database><sqlite>","3","0","3","",""
"3369922","1","3373411","","2010-07-30 08:47:38","0","1541","<p>I have just this piece of code which is quite simple. I have a list and in the onCreate method I added some objects to this list to show them on the screen. I have a broadcast receiver which has to enable/disable some elements of the list when there aren't internet connection. </p><p>The broadcast receiver works good if the connection is lost when the application is already in the screen of this activity. The problem is when there is no connection before entering this activity. In this case after calling oncreate() method in the onresume() the receiver is registered, but when I call getListView() inside the receiver it hasn't got any child (though I've added to the adaptor in the oncreate method and I haven't loaded then using any thread at all).</p><p>Can anyone tell me why this is happening?</p><pre><code>public class MyActivity extends ListActivity {    private List&lt;MyClass&gt; myObjects;    private final BroadcastReceiver receiver = new BroadcastReceiver() {        @Override        public void onReceive(Context context, Intent intent) {            //check if internet connection is available            boolean networkAvailable = ... ;            if (!networkAvailable) {                //No Internet connection: disabled non-cached objects                List&lt;MyClass&gt; cachedObjects = getCachedObjects();                for(int i = 0; i&lt;myObjects.size(); i++){                    MyClass myObject = myObjects.get(i);                    if (!cachedSurveys.contains(myObject)) {                        ListView listView = getListView();                        //The problem is here: listView is empty when there was no connection                        //before creating the activity so the broadcast receiver was called in a sticky way                                             View child = listView.getChildAt(i);                        child.setEnabled(false);                    }                }            } else {                // Internet connection: enable all myObjects                 int size = getListView().getChildCount();                 for (int i = 0; i &lt; size; i++) {                    View child = getListView().getChildAt(i);                    child.setEnabled(true);                }            }        }     };      @Override     public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        myObjects = getMyObjects();        setListAdapter(new ArrayAdapter&lt;MyClass&gt;(this, android.R.layout.simple_list_item_1, myObjects));        getListView().setTextFilterEnabled(true);   }    @Override    protected void onResume() {        super.onResume();        IntentFilter intentFilter = new IntentFilter(""android.net.conn.CONNECTIVITY_CHANGE"");        registerReceiver(receiver, intentFilter);    }    @Override    protected void onPause() {        super.onPause();        unregisterReceiver(receiver);    }}</code></pre><p>Thanks</p>","249699","","249699","","2010-07-30 08:54:46","2010-07-30 16:20:31","Strange problem with broadcast receiver in Android","<java><android><listview><broadcastreceiver>","1","0","","",""
"3369961","1","","","2010-07-30 08:53:03","1","1156","<p>Hi I want to display the gallary elements repeatedly.that means when i move forward or backward there is no need of end of gallary images.If i take 23 elemets array to assign images to gallary then that images again repeat when i move forward or backward of the gallary.For this one please give me some suggestions.Thanks in advance</p>","454808","","","","","2012-01-05 06:24:40","repeat the gallery elements","<android>","2","0","3","",""
"3370211","1","3373150","","2010-07-30 09:28:24","0","2836","<p>How to play an audio during splash screen.Guidance needed.</p>","1497488","","","","","2012-07-02 12:44:28","How to play audio in splash screen in android","<android>","2","0","2","",""
"3370212","1","3370374","","2010-07-30 09:28:30","2","1726","<p>What exactly is the relationship between a Surface and Canvas.</p><p>Please explain.</p>","381699","","","","","2010-07-30 09:53:50","Relationship between Surface and Canvas: Android","<android><canvas><surface>","1","1","2","",""
"3370278","1","","","2010-07-30 09:37:39","13","6837","<p>I tried it and use the following code for recording outgoing calls but it does not..</p><pre><code>  @Override  public void onReceive(Context context, Intent intent)   {          this.context = context;          if (intent.getAction().equalsIgnoreCase(Intent.ACTION_ANSWER))           {              try              {                  phonenbr = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);                  Log.v(""GDHGDHGHDGDHGDHGHDGHDGH"", phonenbr);                  recorder.setAudioSource(MediaRecorder.AudioSource.MIC);                  recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);                  recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);                  recorder.setOutputFile(pathname);                  recorder.prepare();                  recorder.start();                  recordstarted = 1;                  telManager= (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);              }              catch(Exception e)              {                  e.printStackTrace();              }              final PhoneStateListener phoneListener = new PhoneStateListener()                {                    @Override                     public void onCallStateChanged(final int state, final String incomingNumber)                        {                            getTelephonyOverview(telManager);                        }                };           telManager.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE);}</code></pre><p>}</p><pre><code>           public void getTelephonyOverview(final TelephonyManager telManager)           {                   int callState = telManager.getCallState();                   switch (callState)                   {                    case TelephonyManager.CALL_STATE_IDLE:                    {                        if (recordstarted==1)                        {                            recorder.stop();                            recordstarted =0;                        }                        break;                    }                }           }</code></pre><p>Please provide some good solution for this problem..</p>","404052","","21234","","2010-07-30 09:39:09","2014-01-24 11:43:55","Record phone calls on android phone?","<java><android>","5","4","14","",""
"3370351","1","3370399","","2010-07-30 09:49:00","4","1215","<p>Respected All,              I am newly working on android technology. I have use map view which is declared in another layout.I have to display in some part of may screen. can I use same map view or i have to create new mapview programmatically. In short i have to display map in some part of my screen. How can i do it..                                                                          Thank You                                                                         (Vikram Kadam)</p>","395627","","","","","2010-07-30 09:56:48","how to use views declared in one layout xml file in other layout","<android>","2","2","","",""
"3370520","1","","","2010-07-30 10:14:36","3","2229","<p>In an application I have a Spinner that has tens of items.</p><p>When the user taps on the spinner, a popup dialog appears that shows the list of possible selections. However, since there are (sorted) tens of items, I want the user to be able to use the fast-scroll thumb (like <code>fastScrollEnabled</code> attribute on ListView), similar to the one enabled in Contacts application.</p><p>I tried to get the ListView that is used in that popup dialog, but I didn't find any methods to do that.</p>","11238","","","","","2010-07-30 10:55:10","How to enable fast scroll (thumb) in Android Spinner's drop-down menu?","<java><android><listview><spinner><fastscroll>","1","1","0","",""
"3370544","1","3400213","","2010-07-30 10:18:52","3","1246","<p>I set up an account manager for my application which syncs contacts from my cloud service to the device. The account shows up under Accounts &amp; Sync along with other such accounts (Google, FB, ...). After logged in it syncs web contacts to your device. The contacts are linked to that account. They are added using batch operations using the example from the android developer webpage.</p><p>The problem I'm facing is that once synced the contacts can be edited, but the user can edit only the name (I'm transferring email and phone numbers too). The syncadapter has the property</p><pre><code>android:supportsUploading=""true""</code></pre><p>enabled, but it only allows editing of the name. If the property is set to false the contact cannot be edited at all.</p><p>I would really appreciate some help, since it's been bugging me for days now.</p>","297616","","297616","","2010-07-30 10:33:49","2012-06-25 12:06:27","Android contact programmed sync","<android><sync><edit><contact>","1","1","2","",""
"3370628","1","3375267","","2010-07-30 10:29:50","6","15847","<p>I am trying to get the contact's phone number after I have retrieved their ID number from the built-in activity. However, whenever I query the database using the cursor in my code below -- I get zero rows returned even though there is a mobile number for the contact I have selected. </p><p>Can anyone point me in a better direction or show an example of how to get the contact's phone number AFTER getting their userID?</p><p>My code: </p><pre><code>    private Runnable getSMSRunnable() {    return new Runnable() {    public void run() {    Intent i = new Intent(Intent.ACTION_PICK,      ContactsContract.CommonDataKinds.Phone.CONTENT_URI);    startActivityForResult(i, CONTACTS_REQUEST_CODE);   }  }; }</code></pre><p>Returns the Log output </p><pre><code>content://com.android.contacts/data/6802</code></pre><p>From which i pass the ID (6802) into a method which is designed to return the phone number from the ID with the given type (in this case ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE)</p><pre><code>public static String getContactPhoneNumberByPhoneType(Context context, long contactId, int type) {    String phoneNumber = null;    String[] whereArgs = new String[] { String.valueOf(contactId), String.valueOf(type) };    Log.d(TAG, String.valueOf(contactId));    Cursor cursor = context.getContentResolver().query(            ContactsContract.CommonDataKinds.Phone.CONTENT_URI,            null,            ContactsContract.CommonDataKinds.Phone.CONTACT_ID + "" = ? and ""                    + ContactsContract.CommonDataKinds.Phone.TYPE + "" = ?"", whereArgs, null);    int phoneNumberIndex = cursor            .getColumnIndexOrThrow(ContactsContract.CommonDataKinds.Phone.NUMBER);    Log.d(TAG, String.valueOf(cursor.getCount()));    if (cursor != null) {        Log.v(TAG, ""Cursor Not null"");        try {            if (cursor.moveToNext()) {                Log.v(TAG, ""Moved to first"");                Log.v(TAG, ""Cursor Moved to first and checking"");                phoneNumber = cursor.getString(phoneNumberIndex);            }        } finally {            Log.v(TAG, ""In finally"");            cursor.close();        }    }    Log.v(TAG, ""Returning phone number"");    return phoneNumber;}</code></pre><p>Which returns null for a phone number -- which means it cannot find the row that I am trying to access -- which means that something is wrong with my query -- however if I check a contact that has a mobile phone number -- how could I get a 0 row query?</p><p>Any help would be greatly appreciated. Thank you so much!</p>","354247","","354247","","2010-07-30 19:57:19","2010-07-30 20:50:22","Retrieve Contact Phone Number From URI in Android","<android><contactscontract>","2","0","3","",""
"3370635","1","","","2010-07-30 10:31:07","1","2305","<p>I'm using <a href=""http://code.google.com/p/ksoap2-android/"" rel=""nofollow"">ksoap2</a> for my android project and it works great. I've succeeded in connecting to distant server but I currently have a problem when I want to set a timeout to my androidhttptransport.</p><p>Is there a clean way (maybe an attribute to set?) to deal with it?</p><p>I've found this same question <a href=""http://stackoverflow.com/questions/1473810/how-do-i-enforce-a-timeout-on-a-webservice-call-using-ksoap-2"">there</a> but it's not very detailed. Does someone have any detailed answer to this problem?</p><p>Thanks in advance for help!</p><p>Romain</p>","334209","","","","","2012-10-17 11:45:14","How to set a timeout on a soap call using ksoap2-android?","<android><soap><timeout><ksoap2><httpconnection>","1","3","1","",""
"3370659","1","3370736","","2010-07-30 10:36:36","4","4154","<p>I am new to android development. I want to make one background application, so that it keeps running in background, and it's without any UI, and even its icon do not appear on desktop.In short it's a stealth application.<br>Is it possible?</p>","406631","","2535973","","2014-02-24 08:49:13","2014-02-24 08:49:13","Background application without ui","<android><android-backup-service>","2","0","3","",""
"3370671","1","3370756","","2010-07-30 10:38:49","1","432","<p>As far as I understand, applications made with Adobe AIR have been blocked from the App Store. If I wanted to utilize AIR anyway to create a cross-platform app (for iPhone and Android) would it be possible to distribute the apps outside of the App Store?</p><p>I have very little experience with the iPhone, but I know that in Android you can turn on the ability to install applications from other sources than the Android Market. This would not be a problem in this case, where the target group is small and controlled. Is this also possible with the iPhone?</p><h3>Update</h3><p>It seems my basic idea that iPhone AIR apps are possible doesn't work. This is a quote from <a href=""http://labs.adobe.com/technologies/packagerforiphone/"" rel=""nofollow"">Adobe's page about the iPhone packager</a>:</p><blockquote>  <p>At this time, we have ceased further  development of the Packager for  iPhone, and we plan to keep this  completed work in CS5 to demonstrate  the capabilities of the Flash Platform  to support multiple platforms and  devices.</p></blockquote>","185596","","102937","","2013-04-22 23:30:53","2013-04-22 23:30:53","Can I develop for Android and iPhone with Adobe AIR if I don't care about the App Store?","<android><iphone><air><cross-platform>","2","0","","",""
"3370799","1","3370967","","2010-07-30 10:56:50","2","5515","<p>in android manifest code these permissions are used sometimes.for what these are used?</p><pre><code>&lt;uses-permission android:name=""android.permission.CAMERA"" /&gt;&lt;uses-permission android:name=""android.permission.VIBRATE"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"" /&gt;&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.RECEIVE_SMS"" /&gt;&lt;uses-permission android:name=""android.permission.RECORD_AUDIO"" /&gt;&lt;uses-permission android:name=""android.permission.MODIFY_AUDIO_SETTINGS"" /&gt;&lt;uses-permission android:name=""android.permission.READ_CONTACTS"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_CONTACTS"" /&gt;   &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;   &lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt;</code></pre><p>thanks</p>","402980","","133802","","2010-07-30 11:14:16","2011-07-21 08:21:41","what are these permissions used for","<android><android-emulator><android-manifest>","4","1","","",""
"3370951","1","","","2010-07-30 11:19:59","0","1185","<p>I'm new to android now I'm developing an application where a file is downloaded.I want to show a progressbar while the file is being download.i don't know where to check the condition for showing the Progress Bar and also i don't know how to dismiss the Progress Bar.</p>","405388","","","","","2010-07-30 11:22:10","How to dismiss the Progress Bar?","<android>","1","0","","",""
"3370998","1","3371830","","2010-07-30 11:27:14","1","454","<p>I've been coerced into applying Microsoft's PageAsyncTask objects, which I am new to (before I've always used jQuery AJAX calls). I've got everything working just right except once the work is done and the endHandler is called, how do I have the calling page update its contents?</p><p>Basically my async function runs a slew of database operations and reports back to the caller with HTML regarding the results of the database run. I'd like to display these results on the calling page once the operation has completed. I have everything working except the calling page displaying the results.</p><p>Your help is appreciated.</p>","233194","","426671","","2012-06-12 16:59:00","2012-06-12 16:59:00","PageAsyncTask endHandler to update the calling page","<android><asp.net><asynchronous><android-asynctask><pageasynctask>","1","0","1","",""
"3371179","1","3371212","","2010-07-30 11:57:30","0","695","<p>I have a plain vanilla layout:  </p><pre><code>&lt;ScrollView&gt;    &lt;TableLayout&gt;        &lt;TableRow&gt;            ...</code></pre><p>but the content gets clipped by the ScrollViews scrollbar.</p><p>This link illustrates the issue:<br><a href=""http://books.google.com/books?id=7tH3A0UrWEEC&amp;lpg=PA54&amp;ots=zztpvVWPXT&amp;dq=android%20%22clipped%20by%20the%20scrollbar%22&amp;pg=PA54#v=onepage&amp;q&amp;f=false"" rel=""nofollow"">http://books.google.com/books?id=7tH3A0UrWEEC&amp;lpg=PA54&amp;ots=zztpvVWPXT&amp;dq=android%20%22clipped%20by%20the%20scrollbar%22&amp;pg=PA54#v=onepage&amp;q&amp;f=false</a></p><p><strong>How to avoid content clipped by ScrollView scrollbar ?</strong>  </p><p>Edit:<br>Adding android:layout_marginRight=""5dip"" on ScrollView leaves ugly gap on righthand side of emulator screen. See below.</p><p>Any other tips ?</p><p><img src=""http://www.freeimagehosting.net/uploads/96193a3b6e.png"" alt=""alt text""></p>","77115","","77115","","2010-07-30 12:33:27","2011-01-16 21:38:39","How to avoid content clipped by ScrollView scrollbar?","<android>","2","0","","",""
"3371251","1","","","2010-07-30 12:09:15","0","1317","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3029074/how-to-change-tab-style-in-android"">How to change tab style in Android?</a>  </p></blockquote><p>I am using TAB in my android application. I want to change the Background of each Tab at the load time only. The default color is grey. </p>","406494","","","","","2010-07-31 04:14:56","Changing the background color of a Tab widget","<android>","0","4","","2011-09-26 13:09:54",""
"3371307","1","3372008","","2010-07-30 12:19:15","4","21165","<p>I have two tables albums and songs and each song has reference to alum's id.</p><p>Album table :</p><pre><code>CREATE TABLE albums(id INTEGER PRIMARY KEY ASC,name TEXT,additional TEXT)</code></pre><p>Song table:</p><pre><code>CREATE TABLE songs(id INTEGER PRIMARY KEY ASC,album_fk INTEGER NOT NULL,title TEXT,url TEXT,duration BIGINT NOT NULL)</code></pre><p>and i also have a trigger to check when i delete an album if there are existing songs in it :</p><pre><code>CREATE TRIGGER trigger_on_deleteBEFORE DELETE ON albumsFOR EACH ROW BEGINSELECT RAISE(FAIL,'album has songs cannot be deleted')WHERE (SELECT album_fk FROM songs WHERE album_fk = OLD.id) IS NOTNULL;)END</code></pre><p>all this is working fine but sometimes </p><pre><code>Exception: android.database.sqlite.SQLiteConstraintException: errorcode 19: constraint failedStack Trace :android.database.sqlite.SQLiteStatement.native_execute(Native Method)android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:66)</code></pre><p>is thrown when i try to delete an album. My delete method is simply deleting an album by id.The bad thing is that i can't reproduce this so there is no much info i can provide. I tried different scenarios with deleting an album but i never got this exception.</p><p>So any ideas how can investigate this issue. There are not any contraints in album table so what could cause such exception ? Any help will be appreciated.</p>","184601","","184601","","2010-07-30 12:57:42","2012-01-30 04:44:13","sqlite constraint failed error code","<android><sqlite><constraints>","4","2","","",""
"3371425","1","3371482","","2010-07-30 12:37:41","3","201","<p>I currently have an app on the market that supports Android 1.5 (SDK level 3) and up.  It also takes advantage of several features that are only present in Android 2.0 (SDK level 5) and up.  I do this using Reflection.</p><p>I read a post on the Android Developer Blog that talks about how to support these new features while using <strong>no</strong> Reflection, which would be amazing.<a href=""http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html"" rel=""nofollow"">http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html</a></p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""5"" /&gt;</code></pre><p>I have tested this out and while it works there is one huge downfall.  Currently if I try to add a SDK level 5 class, but I don't know that it's a SDK level 5 class, there is no worries.  Eclipse isnt going to find the class and I'm not going to be able to add it.</p><p>Using Google's recommended method does allow me to add the classes and gives me no notification that this code is targeted just to SDK level 5 users.  This opens up too big of a possibility of adding in code that would break some users without knowing.</p><p>Does anyone know of any plugins, options, etc that would warn me at the places I have targeted SDK level 5 to keep this from happening?</p>","242904","","","","","2011-04-18 05:24:42","Supporting Android 1.5, features from Android 2.1 and no Reflection?","<android>","1","0","","",""
"3371496","1","","","2010-07-30 12:45:46","1","930","<p>Is there any API supported by Android for recording phone call ?</p><p>Thanks and Regards...</p>","406631","","","","","2010-11-03 23:26:56","Is there any API supported by Android for recording phone call?","<android>","1","0","","",""
"3371601","1","3373122","","2010-07-30 12:57:02","4","748","<p>I'm launching an activity on a buttonclick from AppWidget. The user enters some data on the activity and when user closes the activity, I want to update the data user entered in a TextView on AppWidget. Any idea how to do that? I have successfully launched activity from AppWidget, only problem being updating the AppWidget.</p>","337214","","225647","","2010-07-30 15:47:18","2010-07-30 15:47:18","Updating AppWidget","<android><appwidget>","1","0","","",""
"3371659","1","","","2010-07-30 13:05:17","0","990","<p>I'm thinking of developping a mobile OCR app to detect words from mobile pictures.The purpose if only to detect what words are in the picture, the layout is not important.Also it would be use on very short texts.</p><p>I'm currently thinking of adapting tesseract to iphone and android.</p><p>I wonder if anyone has had any related experience? What are the limits etc.</p><p>Thanks!</p>","375348","","375348","","2010-07-31 00:14:04","2011-06-20 11:34:02","OCR for mobile photos","<iphone><android><ocr><tesseract>","2","2","","",""
"3371683","1","","","2010-07-30 13:06:45","0","1045","<p>I have implemented GestureListener, and it is working perfectly, but how can I remove GestureListener from my view?</p><pre><code>@Overridepublic boolean onTouchEvent(MotionEvent event) {    if ( event.getAction() == MotionEvent.ACTION_UP ) {        //   remove gestureDetector    } else {        mGestureDetector.onTouchEvent(event);    }    return true;}</code></pre><p>Regards,Nishant Shah</p>","385343","","226476","","2010-07-30 13:09:07","2010-07-30 13:54:09","How to disable GestureListener in android?","<android>","1","1","0","",""
"3371692","1","3385424","","2010-07-30 13:07:29","5","19891","<p>I had my camera set to <code>this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);</code> and it works fine but if I change it to <code>PORTRAIT</code> instead of <code>LANDSCAPE</code> then it crashes with the following error...</p><pre><code>  07-30 12:51:37.655: ERROR/AndroidRuntime(22069): FATAL EXCEPTION: main  07-30 12:51:37.655: ERROR/AndroidRuntime(22069): java.lang.RuntimeException: Fail to connect to camera service  07-30 12:51:37.655: ERROR/AndroidRuntime(22069):     at android.hardware.Camera.native_setup(Native Method)   07-30 12:51:37.655: ERROR/AndroidRuntime(22069):     at android.hardware.Camera.&lt;init&gt;(Camera.java:110)   07-30 12:51:37.655: ERROR/AndroidRuntime(22069):     at android.hardware.Camera.open(Camera.java:90)   07-30 12:51:37.655: ERROR/AndroidRuntime(22069):     at org.digital.com.CamLayer.surfaceCreated(CamLayer.java:3</code></pre><p>The method it crashes in is.. </p><pre><code>  public void surfaceCreated(SurfaceHolder holder) {    synchronized(this) {            mCamera = Camera.open();            Camera.Parameters p = mCamera.getParameters();             p.setPreviewSize(800, 480);            mCamera.setParameters(p);            try {                            mCamera.setPreviewDisplay(holder);                    } catch (IOException e) {                            Log.e(""Camera"", ""mCamera.setPreviewDisplay(holder);"");                    }            mCamera.startPreview();        mCamera.setPreviewCallback(this);    }    }</code></pre><p>It crashes at <code>mCamera = Camera.open();</code></p><p>My Manifest file has <code>&lt;uses-permission android:name=""android.permission.CAMERA""&gt;&lt;/uses-permission&gt;</code></p><p>How do I fix this so I can view my app in Portrait?</p>","358438","","358438","","2010-07-31 18:37:58","2012-10-01 18:01:28","Fail to connect to camera service","<java><android>","6","4","2","",""
"3371824","1","","","2010-07-30 13:22:52","3","1060","<p>I am trying to get the last modified date of an internal file and it always returns me 0 although I could read the file properly. Can you please let me know if I am doing anything wrong...</p><h2>Creating a file...</h2><p>FileOutputStream Os = activity.openFileOutput(""file1.jpg"", Context.MODE_PRIVATE);<br>cachedImage.compress(CompressFormat.JPEG, 75, Os);<br>Os.close();  </p><h2>Reading the file...</h2><p>long mod_time = 0;<br>File file = new File(""file1"".jpg"");<br>mod_time = file.lastModified();<br>FileInputStream Is = activity.openFileInput(""file1.jpg"");<br>cachedImage = BitmapFactory.decodeStream(Is);<br>Is.close();  </p><p><strong>mod_time is always zero!!!!</strong></p>","207823","","","","","2010-07-30 20:39:13","Android: Getting lastModified of a private file","<android><file><last-modified>","1","0","","",""
"3371992","1","","","2010-07-30 13:39:24","2","1322","<p>I'm trying to do something in android, and I'm not sure how.</p><p>I have this <code>ListView</code>, which I update with new info from time to time, and I would like it if I could have a transition effect when the new data is in, like the ""Slide from the left"" affect that I get when calling in a new activity.</p><p>but I'd rather not open a new activity for each new peace of data, as that way I would end up with a lot of activities.</p><p>Is there a way that I can emulate this slide from the left effect?</p>","406682","","119895","","2010-07-30 14:13:29","2011-02-22 08:39:07","Slide in animation when updating screen on android","<android>","1","0","1","",""
"3372020","1","3372074","","2010-07-30 13:42:51","6","7972","<p>Is there any api for facebook to integration in android?</p><p>I got a requirement to publish images to facebook through android application. </p><p>Please give links or suggestions regarding this.. </p>","365184","","1989820","","2013-07-18 07:49:48","2013-12-05 08:01:21","Facebook integration in android application","<android><facebook><api>","4","2","5","",""
"3372167","1","3372201","","2010-07-30 13:59:35","0","1364","<p>I'm looking to implement my first Android database, but I have so many questions which (I believe) are unanswered by all the tutorials I find.</p><p>Here are my needs:- I want my application to have a database that is persistent.  If my application closes and launches again, there is already a database to pull data from.  It does not create a new database every time the application is killed and re-launched.- I want to implement versioning.  Say version 1 of my application has a few tables.  I release version 2 and I want some sort of script to run to add new tables I've added or modify old tables I've added; and so on and so forth.  The application has to know whether the database is at a particular version (which means I'll need a table in the database) so it knows whether to run this script.</p><p>Could someone provide me with some resources so I can figure out how to do what I need? Thank you</p>","406790","","","","","2010-07-30 14:04:49","Managing an Android database","<android><database><sqlite><listview>","1","0","1","",""
"3372380","1","","","2010-07-30 14:23:29","21","20460","<p>I have a mobile website and it has some HTML <code>input</code> elements in it, like this:</p><pre class=""lang-html prettyprint-override""><code>&lt;input type=""text"" name=""txtAccessoryCost"" size=""6"" /&gt;</code></pre><p>I have embedded the site into a <a href=""http://developer.android.com/reference/android/webkit/WebView.html""><code>WebView</code></a> for possible Android 2.1 consumption, so that it will also be an Android application.</p><p>Is it possible to get the keyboard with numbers instead of the default one with letters when this HTML <code>input</code> element is focused?</p><p>Or, is it possible to set it for the whole application (maybe something in <a href=""http://developer.android.com/guide/topics/manifest/manifest-intro.html"">the Manifest file</a>), if it is not feasible for an HTML element?</p>","239626","","578288","","2013-08-15 22:12:07","2013-11-01 00:10:13","How to force keyboard with numbers in mobile website in Android","<android><html><webview><keyboard><html-input>","3","0","7","",""
"3372385","1","9257014","","2010-07-30 14:24:01","2","1158","<p>I want to implement something like the Android Calendar week view, where you can move through the weeks -- or like the Talk app, where you can switch between conversations. In other words, I want to be able to <em>drag</em> the views, not just swipe them.</p><p>The only thing that I seem to be able to do is to switch views (with a sliding animation) <em>after</em> the swipe action. In the two examples I mentioned, the views are actually dragged, i.e. the animation shows while moving your finger on the screen.</p><p>I've been going through the Calendar source, but the classes involved are so huge, I can't make head nor tail of it.</p><p>Has anyone done something like this, or is there any (relatively concise) source available somewhere?</p><p>Cheers.</p>","279363","","","","","2012-02-13 07:37:56","ViewSwitcher dragging (cf. Calendar week view / Google Talk conversations)","<android><animation><view><swipe>","2","3","2","",""
"3372404","1","3376928","","2010-07-30 14:25:53","-1","1393","<p>I am brand new to developing for android and have hit something of a stumbling block that I cant seem to get around.</p><p>Using the NotePad example, I have created my own ContentProvider to serve up data from a database that I will eventually host on a webserver.  But that is lightyears away from where I am right now.</p><p>Just testing my ContentProvider has caused a bit of a headache that I cant solve.  For some reason, when the provider calls <code>SQLiteDatabase db = mOpenHelper.getWritableDatabase();</code> I get a null pointer exception.</p><p>Code Follows:</p><p>MainWindow.java</p><hr><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    /**     * Check for DB, if none, d/l from web server     */    Uri first_use = Rules.CONTENT_URI;    ContentResolver cr = getContentResolver();    Cursor c = cr.query(first_use, null, null, null, null);    if(c == null){        ContentProvider cp = new CoreRulesProvider();        if (cp.onCreate()) {            ContentValues values = new ContentValues();            values.put(Rules._ID, 1);            values.put(Rules.TERM, ""Player"");            values.put(Rules.TEXT, ""You, the person reading these rules, are a Player."");                cp.insert(Rules.CONTENT_URI, values);        }    }</code></pre><p>RulesContentProvider.java</p><hr><pre><code>package com.vortex.rules;import android.content.ContentProvider;import android.content.ContentUris;import android.content.ContentValues;import android.content.Context;import android.content.UriMatcher;import android.content.res.Resources;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteQueryBuilder;import android.net.Uri;import android.text.TextUtils;import android.util.Log;import java.util.HashMap;import com.vortex.rules.Rule.Rules;/** * Provides access to a database of rules.  Each rule has a TERM, the RULE itself, and a creation date and modified data. * @author Michael Martin * */public class CoreRulesProvider extends ContentProvider {    private static final String TAG = ""CoreRulesProvider"";    private static final String DATABASE_NAME = ""core_rules.db"";    private static final int DATABASE_VERSION = 2;    private static final String RULES_TABLE_NAME = ""rules"";    private static HashMap&lt;String, String&gt; sRulesProjectionMap;    private static HashMap&lt;String, String&gt; sLiveFolderProjectionMap;    private static final int RULES = 1;    private static final int RULE_ID = 2;    private static final int LIVE_FOLDER_RULES = 3;    private static final UriMatcher sUriMatcher;    /**     * This class helps open, create, and upgrade the database file.     */    private static class DatabaseHelper extends SQLiteOpenHelper {        DatabaseHelper(Context context) {            super(context, DATABASE_NAME, null, DATABASE_VERSION);        }        @Override        public void onCreate(SQLiteDatabase db) {            db.execSQL(""CREATE TABLE "" + RULES_TABLE_NAME + "" (""                    + Rules._ID + "" INTEGER PRIMARY KEY,""
                    + Rules.TERM + "" TEXT,""
                    + Rules.TEXT + "" LONGTEXT""                    + "");"");        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            Log.w(TAG, ""Upgrading database from version "" + oldVersion + "" to ""                    +newVersion + "", which will destroy all old data"");            db.execSQL(""DROP TABLE IF EXISTS rules"");            onCreate(db);        }    }    /**     * END OF DatabaseHelper CLASS!!!!!     */    private DatabaseHelper mOpenHelper;    @Override    public boolean onCreate() {        mOpenHelper = new DatabaseHelper(getContext());        return true;    }    @Override    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {        SQLiteQueryBuilder qb = new SQLiteQueryBuilder();        qb.setTables(RULES_TABLE_NAME);        switch (sUriMatcher.match(uri)) {        case RULES:            qb.setProjectionMap(sRulesProjectionMap);            break;        case RULE_ID:            qb.setProjectionMap(sLiveFolderProjectionMap);            qb.appendWhere(Rules._ID + ""="" + uri.getPathSegments().get(1));            break;        default:            throw new IllegalArgumentException(""Uknown URI "" + uri);        }        //If no sort order is specified, use the default        String orderBy;        if (TextUtils.isEmpty(sortOrder)) {orderBy = Rules.DEFAULT_SORT_ORDER;    } else {        orderBy = sortOrder;    }        //Get the database and run the query        SQLiteDatabase db = mOpenHelper.getReadableDatabase();        Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, orderBy);        //Tell the cursor what uri to watch, so it knows when its source data changes        c.setNotificationUri(getContext().getContentResolver(), uri);        return c;    }    @Override    public String getType(Uri uri) {        switch (sUriMatcher.match(uri)) {        case RULES:        case LIVE_FOLDER_RULES:            return Rules.CONTENT_TYPE;        case RULE_ID:            return Rules.CONTENT_ITEM_TYPE;        default:            throw new IllegalArgumentException(""Uknown URI "" + uri);        }    }    public Uri insert(Uri uri, ContentValues initialValues) {        //Validate the requested uri        if (sUriMatcher.match(uri) != RULES) {            throw new IllegalArgumentException(""Uknown URI "" + uri);        }        ContentValues values;        if (initialValues != null) {            values = new ContentValues(initialValues);        } else {            values = new ContentValues();        }        //Make sure that the fields are all set        if (values.containsKey(Rules.TERM) == false) {            Resources r = Resources.getSystem();            values.put(Rules.TERM, r.getString(android.R.string.untitled));        }        if (values.containsKey(Rules.TEXT) == false) {            values.put(Rules.TEXT, """");        }        SQLiteDatabase db = mOpenHelper.getWritableDatabase();        long rowId = db.insert(RULES_TABLE_NAME, Rules.TEXT, values);        if (rowId &gt; 0) {            Uri ruleUri = ContentUris.withAppendedId(Rules.CONTENT_URI, rowId);            getContext().getContentResolver().notifyChange(ruleUri, null);            return ruleUri;        }        throw new SQLException(""Failed to insert row into "" + uri);    }    public int delete(Uri uri, String where, String[] whereArgs) {        SQLiteDatabase db = mOpenHelper.getWritableDatabase();        int count;        switch (sUriMatcher.match(uri)) {        case RULES:            count = db.delete(RULES_TABLE_NAME, where, whereArgs);            break;        case RULE_ID:            String ruleId = uri.getPathSegments().get(1);            count = db.delete(RULES_TABLE_NAME, Rules._ID + ""="" + ruleId                    + (!TextUtils.isEmpty(where) ? "" AND ("" + where + ')' : """"),                    whereArgs);            break;        default:            throw new IllegalArgumentException(""Uknown URI "" + uri);        }        getContext().getContentResolver().notifyChange(uri, null);        return count;    }    @Override    public int update(Uri uri, ContentValues values, String where, String[] whereArgs) {        SQLiteDatabase db = mOpenHelper.getWritableDatabase();        int count;        switch (sUriMatcher.match(uri)) {        case RULES:            count = db.update(RULES_TABLE_NAME, values, where, whereArgs);            break;        case RULE_ID:            String ruleId = uri.getPathSegments().get(1);            count = db.update(RULES_TABLE_NAME, values, Rules._ID + ""="" + ruleId                    + (!TextUtils.isEmpty(where) ? "" AND ("" + where + ')' : """")                    , whereArgs);            break;        default:            throw new IllegalArgumentException(""Unknown URI "" + uri);        }        getContext().getContentResolver().notifyChange(uri, null);        return count;    }    static {        sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);        sUriMatcher.addURI(Rule.AUTHORITY, ""rules"", RULES);        sUriMatcher.addURI(Rule.AUTHORITY, ""rules/#"", RULE_ID);        sUriMatcher.addURI(Rule.AUTHORITY, ""live_folders/rules"", LIVE_FOLDER_RULES);        sRulesProjectionMap = new HashMap&lt;String, String&gt;();        sRulesProjectionMap.put(Rules._ID, Rules._ID);        sRulesProjectionMap.put(Rules.TERM, Rules.TERM);        sRulesProjectionMap.put(Rules.TEXT, Rules.TEXT);    }}</code></pre><p>Stack Trace</p><hr><p>07-30 10:22:19.078: ERROR/AndroidRuntime(10903): Uncaught handler: thread main exiting due to uncaught exception07-30 10:22:19.208: ERROR/AndroidRuntime(10903): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vortex.rules/com.vortex.rules.MainWindow}: java.lang.NullPointerException07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2444)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2460)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at android.app.ActivityThread.access$2300(ActivityThread.java:119)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1837)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at android.os.Handler.dispatchMessage(Handler.java:99)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at android.os.Looper.loop(Looper.java:123)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at android.app.ActivityThread.main(ActivityThread.java:4246)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at java.lang.reflect.Method.invokeNative(Native Method)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at java.lang.reflect.Method.invoke(Method.java:521)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at dalvik.system.NativeStart.main(Native Method)07-30 10:22:19.208: ERROR/AndroidRuntime(10903): Caused by: java.lang.NullPointerException07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at com.vortex.rules.CoreRulesProvider.insert(CoreRulesProvider.java:157)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at com.vortex.rules.MainWindow.onCreate(MainWindow.java:42)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2407)07-30 10:22:19.208: ERROR/AndroidRuntime(10903):     ... 11 more</p>","405246","","","","","2010-07-31 05:21:57","ContentProvider fails on insert","<android>","1","0","","",""
"3372406","1","3373273","","2010-07-30 14:26:03","0","497","<p>I'm doing an application on Android.</p><p>I have the content of a web (all the HTML) in a String, and i need extractall the text inside the paragraphs (p elements) with the class=""content"".</p><p>Example:</p><pre><code>&lt;p class=""content""&gt;La la la&lt;/p&gt;&lt;p class=""another""&gt;Le le le&lt;/p&gt;&lt;p class=""content""&gt;Li li li&lt;/p&gt;</code></pre><p>Result:</p><pre><code>La la laLi li li</code></pre><p>What is the best approach to do this?</p>","313409","","119895","","2010-07-30 14:39:00","2010-07-30 16:06:30","Extract portion of a webpage","<android>","2","0","","",""
"3372827","1","","","2010-07-30 15:14:19","6","2776","<p>Intents in Android are an elegant way to pass messages between uncoupled components, but what if you want to send extra data with the Intent? I know you can add various value types, and objects that implement Parcelable, as extras, but this doesn't really cater for sending user defined types locally (i.e. not over a remote interface). Any ideas?</p>","146588","","","","","2010-07-30 16:26:09","How to send custom data objects with Intents in Android?","<android>","3","0","2","",""
"3373289","1","3377049","","2010-07-30 16:07:58","1","574","<p>I don't quite understand what the IntentFilter does? Here is an example manifest:</p><pre><code>&lt;activity android:name=""SomeActivity"" android:label=""@string/app_name""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.MAIN"" /&gt;        &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>What does the <code>&lt;action&gt;</code> and <code>&lt;category&gt;</code> tags do? Say if I declare:</p><pre><code>&lt;activity android:name=""AnotherActivity"" android:label=""AnotherActivity""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.PICK"" /&gt;        &lt;action android:name=""android.intent.action.VIEW"" /&gt;        &lt;action android:name=""android.intent.action.INSERT"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>Does that even do anything if used in conjunction with an Intent object? Please help me understand an IntentFilter? </p>","200477","","","","","2010-07-31 06:09:38","What does an IntentFilter do?","<android><android-intent><intentfilter>","1","1","","",""
"3373342","1","3746125","","2010-07-30 16:12:54","3","746","<p>In the onCreate of an activity we are connecting to a remote system and downloading data. We display a cancellable ProgressDialog to the user all this time. Download is done using AsyncTask. In preExecute(), we show the dialog and in postExecute() we dismiss it.</p><p>Problem is that when the download is in progress and ProgressDialog on display, if the user presses the ""search"" button on the device, the ProgressDialog disappears. The background thread is still running.</p><p>What cause this behavior? How can this be avoided?</p><p>Please help.</p><p>thanks.</p>","236128","","2598","","2010-07-30 18:09:03","2010-09-19 14:38:45","ProgressDialog disappears when ""Search"" key on the phone is pressed","<android><progressdialog>","1","0","","",""
"3373536","1","3376203","","2010-07-30 16:36:38","2","4525","<p>Hi I want to create a splashscreen for an app, and have a gallery rotate several images on a timer. Can anyone show me how I could use a timer to animate the images in a Gallery?</p>","325081","","331052","","2010-07-30 17:09:01","2012-08-15 19:29:23","Using the Android Gallery as an automated slideshow","<java><android><timer><components><gallery>","1","0","1","",""
"3373627","1","","","2010-07-30 16:47:47","4","1112","<p>I'm trying to add a new library to the android platform, but when I run the ""repo status"" command, the folder in which my library is located does not show up as added.</p><p>If for example my library is called foo, I created a folder /external/foo and placed my library code in it.  This foo folder is not seen by the ""repo status"" command.  Is there some way I need to manually add it to the working tree?</p><p>Chris</p>","175280","","","","","2011-02-28 14:41:37","Android - Add new library to repo?","<android><git><repository>","1","0","","",""
"3373668","1","3373814","","2010-07-30 16:52:54","1","3051","<p>I'm new to android development and as a pet project I wanted to try and connect to an bluetooth device using the HID profile using an android phone.  The phone I'll be using is the vibrant and according to samsung it doesn't support the HID Profile ( <a href=""http://ars.samsung.com/customer/usa/jsp/faqs/faqs_view_us.jsp?SITE_ID=22&amp;PG_ID=2&amp;PROD_SUB_ID=557&amp;PROD_ID=560&amp;AT_ID=281257"" rel=""nofollow"">http://ars.samsung.com/customer/usa/jsp/faqs/faqs_view_us.jsp?SITE_ID=22&amp;PG_ID=2&amp;PROD_SUB_ID=557&amp;PROD_ID=560&amp;AT_ID=281257</a> ).  Now my question is this, where does this ""profile"" reside?  Is it on the hardware level or on the software level ( I assume the latter from other sources that I have read ).  And if it is the latter, can HID implementation be created using RFCOMM communication over bluetooth (this is the only seemingly viable method I can see in the android bluetooth API).</p><p>I just want to make sure I understand the technology before I try and implement something that may not be possible.</p><p>Thanks in advance.</p>","305682","","","","","2011-10-20 15:26:08","Where does the Bluetooth HID Profile reside?","<java><android><bluetooth><mobile-phones>","2","0","1","",""
"3373718","1","","","2010-07-30 16:58:20","3","2030","<p>I'm wondering if there's any way to merge two cursors together and then resort them.</p><p>I can easily merge two cursors together by using a MergedCursor, but that doesn't sort them.</p><p>I have two sets of contacts in two separate cursors (with totally different schemas) and I want to merge them and sort them by name (the name column is different in the two cursors).</p><p>Is this possible?</p><p>Thanks,</p><p>Tony</p>","215056","","","","","2011-01-15 00:45:12","Android: Sorting a merged cursor","<android><sorting><merge><cursor>","3","0","","",""
"3373774","1","","","2010-07-30 17:04:58","0","168","<p>I'm just wondering how the word parcel was chosen for the Android Parcel Project. I first saw the project in the Advanced Android Coders Cookbook and went onto google searching for Android Parcels, the top results shows the main problem with the name: Android has a class called Parcel.</p><p>I was just wondering why this was chosen in spite of this, and why not some robot related like Gear or Part. That would be similar to the the word Gem that was chosen for Ruby.</p>","99582","","19750","","2010-07-30 17:14:50","2011-04-09 00:51:57","Why did the Android Parcel Project choose the word Parcel?","<android>","1","0","","",""
"3373790","1","3373979","","2010-07-30 17:06:22","5","6585","<p>Whoa SDK, whoa...</p><p>So I'm attempting to add an ellipse to the end of my TextView (single line) before it runs off screen.  I've read that ellipses are broke (developing for 2.1)?  After Google searching, everyone seems to suggest setting inputType to text and maxLines to 1 and you will get an ellipse.</p><p>There are two problems with this:1) The text runs off the screen, but doesn't ellipse.  I can tell the text is running off the screen because only a half of a character is showing at the edge of the screen, but it's not printing ""..."" instead.2) When I have inputType set on my TextView, clicking my list item no longer works!  There is no highlighting when you click and the onListItemClick handler does not fire!</p><p>So...</p><p>What can I do here?</p><p>I would like to note that there are two ways one could ellipse.  If the entire word does not fit on the screen, hide the entire word and add an ellipse.  Or, just take off enough characters so an ellipse will fit.  Ideally, the latter is what I want.</p><p>Thanks for your help</p>","406790","","","","","2010-09-24 17:54:16","End the ellipse problem with TextViews","<android><textview><ellipse>","1","1","1","",""
"3373860","1","3374687","","2010-07-30 17:17:15","17","23924","<p>I am new to this site, and I come with a question about Android.</p><p>Is there any way to convert a Bitmap to grayscale? I know how to draw a grayscale bitmap (using canvas operations: <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg38890.html"">http://www.mail-archive.com/android-developers@googlegroups.com/msg38890.html</a>) but I really need The actual bitmap in gray colors (or at least something that could be converted to a bitmap later on).Do I have to implement it by hand (pixel by pixel operations)?</p><p>I've searched a lot, and still could not find. Anyone knows a easy/efficient way to do it?</p><p>Thanks a lot!</p>","367342","","","","","2013-12-11 15:54:47","Convert a Bitmap to GrayScale in Android","<android><image-processing><bitmap><grayscale>","3","1","10","",""
"3373876","1","","","2010-07-30 17:19:50","0","331","<p>I have an image selector that has the ""pressed"" state set to a particular drawable.  I want to give the user the opportunity to change this on the fly.  However, I have found no way to programmatically get and modify a selector.</p><p>Is this something that is not supported?</p>","242904","","242348","","2010-07-30 17:24:02","2013-01-11 11:54:01","Change selector on the fly?","<android>","2","0","","",""
"3373989","1","3374117","","2010-07-30 17:33:32","2","378","<p>I would like to pop-up an error from the appwidget when one of its background tasks fails, but I don't think that is permissible -- or if it works, that it is safe.</p>","157804","","27414","","2010-07-30 17:34:07","2010-07-30 19:31:33","Is Toast allowed from an Android appWidget?","<android><toast><appwidget>","1","0","1","",""
"3374061","1","3374149","","2010-07-30 17:42:25","5","6990","<p>My widget reads an image from /res/drawable/.  I would like to be able to change the image and write it back out to the /res/drawable/ structure.  Is this possible?</p>","242904","","","","","2010-07-30 17:54:16","Write to /res/drawable/ on the fly?","<android>","3","0","","",""
"3374159","1","6948470","","2010-07-30 17:56:00","1","850","<p>I have two AsyncTask Activities, whose sole responsibilties are to execute an AsyncTask on the UI Thread. One of them works great, displays the progressBar, and updates the ProgressBar message. This is for my SearchActivity, which is actually a search activity with the Google Search metadata for declaring a search activity. I created a clone of the AsyncTask, and only changed doInBackground code, and also clone the SearchActivity and called it browseActivity.</p><p>I start BrowseActivity for result in a class that extends listView when an item is clicked. What I intended to happen was for the onPreExecute code of the AsyncTask to display a progressBar as the SearchActivity does, between the ListView activity, and the ResultActivity that the ListView will start onActivityResult. The onPreExcute code is being called but the ProgressBar is never displayed. (I thought I ran it on the UI thread correctly?)</p><p>Here is BrowseActivity:</p><pre><code>AsyncTask&lt;String, String, ArrayList&lt;SearchResult&gt;&gt; browseTask;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Intent intent = getIntent();     String genreExtra = getIntent().getStringExtra(Genre.BUNDLE_TAG);        if(genreExtra!=null){            genre = Genre.getgenreFromExtra(genreExtra);        }        String categoryExtra = getIntent().getStringExtra(Category.BUNDLE_TAG);        if(categoryExtra!=null){            this.category = Category.getCategoryFromExtra(categoryExtra);        }        final Connector connector = GlobalVars.getCurrentConnector();        Thread browseThread = new Thread(){            @Override            public void run() {                try {                    browseTask = connector.browse(BrowseActivity.this, category, genre, 1);                    browseTask.execute("""");                } catch (InterruptedException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } catch (ExecutionException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }            };            runOnUiThread(browseThread);            ArrayList&lt;SearchResult&gt; result = null;            try {                result = browseTask.get();            } catch (InterruptedException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (ExecutionException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            Bundle queryBundle = new Bundle();            queryBundle.putSerializable(SERIALIZABLE_KEY, result);            Intent i = new Intent();            i.putExtra(BUNDLE_KEY, queryBundle); //Put in our browse results            i.putExtra(Category.BUNDLE_TAG, category.putExtra()); //put our category in return intent            i.putExtra(Genre.BUNDLE_TAG, genre.putExtra()); //put our genre in return intent            setResult(RESULT_OK, i);            finish();}</code></pre><p>Here is the CategoryActivity (extends ListActivity) activity where browseActivity is started:</p><pre><code>   @Override    protected void onListItemClick(ListView l, View v, final int position, long id) {        super.onListItemClick(l, v, position, id);        Intent i = new Intent(CategorySelectionView.this, BrowseActivity.class);        final Category[] categories = Category.values();        i.putExtra(Category.BUNDLE_TAG, categories[position].putExtra());        i.putExtra(Genre.BUNDLE_TAG, genre.putExtra());        CategorySelectionView.this.startActivityForResult(i, BrowseActivity.RESULT_REQUEST_CODE);    } // Listen for results.    protected void onActivityResult(int requestCode, int resultCode, Intent data){        // See which child activity is calling us back.        switch (requestCode) {            case BrowseActivity.RESULT_REQUEST_CODE:                // This is the standard resultCode that is sent back if the                // activity crashed or didn't doesn't supply an explicit result.                if (resultCode == RESULT_CANCELED){                }                 else {                    ArrayList&lt;SearchResult&gt; recentQueryResults = (ArrayList&lt;SearchResult&gt;)data.getBundleExtra(                            BrowseActivity.BUNDLE_KEY).getSerializable(BrowseActivity.SERIALIZABLE_KEY);                    GlobalVars.setRecentQueryResults(recentQueryResults);                    Category category = Category.getCategoryFromExtra(data.getStringExtra(Category.BUNDLE_TAG));                    Intent i = new Intent(CategorySelectionView.this, RomListView.class);                    i.putExtra(Category.BUNDLE_TAG, category.putExtra());                    i.putExtra(Genre.BUNDLE_TAG, genre.putExtra());                    startActivity(i);                }            default:                break;        }    }</code></pre>","325081","","2598","","2010-07-30 18:08:34","2011-08-04 21:02:09","AsyncTask not displaying onPreExecute","<java><android><multithreading><android-asynctask><ui-thread>","1","0","","",""
"3374228","1","","","2010-07-30 18:05:27","6","5926","<p>I have an array of all the URIs of the images which I am showing in a List.Now I want to run a thread in background which gets this images from web and store them on the SD card.So when I click a particular element in the list instead of fetching from web it should fetch from the SD card in the new activity.</p><p>How do I do this?</p>","355833","","119895","","2010-07-30 20:54:06","2012-12-16 17:33:27","Downloading images in background while showing the listview","<android><listview><image>","4","1","","",""
"3374307","1","","","2010-07-30 18:20:20","1","143","<p>I'm just getting started with android programming,playing with HelloWorld and Eclipse.</p><p>I'd like to know how to install my apps to my samsung Galaxy S</p>","407022","","","","","2010-07-30 18:43:31","newbie, Installing app to samsung phone","<android>","1","0","0","",""
"3374323","1","3374331","","2010-07-30 18:22:36","0","641","<p>This part of my code checks to see that when the user clicks on a contact, the contact actually has a phone number, otherwise a message is displayed and nothing else is done.</p><p>I am confused as to where my null pointer exception is coming from....</p><pre><code>Uri contactData = data.getData();     Cursor c =  managedQuery(contactData, null, null, null, null);     if (c.moveToFirst())      {       String stringName = c.getString(c.getColumnIndexOrThrow(People.NAME));       if(c.getColumnIndex(People.NUMBER)!= -1 )       {       stringNumber = c.getString(c.getColumnIndexOrThrow(People.NUMBER));       }        if((!stringNumber.equals(null)) &amp;&amp; (stringNumber.length() &gt;= 12))        {         name.setText(stringName);         number.setText(stringNumber);        }        else        {         Context context = getApplicationContext();         CharSequence text = ""That contact has an invalid phone number."";         int duration = Toast.LENGTH_SHORT;         Toast toast = Toast.makeText(context, text, duration);         toast.show();        }     }</code></pre><p>my error is ""failure delivering result RESULTINFO"" , and it also says it's a nullpointer exception error in this line:</p><pre><code>if((!stringNumber.equals(null)) &amp;&amp; (stringNumber.length() &gt;= 12))</code></pre><p>earlier in the code, I declare stringNumber to initialize to null. I thought that since the first part of the if evals to false, it wouldn't even check the second part (which is where I think the error is coming from).</p>","413394","","","","","2010-07-30 18:23:45","Null pointer exception when trying to check for a valid contact with a phone number","<android><null><pointers><contacts>","1","0","","",""
"3374363","1","4362161","","2010-07-30 18:29:18","1","579","<p>I received the following error when attempting to switch between a ProgressBar and an Image using a viewSwitcher:</p><pre><code>07-30 18:08:00.627: ERROR/AndroidRuntime(307): Caused by: java.lang.NullPointerException07-30 18:08:00.627: ERROR/AndroidRuntime(307):     at android.view.ViewGroup.addView(ViewGroup.java:1815)07-30 18:08:00.627: ERROR/AndroidRuntime(307):     at android.view.ViewGroup.addView(ViewGroup.java:1802)07-30 18:08:00.627: ERROR/AndroidRuntime(307):     at com.romcessed.romsearch.activities.RomDetailActivity$LoadImageViewsTask.intializeSwitchers(RomDetailActivity.java:161)</code></pre><p>Here is the code that caused the error:</p><pre><code>//Place indeterminate progress bars for our ImageViews until computation is completeswitcherTask = new LoadImageViewsTask();switcherTask.intializeSwitchers();switcherTask.execute((Void) null);......void intializeSwitchers(){    captchaSwitcher = new ViewSwitcher(RomDetailActivity.this);    gallerySwitcher = new ViewSwitcher(RomDetailActivity.this);    /*Line that caused error */     captchaSwitcher.addView((ProgressBar)findViewById(R.layout.indeter));    /*                       */    gallerySwitcher.addView(findViewById(R.layout.indeter));    captchaSwitcher.addView(iv_Captcha);    gallerySwitcher.addView(gal_Screenshots);}</code></pre><p>Here is indeter.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;ProgressBar        xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/progressbar""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_centerVertical=""true"" /&gt;</code></pre>","325081","","1583","","2010-07-31 21:13:41","2010-12-06 00:10:27","Switching between indeterminate ProgressBar and Image in ViewSwitcher","<java><android><xml><components>","1","0","","",""
"3374367","1","","","2010-07-30 18:29:51","0","461","<p>The default Contacts app in Android has a very handy Quick Action menu when you tap on user's icon.</p><p>I would like to know whether anyone has been able to attach their own app to this menu and if so how they did it.</p><p>I would like to avoid writing my own contacts app just to provide a feature.</p>","407029","","","","","2010-11-29 22:34:27","Attach my app's icon to default Contacts app's Quick Action menu","<android>","1","0","2","",""
"3374683","1","","","2010-07-30 19:21:49","2","2115","<p>Like the title says, I am thinking about developing my own browser for Android devices.</p><p><strong>My first thought is to know what kind of possibilities I have, before I begin creating my software architecture. Are there any (open?) Browser Engines you could include into your library and reuse them?</strong><em>(There are some unknown browsers in the Android Market and I can't imagine they implemented the parsing).</em></p><p>Furthermore: If there IS something like I've described before, is it possible to modify (or ""fine tune"") the render methods? This is one of the most interesting points I guess.</p><p>And to end this question and catch the else-case: What would be the alternative way to begin?[I guess this is not only interesting to know for mobile developers, also for desktop software developers]</p><p><strong>Abbreviated version of this question: I want to develop my own Android Browser. How to begin?</strong></p><p>Hoping for a booming discussion round.</p><p>Chris</p>","149690","","","","","2011-06-30 10:42:06","How to develop an own browser for Android? How to parse HTML, JS & Co.?","<android><parsing><browser><mobile><w3c>","2","0","","",""
"3374794","1","3374926","","2010-07-30 19:37:42","0","308","<p>I have a <code>ListActivity</code> whose layout looks like</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;  &lt;ListView android:id=""@android:id/list"" android:cacheColorHint=""@color/transparent"" style=""@style/FullWidth.NoteList"" /&gt;  &lt;LinearLayout android:id=""@android:id/empty"" style=""@style/FillParent""&gt;    &lt;ImageView style=""@style/NoNotesImage"" /&gt;    &lt;TextView android:text=""@string/no_notes"" style=""@style/Shadowed.NoNotesText"" /&gt;    &lt;Button android:id=""@+id/note_add"" android:text=""@string/note_add"" style=""@style/Shadowed.Button.Blue""/&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>The styles relevant here.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;style name=""Shadowed""&gt;  &lt;item name=""android:shadowDx""&gt;1.1&lt;/item&gt;  &lt;item name=""android:shadowDy""&gt;1.1&lt;/item&gt;  &lt;item name=""android:shadowRadius""&gt;1.1&lt;/item&gt;&lt;/style&gt;&lt;style name=""NoNotesImage""&gt;  &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;  &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;  &lt;item name=""android:gravity""&gt;center&lt;/item&gt;  &lt;item name=""android:layout_marginTop""&gt;80.5dip&lt;/item&gt;  &lt;item name=""android:layout_marginLeft""&gt;20dip&lt;/item&gt;  &lt;item name=""android:src""&gt;@drawable/bg_no_notes&lt;/item&gt;&lt;/style&gt;&lt;style name=""Shadowed.NoNotesText""&gt;  &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;  &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;  &lt;item name=""android:gravity""&gt;center&lt;/item&gt;  &lt;item name=""android:textSize""&gt;10sp&lt;/item&gt;  &lt;item name=""android:textColor""&gt;@color/no_notes_text&lt;/item&gt;  &lt;item name=""android:shadowColor""&gt;@color/no_notes_shadow&lt;/item&gt;&lt;/style&gt;&lt;style name=""FillParent""&gt;  &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;  &lt;item name=""android:layout_height""&gt;fill_parent&lt;/item&gt;&lt;/style&gt;</code></pre><p>However, my empty list view consist only of the <code>ImageView</code> listed first inside the nested <code>LinearLayout</code>.</p><p>This seems like a reasonable thing to do but I don't completely understand Android's layout rules yet.</p>","1357024","","1357024","","2010-07-30 20:01:39","2010-07-30 20:01:39","Is it possible to use a ViewGroup for Empty ListView?","<android><listview><layout>","1","2","","",""
"3375166","1","3397649","","2010-07-30 20:31:54","12","23621","<p>I am presently using the following piece of code to load in images as drawable objects form a URL.</p><pre><code>Drawable drawable_from_url(String url, String src_name) throws java.net.MalformedURLException, java.io.IOException {        return Drawable.createFromStream(((java.io.InputStream)new java.net.URL(url).getContent()), src_name);    }</code></pre><p>This code works exactly as wanted, but there appears to be compatibility problems with it. In version 1.5, it throws a FileNotFoundException when I give it a URL. In 2.2, given the exact same URL, it works fine. The following URL is an sample input I am giving this function.</p><pre><code>http://bks6.books.google.com/books?id=aH7BPTrwNXUC&amp;printsec=frontcover&amp;img=1&amp;zoom=5&amp;edge=curl&amp;sig=ACfU3U2aQRnAX2o2ny2xFC1GmVn22almpg</code></pre><p>How would I load in images in a way that is compatible across the board from a URL?</p>","122105","","181336","","2013-10-14 11:15:27","2014-03-12 11:26:35","Android Drawable Images from URL","<android><url><image><drawable>","5","0","8","",""
"3375296","1","3392749","","2010-07-30 20:54:35","13","4995","<p>I'm working on an app right now which uses subclassed <code>ImageView</code> to show an image with a bounding box over part of it.</p><p>Right now the box is drawn in yellow no matter what, but I think it would look a lot better if the color matched the system's button pressed color, such as orange for the Droid, green for the Evo, or blue for the Galaxy S.</p><p>I looked around the APIs a bit, but couldn't find how to programmatically nab that color.Any ideas?</p>","382441","","119895","","2010-07-30 21:11:14","2013-05-29 08:52:02","Programmatically get theme colors","<android>","4","1","2","",""
"3375364","1","","","2010-07-30 21:07:53","2","1749","<p>I have problem when i try to read a .key file. This file is created by a normal java (J2SE) and i read it from android application. When i read this file from android it gives me nothing and i have done some debugging and i noticed that it can't read the file. Also i have checked if i can read the file (using <code>file.canRead())</code> and it appears that i can't. Notice that i created normal java application (J2SE) with the same code and it worked successfully.</p><p>The code I have used is this:</p><pre><code>    public KeyPair LoadKeyPair(String algorithm, String publicFileName, String privateFileName) {    // Read Public Key.    PublicKey publicKey = null;    PrivateKey privateKey = null;    try {    File filePublicKey = new File(publicFileName);    FileInputStream fis = new FileInputStream(publicFileName); // The program stops here    byte[] encodedPublicKey = new byte[(int) filePublicKey.length()];    fis.read(encodedPublicKey);    fis.close();// Read Private Key.File filePrivateKey = new File(privateFileName);fis = new FileInputStream(privateFileName);byte[] encodedPrivateKey = new byte[(int) filePrivateKey.length()];fis.read(encodedPrivateKey);fis.close();// Generate KeyPair.KeyFactory keyFactory = KeyFactory.getInstance(algorithm);X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(encodedPublicKey);publicKey = keyFactory.generatePublic(publicKeySpec);PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(encodedPrivateKey);privateKey = keyFactory.generatePrivate(privateKeySpec);} catch (FileNotFoundException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (NoSuchAlgorithmException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (InvalidKeySpecException e) {// TODO Auto-generated catch blocke.printStackTrace();}return new KeyPair(publicKey, privateKey);}</code></pre>","377376","","119895","","2010-07-30 21:18:30","2012-02-18 14:45:37","reading .key file android","<android><file>","2","2","","",""
"3375414","1","","","2010-07-30 21:16:35","0","479","<p>I am having a real hard time on putting my activities in tabs. I have an activity that parses an XML file and puts them on a list, and it works perfectly on its own. When I call it on a tab however it does not work (i get the dreaded ""Sorry! blah blah.. has stopped unexpectedly"" prompt... BTW yes I did the manifest). </p><p>I have migrated the activities to work as one activity, voila! it worked!!! However this is not the way we wanted to go with this project - WE REALLY NEED to have separate activities.</p><p>So as many people had found out that tabs and activities doesn't work well together is there a way to work around it? Some sort of emulsifier maybe?  </p><p>Here is the code:</p><p>import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.widget.TabHost;import android.widget.Toast;</p><p>public class TabDemo extends Activity{</p><pre><code>/** data members go here*/public void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    try {        TabHost tabs= (TabHost)findViewById(R.id.tabhost);        tabs.setup();        Intent callResultHits = new Intent(this, my.tabebd.layout.ResultHits.class);        TabHost.TabSpec spec = tabs.newTabSpec(""tag1"");        spec.setContent(callResultHits);        spec.setIndicator(""Result"",   getResources().getDrawable(R.drawable.ic_tab_search_result) );        tabs.addTab(spec);        spec = tabs.newTabSpec(""tag2"");        spec.setContent(R.id.tab2);        spec.setIndicator(""Details"",getResources().                             getDrawable(R.drawable.ic_tab_details));        tabs.addTab(spec);        tabs.setCurrentTabByTag(""tag1"");    } catch (Throwable t) {        // TODO Auto-generated catch block        Toast.makeText(this, ""Exception: "" + t.toString(), 50000).show();    }}</code></pre><p>here is one of the activities...</p><pre><code>public class ResultHits extends Activity implements OnItemClickListener {ListView listView_titles;ArrayList&lt;String&gt; items = new ArrayList&lt;String&gt;();String [] test = {""1"", ""2"",""3""};    @Override    public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);    listView_titles = (ListView)findViewById(R.id.list);    listView_titles.setAdapter(new ArrayAdapter&lt;String&gt;    (this,R.layout.row, R.id.row_text,test));}</code></pre><p>}</p><p>I omitted the xml parsing part... if this basic list can be shown inside the tab then it will be perfect. TY in advance</p><p>BTW setcurrenttabByTag was previously setCurrenttab(2)..actualy i did these values 0,1, 2, 3 just in case  ;)</p>","404662","","404662","","2010-08-02 14:01:17","2010-08-02 14:01:17","If Tabs and Activities don't go together..Is there a way to cheat?","<android><tabs><activity><android-tabhost>","1","0","","",""
"3375434","1","","","2010-07-30 21:21:03","0","2775","<p>I'm calling this tasks:</p><pre><code>TimerTask taskA = new ThreadA(this);TimerTask taskB = new ThreadB(this);tasks.add(taskA);tasks.add(taskB);timer.schedule(taskA, 10000);timer.schedule(taskB, 5000);</code></pre><p>And here are the two TimerTasks:</p><pre><code>public class ThreadA extends TimerTask {    private Ghost ghost;    public GhostThread(Ghost ghost) {        this.ghost = ghost;    }    @Override    public void run() {        ghost.stopBeingDeadAndBeAwesomeAgain();    }}public class ThreadB extends TimerTask {    private Ghost ghost;    public WarnThread(Ghost ghost) {        this.ghost = ghost;    }    @Override    public void run() {       ghost.beDeadAgain();    }}</code></pre><p>As you can see, I just call a method after 5 resp. 10 seconds. From time to time I would like to pause the ""countdown"". This means i want that the time until the 5 seconds are passed isn't running anymore. And then in a later point in time, I would like to resume it.</p><p>How can I achieve that??</p>","","anon","","","","2010-07-30 22:36:20","Is there any possibility to pause&resume a TimerTask in Android?","<java><android><timer>","1","0","","",""
"3375561","1","15251956","","2010-07-30 21:42:03","7","1640","<p>When I start the SMS application using the following methods -- everything works fine up until the point where the message is sent. When I send the message -- it never navigates back to the original activity unless I press the back button. How can I start the SMS activity and then once the message is sent have the parent activity showed again?</p><p>This is how I call the SMS app with result.</p><pre><code>String message = getMessageString();    Intent sendIntent = new Intent(Intent.ACTION_SENDTO);    sendIntent.setData(Uri.parse(""sms:"" + number));    sendIntent.putExtra(""sms_body"", message);    startActivityForResult(sendIntent, INVITE_COMPLETED);</code></pre>","354247","","1104926","","2011-12-19 13:43:06","2013-03-06 15:53:31","Return to Activity after action completed in Android?","<android><sms>","3","0","","",""
"3375615","1","3375692","","2010-07-30 21:51:00","0","402","<p>I have used SearchManager and it provides search key only when app is launched. Is there a way to put a text box on the home screen/wallpaper and invoke activity when user presses enter?</p>","229106","","","","","2010-07-30 22:03:41","Search Box on Home Screen","<android><search><android-searchmanager>","1","0","","",""
"3375620","1","","","2010-07-30 21:51:24","0","3449","<p>Developing my first app for android.  Works OK on emulator, but on phone I get a <code>""Source not found error""   ViewRoot.handleMessage(Message)line:1757</code>.  I get the error when I press button number 4 on the application and try to display my media images on phone.</p><p>Code:</p><pre><code>package com.example.famiily_connect_v1;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;public class family_connect extends Activity implements OnClickListener {    /** Called when the activity is first created. */    Button incrementButton, decrementButton, makecallButton,            media_cameraButton;    TextView numberdisplayTextView;    EditText inputEditText;    int A = 0;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        incrementButton = (Button) findViewById(R.id.Button01);        decrementButton = (Button) findViewById(R.id.Button02);        makecallButton = (Button) findViewById(R.id.Button03);        media_cameraButton = (Button) findViewById(R.id.Button04);        numberdisplayTextView = (TextView) findViewById(R.id.TextView01);        inputEditText = (EditText) findViewById(R.id.EditText01);        incrementButton.setOnClickListener(this);        decrementButton.setOnClickListener(this);        makecallButton.setOnClickListener(this);        media_cameraButton.setOnClickListener(this);        numberdisplayTextView.setOnClickListener(this);        inputEditText.setOnClickListener(this);    }    @Override    public void onClick(View arg0) {        switch (arg0.getId()) {        case R.id.Button01:            A++;            numberdisplayTextView.setText(String.valueOf(A));            break;        case R.id.Button02:            A--;            numberdisplayTextView.setText(String.valueOf(A));            break;        case R.id.Button03:            break;        case R.id.Button04:            Intent myIntent = new Intent();            myIntent.setAction(Intent.ACTION_VIEW);          myIntent.setData(android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);            startActivity(myIntent);            break;        default:            break;        }    }}</code></pre><p>XML</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:background=""#00AAAA""&gt;    &lt;TextView android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:text=""@string/hello"" /&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout01""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/LinearLayout&gt;    &lt;Button android:id=""@+id/Button01"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""increment""&gt;&lt;/Button&gt;    &lt;Button android:id=""@+id/Button02"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""decrement""&gt;&lt;/Button&gt;    &lt;Button android:id=""@+id/Button03"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""make call""&gt;&lt;/Button&gt;    &lt;Button android:id=""@+id/Button04"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""media_camera""&gt;&lt;/Button&gt;    &lt;TextView android:id=""@+id/TextView01"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:textSize=""24sp""        android:text=""0"" android:textStyle=""bold"" android:textColor=""#000000""&gt;&lt;/TextView&gt;    &lt;EditText android:id=""@+id/EditText01"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""enter new button text""&gt;&lt;/EditText&gt;    &lt;RadioButton android:id=""@+id/RadioButton01""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:text=""camera""&gt;&lt;/RadioButton&gt;&lt;/LinearLayout&gt;</code></pre>","407136","","1076164","","2011-12-22 14:51:25","2011-12-22 14:51:25","""Source not found"" error in Eclipse","<android><eclipse>","1","0","","",""
"3375700","1","3469577","","2010-07-30 22:04:52","4","1808","<p>I am trying to create a dynamic body that orbits around a static body in Box2D.I have a zero-gravity world, and a <code>DistanceJoint</code> that connects the two bodies. I have removed all friction and damping from the bodies and the joint, and am applying an initial linear velocity to the dynamic body. The result is that the body starts orbiting, but its velocity diminishes over time - which I do not expect in a zero gravity environment without friction.</p><p>Am I doing something wrong? Should the linear velocity be recreated at each step, or can I delegate this work to Box2D?</p><p>Here is the relevant code:</p><pre><code>// positions of both bodiesVector2 planetPosition = new Vector2(x1 / Physics.RATIO, y1 / Physics.RATIO);Vector2 satellitePosition = new Vector2(x2 / Physics.RATIO, y2 / Physics.RATIO);// creating static bodyBodyDef planetBodyDef = new BodyDef();planetBodyDef.type = BodyType.StaticBody;planetBodyDef.position.set(planetPosition);planetBodyDef.angularDamping = 0;planetBodyDef.linearDamping = 0;planetBody = _world.createBody(planetBodyDef);CircleShape planetShapeDef = new CircleShape();planetShapeDef.setRadius(40);FixtureDef planetFixtureDef = new FixtureDef();planetFixtureDef.shape = planetShapeDef;planetFixtureDef.density = 0.7f;planetFixtureDef.friction = 0;planetBody.createFixture(planetFixtureDef);// creating dynamic bodyBodyDef satelliteBodyDef = new BodyDef();satelliteBodyDef.type = BodyType.DynamicBody;satelliteBodyDef.position.set(satellitePosition);satelliteBodyDef.linearDamping = 0;satelliteBodyDef.angularDamping = 0;satelliteBody = _world.createBody(satelliteBodyDef);CircleShape satelliteShapeDef = new CircleShape();satelliteShapeDef.setRadius(10);FixtureDef satelliteFixtureDef = new FixtureDef();satelliteFixtureDef.shape = satelliteShapeDef;satelliteFixtureDef.density = 0.7f;satelliteFixtureDef.friction = 0;satelliteBody.createFixture(satelliteFixtureDef);// create DistanceJoint between bodiesDistanceJointDef jointDef = new DistanceJointDef();        jointDef.initialize(satelliteBody, planetBody, satellitePosition, planetPosition);jointDef.collideConnected = false;jointDef.dampingRatio = 0;_world.createJoint(jointDef);// set initial velocitysatelliteBody.setLinearVelocity(new Vector2(0, 30.0f)); // orthogonal to the joint</code></pre>","25427","","25427","","2010-07-30 22:22:14","2011-10-04 13:35:23","Diminishing speed in zero gravity box2d world","<android><physics><box2d><rokon>","2","0","","",""
"3375885","1","3375900","","2010-07-30 22:41:37","0","693","<p>i'm trying to get a query that returns rows only with a specified name, and sort descending by week (integer).</p><p>Everytime I try and run it it gives me a FC and logcat says </p><p>ERROR/AndroidRuntime(728): android.database.sqlite.SQLiteException: no such column: New: , while compiling: SELECT Name, Week, Total FROM notes WHERE Name=New ORDER BY WeekDESC LIMIT 10</p><pre><code>    public Cursor graphQuery(String name){    return mDb.query(DATABASE_TABLE, new String[] {KEY_NAME,            KEY_WEEK, KEY_TOTAL}, KEY_NAME + ""="" + name, null, null, null, KEY_WEEK + ""DESC"",""10"");}</code></pre><p>It says that there is no such column, which doesn't make sense because it should be looking at the names in the row and returning the ones that match. Also if I put KEY_NAME + ""="" + name as null, it says that there is no such column WeekDESC which doesn't make sense either cause it is just supposed to be sorting by an integer.</p><p>I have gotten this code working before, but I misplaced it and can't seem to get it working again... This is getting frustrating, any help is very much appreciated!</p>","394093","","","","","2010-07-30 22:44:43","SQLITE Selection and order by causing errors","<android><sqlite>","1","0","","",""
"3375967","1","4503792","","2010-07-30 23:01:53","1","5263","<p>I was informed in a later answer that I have to add the GestureOverlayView I create in code to my view hierarchy, and I am not 100% how to do that.  Below is the original question for completeness.</p><p>I want my game to be able to recognize gestures.  I have this nice SurfaceView class that I do an onDraw to draw my sprites, and I have a thread thats running it to call the onDraw etc .</p><p>This all works great.</p><p>I am trying to add the GestureOverlayView to this and it just isn't working.  Finally hacked to where it doesn't crash but this is what i have</p><pre><code>public class Panel extends SurfaceView implements SurfaceHolder.Callback,         OnGesturePerformedListener  { public Panel(Context context){    theContext=context;    mLibrary = GestureLibraries.fromRawResource(context, R.raw.myspells);    GestureOverlayView gestures = new GestureOverlayView(theContext);           gestures.setOrientation(gestures.ORIENTATION_VERTICAL);    gestures.setEventsInterceptionEnabled(true);    gestures.setGestureStrokeType(gestures.GESTURE_STROKE_TYPE_MULTIPLE);    gestures.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,            LayoutParams.FILL_PARENT));    //GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures);    gestures.addOnGesturePerformedListener(this); } ... ... onDraw...surfaceCreated(..);......public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {  ArrayList&lt;Prediction&gt; predictions = mLibrary.recognize(gesture);  // We want at least one prediction  if (predictions.size() &gt; 0) {   Prediction prediction = predictions.get(0);   // We want at least some confidence in the result   if (prediction.score &gt; 1.0) {    // Show the spell         Toast.makeText(theContext, prediction.name, Toast.LENGTH_SHORT).show();   }  } }}</code></pre><p>The onGesturePerformed is never called.  Their example has the GestureOverlay in the xml, I am not using that, my activity is simple:</p><pre><code>   @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    Panel p = new Panel(this);    setContentView(p);}</code></pre><p>So I am at a bit of a loss of the missing piece of information here, it doesn't call the onGesturePerformed and the nice pretty yellow  ""you are drawing a gesture"" never shows up.</p>","327258","","327258","","2010-08-01 02:51:39","2012-12-06 12:09:14","Adding GestureOverlayView to my SurfaceView class, how to add to view hierarchy?","<android><gesture><surfaceview>","4","0","6","",""
"3376013","1","3376058","","2010-07-30 23:14:30","0","2458","<p>I am using Eclipse and created HelloWorld and it works fine using emulator.Then I tried to create ToDoList app where you can enter text and click to submit, following the example on the book I have and getting an error that cause my app to force close when I interact with the application.</p><p>my directory structure: (please ignore other folders)</p><pre><code>ProjectToDoList   |   |-----src   |      |----com.test.dotolist   |                          |------ToDoList.java   |                          |------ToDoListItemView.java   ------res          |          |----layout                 |-------main.xml                 |-------todolist_item.xml</code></pre><p>I tracked where it is happening:</p><p>If I just use default layout in ToDoList.java like:</p><pre><code> final ArrayList&lt;String&gt; todoItems = new ArrayList&lt;String&gt;(); final ArrayAdapter&lt;String&gt; aa; aa = new ArrayAdapter&lt;String&gt;(this,             android.R.layout.simple_expandable_list_item_1, todoItems);</code></pre><p>The app works fine. I can type in text and click a button for the text to show up.</p><p>But I'm trying to use my custom layout:</p><p>ToDoList.java, </p><pre><code>        final ArrayList&lt;String&gt; todoItems = new ArrayList&lt;String&gt;();        int resID = R.layout.todolist_item;        //create array adopter to bind the array to the listview        final ArrayAdapter&lt;String&gt; aa;        aa = new ArrayAdapter&lt;String&gt;(this, resID, todoItems);        //bind the array adapter to the listview        myListView.setAdapter(aa);</code></pre><p>As you can see when I try to pass resID to ArrayAdapter, it compile and my app shows up on the emulator. But when I click submit button, it force to close.</p><p>todoList_item.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.test.todolist.ToDoListItemView    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10dp""    android:scrollbars=""vertical""    android:textColor=""@color/notepad_text""    android:fadingEdge=""vertical""    /&gt;</code></pre><p>The logcat output: (I can't figure out what's wrong)</p><pre><code>W/KeyCharacterMap(  279): Using default keymap: /system/usr/keychars/qwerty.kcm.binD/AndroidRuntime(  279): Shutting down VMW/dalvikvm(  279): threadid=1: thread exiting with uncaught exception (group=0x4001d800)E/AndroidRuntime(  279): FATAL EXCEPTION: mainE/AndroidRuntime(  279): android.view.InflateException: Binary XML file line #2: Error inflating class com.test.todolist.ToDoListItemViewE/AndroidRuntime(  279):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)E/AndroidRuntime(  279):    at android.view.LayoutInflater.inflate(LayoutInflater.java:385)E/AndroidRuntime(  279):    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)E/AndroidRuntime(  279):    at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:332)E/AndroidRuntime(  279):    at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)E/AndroidRuntime(  279):    at android.widget.AbsListView.obtainView(AbsListView.java:1315)E/AndroidRuntime(  279):    at android.widget.ListView.measureHeightOfChildren(ListView.java:1198)E/AndroidRuntime(  279):    at android.widget.ListView.onMeasure(ListView.java:1109)E/AndroidRuntime(  279):    at android.view.View.measure(View.java:8171)E/AndroidRuntime(  279):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)E/AndroidRuntime(  279):    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)E/AndroidRuntime(  279):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)E/AndroidRuntime(  279):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)E/AndroidRuntime(  279):    at android.view.View.measure(View.java:8171)E/AndroidRuntime(  279):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)E/AndroidRuntime(  279):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)E/AndroidRuntime(  279):    at android.view.View.measure(View.java:8171)E/AndroidRuntime(  279):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:526)E/AndroidRuntime(  279):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)E/AndroidRuntime(  279):    at android.view.View.measure(View.java:8171)E/AndroidRuntime(  279):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)E/AndroidRuntime(  279):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)E/AndroidRuntime(  279):    at android.view.View.measure(View.java:8171)E/AndroidRuntime(  279):    at android.view.ViewRoot.performTraversals(ViewRoot.java:801)E/AndroidRuntime(  279):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)E/AndroidRuntime(  279):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  279):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  279):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(  279):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  279):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  279):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(  279):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(  279):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  279): Caused by: java.lang.ClassNotFoundException: com.test.todolist.ToDoListItemView in loader dalvik.system.PathClassLoader[/data/app/com.test.dotolist-1.apk]E/AndroidRuntime(  279):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)E/AndroidRuntime(  279):    at java.lang.ClassLoader.loadClass(ClassLoader.java:573)E/AndroidRuntime(  279):    at java.lang.ClassLoader.loadClass(ClassLoader.java:532)E/AndroidRuntime(  279):    at android.view.LayoutInflater.createView(LayoutInflater.java:466)E/AndroidRuntime(  279):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)E/AndroidRuntime(  279):    ... 32 moreW/ActivityManager(   66):   Force finishing activity com.test.dotolist/.ToDoList</code></pre><p>Please let me know if you need clarification.</p>","355044","","","","","2010-07-30 23:26:07","android - Using custom layout throws InflateException causing app to force close","<android><layout>","1","2","","",""
"3376122","1","","","2010-07-30 23:45:20","5","1608","<p>I have a TextView that displays text that changes and run time. I want to use the View.getLineCount() method to see how many lines the TextView takes up and do different functions accordingly. The problem is I need to determine the number of lines the TextView takes up in the same method that needs to know how many line it takes up. I have tried calling View.invalidate() in between the two calls but that hasn't seemed to fix anything. I would like to measure the number of lines without rendering the view if possible but if I have to render it I would be open to doing that as well. Let me know if this is not specific enough and I will try to be more specific. Thanks! </p>","395256","","","","","2012-02-25 04:59:48","Android: Measure Size of View before rendering","<android><view><measure>","1","0","","",""
"3376166","1","3376472","","2010-07-30 23:57:47","1","889","<p>I have a Website, which is built upon a CMS, written in PHP. And now i'm trying to develop an App. I want the app to check for Updates on the website every time it starts, for example, if a new article is added to the website, a news about this publishment should be displayed on the app. </p><p>My knowledge in this area is very poor. Can somebody tell me, what i should do on the website and what should be done on the app?</p>","353857","","225647","","2010-07-30 23:58:46","2011-03-16 21:15:11","How to check updates on a website from an app?","<android><check>","2","0","1","",""
"3376194","1","3376730","","2010-07-31 00:04:50","2","205","<p>I consider myself an Android developer, after having created four apps and learned a lot by creating them. Now I've begun my venture into the iPhone app development world, and I don't remember the Android learning curve being this extreme. It doesn't help, though, that I was very familiar with Java and Eclipse whereas I hardly even know how to use OS X.</p><p>I learn fast and I know exactly what I want to make, I just need the means to get there. I'm really floundering with Xcode and the new project templates (of which there are several, and I hardly know what they mean). I know there are many books and things out there for starting from scratch but I feel like my Android knowledge should count for something.</p><p><strong>Is there a good resource for learning the basics of iPhone development, given that I am quite familiar with the Android platform?</strong> I'm looking for anything that converts Android knowledge to iPhone knowledge; a table of UI element names in each platform, or of concept equivalents, or a compare/contrast of the frameworks involved, or anything that will increase the rate of learning given that I know the Android platform already.</p>","47493","","","","","2010-07-31 05:24:28","Is there a guide on learning iPhone development from the perspective of an Android developer?","<iphone><android>","2","0","1","",""
"3376273","1","4432860","","2010-07-31 00:31:25","1","790","<p>I've defined my preferences in an xml file, preferences.xml. I've also got a SettingsWindow class which extends PreferenceActivity. I've set the android:defaultValue attribute on my preferences in the xml file but they don't appear the first time the app is launched. How do I load the default values defined in the xml file into the SettingsWindow the first time the activity is launched?</p>","124538","","","","","2010-12-13 19:48:44","How to display defaultValues the first time a PreferenceActivity is started?","<android><preferences><android-preferences><preferenceactivity>","1","1","","",""
"3376322","1","3379882","","2010-07-31 00:53:16","4","3957","<p>I am trying to create a simple 3-D app for android that will have an additional view layered on top of the OpenGL view (much like the SurfaceViewOverlay example in the API demos). I'm running into an issue trying to implement that method with an extended GLSurfaceView class. I've set up an example where I'm trying to do a combination of <a href=""http://www.droidnova.com/android-3d-game-tutorial-part-i,312.html"" rel=""nofollow"">this demo</a> with the API Oerlay demo. If I try to cast to a Martin's VortexView object like this (replace lines 44-46 in the API demo)</p><pre><code>VortexView glSurfaceView=     (VortexView) findViewById(R.id.glsurfaceview);</code></pre><p>I get a ClassCastException error (which is understandable, as I assume casting is fairly specific) so I guess I'm looking for a method to transfer the view from a GLSurfaceView instance to a new subclass or a way to set the rendering surface to an XML defined view for a subclass after it has been created.</p><p>EDIT:I've made some progress trying to get this to work-in the API example the view XML uses(from ApiDemos/res/layout/surface_view_overlay.xml)</p><pre><code>        &lt;android.opengl.GLSurfaceView android:id=""@+id/glsurfaceview""            android:layout_width=""match_parent""            android:layout_height=""match_parent"" /&gt;</code></pre><p>If I change that element to a<br>    com.domain.project.VortexView it will do the casting correctly with the above code but generates Null Pointer Exceptions when it hits the surfaceCreated and surfaceChanged routines (I think it's the called methods in the GLThread class based on the line number) inside the GLSurfaceView class. So maybe I should change the question- How can I implement an extension for GLSurfaceView without generating NullPointerExceptions on surfaceCreated and surfaceChanged, or how can I debug them without having the source for GLSurfaceView.java?</p>","407234","","44729","","2010-08-02 00:51:22","2010-08-02 00:51:22","Android OpenGL extending GLSurfaceView null pointer exceptions","<android><3d><opengl-es><views><surfaceview>","1","0","","",""
"3376473","1","3376523","","2010-07-31 02:05:22","5","4145","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2248510/how-can-i-determine-if-a-geopoint-is-displayed-in-currently-viewable-area"">How can I determine if a geopoint is displayed in currently viewable area?</a>  </p></blockquote><p>I was wondering if there was any way (I'm somewhat a newbie at Java) to get the MapBounds of a Google MapView on Android.</p><p>Just to clarify, here's what I'd like to do.</p><p>Calculate the maximum and minimum long and lat whenever the map is moved, or zoomed and display those values in a Toast. </p><p>Is there any possible way to do this -- or am I in over my head?</p>","354247","","","","","2012-12-02 20:56:48","Get Map Bounds Using Android Google Maps","<android><google-maps>","1","1","4","2012-09-21 16:11:30",""
"3376549","1","","","2010-07-31 02:39:53","0","210","<p>Are there any places where you can download prebuilt android images?</p><p>This would be allot easier than trying to guess what settings each device has.</p>","407256","","","","","2014-02-13 21:06:44","Prebuilt android avd?","<android>","1","2","","",""
"3376556","1","3379243","","2010-07-31 02:43:36","0","180","<p>Help! I updated my android application on the market. This update included a change in the databaseHelper file where I put in more data and tables. Normally, when debugging, I would have to uninstall and reinstall the app because it doesn't see the new values in the database. Now, it's doing the same thing on the market. </p><p>Why is this happening? How can I fix this? Is it possible to 'rollback' the changes to the app? </p>","390608","","","","","2010-07-31 18:02:26","Updating Android app properly?","<android>","1","0","","",""
"3376560","1","3509273","","2010-07-31 02:47:06","0","596","<p>My application requires me to store sets of bits along with some accompanying metadata on the Android platform (read only for now). Now obviously I could just implement the Serializable interface, but I hear it's very slow on Android (I can imagine has to do something with the custom VM and compiler that makes such reflective features inefficient). Should I:</p><ol><li>Use Android's Parcel system which seems to be an ""assisted"" marshalling technique.</li><li>Use a custom binary format (maybe BMP style with the header information stripped).</li><li>Store into an XML file manually, use XML parser to retrieve data.</li></ol><p>Now from what I understand XML serialization or parcelization isn't really backwards compatible on Android? The appeal of XML is of course that these persistent files could be edited in a regular text editor. Which leaves me in a difficult position, since I hate writing code that is redundant. </p><p>At this point I am heavily leaning towards the first option (i.e. bitset being parcelized). Any experienced Java/Android programmers care to tell me how well I can expect this to perform? Would I have to expand the bitset into an array of booleans to get acceptable runtime performance? Of course the problem with this is that even a rudimentary benchmark would have to be run on the Dalvik VM since I can't expect Sun's VM on x86 have similar performance to Android on ARM. How does the Android emulator work? Is it a VM on top of the x86 host or does it emulate the ARM instruction set and run the VM targeted at ARM?</p><p>I hope this ADD post didn't confuse everyone because it confused me. :D</p>","407254","","","","","2010-08-18 05:44:50","How to efficiently store bitsets on Android","<java><android><xml><serialization><bitmap>","2","0","","",""
"3376567","1","3460578","","2010-07-31 02:50:17","0","856","<p>I am trying to debug a problem where my widget becomes invalid and a new one fills in.  This only happens once at the beginning of time and then it remains the second widget forever.  So, I want to put code in to narrow down the point in time when it happens.  What I would like to do it something like this:</p><pre><code>e.g., (not real code) Log.d(TAG, ""myWidgetId="" + this.getMyWidgetId());</code></pre><p>Then I would get a list of all the enabled IDs and see if I am in the list.  I cannot find a method, member, attribute, etc. that would give me my id?</p>","157804","","157804","","2010-07-31 03:25:52","2010-08-11 16:24:55","How can one get the appwidget's own ID?","<android><uniqueidentifier><appwidget>","1","0","1","",""
"3376572","1","3380017","","2010-07-31 02:51:50","1","6550","<p>I am currently making an app which works with images.  I need to implement functionality where the user picks a file stored on the SD card.  Once they pick the picture (using the Android gallery), the the file-location of the image will be sent to another Activity, where other work will be done upon it.</p><p>I have seen similar posts here on SO, but none to answer my question specifically.  Basically this is the code I am doing when the user clicks the ""Load a Picture"" button:</p><pre><code>// Create a new Intent to open the picture selector:Intent loadPicture = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);// To start it, run the startActivityForResult() method:startActivityForResult(loadPicture, SELECT_IMAGE);</code></pre><p>From that code, I then have a <code>onActivityResult()</code> method to listen to the call-back:</p><pre><code>// If the user tried to select an image:if(requestCode == SELECT_IMAGE){    // Check if the user actually selected an image:    if(resultCode == Activity.RESULT_OK)    {        // This gets the URI of the image the user selected:        Uri selectedImage = data.getData();        // Create a new Intent to send to the next Activity:        Intent i = new Intent(currentActivty.this, nextActivity.class);        // ----------------- Problem Area -----------------        // I would like to send the filename to the Intent object, and send it over.        // However, the selectedImage.toString() method will return a        // ""content://"" string instead of a file location.  How do I get a file        // location from that URI object?        i.putExtra(""PICTURE_LOCATION"", selectedImage.toString());        // Start the activity outlined with the Intent above:        startActivity(i);</code></pre><p>As the code above states, the <code>uri.toString()</code> will return a <code>content://</code> string instead of the file location of the selected picture.  How do I obtain the file location?</p><p>Note: Another possible solution is to send over the <code>content://</code> string and convert that into a <code>Bitmap</code> (which is what happens in the next Activity).  However, I don't know how to do that.</p>","318709","","","","","2012-07-22 20:47:54","Get Selected Image File Location in Android","<android><image><file-io><gallery>","2","1","","",""
"3376608","1","3376658","","2010-07-31 03:04:42","2","464","<p>I was designing a mobile version of my website but then realized I need to support at least three (iPhone, iPad and Android). In that case, I was thinking of using jQuery for the task where I would first detect what device it is and then load the appropriate CSS. How would I go about doing this? Is it something like this? And is this even the good way or is there a better way of achieving the same?</p><pre><code>&lt;html&gt;&lt;head&gt;&lt;script type=""text/javascript""&gt;   //Detect device type using jQuery   //Insert the proper stylesheet?   //Rest of the javascript&lt;/script&gt;&lt;/head&gt;&lt;body&gt;...&lt;/body&gt;</code></pre>","184046","","","","","2010-07-31 03:29:25","How can I use a different CSS using jQuery?","<javascript><jquery><iphone><css><android>","1","0","","",""
"3376672","1","","","2010-07-31 03:33:53","2","23910","<p>I am writing an app to capture the camera preview frames and convert it to bitmap in Android. Here is my code:</p><pre><code>   Camera.PreviewCallback previewCallback = new Camera.PreviewCallback()      {             public void onPreviewFrame(byte[] data, Camera camera)              {                     try                     {                             BitmapFactory.Options opts = new BitmapFactory.Options();                             Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);//,opts);                     }                     catch(Exception e)                     {                    }             }     };     mCamera = Camera.open();    mCamera.setPreviewCallback(previewCallback); </code></pre><p>After I start preview, the callback got called with data, but the bitmap is null. </p><p>What did I do wrong when convert the byte array to BitMap?</p>","95490","","1583","","2010-07-31 21:13:32","2012-09-29 20:25:22","How to capture preview image frames from Camera Application in Android Programming?","<android><bitmap><camera>","2","1","2","",""
"3376678","1","3378903","","2010-07-31 03:36:12","1","6072","<p>Trying to have a ListView (scrollable  list) of rows made of two TextViews.  I have  a list of items from a database that I want to populating into the LinearLayout->ListView->TextView but can't get to the id...</p><p>Layout somewhat like this instructional link, but have backed away from RelativeLayout and using LinearLayout to get it working.  Not even worried about how it looks yet; just can't get it wired together yet.</p><p><a href=""http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html"" rel=""nofollow"">http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html</a></p><p>Have two XML files (very abbreviated details below)main.xml and stuff.xml</p><p>main.xml has</p><p>...TextView</p><p>...ListView</p><p>stuff.xml has</p><p></p><p>... android:id=""@+id/firstLine""</p><p></p><p>...     android:id=""@+id/secondLine""</p><p>YES, I do setContentView(R.layout.main); right after onCreate.</p><p>Getting null on findViewByID(firstLine) and findViewID(secondLine).</p><p>I have an ArrayAdapter where I inflate the stuffView.  My thinking and understanding of other examples is it's not inflated (this nested stuffView) until I purposely inflate it.  That all works fine but when I do the findViewById it returns null and thus I can't setText().</p><p>epic Fail due to complete ignorance/newbieness on my part.  Note:  I've pored through what I can of Reto's book, especially a simliar example on Page 163 but fail fail fail...</p><p>Can some kind soul point me in the right direction?</p><p>Must I inflate this nested view? (Reto's example does).  If so, what am I missing?  I'm hoping someone can point me to a better example.  My code's probably too involved at this point to post and a bit proprietary.</p><p>Thanks</p><p>main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" &gt; &lt;TextView android:id=""@+id/identText""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:text=""some text here""  /&gt; &lt;ListView     android:id=""@+id/myListView""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""   /&gt; &lt;/LinearLayout&gt;</code></pre><p>thing_item.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  &gt;&lt;TextView android:id=""@+id/identText""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:text=""some text here""  /&gt; &lt;ListView     android:id=""@+id/myListView""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""   /&gt;&lt;/LinearLayout&gt;</code></pre><p>A pojo called Thingy  (not copying Thingy.java here - very simple)</p><p>The main class: ShowLayoutNicely.java</p><pre><code>package com.blap.test;import java.util.ArrayList;import android.app.Activity;import android.os.Bundle;import android.widget.ListView;import android.widget.TextView;public class ShowLayoutNicely extends Activity { ListView myListView; TextView myTextView;ArrayList&lt;Thingy&gt; thingys;ThingyAdapter aa;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    myListView = (ListView) findViewById(R.id.myListView);    myTextView = (TextView) findViewById(R.id.identText);    thingys = new ArrayList&lt;Thingy&gt;();    aa = new ThingyAdapter(this, android.R.layout.simple_list_item_1, thingys);    myListView.setAdapter(aa);// real deal has a call to go find items from database, populate array and notify of change.          Thingy thing1 = new Thingy(""first"", ""first row"");    thingys.add(thing1);// sadly - this isn't triggering getView() which I've overriden...    aa.notifyDataSetChanged();    Thingy thing2 = new Thingy(""second"", ""second row"");    thingys.add(thing2);    aa.notifyDataSetChanged();}}</code></pre><p>The adapter override class ThingyAdapter.java</p><pre><code>package com.blap.test;import java.util.List;import android.content.Context;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;import android.widget.LinearLayout;import android.widget.TextView;public class ThingyAdapter extends ArrayAdapter&lt;Thingy&gt; {int resource;public ThingyAdapter (Context _context, int _resource, List&lt;Thingy&gt; _items){super( _context, _resource, _items);resource = _resource;}@Overridepublic View getView(int position, View convertView, ViewGroup parent)  {LinearLayout thingView;Thingy thingItem = getItem(position);String identString = thingItem.getIdent();String nameString =thingItem.getName();if (convertView == null){    thingView= new LinearLayout(getContext());    LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);    View nuView = vi.inflate(resource, thingView, true);}else{    thingView = (LinearLayout) convertView;}//here's the problem - these calls return nulls.TextView row1 = (TextView)thingView.findViewById(R.id.firstLine);TextView row2 = (TextView)thingView.findViewById(R.id.secondLine);//and naturally these puke ingloriously....row1.setText(thingItem.getIdent());row2.setText(thingItem.getName());return thingView;}}</code></pre><p>So this code is in essence what I'm looking for help on; neutered the names to call it Thingy....  This sample isn't triggering the getView(). That's a secondary problem I have to sort out. More importantly, your help on the findViewById failure and if I've got the XML right would help a bunch.</p>","407261","","407261","","2010-08-04 04:34:39","2010-08-04 10:58:33","Fail on trying to findViewById for nested TextView (within ListView)","<android><listview><nested><textview>","1","4","","",""
"3376721","1","3376737","","2010-07-31 03:56:55","14","9545","<p>When you click a link in the Android browser, the target link area gets highlighted with an orange box by default.  A longpress then opens up the context menu for link handling (copy, paste, new window, etc).  Is there a way to disable either / both of these in webview?  I'm using the <a href=""http://wiki.github.com/madrobby/scriptaculous/effect-highlight"">highlight code</a> in scriptaculous and the default android link styling is being laid over top of the effect.</p>","335019","","","","","2013-12-11 04:56:23","Can I remove Android default link styling in webview","<android><webview>","2","0","6","",""
"3376772","1","4619001","","2010-07-31 04:17:25","1","2962","<p>I am working on an Android app where we enter some text in edit box and all I want to do is simply send the text which typed (i.e.., edittext.gettext()) to facebook as my status. </p><p>The important thing is I don't want a Facebook dialog box to open, just send the message as status without a dialog box. </p><p>Is there any way I could post without using dialog box?</p>","401983","","368070","","2011-03-21 06:23:05","2011-03-21 06:23:05","send message as status without a dialog : Android Facebook","<android><facebook>","2","1","1","",""
"3376912","1","","","2010-07-31 05:12:00","2","1092","<p>I have read that in order to clear data stored in the Android emulator I should start the emulator with the ""-wipe-data"" arguments. However, I can't see how to specify startup arguments. I have read that it should be possible to specify these in the ""Target"" tab of the Debug Configurations dialog. However, if I open Debug Configurations from the Eclipse Run menu all I see in the Target tab are radio buttons for ""Manual"" or ""Automatic"" Deployment Target Selection Mode, buttons for ""Refresh"" and ""Manager..."" and drop-down boxes for ""Network Speed"" and ""Network Latency"" options. There are buttons for ""Details..."" and ""Start..."" but these are grey. I can't see anywhere where I can enter a ""-wipe-data"" option. The Run Configurations dialog seems to be identical. (I am using Eclipse SDK 3.5.2)</p>","250845","","","","","2010-08-04 14:12:38","How to specify arguments when starting Android emulator in Eclipse (to wipe data)","<android><eclipse><configuration><startup>","1","0","1","",""
"3377037","1","3389770","","2010-07-31 06:04:58","1","2801","<p>Building on 1.6 SDK4</p><pre><code>InputStream is = Resources.getSystem().openRawResource(R.raw.vortexrules);</code></pre><p>This line is causing me no end of trouble...</p><p>My R.java shows:</p><pre><code>public static final class raw {    public static final int vortexrules=0x7f040000;</code></pre><p>which tells me that the compiler is recognizing the text file and the folder and setting them as a resource.</p><p>When I run the code above, trying to set the InputStream to the text file i get:</p><pre>07-31 01:53:58.839: ERROR/AndroidRuntime(19573): Uncaught handler: thread main exiting due to uncaught exception07-31 01:53:58.947: ERROR/AndroidRuntime(19573): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vortex.rules/com.vortex.rules.MainWindow}: android.content.res.Resources$NotFoundException: Resource ID #0x7f04000007-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2444)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2460)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at android.app.ActivityThread.access$2300(ActivityThread.java:119)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1837)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at android.os.Handler.dispatchMessage(Handler.java:99)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at android.os.Looper.loop(Looper.java:123)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at android.app.ActivityThread.main(ActivityThread.java:4246)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at java.lang.reflect.Method.invokeNative(Native Method)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at java.lang.reflect.Method.invoke(Method.java:521)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at dalvik.system.NativeStart.main(Native Method)07-31 01:53:58.947: ERROR/AndroidRuntime(19573): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f04000007-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at android.content.res.Resources.getValue(Resources.java:888)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at android.content.res.Resources.openRawResource(Resources.java:813)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at android.content.res.Resources.openRawResource(Resources.java:795)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at com.vortex.rules.CSV_Reader.onCreate(CSV_Reader.java:18)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at com.vortex.rules.MainWindow.CreateDatabase(MainWindow.java:103)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at com.vortex.rules.MainWindow.onCreate(MainWindow.java:39)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2407)07-31 01:53:58.947: ERROR/AndroidRuntime(19573):     ... 11 more</pre><p>out of the LogCat.</p><p>This tells me that it can't find the resource with that ID, but it just got the ID from R.java, which is getting its information from the compiler.</p><p>I am completely lost at this point.</p><p>ANY help would be appreciated...</p>","405246","","56338","","2010-08-02 18:12:16","2012-01-26 07:15:12","Resources.getSystem().openRawResource(random.txt) returns Resource$NotFoundException","<java><android><resources><inputstream>","1","3","","",""
"3377142","1","","","2010-07-31 06:46:30","0","2598","<p>I changed the background color of Tab WIdget in Android. But when I changed the background, I lost the border of each Tab.I want to change the border color of Tab Widget. How can I change it? Is there any other way by which I can show the border?</p>","406494","","851273","","2012-06-15 06:27:45","2012-06-15 06:27:45","Changing Tab Widget Border Color","<android>","1","0","","",""
"3377162","1","","","2010-07-31 06:51:40","1","1038","<p>I want to open soft keyboard while starting an activity.</p><p>The activity contains nothing as its element. I just need to open soft keyboard on the launch.</p><p>I've tried with </p><p><code>&lt;activity android:windowSoftInputMode=""stateAlwaysVisible|stateVisible|adjustResize""</code> but it didn't work.</p><p>Also tried with</p><pre><code>getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);</code></pre><p>but it didn't work as well</p><p>i'm using emulator to run the code</p><p>Thanks in advance</p>","198837","","","","","2013-08-01 08:41:54","Show soft keyboard when Activity starts when no text field is present","<android><android-softkeyboard>","3","0","","",""
"3377220","1","","","2010-07-31 07:16:16","0","954","<p>I have an activity that loads an AlertDialog like this.</p><pre><code>        progressDialog = new ProgressDialog( MyActivity.this );        progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);        progressDialog.setMessage(""Doing Something"");        progressDialog.setCancelable(false);        progressDialog.show();</code></pre><p>I also have another class that extends AsyncTask</p><pre><code>    private class MyBackgroundTask extends AsyncTask&lt;Void, Void, Boolean&gt; {        @Override        protected Boolean doInBackground(Void... params) {            ...do stuff        }        @Override        protected void onPostExecute(Boolean result) {            progressDialog.dismiss();        }        @Override        protected void onProgressUpdate(Void... values) {        }    }</code></pre><p>If the orientation of the screen changes I get an error about trying to attach to a view that does not exist.  This is because the Activity has been destroyed and the  context has gone away.</p><p>So I added this to onDestroy() and it fixed it.</p><pre><code>    @Override    public void onDestroy() {        if(progressDialog!=null)            if(progressDialog.isShowing())                progressDialog.cancel();        if(background!=null)            background.cancel(true);    }</code></pre><p>But this means that I always have to keep a reference to the Dialog and AsyncTask</p><p>So I cant do this for example:</p><pre><code>new MyAsyncTask().execute();</code></pre><p>In case the orientation changes, equally I can't do this:</p><pre><code>    new AlertDialog.Builder(this)    .setIcon(android.R.drawable.ic_dialog_alert)    .setTitle( ""some title"" )    .setMessage(""some message"")    .setPositiveButton(R.string.ok, null)    .show();</code></pre><p>This does not seem right to me and there must be a better way, I know you can use getApplicationContext() but in some situations this is not viable.</p><p>How do I manage this properly?</p>","248521","","248521","","2010-07-31 11:56:57","2011-01-23 10:11:57","Handling Orientation changes with Context and AlertDialog/AsyncTask","<android>","1","0","2","",""
"3377288","1","","","2010-07-31 07:47:37","7","12974","<p>Can anyone help on removing the g factor from accelerometer readings. I am using SensorEventListener with onSensorChanged() method for getting Sensor.TYPE_ACCELEROMETER data. I need only pure acceleration values in all directions. So at any state if the device is stable (or in constant speed), it should give (0.0,0.0,0.0) roughly. Currently, depending on its pitch and roll, it gives me variable output depending on the g forces acting on each axis.</p><p>I hope there is some formula to remove this, as I also get orientation values (pitch and roll) from Sensor.TYPE_ORIENTATION listener. I had used some but didn't work.</p><p>Any help please ?</p>","315619","","","","","2013-03-13 09:06:10","How to remove Gravity factor from Accelerometer readings in Android 3-axis accelerometer","<android><accelerometer>","4","0","1","",""
"3377320","1","","","2010-07-31 07:59:52","3","459","<p>Ok so I have my app that I am about to release as a beta. It also has bug reporting feature thanks to <a href=""http://code.google.com/p/acra"" rel=""nofollow""><strong>ACRA</strong></a>.  </p><p>Now I want to be updating the beta and also fix any bugs that has been reported.<br>But of course I would want to keep the original released copy so that I can figure out the bugs and what not.<br>And then as final versions get released I would want to do the same with each released version. </p><p>So I need some kind of version control system. I am new to all this so I'm not sure what the best/simplest way to go about doing so.</p><p>I'v googled around and there seems to be numerous revision control systems with a lot of features I don't really need.<br>But as long at its easy to do what I'm looking for I'll be happy with it. I am also using eclipse so something that goes great with it would be nice.</p><p>I'm not too sure how it would all work so any help is appreciated.<br>Thanks!</p>","362476","","6309","","2010-07-31 08:44:10","2010-07-31 08:44:10","Android best revision control for apps?","<java><android><version-control>","1","0","2","",""
"3377368","1","","","2010-07-31 08:20:26","0","1190","<p>Hi I am using the gallery for displaying images. But the gallery has an end. I don't want this behaviour; I want to repeat the images again and again on both sides of the gallery. Is there a way to display the gallery elements as a circle?</p>","454808","","592182","","2011-08-02 07:53:42","2011-08-02 08:54:11","Display gallery elements as a circle","<android><photo-gallery>","1","0","2","",""
"3377433","1","3378864","","2010-07-31 08:50:14","0","600","<p>I'm creating a widget for the Android platform., however I need some advice on certain aspects.</p><p>1) If I have a 3x3 widget, what is the actual dip/dp for this layout?<br>2) I'm creating a basic calculator layout inside the widget, how can I better layout the elements? <strong>Linear/Absolute/Relative?</strong><br>3) Depending on the layout above, are there any examples showing how to better position the elements I want to draw?</p><p>Cheers :)</p>","109652","","","","","2010-07-31 16:08:05","Android widget design questions","<android><design><android-widget>","1","0","","",""
"3377437","1","","","2010-07-31 08:51:08","0","931","<p>I am using preference concept (listpreference) in my application.I want to do something when i choose particular option from listSo plese tell me how is it possible?</p>","394607","","","","","2010-11-04 19:43:20","want to do something when choose options from list (listpreference)","<android><events><listpreference>","3","0","","",""
"3377467","1","","","2010-07-31 08:59:54","2","929","<p>How much does active GPS drain the battery? Without the overhead of the gps navigator software. say I want to sample the gps every 2 minutes and save it to a file. how much battery power will that cost me?</p><p>Will I get 10% shorter life? 20%? ..?</p>","161753","","","","","2011-11-24 12:48:40","What is active GPS effect on mobile devices battery life?","<iphone><android><mobile><gps><mobile-phones>","3","1","","",""
"3377469","1","","","2010-07-31 09:00:32","0","954","<pre><code>Double temp_val = 0.0;temp_val = Double.parseDouble(et1.getText().toString());if (temp_val &lt; 14) {  final AlertDialog alertDialog = new AlertDialog.Builder(this).create();  alertDialog.setTitle(""Reset..."");  alertDialog.setMessage(""WB should be greater than or equal to 14"");  alertDialog.setButton2(""OK"", new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dialog, int which) {      // here you can add functions      dialog.dismiss();    }  });  alertDialog.setIcon(R.drawable.icon);  alertDialog.show();  et1.setText("""");  tv1.setText(""WB"");  return;}double p = 1.8;double fvalue = p;temp_val = temp_val * fvalue;temp_val = (temp_val + 32);String temp_val1 = Double.toString(temp_val);wbval = Integer.parseInt(temp_val1);</code></pre><p>and I got the following Exception, please give me solution</p><pre><code>07-31 14:27:35.558: ERROR/AndroidRuntime(375): FATAL EXCEPTION: main07-31 14:27:35.558: ERROR/AndroidRuntime(375): java.lang.NumberFormatException: unable to parse '' as integer07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at java.lang.Integer.parseInt(Integer.java:412)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at java.lang.Integer.parseInt(Integer.java:382)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at com.ExtraCharge.Calc.onClick(Calc.java:744)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at android.view.View.performClick(View.java:2408)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at android.view.View$PerformClick.run(View.java:8816)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at android.os.Handler.handleCallback(Handler.java:587)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at android.os.Handler.dispatchMessage(Handler.java:92)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at android.os.Looper.loop(Looper.java:123)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at android.app.ActivityThread.main(ActivityThread.java:4627)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at java.lang.reflect.Method.invokeNative(Native Method)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at java.lang.reflect.Method.invoke(Method.java:521)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)07-31 14:27:35.558: ERROR/AndroidRuntime(375):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","398721","","648313","","2011-09-02 10:53:37","2011-09-02 10:53:37","Small project in Android","<android>","1","2","","",""
"3377487","1","3377493","","2010-07-31 09:08:58","0","8108","<p>I am trying to detect Screen backlight On / Off.</p><p>I've found <code>android.intent.action.SCREEN_OFF</code> related its event. </p><p>But I don't know how to use this. </p><p>Can you suggest me about how to detect screen backlight on / off ? </p><p>I missing some example or sample code. </p><p>Thanks in advance.</p>","164589","","55093","","2011-06-14 13:06:58","2011-06-14 13:11:46","android.intent.action.SCREEN_OFF","<android>","3","0","1","",""
"3377507","1","","","2010-07-31 09:17:19","0","320","<p>Basically, I don't know what functions &amp; XML attributes to provide when programming a specific Android feature; eg, Android Search Widget with Edittext in the middle, magnifier glass on the right, and a custom icon on the left.</p><p>From where I can find out what methods, parameters &amp; XML attributes to call when doing a specific Android task?  </p><p>Fron what sources can we find out how to program specific Android feature?   Are there some overall programming pictures to reference?</p><p>Praiser</p>","407375","","379693","","2010-07-31 10:08:15","2010-07-31 10:08:15","How can I know what functions to call when programming Android features?","<android><android-widget>","1","0","","",""
"3377529","1","","","2010-07-31 09:23:39","0","7208","<pre><code>try{        if (flag_conv == false)    {      if ((Integer.parseInt(et1.getText().toString()))&lt;=55)      {       final AlertDialog alertDialog = new AlertDialog.Builder(this).create();       alertDialog.setTitle(""Reset..."");       alertDialog.setMessage(""WB should be grater than 55"");       alertDialog.setButton2(""OK"", new DialogInterface.OnClickListener() {          public void onClick(DialogInterface dialog, int which)           {                // here you can add functions                dialog.dismiss();          }});       alertDialog.setIcon(R.drawable.icon);       alertDialog.show();       tv1.setText(""WB"");       et1.setText("""");       wbflg = true;       wbval = 0;       return;               }     else     {                           wbval = Integer.parseInt(et1.getText().toString());     }   } catch(NumberFormatException nfe){System.out.println(""Could not parse "" + nfe);}</code></pre><p>And i got the following Exception</p><pre><code>07-31 14:48:45.409: INFO/System.out(431): Could not parse java.lang.NumberFormatException: unable to parse '' as integer07-31 14:48:50.569: INFO/System.out(431): Could not parse java.lang.NumberFormatException: unable to parse '' as integer07-31 14:48:54.599: INFO/System.out(431): Could not parse java.lang.NumberFormatException: unable to parse '' as integer07-31 14:48:54.829: INFO/System.out(431): Could not parse java.lang.NumberFormatException: unable to parse '' as integer07-31 14:48:54.958: INFO/System.out(431): Could not parse java.lang.NumberFormatException: unable to parse '' as integer07-31 14:48:55.108: INFO/System.out(431): Could not parse java.lang.NumberFormatException: unable to parse '' as integer07-31 14:48:55.259: INFO/System.out(431): Could not parse java.lang.NumberFormatException: unable to parse '' as integer07-31 14:48:55.409: DEBUG/dalvikvm(118): GREF has increased to 20107-31 14:48:55.429: INFO/System.out(431): Could not parse java.lang.NumberFormatException: unable to parse '' as integer07-31 14:52:43.798: DEBUG/SntpClient(58): request time failed: java.net.SocketException: Address family not supported by protocol</code></pre>","398721","","618465","","2011-05-30 00:02:14","2011-05-30 00:02:14","Could Not parse java.lang.NumberFormat Exception","<android><parsing><int>","2","2","","",""
"3377553","1","3377975","","2010-07-31 09:33:22","1","2611","<p>I am using android 1.5.Here is my image capture code :</p><pre><code>public class CaptureImage extends Activity implements SurfaceHolder.Callback{    private Camera camera=null;    private SurfaceHolder surfaceHolder = null;    private boolean previewRunning = false;    private Context thisContext = this;    private String imageName = null;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        getWindow().setFormat(PixelFormat.TRANSLUCENT);        requestWindowFeature(Window.FEATURE_NO_TITLE);        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,        WindowManager.LayoutParams.FLAG_FULLSCREEN);        setContentView(R.layout.image_capture);        SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surface_camera);        surfaceHolder = surfaceView.getHolder();        surfaceHolder.addCallback(this);        surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);        Button btn =(Button) findViewById(R.id.capture_image_btn);        btn.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View arg0) {                camera.takePicture(null, picCalBac, picCalBac);            }        });    }    Camera.PictureCallback picCalBac = new PictureCallback() {        @Override        public void onPictureTaken(byte[] paramArrayOfByte, Camera paramCamera) {            if (paramArrayOfByte != null) {                //Intent intent = new Intent();                //imageName = ""myImg.jpg"";                //storeByteImage(thisContext, paramArrayOfByte, 75, imageName);                //setResult(RESULT_OK, intent);                //finish();            }        }    };    @Override    public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) {        if (previewRunning) {            camera.stopPreview();            }            Camera.Parameters p = camera.getParameters();            p.setPreviewSize(arg2, arg3);            p.setPictureSize(800, 600);            camera.setParameters(p);            try {            camera.setPreviewDisplay(surfaceHolder);            } catch (IOException e) {                Log.d(""IOException"", e.getMessage());                }            camera.startPreview();            previewRunning = true;    }    @Override    public void surfaceCreated(SurfaceHolder arg0) {        camera = Camera.open();    }    @Override    public void surfaceDestroyed(SurfaceHolder arg0) {        camera.stopPreview();        previewRunning = false;        camera.release();    }    private boolean storeByteImage(Context mContext, byte[] imageData,            int quality, String expName) {        FileOutputStream fileOutputStream = null;        try {            BitmapFactory.Options options=new BitmapFactory.Options();            options.inSampleSize = 1;            Bitmap myImage = BitmapFactory.decodeByteArray(imageData, 0,                    imageData.length,options);            fileOutputStream = openFileOutput(imageName, Context.MODE_PRIVATE);            BufferedOutputStream bos = new BufferedOutputStream(                    fileOutputStream);            myImage.compress(CompressFormat.JPEG, quality, bos);            bos.flush();            bos.close();        } catch (FileNotFoundException e) {            Log.d(""FileNotFoundException"", e.getMessage());        } catch (IOException e) {            Log.d(""IOException"", e.getMessage());        }        return true;    }</code></pre><p>Here is my image_capture.xml :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;    &lt;SurfaceView android:id=""@+id/surface_camera""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:layout_weight=""1""&gt;    &lt;/SurfaceView&gt;    &lt;LinearLayout android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;Button android:text=""Capture"" android:gravity=""center_horizontal""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:id=""@+id/capture_image_btn"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I have added user permission in manifest.xml.</p><p>This code is accessed onClick from another activity. And after I click the photo the screen remains still with clicked snapshot. The issue is the camera window is very small about 40% of height and width and the preview shown after image is clicked is also smaller, about 80% of height and width. How to make both (camera window and preview after click) full screen ?</p>","368084","","","","","2010-07-31 11:56:32","Full screen preview after image is captured in camera in android","<android><android-emulator>","1","0","","",""
"3377679","1","","","2010-07-31 10:20:12","1","3182","<p>I have an Android device where the default is for the Notification bar to be off so you cannot drag it down. I want to write a simple program that turns the notification bar back on so you can drag it down to view the notifications. If someone could show me the code to do that I would be very grateful.</p>","407408","","","","","2010-07-31 16:42:12","Android - Simple code to enable notification bar","<android>","2","0","2","",""
"3377690","1","","","2010-07-31 10:22:28","1","996","<p>I have wrote video player code in android.But one problem that i am facing is When i debug my code video is playing properly but when i run this, video is not appeared only sound can be listen.</p><p>Any help would be appreciated.</p><p>This is main method of my video player.</p><pre><code>private void playVideo(String url)  {  try   {   media.setEnabled(false);   if (player==null)    {    player=new MediaPlayer();    player.setScreenOnWhilePlaying(true);    //player.reset();   }   else    {    player.stop();    player.reset();   }   player.setOnErrorListener(this);   player.setDataSource(url);   player.setDisplay(holder);   player.setAudioStreamType(AudioManager.STREAM_MUSIC);   player.setOnPreparedListener(this);   player.prepareAsync();   player.setOnBufferingUpdateListener(this);   player.setOnCompletionListener(this);  }  catch(IllegalStateException ex)  {      try   {    player.reset();    player.setOnErrorListener(this);    player.setDataSource(url);    player.setDisplay(holder);    player.setAudioStreamType(AudioManager.STREAM_MUSIC);    player.setOnPreparedListener(this);    player.prepareAsync();    player.setOnBufferingUpdateListener(this);    player.setOnCompletionListener(this);   }   catch(Exception ex1)   {    ex1.printStackTrace();   }  }  catch (Throwable t)   {   Log.e(TAG, ""Exception in media prep"", t);   goBlooey(t);  } }</code></pre>","307583","","1583","","2010-07-31 21:13:22","2011-02-02 10:54:16","Android video player problem","<android><video>","1","0","1","",""
"3377770","1","","","2010-07-31 10:53:35","0","78","<p>I want to execute one method wheneer i enter number in EditText view.But i did not change the focus of EditText.I am stay in the same EditText when i enter a new number automatically i eant to execute one function.Now my question is how we find that event that means enter a new number in EditText </p>","454808","","","","","2010-07-31 11:31:31","Find out the new element in EditText View","<android>","1","0","","",""
"3377796","1","3388622","","2010-07-31 11:00:33","1","1064","<p>Hi: Is it generally possible to have Wifi Tethering turned on (creating a Hotspot) and at the same time scanning for Wifi devices? I want several devices just discover (NOT connect) each other and log the signal strength. To do that all devices must be discoverable over Wifi and at the same time discover others.I would just need that for some specific use case..</p>","281535","","","","","2013-09-15 17:23:58","On Android 2.2: Being in Tethering mode and scanning wifi at the SAME time","<java><android><wifi><jvm-hotspot><signal-strength>","1","0","2","",""
"3377810","1","3444584","","2010-07-31 11:05:56","20","5603","<p>What I'm trying to do is have a clock widget of different sizes (i.e. 2x2, 3x3, 4x4 etc) in one apk and a configuration activity to be able to select which size to add.</p><p>From what i've learned from documentation:</p><ol><li>Widget size is specified in &lt;appwidget-provider&gt; tag in respective xml file</li><li>Also in that file I set up the configuration activity for that provider</li></ol><p>So it seems that size is a property of AppWidgetProvider and I'll need to somehow create another provider from the code in configuration Activity of the first one...Or am I getting this wrong and there's another way?</p><p>Is this possible at all? :)I've been told that some widgets can do this :)</p><p>Thanks in advance!</p><p>P.S. I have read <a href=""http://stackoverflow.com/questions/2570004/how-to-add-multiple-widgets-in-one-app"">this</a> and <a href=""http://stackoverflow.com/questions/1860914/changing-widget-layout-programmatically"">this</a>. First one explains how to put multiple wigets in one apk, but it's not clear how to select between them in runtime. Second one is about changing layouts, but not size...</p>","258848","","","","","2013-03-07 06:48:11","How to put multiple widget sizes in one apk?","<android><widget><android-widget>","3","3","8","",""
"3377941","1","","","2010-07-31 11:47:06","1","374","<p>I got an exception ""Unable to parse 53.6 as an integer"". What is the proper format?</p><pre><code>double dbval;double temp_val=12;double p = 1.8;double fvalue =p;temp_val = temp_val * fvalue;temp_val = (temp_val + 32);String dbcal1=Double.toString(temp_val);dbval = Integer.parseInt(dbcal1);System.out.println(""dbval""+dbval);</code></pre>","398721","","995926","","2012-04-29 13:37:45","2012-04-29 13:37:45","Why does Integer.parseInt(""53.6"") fail?","<android><parsing>","1","0","","",""
"3378102","1","","","2010-07-31 12:29:31","12","13361","<p>I am getting the following remotely from clients so I don't know what hardware etc they are using.</p><pre><code>java.lang.IllegalArgumentException: View not attached to window manager       at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355)       at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200)       at android.view.Window$LocalWindowManager.removeView(Window.java:417)       at android.app.Dialog.dismissDialog(Dialog.java:279)       at android.app.Dialog.access$000(Dialog.java:72)       at android.app.Dialog$1.run(Dialog.java:108)       at android.app.Dialog.dismiss(Dialog.java:263)       at com..mysite.android.ActivityGame$1.onFinish(ActivityGame.java:154)       at android.os.CountDownTimer$1.handleMessage(CountDownTimer.java:118)       at android.os.Handler.dispatchMessage(Handler.java:99)       at android.os.Looper.loop(Looper.java:123)       at android.app.ActivityThread.main(ActivityThread.java:4203)       at java.lang.reflect.Method.invokeNative(Native Method)       at java.lang.reflect.Method.invoke(Method.java:521)       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)</code></pre><p>This is happening because of a ProgressDialog</p><pre><code>    progressDialog = new ProgressDialog( this );    progressDialog.setMessage(getString(R.string.get_ready));    progressDialog.setCancelable(false);    progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);    progressDialog.setMax(12);    progressDialog.show();    new CountDownTimer(3000, 250) {         @Override        public void onTick(long millisUntilFinished) {             //progressDialog.incrementProgressBy(1);         }         @Override        public void onFinish() {             progressDialog.dismiss(); //********* ERROR HAPPENS HERE *********             nextQuestion();         }    }.start();</code></pre><p>The Activity looks like this in the Manifest.</p><pre><code>&lt;activity android:theme=""@style/GameTheme"" android:name="".ActivityGame"" android:screenOrientation=""portrait"" android:launchMode=""singleTask"" android:configChanges=""keyboardHidden|orientation""&gt;&lt;/activity&gt;</code></pre><p>So what could this mean?  I think it has something to do with the Activity being destroyed then created but as you can see I have the configChanges set correctly.</p>","248521","","","","","2012-11-27 21:44:27","Error: View not attached to window manager","<android>","4","3","3","",""
"3378193","1","3378830","","2010-07-31 13:00:43","7","5848","<p>In my application I notify the user with notifications, if something special happens:</p><pre><code>public void triggerNotification(String msg) {        notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);        Intent contentIntent = new Intent(this, ABC.class);        Notification notification = new Notification(R.drawable.icon, msg, System.currentTimeMillis());        notification.setLatestEventInfo(this, ""ABC"", msg, PendingIntent.getActivity(this.getBaseContext(), 0, contentIntent, PendingIntent.FLAG_CANCEL_CURRENT));        notification.flags = Notification.FLAG_AUTO_CANCEL;        notificationManager.notify(notificationCounter, notification);        notificationCounter++;}</code></pre><p>If the user clicks on the Notification, the onCreate() method is called. But I want that a specific method in my app is called, or if the app is not in the foreground, that it is brought back to the foreground.</p><p>I know there are lots of tutorials that explain how to handle notifications, but I just don't understand them completely and wasn't ever able to implement the things like I'd like to.</p>","","anon","","","","2013-02-04 02:43:14","Android: How to avoid that clicking on a Notification calls onCreate()","<java><android><gui><notifications>","2","0","7","",""
"3378208","1","","","2010-07-31 13:04:43","7","8162","<p>is there any way to Stream video From iPhone Or Android to RTMP Server using Red5?? i searched over internet and there is only 2 application that mange to do this successfully(UStream , Qik)the problem they closed source So if anyone could help me find some code snippets that make this possible ??</p>","407463","","","","","2012-03-15 23:31:17","Stream video From iPhone Or Android to RTMP","<iphone><android><stream><red5><rtmp>","3","0","4","",""
"3378395","1","3911556","","2010-07-31 13:58:52","4","1584","<p>I have two TableLayouts, one above the other, in my View. I want them to act as a single table for the purpose of calculating column widths, but appear separately with a gap between them (and the main View background showing through) for aesthetic reasons.</p><p>Each table has 3 columns, and I want the column widths sized automatically depending on content, but I just want the columns to line up nicely with the same widths in both tables.</p><p>At the moment my tables look like this:</p><pre><code>+---------------------------+|      |                |   ||      |                |   |+---------------------------++---------------------------+|          |            |   ||          |            |   ||          |            |   ||          |            |   |+---------------------------+</code></pre><p>But I want them to look like this:</p><pre><code>+---------------------------+|         |             |   ||         |             |   |+---------------------------++---------------------------+|         |             |   ||         |             |   ||         |             |   ||         |             |   |+---------------------------+</code></pre><p>The only way I can see of getting what I want is to apply a fixed width to the columns in questions, but that defeats the point of having the TableLayout calculate the widths for me.</p><p>Is it at all possible?</p>","385478","","","","","2010-10-12 03:49:10","Android TableLayout: preserve column widths between different tables","<android><width><tablelayout>","2","0","","",""
"3378495","1","3378805","","2010-07-31 14:26:07","0","88","<p>After I launch my app, I see my startup activity with the title bar and a blank screen.  After a long delay (about 8 seconds), I finally see my splash screen.</p><p>This behavior is inconsistent....it can be a delay from 2 seconds (the time I specified in the code) to 8 seconds.</p><p>Can someone  suggest a plan to diagnose the issue?  What tools are available to use and what resources should I be looking at?</p><p>Thanks!</p>","291981","","","","","2010-07-31 15:50:23","troubleshoot Android Application","<android>","2","0","","",""
"3378501","1","3380718","","2010-07-31 14:27:55","19","38396","<p>I try to browse localhost on my htc magic. I have connected my device with eclipse via usb. browsing <a href=""http://10.0.2.2"">http://10.0.2.2</a> I get a ""Page not avialable. I remember, some days ago it worked</p><p>but on the emulator I am able to browse localhost</p><p>any ideas?regards</p>","401025","","401025","","2011-03-10 14:40:14","2014-01-04 07:25:04","How to browse localhost on android device?","<android><android-emulator>","8","0","3","",""
"3378550","1","3378791","","2010-07-31 14:39:39","15","11881","<p>Do you know any crash reporting library for Android?</p><p>I don't want to spend a lot of time to write my own reporting system.<br>The output can be send to the email or some kind of server.</p><p>I know that Google introduced crash reporting in Froyo, but I want something for older versions of the system.</p><hr><p>Let's sum up the answers:</p><ul><li><a href=""http://code.google.com/p/android-remote-stacktrace/"">android-remote-stacktrace</a> - sends raports to mail or php script</li><li><a href=""http://acra.googlecode.com/"">acra</a> - sends reports to google docs</li><li><a href=""https://github.com/tomquist/Android-Error-Reporter"">Android Error Reporter</a> - sends reports via HTTP post request</li></ul>","361832","","993246","","2013-03-12 16:50:23","2013-03-12 16:50:23","Android crash reporting library (pre Froyo)","<android><crash-reports>","5","0","16","2013-03-13 05:50:04",""
"3378586","1","","","2010-07-31 14:46:25","0","257","<p>I am connecting to a php page via httppost in Android. I am getting an IOException.I am running in localhost. What is the reason for this? Please help.The code is like this.</p><pre><code>    htClient = new DefaultHttpClient();    httpPost = new HttpPost(""http://localhost/form/android_test.php"");    response = new BasicResponseHandler();    try    {                   result = htClient.execute(httpPost,response);        Toast.makeText(active.this,result, Toast.LENGTH_SHORT).show();    }     catch (ClientProtocolException e) {        Toast.makeText(active.this,e.getMessage(), Toast.LENGTH_SHORT).show();    }     catch (IOException e) {    // i am always getting this exception.           Toast.makeText(active.this,""IO Error "" + e.getMessage(), Toast.LENGTH_LONG).show();    }</code></pre>","655814","","23897","","2010-07-31 17:20:28","2010-07-31 17:20:28","IO Error in Android","<android>","1","0","","",""
"3378667","1","","","2010-07-31 15:09:24","0","333","<p>I have to load the view in webview by executing its url,and the two relative layouts there in Linearlayout i hide one at the time showing url in webview,it have scroll on both vertical and horizontal,the problem i'm facing here is it only scrolls horizontally only but i need to view it also in vertical also,</p><p>here the xml code for layout</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:layout_width=""fill_parent"" android:layout_height=""wrap_content""              android:layout_marginTop=""5dip"" android:layout_marginBottom=""5dip""              android:scrollbars=""none""&gt;    &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""                     android:layout_width=""fill_parent"" android:layout_height=""fill_parent""                     android:id=""@+id/jr_lb_view_preview""&gt;        &lt;ProgressBar android:id=""@+id/jr_lb_content_iv_progress""                     android:layout_centerInParent=""true"" android:layout_width=""wrap_content""                     android:layout_height=""wrap_content""                     android:indeterminateDrawable=""@drawable/pb"" /&gt;        &lt;ImageView android:id=""@+id/jr_lb_content_iv""                   android:layout_centerInParent=""true"" android:layout_width=""150dip""                   android:layout_height=""225dip"" android:background=""@drawable/border""/&gt;    &lt;/RelativeLayout&gt;    &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""                    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                    android:id=""@+id/jr_lb_wb_view"" android:background=""@drawable/border""                    android:scrollX=""1dip""&gt;                      &lt;WebView android:id=""@+id/jr_lb_view_preview_switcher2""                android:layout_width=""308dip"" android:layout_height=""305dip""                android:background=""@drawable/border"" android:scrollbars=""vertical""                 android:scrollbarAlwaysDrawVerticalTrack=""true""/&gt;    &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>the activity code</p><pre><code>public void onClick(View v) {    preview.setVisibility(View.GONE);    g.setSelection(gPosition);    webview = (WebView) findViewById(R.id.jr_lb_view_preview_switcher2);    webview.getSettings().setBuiltInZoomControls(true);    new Task_Item_Selected().execute();       webview.loadUrl(product_img_large[gPosition]);    webview.setVisibility(WebView.VISIBLE);    preview2.setVisibility(View.VISIBLE);      // applyRotation(0, 0, 90);   }</code></pre><p>anybody help me fix it,thanks in advance</p>","407506","","218196","","2010-07-31 15:13:09","2010-10-06 23:35:35","Issue in Image scrolling vertically","<android>","1","0","","",""
"3378689","1","","","2010-07-31 15:18:09","0","1113","<p>How do I show an animated image in Android?</p>","655814","","23897","","2010-07-31 17:19:46","2011-10-17 11:15:46","Show animated image on Android","<android>","1","1","1","",""
"3378879","1","3378969","","2010-07-31 16:14:18","0","906","<p>I want to create a notification and I have this bit of code that worked before but now gives me a null pointer at the last line.</p><p>Any ideas as to what may cause this?</p><p>I know it may be hard with this bit of code that I have provided, I just need a hint as to what could possibly cause this.</p><pre><code>   private void showNotification() {    CharSequence text = getText(R.string.myString);    Notification notification = new Notification(R.drawable.playbackstart, text,            System.currentTimeMillis());    PendingIntent contentIntent = PendingIntent.getActivity(this, 0,            new Intent(this, MyActivity.class), 0);    notification.setLatestEventInfo(this, getText(R.string.myString),                   text, contentIntent);    mNM.notify(R.string.myString, notification);}</code></pre>","282475","","","","","2011-11-14 14:08:49","Android Notification NullPointer","<android><nullpointerexception><notifications>","3","0","","",""
"3378886","1","","","2010-07-31 16:16:31","1","4362","<p>How can I resume my activity when a notification in the statusbar is clicked?</p><p>This is the code I have, it shows the notification but when you click it nothing happens:</p><pre><code>public void showNotification(){          myNotificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);          CharSequence NotificationTicket = ""Notification"";          CharSequence NotificationTitle = ""Notification"";          CharSequence NotificationContent = ""Test""          long when = System.currentTimeMillis();          Notification notification =           new Notification(R.drawable.status_icon, NotificationTicket, when);          Context context = getApplicationContext();          Intent notificationIntent = new Intent(this,bgPlayer.class);          PendingIntent contentIntent =           PendingIntent.getActivity(this, 0, notificationIntent, 0);          notification.setLatestEventInfo(context, NotificationTitle,            NotificationContent, contentIntent);          myNotificationManager.notify(NOTIFICATION_ID, notification);    }</code></pre>","404784","","404784","","2010-07-31 16:34:46","2010-07-31 16:40:16","Launch activity when notification is clicked?","<android>","0","1","","2013-08-26 10:03:26",""
"3379023","1","","","2010-07-31 17:01:16","2","662","<p>The question is ""How to get a list of favorite contacts with android sdk?"". Now I am using android v1.5.Thanks.</p>","407565","","","","","2011-01-30 20:02:46","How to get a list of favorite contacts with android sdk?","<android>","1","0","1","",""
"3379050","1","","","2010-07-31 17:10:55","0","3002","<p>Can we load an XML file by slowly hiding the previous XML? I want a splash screen effect.</p>","655814","","23897","","2010-07-31 17:18:49","2010-07-31 18:31:48","Load XML slowly","<android>","1","1","1","",""
"3379261","1","3411205","","2010-07-31 18:07:42","2","557","<p>Hey. all,   I'm in the process of up-scaling the graphics for my game for better display on higher density devices. I created the higher dpi artwork, added it to the correct place (res/layout/drawable-hdpi).  I added the following to my manifest:</p><pre><code> &lt;supports-screens       android:smallScreens=""false""      android:normalScreens=""true""      android:largeScreens=""true""      android:anyDensity=""true"" /&gt;</code></pre><p>And it worked beautifully... with the exception of one image I forgot to upscale and was being pulled from drawable-mdpi. I upscaled that image, dropped it into drawable-hdpi and relaunched. Now the game is only pulling images from mdpi.  </p><p>I can verify with git that the only change i made to the codebase since it was working is adding the new image file.  For troubleshooting purposes I've tried both removing  that added image and resetting my git repo to the state it was in when it worked. In both cases its still just always loading from mdpi.  This leads me to believe it may be an issue with the emulator.  I'm developing this in my car on a netbook, which sometimes gives me issues with the emulator (usually takes an hour or so to boot and runs very, very sluggishly on the Atom).  </p><p>Anyone have an idea as to what might be stopping the game from pulling from hdpi?</p><p><em>Edit</em> </p><p>After a lot of troubleshooting I'm still no closer to solving this.  It seems my app may be running in compatibility mode.  It's not displaying ""postage stamp"" sized, it's using the whole wvga800 screen; but getDisplayMetrics().density returns 1.0.  The emulator states it is set at High (240) dpi, so I'm assuming density should be > 1.0.  </p><p>Random datapoint:  Changing the drawable-hdpi directory to drawable-large causes the larger images to load.  In that case getDisplayMetrics().density is still 1.0 so I can't do  proper px->dp conversions. </p>","1742702","","1140748","","2012-05-06 16:44:47","2012-05-06 16:44:47","hdpi assets no longer loading","<android><scaling><dpi>","2","0","","",""
"3379354","1","3380686","","2010-07-31 18:35:52","2","2250","<p>i have two projects in Eclipse: service and UI client.</p><p>In onCreate in UI client I have:</p><pre><code>startService(new Intent(this, ExampleService.class));</code></pre><p>but this fragment:</p><pre><code>ExampleService.class</code></pre><p>throws NoClassDefFoundError exception at runtime. I have installed ExampleService.apk, and ExampleUiClient.apk. Project compiles, and everything looks fine. What I am doing wrong? </p><p><strong>Is it possible to start service from other apk?</strong></p>","351748","","","","","2011-06-21 11:02:16","Starting service from other apk - throws NoClassDefFoundError exception","<android>","3","0","","",""
"3379403","1","","","2010-07-31 18:48:28","15","10756","<p>I am writing an app for android phones and after my splash screen it shows an activity which has several spinners and edittext views.  </p><p>On an android device without a keyboard it shows the virtual keyboard which then blocks the rest of the app and looks unprofessional to me.  I have tried to hide the virtual keyboard in the activity.onCreate method however no avail there.  </p><p>My next option I tried was setting an onFocus listener to the actual offending edittext view and still no avail.  </p><p>How can I prevent the virtual keyboard from showing until a user explicitly clicks an edittext view?  Is there a way to give one of the spinner's focus since one of the spinners is before the edittext view in the layout xml?  </p>","407611","","","","","2013-04-16 19:15:21","Android App start with virtual keyboard open","<android>","3","0","4","",""
"3379522","1","","","2010-07-31 19:30:06","1","392","<p>LinearLayout just works fine in an AppWidget. However, when I change the layout's xml to a TableLayout, I am unable to get the widget working :(. </p><p>Can anyone point me to a sample? [could not find anything on the web]</p><p>-Sri</p>","407627","","6391","","2010-08-03 04:41:01","2011-04-07 07:48:44","Can I have a TableLayout in an AppWidget?","<android><appwidget>","1","0","","",""
"3379575","1","3380655","","2010-07-31 19:45:03","9","8419","<p>I have written one <code>MapActivity</code> class that is able to display a set of places as well as single places. On startup, the application creates an instance of this <code>MapActivity</code> and displays multiple places. If the user clicks on a certain place, then a new <code>Activity</code> is launched that shows the details of the selected place. This activity has a menu item that allows the user to view the place on a map - this causes that a new instance of the <code>MapActivity</code> is created, except that now only this single place is displayed. </p><p>The problem now is that if the user navigates back to the first <code>MapActivity</code> (the one that shows multiple places) the tiles won't be loaded anymore + sometimes OutOfMemoryErrors are encountered.</p><p>According to the Android JavaDocs, it is only possible to have one <code>MapActivity</code> per process. However, I don't want to define my <code>MapActivity</code> as a singleInstance/singleTask, since the user should always be able to navigate back to the first MapActivity that shows multiple places. </p><p>I have seen that the Google Places app (which has come with Google Map 4.4) for Android uses multiple <code>MapActivity</code> instances. How is this possible? And how can I achieve it in my application? </p>","407633","","94363","","2013-01-14 10:51:01","2013-04-29 04:53:14","How to use multiple MapActivities/MapViews per Android application/process","<android><google-maps><android-mapview>","4","0","10","",""
"3379674","1","4741655","","2010-07-31 20:21:28","2","1082","<p>I have an abstract Activity in an Android library (<strong>AbstractActivity</strong>) that is supposed to be used in other applications as the base Activity.</p><p>Since this Activity isn't supposed to be used directly, it isn't declared in the library AndroidManifest.xml file (the real reason is because the Activity is declared as abstract) and so I can't declare it in the applications AndroidManifest.xml file.</p><p>The real problem is that when I create an application that uses the library, two .apk files get deployed to the device, <em>Library.apk</em> and <em>Application.apk</em>, and when the Application.apk is started it closes with the following message in LogCat:</p><pre><code>ERROR/AndroidRuntime(4709): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{foo.bar/foo.bar.ApplicationActivity}: java.lang.ClassNotFoundException: foo.bar.ApplicationActivity in loader dalvik.system.PathClassLoader@44bec098</code></pre><p>Can I reference an abstract Activity that is declared in a library and use it as the base for an Activity in a project that references this library?</p>","114227","","","","","2011-01-19 23:03:26","Abstract classes in Android library","<android>","2","1","1","",""
"3379743","1","3380716","","2010-07-31 20:48:25","3","2425","<p>I am looking for example for <em>Google Search like home page widget</em> from where user can type-in keywords to search within my app. <a href=""http://www.youtube.com/watch?v=zLxVQi0lRQ4#t=0m55s"" rel=""nofollow"">Youtube video here</a>.</p><p>I followed the tutorial at the <a href=""http://developer.android.com/guide/topics/appwidgets/index.html"" rel=""nofollow"">dev guide</a>. However, it lists the available RemoteViews, and there is no EditView. In such case how can I provide a editable text-box. I want to build a widget similar to SearchManager UI, but available as widget at home-screen.</p>","229106","","229106","","2010-08-09 08:38:10","2012-02-13 16:47:14","Google Search Like Widget Example","<android><search><widget>","3","0","1","",""
"3379770","1","","","2010-07-31 20:57:24","1","151","<p>I have an activity that extends MapActivty that renders out a marker.  I would like the map to handle long clicks the same way the native Maps app does in finding the physical address of the geo point, displaying the address, then allow me to press the caption containing the address to view more details ie driving directions, what's nearby.</p><p>Is this possible or is the functionality embedded into the native Maps app?</p><p>BTW: because I need a custom options menu I am unable to implicitly launch the map activity with a geo:0,0?q=address string.</p>","26849","","102703","","2010-08-01 00:22:49","2010-08-01 00:22:49","How do I view a map location's info by long clicking in a custom activity?","<android><google-maps><android-mapview>","0","2","","",""
"3379973","1","3380419","","2010-07-31 22:10:40","6","2749","<p>I'm dynamically generating a grid of EditText views in code based on a specified number of rows and columns.  I want each of the EditText views to be the same width (e.g., 100dp).</p><p>Although I can set the size of the views with either setWidth or by creating a LayoutParam object, I only seem able to specify the value in pixels.  I instead want to use the DP (density independent) units, similar to what I've done using an XML layout.</p><p>How can this be done in code?   </p>","230388","","133203","","2010-07-31 22:16:16","2010-08-01 01:38:38","How to programatically set the width of an Android EditText view in DPs (not pixels)","<android>","2","0","","",""
"3380112","1","","","2010-07-31 23:01:06","1","605","<p>The only AsyncTask that I have that is working properly is one that handles a progressdialog for a search. None of my other AsyncTasks are getting to onPostExecute() even though the doInBackground() is completing! I am pulling my hair out because it used to work in earlier commits and doing a compare, I see no difference! A lot of the AsyncTasks used to update correctly and call postExecute, now they update really slowly and only a few times, and never execute onPostExecute!</p>","325081","","244296","","2010-08-01 00:14:01","2010-08-01 00:14:01","None of my AsyncTasks are executing on PostExecute","<java><android><multithreading><concurrency><ui-thread>","0","7","1","",""
"3380234","1","","","2010-07-31 23:59:25","3","3056","<p>How do you determine which input method is currently active - A user can change the input method (soft keyboard) by long pressing on a text edit field - From code, how does one determine which input method the user has chosen</p>","407717","","49246","","2010-11-13 10:15:08","2011-04-19 22:10:52","Android: Determine active input method from code","<android><android-input-method>","1","5","3","",""
"3380256","1","","","2010-08-01 00:10:36","0","935","<p>I have a Service with a MediaPlayer which streams audio from the Internet but when I press the Home button and it goes back to the home screen it Force Closes. It's strange though because it works perfectly in the emulator and sometimes it doesn't Force Close on my phone (G1), when I've just turned it on. This is my code:</p><pre><code>    public class backgroundPlayer extends Service { @Override public IBinder onBind(Intent intent) {  return null; } @Override public void onCreate() { } @Override public void onDestroy() {  MyMainClass.myMediaPlayer.stop(); } @Override public void onStart(Intent intent, int startid) {  MyMainClass.myMediaPlayer.reset();  try {  MyMainClass.myMediaPlayer.setDataSource(MyMainClass.channelUrl[player.selectedChannel]);  } catch (IllegalArgumentException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IllegalStateException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }  try {   MyMainClass.myMediaPlayer.prepare();  } catch (IllegalStateException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }  MyMainClass.myMediaPlayer.start(); }}</code></pre><p>Log:</p><pre><code>08-01 02:51:29.467: INFO/ActivityManager(123): Start proc com.android.settings for broadcast com.android.settings/.widget.SettingsAppWidgetProvider: pid=17820 uid=1000 gids={3003, 1015, 3002, 3001}08-01 02:51:29.467: INFO/ActivityManager(123): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher/.Launcher }08-01 02:51:29.547: INFO/ActivityManager(123): Start proc android.process.acore for activity com.android.launcher/.Launcher: pid=17823 uid=10003 gids={1015, 3003}08-01 02:51:30.287: INFO/ActivityManager(123): Process com.google.android.voicesearch (pid 17726) has died.08-01 02:51:30.306: INFO/ActivityManager(123): Low Memory: No more background processes.08-01 02:51:30.427: INFO/ActivityThread(17823): Publishing provider com.android.launcher.settings: com.android.launcher.LauncherProvider08-01 02:51:30.457: INFO/ActivityThread(17823): Publishing provider user_dictionary: com.android.providers.userdictionary.UserDictionaryProvider08-01 02:51:30.497: INFO/ActivityThread(17823): Publishing provider com.android.social: com.android.providers.contacts.SocialProvider08-01 02:51:30.537: INFO/ActivityThread(17823): Publishing provider applications: com.android.providers.applications.ApplicationsProvider08-01 02:51:30.757: INFO/ActivityThread(17823): Publishing provider contacts;com.android.contacts: com.android.providers.contacts.ContactsProvider208-01 02:51:31.457: INFO/ActivityManager(123): Process com.android.settings (pid 17820) has died.08-01 02:51:31.467: INFO/ActivityManager(123): Low Memory: No more background processes.08-01 02:51:31.667: DEBUG/dalvikvm(17823): GC_FOR_MALLOC freed 2871 objects / 200896 bytes in 116ms08-01 02:51:31.687: INFO/ActivityThread(17823): Publishing provider call_log: com.android.providers.contacts.CallLogProvider08-01 02:51:31.957: DEBUG/dalvikvm(17823): GC_EXTERNAL_ALLOC freed 967 objects / 49736 bytes in 110ms08-01 02:51:33.867: DEBUG/dalvikvm(17823): GC_EXTERNAL_ALLOC freed 6359 objects / 416536 bytes in 154ms08-01 02:51:34.666: DEBUG/dalvikvm(17823): GC_EXTERNAL_ALLOC freed 1253 objects / 75368 bytes in 306ms08-01 02:51:35.297: INFO/ActivityManager(123): Displayed activity com.android.launcher/.Launcher: 83778 ms (total 5806 ms)08-01 02:51:37.347: DEBUG/HomeLoaders(17823):   ----&gt; items cloned, ready to refresh UI08-01 02:51:38.237: DEBUG/Launcher(17823): about to setAppWidget for id=6, info=AppWidgetProviderInfo(provider=ComponentInfo{com.android.deskclock/com.android.alarmclock.AnalogAppWidgetProvider})08-01 02:51:38.417: INFO/ActivityManager(123): Start proc com.android.deskclock for broadcast com.android.deskclock/com.android.alarmclock.AnalogAppWidgetProvider: pid=17862 uid=10011 gids={}08-01 02:51:38.817: INFO/ActivityManager(123): Process com.ktix007.mira (pid 17708) has died.08-01 02:51:38.817: INFO/WindowManager(123): WIN DEATH: Window{4407fd70 com.ktix007.mira/com.ktix007.mira.Mira paused=false}08-01 02:51:38.827: WARN/ActivityManager(123): Scheduling restart of crashed service com.ktix007.mira/.bgPlayer in 5000ms08-01 02:51:38.847: WARN/TimedEventQueue(96): Event 315 was not found in the queue, already cancelled?08-01 02:51:38.857: INFO/WindowManager(123): WIN DEATH: Window{440a3ed0 com.ktix007.mira/com.ktix007.mira.player paused=false}08-01 02:51:38.867: INFO/ActivityManager(123): Low Memory: No more background processes.08-01 02:51:38.907: INFO/ActivityThread(17862): Publishing provider com.android.deskclock: com.android.deskclock.AlarmProvider08-01 02:51:39.717: INFO/ActivityManager(123): Process com.android.deskclock (pid 17862) has died.08-01 02:51:39.727: INFO/ActivityManager(123): Low Memory: No more background processes.08-01 02:51:39.907: DEBUG/dalvikvm(17823): GC_FOR_MALLOC freed 7394 objects / 409864 bytes in 140ms08-01 02:51:40.197: DEBUG/Launcher(17823): about to setAppWidget for id=2, info=AppWidgetProviderInfo(provider=ComponentInfo{com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.SearchWidgetProvider})08-01 02:51:40.247: INFO/ActivityManager(123): Start proc com.google.android.googlequicksearchbox for broadcast com.google.android.googlequicksearchbox/.SearchWidgetProvider: pid=17869 uid=10044 gids={3003}08-01 02:51:41.017: INFO/ActivityThread(17869): Publishing provider com.google.android.googlequicksearchbox.google: com.google.android.googlequicksearchbox.google.GoogleSuggestionProvider08-01 02:51:41.627: DEBUG/Launcher(17823): about to setAppWidget for id=7, info=AppWidgetProviderInfo(provider=ComponentInfo{com.android.settings/com.android.settings.widget.SettingsAppWidgetProvider})08-01 02:51:41.667: INFO/ActivityManager(123): Start proc com.android.settings for broadcast com.android.settings/.widget.SettingsAppWidgetProvider: pid=17878 uid=1000 gids={3003, 1015, 3002, 3001}08-01 02:51:42.747: INFO/ActivityManager(123): Process com.google.android.googlequicksearchbox (pid 17869) has died.08-01 02:51:42.757: INFO/ActivityManager(123): Low Memory: No more background processes.08-01 02:51:43.067: INFO/ActivityManager(123): Process com.google.android.apps.genie.geniewidget (pid 17590) has died.08-01 02:51:43.077: WARN/ActivityManager(123): Scheduling restart of crashed service com.google.android.apps.genie.geniewidget/.GenieRefreshService in 10750ms08-01 02:51:43.097: INFO/ActivityManager(123): Low Memory: No more background processes.08-01 02:51:43.397: DEBUG/dalvikvm(17823): GC_FOR_MALLOC freed 8354 objects / 423984 bytes in 409ms08-01 02:51:43.567: DEBUG/Launcher(17823): about to setAppWidget for id=8, info=AppWidgetProviderInfo(provider=ComponentInfo{com.google.android.apps.genie.geniewidget/com.google.android.apps.genie.geniewidget.miniwidget.MiniWidgetProvider})08-01 02:51:43.667: INFO/ActivityManager(123): Start proc com.google.android.apps.genie.geniewidget for broadcast com.google.android.apps.genie.geniewidget/.miniwidget.MiniWidgetProvider: pid=17887 uid=10048 gids={3003, 1015}08-01 02:51:43.887: INFO/ActivityManager(123): Start proc com.ktix007.mira for service com.ktix007.mira/.bgPlayer: pid=17892 uid=10053 gids={3003}08-01 02:51:44.576: DEBUG/AndroidRuntime(17892): Shutting down VM08-01 02:51:44.576: WARN/dalvikvm(17892): threadid=1: thread exiting with uncaught exception (group=0x400207e8)08-01 02:51:44.677: ERROR/AndroidRuntime(17892): FATAL EXCEPTION: main08-01 02:51:44.677: ERROR/AndroidRuntime(17892): java.lang.RuntimeException: Unable to start service com.ktix007.mira.bgPlayer@43c9e050 with null: java.lang.NullPointerException08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3063)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at android.app.ActivityThread.access$3600(ActivityThread.java:125)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2096)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at android.os.Handler.dispatchMessage(Handler.java:99)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at android.os.Looper.loop(Looper.java:123)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at java.lang.reflect.Method.invokeNative(Native Method)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at java.lang.reflect.Method.invoke(Method.java:521)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at dalvik.system.NativeStart.main(Native Method)08-01 02:51:44.677: ERROR/AndroidRuntime(17892): Caused by: java.lang.NullPointerException08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at com.ktix007.mira.bgPlayer.onStart(bgPlayer.java:35)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at android.app.Service.onStartCommand(Service.java:420)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3053)08-01 02:51:44.677: ERROR/AndroidRuntime(17892):     ... 10 more08-01 02:51:45.137: DEBUG/Launcher(17823): about to setAppWidget for id=10, info=AppWidgetProviderInfo(provider=ComponentInfo{com.android.music/com.android.music.MediaAppWidgetProvider})08-01 02:51:45.197: INFO/ActivityManager(123): Process com.android.settings (pid 17878) has died.08-01 02:51:45.197: INFO/ActivityManager(123): Low Memory: No more background processes.08-01 02:51:45.267: INFO/ActivityThread(17887): Publishing provider com.google.android.apps.genie.geniewidget.weather: com.google.android.apps.genie.geniewidget.providers.WeatherProvider08-01 02:51:45.417: INFO/ActivityThread(17887): Publishing provider com.google.android.apps.genie.geniewidget.newsimage: com.google.android.apps.genie.geniewidget.providers.NewsImageProvider08-01 02:51:46.197: WARN/Genie(17887): Cache file not found: java.io.FileNotFoundException: /data/data/com.google.android.apps.genie.geniewidget/files/genie_iconcache (No such file or directory)08-01 02:51:46.487: DEBUG/Launcher(17823): about to setAppWidget for id=11, info=AppWidgetProviderInfo(provider=ComponentInfo{com.google.android.youtube/com.google.android.youtube.widget.WidgetProvider})08-01 02:51:46.896: DEBUG/dalvikvm(17887): GC_FOR_MALLOC freed 9118 objects / 346184 bytes in 247ms08-01 02:51:47.437: INFO/ActivityManager(123): Start proc com.android.music for broadcast com.android.music/.MediaAppWidgetProvider: pid=17907 uid=10020 gids={3003, 1015}08-01 02:51:47.517: INFO/ActivityManager(123): Process com.google.android.apps.genie.geniewidget (pid 17887) has died.08-01 02:51:47.517: INFO/ActivityManager(123): Low Memory: No more background processes.08-01 02:51:48.137: INFO/dalvikvm(17823): Jit: resizing JitTable from 512 to 102408-01 02:51:48.277: INFO/ActivityManager(123): Start proc com.google.android.youtube for broadcast com.google.android.youtube/.widget.WidgetProvider: pid=17914 uid=10023 gids={3003}08-01 02:51:48.587: INFO/ActivityManager(123): Process com.android.music (pid 17907) has died.08-01 02:51:48.587: INFO/ActivityManager(123): Low Memory: No more background processes.08-01 02:51:48.647: INFO/ActivityThread(17914): Publishing provider com.google.android.youtube.SuggestionProvider: com.google.android.youtube.suggest.SuggestionProvider08-01 02:51:49.027: INFO/YouTube(17914): Distribution channel:mvapp-android-google08-01 02:51:49.827: INFO/ActivityManager(123): Process com.google.android.youtube (pid 17914) has died.08-01 02:51:49.827: INFO/ActivityManager(123): Low Memory: No more background processes.</code></pre>","404784","","404784","","2010-08-01 00:49:14","2011-06-16 12:01:14","Service with MediaPlayer Force Closes","<android>","2","3","","",""
"3380261","1","3382112","","2010-08-01 00:13:12","3","893","<p>I have a layout that creates a ListActivity. Before displaying the ListActivity, I perform a database query, and then hook that data up to the List using a SimpleCursorAdapter.</p><p>All of this works fine on 1.6 and higher. On 1.5, the my function that performs the query successfully executes, but then a few seconds later a StackOverflowError takes place. Does anyone know why this error would occur in 1.5 but not in 1.6?</p><p>UPDATE: I have determined that the crash occurs when I move from an Activity with a TabView to an Activity with the ListView. If I go to the ListView from an Activity that does not contain a Tab View, then the crash does not occur. The activity with the ListView is returning a Cursor to a query where the database has about 10 columns. Of those 10 columns, I display 3 columns on the screen.</p><p>Here is the flow of execution for my code:</p><pre><code>TabView Activity sends Intent to start List View ActivityonCreate() //of ListActivity{    showList();}showList(){    //open DataBase    //perform query    //create SimpleCursorAdapter    //setListAdapter}</code></pre><p>So for example, this runs completely fine on a Droid with 2.1 installed and on an emulator targeting 1.6. But the above fails on the HTC Hero with 1.5 and on an emulator targeting 1.5.</p><p>The crash happens if I let setListAdapter execute. If that line is out, everything works, but obviously my data does not get shown. It doesn't crash on the line that calls setListAdapter, but it'll eventually crash if setListAdapter is ever executed.</p><p>Stack Trace:</p><pre><code>Thread [&lt;3&gt; main] (Suspended (exception StackOverflowError))ViewRoot.draw(boolean) line: 1235   ViewRoot.performTraversals() line: 1030 ViewRoot.handleMessage(Message) line: 1482  ViewRoot(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 123 ActivityThread.main(String[]) line: 3948    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  Method.invoke(Object, Object...) line: 521  ZygoteInit$MethodAndArgsCaller.run() line: 782  ZygoteInit.main(String[]) line: 540 NativeStart.main(String[]) line: not available [native method]  </code></pre>","449070","","449070","","2010-08-01 15:54:23","2011-09-14 11:28:10","StackOverflowError 1.5 vs 1.6","<android>","1","3","","",""
"3380271","1","3380304","","2010-08-01 00:22:23","0","515","<p>Is there a way to know which Intent Filter is responsible for launching an Activity which has two Intent Filters defined in AndroidManifest.xml? I want a slightly different set of logic, but not enough that should require a whole new Activity.</p><p>Thanks!</p>","383455","","","","","2010-08-01 00:36:13","2 Intent Filters, 1 Activity - Which opened it?","<android><android-intent><intentfilter>","1","0","","",""
"3380322","1","3382093","","2010-08-01 00:43:06","2","1781","<p>I've got a quite interesting issue when I try to display a <code>ProgressDialog</code> (the simple, spinner type) within a <code>onPreferenceChange</code> listener.</p><pre><code>public class SettingsActivity extends PreferenceActivity {  private ProgressDialog dialog;  public void onCreate(Bundle savedInstanceState) {    ListPreference pref= (ListPreference) findPreference(""myPreference"");      pref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {      @Override      public boolean onPreferenceChange(Preference preference, Object newValue) {        dialog = ProgressDialog.show(SettingsActivity.this, """", ""Doing stuff..."", true);        SystemClock.sleep(2000);     }    return true;  }}</code></pre><p>The <code>ProgressDialog</code> shows up, but not until the method (<code>sleep</code> in this case) has finished. What am I doing wrong?</p>","404691","","","","","2010-08-01 12:55:30","Displaying ProgressDialog within a PreferenceActivity","<java><android><progressdialog><preferenceactivity>","2","0","1","",""
"3380323","1","","","2010-08-01 00:43:25","0","591","<p>This is my layout for an image capture program in android </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;SurfaceView android:id=""@+id/surface_camera""            android:layout_width=""fill_parent"" android:layout_height=""420px""&gt;        &lt;/SurfaceView&gt;    &lt;RelativeLayout android:layout_width=""fill_parent""        android:layout_alignParentBottom=""true"" android:id=""@+id/beforeClick""        android:layout_height=""wrap_content"" android:background=""@color/clickPanelBK""        android:paddingTop=""6dp"" android:paddingBottom=""6dp""&gt;        &lt;Button android:gravity=""center"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:id=""@+id/capture_image_goback_btn""            android:background=""@drawable/generalbutton"" android:text=""@string/back"" /&gt;        &lt;Button android:gravity=""center""            android:layout_centerHorizontal=""true"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:id=""@+id/capture_image_btn""            android:background=""@drawable/clickbutton"" /&gt;    &lt;/RelativeLayout&gt;    &lt;RelativeLayout android:layout_width=""fill_parent""        android:layout_alignParentBottom=""true"" android:id=""@+id/afterClick""        android:layout_height=""wrap_content"" android:background=""@color/clickPanelBK""        android:paddingTop=""6dp"" android:paddingBottom=""6dp""&gt;        &lt;Button android:gravity=""center"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:id=""@+id/img_retake""            android:background=""@drawable/generalbutton"" android:text=""@string/retake"" /&gt;        &lt;Button android:gravity=""center""            android:layout_alignParentRight=""true"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:id=""@+id/img_save""            android:text=""@string/saveImg"" android:background=""@drawable/generalbutton"" /&gt;    &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>The last 2 relative layouts are swappable and are aligned fine. Only one of them appear at a time and is changed on a button click. Anyway, The problem here is, I have to mention the layout_height of surface view in px or dp. If I give layout_height as  fill_parent, the view appears very small, 35% of width and height. Can anyone please give me a solution ?</p>","368084","","368084","","2010-08-01 00:49:13","2010-08-01 19:07:27","Problems with layout_height used inside RelativeLayout in android 1.5","<android><android-emulator>","1","1","","",""
"3380444","1","3380641","","2010-08-01 01:54:30","0","5274","<p>I'm using <a href=""http://stackoverflow.com/questions/1389811/gps-not-update-location-after-close-and-reopen-app-on-android"">this code</a>  to find my current location. But if I'm at home it can't locate me. But google maps and another similar applications can locate me although I'm at home. What is difference?</p>","346665","","","","","2010-08-01 04:09:51","Android GPS My Location finding","<android><google-maps><gps><location>","1","0","","",""
"3380479","1","3380630","","2010-08-01 02:16:13","0","1064","<p>I am using the Android SDK icon-button for refresh (ic_menu_refresh) in a widget and I need to change the selection state when it is pressed.  How is this done?  Do I define an XML for the button?</p>","157804","","","","","2010-08-01 03:32:06","How do I get the android icons to change state (highlights)?","<android><icons><android-widget><standard-icons>","1","0","","",""
"3380489","1","","","2010-08-01 02:22:14","1","645","<p>G'day,</p><p>I'm trying to update part of a VBO with a call to glBufferSubData(). When I update from the start (0) of my existing shadow buffer, there is no problem, as the buffer starts reading from 0. The following will read 0 to y from the buffer and place it at 0 to y in the VBO:</p><pre><code>gl.glBufferSubData(GL11.GL_ARRAY_BUFFER, 0, y, mPositionBuffer);</code></pre><p>However, if I want to update a portion of the VBO (not from 0) I run into a problem; The following doesn't work, since it will write the values from the start of the buffer (0 to y) into position x to x+y of the VBO:</p><pre><code>gl.glBufferSubData(GL11.GL_ARRAY_BUFFER, x, y, mPositionBuffer);</code></pre><p>Changing the position using buffer.position(x) does not have any effect:</p><pre><code>gl.glBufferSubData(GL11.GL_ARRAY_BUFFER, x, y, mPositionBuffer.position(x));</code></pre><p>A solution is to slice() the buffer, which works great:</p><pre><code>mPositionBuffer.position(x);gl.glBufferSubData(GL11.GL_ARRAY_BUFFER, x, y, mPositionBuffer.slice());</code></pre><p>But this causes garbage since a new buffer is generated by using slice, even though it uses the same data store.</p><p>The question: Is there a way to get the desired result (replace an offset part of a VBO using an offset into a buffer) without generating garbage? As you probably guessed, this is for an android game and in-game garbage collection is a no-no.</p><p>Thanks! Aert.</p>","158121","","","","","2011-05-30 12:50:32","glbuffersubdata with an offset into buffer, without causing garbage","<java><android><opengl-es>","2","0","","",""
"3380549","1","3380620","","2010-08-01 02:47:36","0","913","<p>I want to show automatic checklist in android. For example I can have 4 list of item with unchecked check box adjutant to that. </p><p>After 5 sec. delay I want to check the first item then move on to second. At the end of 20 sec. I should have all 4 check box checked one by one. </p><p>Any idea how should I go on doing this ? I can use list view with checkbox opeion on ..right ??</p><p>I am a .net programmer and this is new experience for me so any comment / advise is appreciated.</p>","110287","","244296","","2010-08-01 03:34:45","2010-08-01 03:34:45","Automatic Checkbox list with 5 sec. delay in android","<java><android><android-ui>","2","0","1","",""
"3380595","1","3380617","","2010-08-01 03:15:15","0","1019","<p>I have a program with a function copied below it plays a sound upon clicking a button. If you click the button 10 times 10 different media players play the same sound that is the way i want it but how can i assign a button to stop all 10 media players at a time like a ""STOP ALL BUTTON""</p><pre><code>public void onClick(View v){ int resId = 0; int stopped = 0; switch (v.getId()){ case R.id.Wail:  resId = R.raw.fedsigwail;  break; case R.id.Yelp:  resId = R.raw.fedsigyelp;  break; case R.id.HiLow:  resId = R.raw.hilow;       break; case R.id.FederalQ:  resId = R.raw.federalq;  break; case R.id.Horn:  resId = R.raw.fedsignhorn;  break; case R.id.STOPALL:  mp.stop();  mp.release();  stopped = 1;  break; } if (stopped != 1){ mp = MediaPlayer.create(this, resId); mp.start(); }}</code></pre><p>The code above only stops the last instance of mp.</p><p>Any Input would be appreciated</p>","407754","","","","","2010-08-01 03:26:55","Android MediaPlayer SDK","<android>","1","0","","",""
"3380761","1","8323190","","2010-08-01 04:40:20","1","1953","<p>I have a widget which is a TimePicker that retrieves the time saved in a field in a database.</p><p>Thing is that when the user changes the time value in the widget, this is not being saved in the database.</p><p>So I came across the <strong>setOnTimeChangedListener</strong> method that works like a charm, if you are only using the plus and minus signs in the widget.  It does not capture the change if you are using the keyword.</p><p>Here is my code:</p><pre><code>pickedTime.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() {        public void onTimeChanged(TimePicker arg0, int arg1, int arg2) {            System.out.println(""What time is it? ""                    + String.valueOf(arg0.getCurrentHour()) + "":""                    + String.valueOf(arg0.getCurrentMinute()));        }    });</code></pre><p>I've also tried unsuccessfully:</p><p><strong>pickedTime.setOnFocusChangeListener</strong> and <strong>pickedTime.setOnKeyListener</strong> methods.</p>","372475","","249630","","2011-11-30 08:49:11","2013-11-08 13:57:03","How can I capture when time changes in a TimePicker if the keyboard is being used?","<android><timepicker>","3","2","2","",""
"3380767","1","3380825","","2010-08-01 04:43:30","5","5464","<p>I have created an application that loads a website using WebView. Everything works fine except that I'm unable to play any video files within the application. So, what I'm looking for help on is getting my application to launch the mediaplayer when I click on a link ending with .mp4. Any help and tips would be much appreciated!</p>","407774","","","","","2012-04-09 22:21:46","launch mediaplayer on link click in WebView","<android>","2","1","4","",""
"3380775","1","","","2010-08-01 04:47:33","0","211","<p>alright first off i will say that im definitely newer to android programming than most.. i think that i am picking up quite quickly however i think that the program that im looking to eventually create is a bit out of my league right now considering my level of knowledge.. im hoping someone here can either tell me what i need to do so i can do my research and start working or maybe even provide me with some sample source code to work from</p><p>i have figured out how to do everything in my android program except for creating a list that is populated by an internet file that i update and maintain on a daily basis.. i dont care what file type it is.. i can learn to use whatever if it gets the job done.. the program reads the information from the file, properly splits it up into an array (multiple actually considering there are multiple parts that accompany each item in the list), and creates the list with the items - each of which are clickable and sends you to a separate page/activity with the full information of that item that you clicked on</p><p>any help with this would be greatly greatly appreciated</p>","407775","","","","","2010-08-01 04:47:33","clickable list of individual items populated by single internet file (android)","<android><list><internet><clickable>","0","2","","",""
"3380853","1","3380921","","2010-08-01 05:17:32","3","1824","<p>In my case I want to write an app which is totally symetrical (not client-server) with identical functionality at two PCs, one a 'standard' Windows or Linux box and the other an Android slate.</p><p>Can I run the same program on both or do I nneed to wrap it in an Android package for persmissioons, etc? </p><p>The two PCs will communciate by TCP/IP, sort of peer-to-peer, but I suspect that as a generic question this might be of interest to many.</p>","192910","","454824","","2013-04-05 10:04:42","2013-04-05 10:04:42","Can I run a ""standard"", non-Android, Java app on Android?","<android>","2","0","","",""
"3380923","1","","","2010-08-01 05:48:45","1","296","<p>I have a service that starts and binds correctly when it's first called, but successive bindings to that same service fail when called by other activities.</p><p>The code:</p><pre><code>activity.startService(new Intent().setClass(activity, ServerListenerService.class));        xmppServiceConnection = new ServiceConnection() {        public void onServiceDisconnected(ComponentName name) {            ServerActivityConnection.this.xmppService = null;        }        public void onServiceConnected(ComponentName name, IBinder binder) {            //set everything up        }    };activity.bindService(new Intent().setClass(activity, ServerListenerService.class), xmppServiceConnection, Activity.BIND_AUTO_CREATE);</code></pre><p>The second time around, after the call to <code>activity.bindService</code>, the serviceconnection's <code>onServiceConnected</code> method never gets called. I use a connection class that does the binding, so the method is the same for both activities. The service is also correctly added the manifest file.</p><p>Any ideas?</p><p>Many Thanks</p>","407791","","","","","2011-05-28 23:45:39","Android Service starts/binds correctly, but only the first time","<android><android-service>","1","0","","",""
"3381050","1","","","2010-08-01 06:46:07","0","2504","<p>Here is my code. everything works great except the orientation, it reloads every time I rotate the phone it reloads to the home page, it is a pain. can anyone tell me where the problem is.</p><pre><code>import android.app.Activity;import android.content.Intent;import android.content.res.Configuration;import android.os.Bundle;import android.view.Gravity;import android.view.KeyEvent;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.View;import android.view.ViewGroup;import android.view.Window;import android.webkit.WebChromeClient;import android.webkit.WebSettings;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.FrameLayout;import android.widget.Toast;public class hpro extends Activity {/** Called when the activity is first created. */WebView webview;//zoomprivate static final FrameLayout.LayoutParams ZOOM_PARAMS =    new FrameLayout.LayoutParams(    ViewGroup.LayoutParams.FILL_PARENT,    ViewGroup.LayoutParams.WRAP_CONTENT,    Gravity.BOTTOM);//finish zoom@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);//progress bargetWindow().requestFeature(Window.FEATURE_PROGRESS);// frame startssetContentView(R.layout.main);webview = (WebView) findViewById(R.id.webview); WebSettings webSettings = webview.getSettings(); webview.getSettings().setPluginsEnabled(true);webview.setWebViewClient(new HelloWebViewClient() {}); // MARKwebSettings.setJavaScriptEnabled(true); //zoom FrameLayout mContentView = (FrameLayout) getWindow().getDecorView().findViewById(android.R.id.content);final View zoom = this.webview.getZoomControls();mContentView.addView(zoom, ZOOM_PARAMS);zoom.setVisibility(View.GONE);//end zoom//loading barfinal Activity activity = this;webview.setWebChromeClient(new WebChromeClient() {  public void onProgressChanged(WebView view, int progress) {    // Activities and WebViews measure progress with different scales.    // The progress meter will automatically disappear when we reach 100%    activity.setProgress(progress * 100);  }});webview.setWebViewClient(new WebViewClient() {  public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {    Toast.makeText(activity, ""Oh no! "" + description, Toast.LENGTH_SHORT).show();  }});webview.loadUrl(""http://mypage.com/""); }//orientation@Overridepublic void onConfigurationChanged(Configuration newConfig){           super.onConfigurationChanged(newConfig);}//block browserprivate class HelloWebViewClient extends WebViewClient {@Overridepublic boolean shouldOverrideUrlLoading(WebView view, String url){view.loadUrl(url);return true;}}// back keypublic boolean onKeyDown(int keyCode, KeyEvent event) {if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {webview.goBack();return true;}return super.onKeyDown(keyCode, event);}//start submenu@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.menu, menu);    return true;}public boolean onOptionsItemSelected(MenuItem item) {switch (item.getItemId()) {case R.id.home:webview.loadUrl(""http://mypage.com"");return true;case R.id.exit:// TODOIntent i = new Intent();i.setAction(Intent.ACTION_MAIN);i.addCategory(Intent.CATEGORY_HOME);this.startActivity(i);return true;case R.id.reg:webview.loadUrl(""http://mypage.com/subpage"");return true;case R.id.help:webview.loadUrl(""http://mypage.com/help"");return true;}return false;}}</code></pre>","407807","","12707","","2010-08-01 07:01:58","2011-01-16 13:34:38","Webview orientation not working","<android><webview><screen-orientation><screen-rotation>","2","0","","",""
"3381217","1","","","2010-08-01 07:56:58","1","494","<p>I have to create a UI with components(TextView, Bottons etc) placed at particular coordinates as specified in an XML coming from a server. I am currently using AbsoluteLayout but since its deprecated i want to use some other method.</p>","237403","","","","","2010-08-01 08:05:27","How to add UI components on specific coordinates","<android><android-ui>","2","0","","",""
"3381326","1","3381461","","2010-08-01 08:37:19","2","7001","<p>I have a number of images in my directory.I want to show random images in ANDROID.Please anyone provide me with an example.</p>","655814","","19540","","2010-08-01 08:42:09","2012-08-07 18:54:45","How to show random images on Android?","<android>","3","0","","",""
"3381364","1","3381410","","2010-08-01 08:47:05","0","3723","<p>I am trying to download a zip file using HttpCLient 4 and it is going at around .5 (kilobytes/kilobits)? per minute. The file is less than a MB large, and the download will probably take an hour! Am I doing something wrong? How else should I do this? Here is my current implementation:</p><pre><code>@Override            protected Uri doInBackground(String... params) {                publishProgress(""Downloading..."");                  try {                        HttpPost searchPOST = new HttpPost(""http://www.somesite.com/"" + searchResult.getURLSuffix());                        List&lt;NameValuePair&gt; formparams = new ArrayList&lt;NameValuePair&gt;();                        //added parameters here...                        UrlEncodedFormEntity paramsEntity = new UrlEncodedFormEntity(formparams, HTTP.UTF_8);                        searchPOST.setEntity(paramsEntity);                HttpResponse manualResponse = client.execute(searchPOST);                Header fileNameHeader = manualResponse.getFirstHeader(""Content-Disposition"");                Pattern p = Pattern.compile(""filename=\""(.+?)\"""");                Matcher m = p.matcher(fileNameHeader.getValue());                if (m.find()) {                    String fileName = m.group(1);                    InputStream zipStream = manualResponse.getEntity().getContent();                    File cacheDir = context.getCacheDir();                    String tempFileForZip = cacheDir.getAbsolutePath() + ""/"" + fileName;                    FileOutputStream fos = new FileOutputStream(tempFileForZip);                    int bytesDownloaded = 0;                    try {                        int c;                        while ((c = zipStream.read()) != -1) {                            fos.write(c);                            bytesDownloaded++;                            kilobytesDownloaded=(bytesDownloaded / 1000);                            publishProgress((String[])null);                        }                    } finally {                        if (zipStream != null) {                            zipStream.close();                        }                        if (fos != null) {                            fos.close();                        }                    }                    fos.close();                String zipFilePath = tempFileForZip;                //Change to indeterminate                kilobytesDownloaded = fileSize;                publishProgress(""Extracting..."");                //TODO: Preferences for save directory                saveDirectory = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + ""/"" + ""Downloads/"");                ZipTools.unzipArchive(new File(zipFilePath), saveDirectory);                }                    } catch (IllegalStateException e) {                        // TODO Auto-generated catch block                        e.printStackTrace();                    } catch (IOException e) {                        // TODO Auto-generated catch block                        e.printStackTrace();                    } finally {                    }                return Uri.fromFile(saveDirectory);         }</code></pre>","325081","","40342","","2013-10-07 12:17:05","2013-10-07 12:17:05","Apache HttpClient in Android extremely slow downloading attachment","<android><performance><download><apache-httpclient-4.x>","1","0","3","",""
"3381523","1","3382066","","2010-08-01 09:47:11","1","329","<p>I want to send a username and password to a php page in android.how do i do this using httposti.e i want to get the values using POST in the PHP page.Please give me an example.Thankyou</p>","655814","","","","","2010-08-01 12:44:06","Httpost in android","<android>","1","0","1","",""
"3381702","1","3381718","","2010-08-01 10:42:20","1","2733","<p>I wonder,how can I draw a nice flight route between 2 points on a google map'sMapView?</p><p>look at this:<a href=""http://maps.forum.nu/gm_flight_path.html"" rel=""nofollow"">http://maps.forum.nu/gm_flight_path.html</a></p><p>this is exactly what I need.</p><p>thanks!</p>","258429","","","","","2010-08-03 07:46:01","Google Maps - MapView - draw a nice flight route between 2 points","<android><google-maps>","1","0","1","",""
"3381752","1","3382032","","2010-08-01 10:58:56","0","566","<p>Hi I am developing an Android App where I require a user to authenticate his session before using the app. One way is to store a user name and password by asking him to register on the app and then use that to authenticate him. But i was looking to do something else, maybe use an OpenId account to authenticate or Opensoial or something like Facebook Connect. Any Suggestions and comments? thanks for you help.</p>","363441","","","","","2010-08-01 12:29:26","Authentication on Android","<java><android><openid><oauth><authorization>","1","1","","",""
"3382080","1","3382180","","2010-08-01 12:50:38","1","2754","<p>for quite a while I have been trying to solve an issue with a Null Pointer Exception while populating a ViewStub. What I am trying to do is within a SlidingDrawer that contains some imageButtons and ViewStubs to fill in the ViewStubs when an ImageButton is pressed. I have been following the <a href=""http://developer.android.com/reference/android/view/ViewStub.html"" rel=""nofollow"">ViewStub Class Overview</a> to create the ViewStubs, but I still get the Null Pointer Exception. If someone could help me out here, that would be great because I really don't know anymore what I should do to solve this issue...I will post my code below</p><p>Thank you very much in advance!</p><hr><p>Here is the part of my code causing the exception:</p><pre><code>btnExposure = (ImageButton) findViewById(R.id.button_exposure);        btnExposure.setOnClickListener(new OnClickListener()        {         @Override   public void onClick(View v) {          try{              ViewStub stub = (ViewStub) findViewById(R.id.stub_exposure);           importStub = stub.inflate();          }catch (Exception e){                 Log.e(""ERROR"", ""Error in Code:"" +e.toString());}   }        });</code></pre><p>This is the DrawingSlider XML file containing the ViewStub: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""   android:layout_width=""fill_parent""    android:layout_height=""fill_parent""   android:background=""@drawable/shape_background_gradient""         &gt;     &lt;LinearLayout      android:layout_width=""205px""      android:layout_height=""155px""      android:background=""#FFCCCCCC""      android:id=""@+id/VideoViewHolder""      android:padding=""2.5px""      android:layout_centerHorizontal=""true""      android:layout_marginTop=""5px""      android:layout_marginBottom=""5px""      &gt;  &lt;VideoView   android:layout_width=""200px""   android:layout_height=""150px""   android:id =""@+id/VideoViewEdit""   android:layout_centerHorizontal=""true""   &gt;  &lt;/VideoView&gt;  &lt;/LinearLayout&gt;  &lt;ScrollView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@id/VideoViewHolder""&gt;   &lt;TableLayout     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:stretchColumns=""0""&gt;    &lt;TableRow      android:background=""@drawable/shape_track_background""      android:padding=""5px""      &gt;     &lt;ImageView android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:src=""@drawable/ic_editor_videotrack""          android:padding=""5px""          android:layout_gravity=""left""/&gt;    &lt;/TableRow&gt;    &lt;TableRow      android:background=""@drawable/shape_track_background""      android:padding=""5px""      &gt;      &lt;ImageView android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:src=""@drawable/ic_editor_audiotrack""          android:padding=""5px""          android:layout_gravity=""left""/&gt;    &lt;/TableRow&gt;    &lt;TableRow      android:background=""@drawable/shape_track_background""      android:padding=""5px""      &gt;     &lt;ImageButton android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:src=""@drawable/ic_editor_add_media""          android:padding=""5px""          android:layout_gravity=""left""          /&gt;    &lt;/TableRow&gt;   &lt;/TableLayout&gt;  &lt;/ScrollView&gt; &lt;SlidingDrawer     android:id=""@+id/drawer""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""  android:orientation=""horizontal""     android:handle=""@+id/handle""     android:content=""@+id/content""&gt;     &lt;ImageView         android:id=""@id/handle""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/slider_handle""         /&gt;     &lt;LinearLayout         android:id=""@id/content""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         android:orientation=""vertical""&gt;        &lt;ImageButton          android:id=""@+id/button_exposure""         android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:background=""#77000000""   android:src=""@drawable/ic_slider_exposure""   android:padding=""5px""   android:layout_marginBottom=""1px""   android:layout_gravity=""left""/&gt;        &lt;ImageButton          android:id=""@+id/button_properties""         android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:background=""#77000000""   android:src=""@drawable/ic_slider_properties""   android:padding=""5px""   android:layout_marginBottom=""1px""   android:layout_gravity=""left""/&gt;        &lt;ImageButton          android:id=""@+id/button_special_effects""         android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:background=""#77000000""   android:src=""@drawable/ic_slider_special_effects""   android:padding=""5px""   android:layout_marginBottom=""1px""   android:layout_gravity=""left""/&gt;  &lt;ImageButton          android:id=""@+id/button_test1""         android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:background=""#77000000""   android:src=""@drawable/ic_slider_exposure""   android:padding=""5px""   android:layout_marginBottom=""1px""   android:layout_gravity=""left""/&gt;        &lt;ImageButton          android:id=""@+id/button_test2""         android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:background=""#77000000""   android:src=""@drawable/ic_slider_exposure""   android:padding=""5px""   android:layout_marginBottom=""1px""   android:layout_gravity=""left""/&gt;     &lt;/LinearLayout&gt;     &lt;ViewStub      android:id=""@+id/stub_exposure""      android:inflatedId=""@+id/stub_exposure_view""      android:layout=""@layout/exposureview""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:background=""#77000000""&gt;     &lt;/ViewStub&gt;     &lt;ViewStub      android:id=""@+id/stub_properties""      android:inflatedId=""@+id/stub_properties_view""      android:layout=""@layout/propertiesview""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:background=""#77000000""&gt;     &lt;/ViewStub&gt;     &lt;ViewStub      android:id=""@+id/stub_special_effects""      android:inflatedId=""@+id/stub_special_effects_view""      android:layout=""@layout/specialeffectsview""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:background=""#77000000""&gt;     &lt;/ViewStub&gt; &lt;/SlidingDrawer&gt;&lt;/RelativeLayout&gt;</code></pre><p>And this is the ViewStub layout xml (exposureview.xml), which is called to inflate the Stub:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" &gt; &lt;TextView  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:text=""@+String/hello"" &gt;&lt;/TextView&gt; &lt;SeekBar  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:thumb=""@drawable/seek_thumb""  android:progress=""50""  android:max=""100""&gt; &lt;/SeekBar&gt;&lt;/RelativeLayout&gt;</code></pre>","390782","","","","","2012-04-21 03:13:07","How to solve a Null Pointer Exception when trying to populate a ViewStub?","<android><nullpointerexception><viewstub>","3","2","","",""
"3382130","1","3387829","","2010-08-01 13:08:06","36","1411","<p>I have a friend who is quite a capable programmer, especially considering that he is blind.  Now he would like to start developing for Android.  But, the problem I see him running into is that there appears to be no accessibility features for the Android emulator.  Ideally he would be able to have his computer read the contents of the Android emulation screen to him.  However, at least from what I've seen, the contents of the Android screen and the buttons that can be used to manipulate the emulation Android etc. are all invisible to a screen reader.</p><p>Does anyone know of a workaround for this?</p><hr><p>UPDATE:  I found what looks like a promising resource <a href=""http://eyes-free.googlecode.com/svn/trunk/documentation/tutorial/tutorial.html"">here</a>.  It's a Text-to-Speech library for Android developed by <a href=""http://en.wikipedia.org/wiki/T._V._Raman"">T. V. Raman</a> of Google.  I'm still looking for more information from the community though.</p>","348056","","348056","","2010-08-01 19:04:00","2013-11-09 01:28:34","Programming for Android as a blind person","<android><accessibility><android-emulator><blind>","3","2","3","",""
"3382164","1","3382544","","2010-08-01 13:17:57","2","627","<p>I have created an application that read messages with voice. I would like to pause any running media player when a message arrives in order to make the voice more clear. Is there any intent that could achieve this aim? I have noticed that google navigator, for example, is able to pause media player (and other music app like pandora).</p><p>Thanks in advanceTobia Loschiavo </p>","269585","","","","","2010-08-01 15:22:52","Pause any mediaplayer on some event","<android><android-intent><media-player>","1","0","1","",""
"3382188","1","","","2010-08-01 13:25:41","5","10154","<p>I am trying to use a WebView in my Android application. I am creating my webview in code-side (not in XML). My problem is; when I call loadUrl method of webview, the webview goes fullscreen mode. How can I keep the size of the webview for example 200x200 pixels?</p><p>If there is any other option instead of webview, of course welcome :)</p><p>Thanks,</p>","407941","","","","","2012-09-16 14:31:10","How to set WebView as non-fullscreen?","<android><webview>","4","2","1","",""
"3382499","1","3382532","","2010-08-01 15:09:23","3","3340","<p>I'm dipping my toes into Android development. I have a project that will interface with a RESTful resource and I'm trying to figure out how to do a basic GET with params over HTTP. From everything I've read, the consensus seems to be favoring HTTPClient over HttpURLConnection.</p><p>I've written a wrapper class with a method that takes care of instantiating the key object to make a request using HTTPClient:</p><pre><code>public String get() {      String responseString = null;    HttpClient client = new DefaultHttpClient();    HttpGet get = new HttpGet();    try {        get.setURI(new URI(this.baseURL()));    } catch (URISyntaxException e1) {        e1.printStackTrace();    }    HttpResponse response;    try {        response = client.execute(get);        responseString = readResponse(response.getEntity());        if(response != null) {            System.out.println(responseString);        }    } catch(ClientProtocolException e) {        e.printStackTrace();    } catch(IOException e) {        e.printStackTrace();    }    return responseString;</code></pre><p>}</p><p>The line <code>HttpClient client = new DefaultHttpClient();</code> throws the following exception:</p><pre><code>java.lang.RuntimeException: Stub!at org.apache.http.impl.client.AbstractHttpClient.&lt;init&gt;(AbstractHttpClient.java:5)at org.apache.http.impl.client.DefaultHttpClient.&lt;init&gt;(DefaultHttpClient.java:7)at org.rcindustries.appmap.RestClient.get(RestClient.java:54)at org.rcindustries.appmap.test.functional.RestClientTest.shouldReturnSomeJSon(RestClientTest.java:26)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)at org.junit.runners.ParentRunner.run(ParentRunner.java:236)at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)</code></pre><p>Every example I've seen for HttpClient uses a similar structure to do GETs and POSTs. Is the  Apache Commons library bundled with the Android SDK significantly different that the standard lib?</p>","120259","","403455","","2012-03-07 22:10:24","2013-10-30 14:21:20","Apache DefaultHttpClient invocation results in ""java.lang.RuntimeException: Stub!""","<java><android><unit-testing><httpclient><apache-commons>","3","0","2","",""
"3382597","1","3382747","","2010-08-01 15:40:03","0","398","<p>I've got the hard-coded layout, consisting of <code>Button</code>s, and need to enlarge some of them. I found <code>Button</code>'s method <code>setWidth(int value)</code>, accepting width in pixels, but I need to set value in <code>dp</code>. So, how can I set <code>dp</code> value in program code?</p>","402534","","1507439","","2013-04-23 19:39:01","2013-04-23 19:39:01","Hard-coding button's width in dimension units","<java><android>","1","2","","",""
"3382603","1","3382659","","2010-08-01 15:42:43","4","6146","<p>My SeekBar (slider) works just fine but, it increments/decrements by one's as I slide my finger but, I want to change the increment value to a constant, such as 5.  I tried using</p><blockquote>  <p>slider.incrementProgressBy(5);</p></blockquote><p>to do it but, it doesn't work (note: I placed it in different locations, inside and outside the action listener, but it didn't work).</p><p>Here are the two lines that relate to this:</p><pre><code>slider.incrementProgressBy(5);validBpm = slider.getProgress();</code></pre><p>Those lines are currently inside the SeekBar's touch listener.</p><p>I imagine it's simple and I'm overlooking the obvious - any suggestions?  Thanks...</p>","382200","","","","","2010-08-01 15:58:49","Android: SeekBar Increment Value - How To","<android><slider><increment><seekbar>","1","0","2","",""
"3382790","1","3383056","","2010-08-01 16:33:47","0","569","<p>I am working on an application that tries to streamline data entry from a very repetitive process:</p><ol><li>Enter some details that require full-screen graphics and would be confusing if scrolled</li><li>Enter some more atomic details</li><li>Enter yet more atomic details</li><li>Apply the accumulated data</li><li>Go back to step 1</li></ol><p>I am pretty sure that i can represent this as 3 separate Activities and then just fire up new Intents for each activity in each cycle. What I can't yet get a sense of is whether this is a viable approach.</p><p><strong>Question 1:</strong> If I do a fire-and-forget approach, how much of the resource management is going to be handled by Android? Will it just happily deallocate/reuse/etc. activities behind the scenes? Or is this something i have to manage myself?</p><p><strong>Question 2:</strong> Is there a way to cause the reusing of activities so that only one instance of each activity is ever allocated and is just reused for each cycle? </p><p><strong>Question 3:</strong> Can one manipulate the activity stack so that there aren't ~100 (approximated number of expected cycles) cycles worth of activities on the stack? I'd like to be able to use the back key no more than three times and exit out of the data entry portion to a summary page.</p><p><strong>Question 4:</strong> Can anyone suggest alternate approaches to the cycles of activities problem? I have considered view flippers and tabs, but wasn't sure that would be better or not.</p>","8668","","","","","2010-08-01 17:41:44","Android: Repetitive Android Activity Workflow. Fire and Forget?","<android><workflow><activity>","1","0","","",""
"3382996","1","","","2010-08-01 17:26:03","20","20727","<p>I need a small code snippet which unzips a few files from a given .zip file and gives the separate files according to the format they were in the zipped file. Please post your knowledge and help me out. </p>","408033","","815724","","2013-04-09 01:28:12","2013-09-03 06:16:43","How to unzip files programmatically in Android?","<java><android><unzip>","6","0","15","",""
"3383082","1","3383327","","2010-08-01 17:47:52","1","790","<p>How do I create code for collision detection on a bitmap rotated by a matrix?</p><pre><code>canvas.drawBitmap(mAnimation, mainMatrix, null);</code></pre><p>mainMatrix is derived from a PathMeasure so i do not know the rotationThe bitmap is rotated around x=0,y=0  and thus a circle around the centre will not work (or at least be too big)</p><p>thanks</p>","381258","","","","","2010-08-01 19:01:52","Android - Setting bitmap collision detection after rotation by matrix","<android><matrix><collision-detection>","1","0","","",""
"3383198","1","3383333","","2010-08-01 18:20:48","0","1200","<p>I don't think this problem is caused from my ListActivity subclass. I think it has something to do with with my BaseAdapter subclass:</p><pre><code>package com.mohit.gtodo;import com.mohit.gtodo.database.TasksDBAdapter;import android.content.Context;import android.database.Cursor;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.CheckBox;import android.widget.CursorAdapter;import android.widget.TextView;public class TasksCursorAdapter extends CursorAdapter {public TasksCursorAdapter(Context context, Cursor c) {    super(context, c);}@Overridepublic void bindView(View view, Context context, Cursor cursor) {    CheckBox completed = (CheckBox) view.findViewById(R.id.completed);    TextView title = (TextView) view.findViewById(R.id.title);    title.setText(cursor.getString(cursor.getColumnIndex(TasksDBAdapter.KEY_TITLE)));    completed.setChecked(cursor.getInt(cursor.getColumnIndex(TasksDBAdapter.KEY_COMPLETED)) &gt; 0);}@Overridepublic View newView(Context context, Cursor cursor, ViewGroup parent) {    LayoutInflater inflater = LayoutInflater.from(context);    View view = inflater.inflate(R.layout.list_item, null);    return view;}}</code></pre><p>Am I forgetting a method override? </p>","200477","","","","","2010-08-01 19:02:38","OnListItemClick is never called?","<java><android><cursor><adapter>","1","0","","",""
"3383321","1","3383338","","2010-08-01 19:00:57","0","463","<p>In the Gmail app on my HTC Android phone, the headers are glossy black, much like the header on an iPhone.</p><p>Is there a setting on a view that I can use to create this background look, or is it a graphic they are over laying?</p>","172861","","","","","2010-08-01 19:03:37","Android Black Glossy Header/Footer View?","<android>","1","0","","",""
"3383353","1","3383602","","2010-08-01 19:07:52","1","836","<p>I have been asked to build an app that lets the user scroll massive amounts of text. The text will be several thousand of pages long. (Each page has and ID so we'll have a navigator too.)</p><p>Question: What's the best approach to have a lot of text scroll but load on demand more text as needed (up or down). I don't want to load the entire text stream, as that would take a long time. It'll need to display text in different colors and styles. eg headers in the text will be bold.</p><p>I considered the webview, but I would have to load the entire text into it wouldn't I?</p><p>Think: ""Browser for the War and Peace novels""</p><p>Ideas?</p>","172861","","","","","2010-08-01 20:23:31","Android extremely long text: scrolling ideas?","<android><scrolling>","1","0","1","",""
"3383367","1","3696663","","2010-08-01 19:10:59","6","9196","<p>I am trying to send a cookie along with my HttpGet request, but everytime I try I havent been able to successfully send it.   I also tried to modify the headers directly, here is my code:</p><pre><code>DefaultHttpClient httpClient = new DefaultHttpClient();  CookieStore store = new BasicCookieStore();store.addCookie(MyCookieStorageClass.getCookie());httpClient.setCookieStore(store);HttpGet httpGet = new HttpGet(""http://localhost/);     try {    // Execute HTTP Get Request      HttpResponse response = httpclient.execute(httpGet);      String responseData = ResponseHandler.getResponseBody(response);} catch (IOException e) {    e.printStackTrace();}</code></pre>","408079","","952041","","2012-10-30 15:19:03","2013-01-13 15:17:33","How to send a cookie along with HttpGet in Java","<java><android><cookies><httpclient>","3","1","6","",""
"3383439","1","3383568","","2010-08-01 19:34:28","2","818","<p>Beginner here, I have a simple question.</p><p>In Android what would be the best what to check for something at regular intervals?</p><p>Please bear with me, I'll try to explain the best I can --</p><p>For example my audio app is very simple, a main activity and a service. The main activity has a UI with two buttons, start and stop audio. I press start and the audio service starts. Likewise when I click Stop the service stops and the audio ends. If <code>isLooping()</code> is hard-coded to true there is no issue because the audio never ends unless I hit stop button, which stops the audio service and also resets the button states. </p><p>This is an issue now because I set <code>isLooping()</code> to false so the audio doesn't loop. So the audio will stop playing but the service is still running. </p><p>I want to be able to detect when the audio stops so I can set the states of the UI buttons. So I need something that is always checking whether audio is playing (i.e. check <code>player.isPlaying()</code> so I can end the service and set the enable/disable state of the buttons.</p><p>I figured out binding to the service so I can access the <code>MediaPlayer</code> controls via my main activity so I know the code to check if it's playing, but WHERE do I put this code so it's checked all the time? </p><p>Am I making sense? I know this is probably very simple. Thanks for any help.</p>","403146","","","","","2010-08-02 03:12:45","How to check something at regular intervals?","<android>","1","0","2","",""
"3383596","1","3383613","","2010-08-01 20:21:29","1","1876","<p>Here is the xml file of my Android widget: <a href=""http://pastebin.com/Kqxs5t9E"" rel=""nofollow"">http://pastebin.com/Kqxs5t9E</a></p><p>This code is showing me some good results in Eclipse, but as soon as I sent the file to my device and try to add the widget to my homescreen I get this error code and the widget showing: ""Problem Loading the Widget"": </p><p><a href=""http://pastebin.com/UcvWs1DA"" rel=""nofollow"">http://pastebin.com/UcvWs1DA</a></p><p>So what? I cannot use a Tablelayout within a widget????</p><p>What is the best solution so? I can create a lot of relativelayout but I guess that's not a good idea.</p><p>Thank for any help</p>","327402","","","","","2010-08-01 20:26:40","cannot use a Tablelayout within a widget?","<android><widget><tablelayout>","1","0","","",""
"3383638","1","","","2010-08-01 20:32:32","0","1008","<p>hii have a simple list view control my queries are:</p><p>1) how to set first row selected on start (after fill data in list view)</p><p>2) when i navigate by hardware button i got AdapterView.OnItemSelectedListener and color of row background change, but when i click i not get any OnItemSelectedListener and no row selected. How to select row on click.</p><p>3) when i change focus list row selection removed,</p><p>please any one with any solution, code example or articles i search but no susses</p><p>with regardsChandra Kant Singh  </p>","408122","","","","","2011-04-02 06:38:55","List view row Selection","<android><listview><select><listviewitem>","1","0","","",""
"3383826","1","3383942","","2010-08-01 21:31:28","0","473","<p>I have got list that is filled with data from internet.</p><p>Datas are downloaded in chunks. At the end of the list next portion of data is downloaded  and added to the list.</p><p>I'm detecting list end with help of onScrollListner:</p><pre><code>@Overridepublic void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {    if (view.getAdapter() != null &amp;&amp; ((firstVisibleItem + visibleItemCount) &gt;= totalItemCount) &amp;&amp; totalItemCount != mPrevTotalItemCount) {        Log.v(TAG, ""onListEnd, extending list"");        mPrevTotalItemCount = totalItemCount;        addMoreData();    }}</code></pre><p>I would like to add<code>Loading...</code> row when datas are being downloaded. Something similar to Gmail loading row at the end of the list. </p><p>I know that I can hack <code>adapter.getCount()</code> to return size + 1 and force <code>adapter.getView</code> to display loading... at the end of the list.</p><p>How can I do that in <strong>more</strong> elegant way?</p>","361832","","361832","","2010-08-02 15:27:30","2010-08-02 15:27:30","Loading... row at the end of the list - during data download","<android><listview><loading>","1","0","","",""
"3383952","1","","","2010-08-01 22:12:37","0","1296","<p>I have 5 Content Providers for my 5 table SQLiteDatabase.  They are named: </p><p><code>CoreActionProvider</code><code>CoreMovementProvider</code> <code>CoreRoundsProvider</code> <code>CoreChecksProvider</code> <code>CoreTermsProvider</code> </p><p>I have stepped through the startup process several times and have confirmed that all 5 Providers are loading.  However, only <code>CoreTermsProvider</code> and <code>CoreChecksProvider</code> are firing their <code>onCreate()</code> methods. </p><p>The tables do not exist for for the other 3.  I have attempted to run queries against them, and been greeted with the dreaded <code>SQLException</code>, stating that the table does not exist. </p><p>Is there a limit to the number of custom providers? </p><p>I will post the code for <code>CoreTermsProvider</code> only, as all 5 providers share the same code structure, just different table names: </p><pre><code>package com.vortex.rules.providers; import android.content.ContentProvider; import android.content.ContentUris; import android.content.ContentValues; import android.content.Context; import android.content.UriMatcher; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteQueryBuilder; import android.net.Uri; import android.text.TextUtils; import android.util.Log; public class CoreTermsProvider extends ContentProvider{     public static final String PROVIDER_NAME =         ""com.vortex.rules.providers.CoreTerms"";     public static final Uri CONTENT_URI = Uri.parse(""content://""+ PROVIDER_NAME + ""/terms"");     public static final String _ID = ""_id"";     public static final String TITLE = ""title"";     public static final String TEXT = ""text"";     private static final int TERMS = 1;     private static final int TERM_ID = 2;     private static final UriMatcher uriMatcher;     static{             uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);             uriMatcher.addURI(PROVIDER_NAME, ""terms"", TERMS);             uriMatcher.addURI(PROVIDER_NAME, ""terms/#"", TERM_ID);     }     //---for database use---     private SQLiteDatabase rulesDB;     private static final String DATABASE_NAME = ""Rules.db"";     private static final String DATABASE_TABLE = ""terms"";     private static final int DATABASE_VERSION = 1;     private static final String DATABASE_CREATE =             ""create table if not exists "" + DATABASE_TABLE +             ""(_id integer primary key autoincrement, ""             + ""title text not null, text longtext not null);"";     private static class DatabaseHelper extends SQLiteOpenHelper{             DatabaseHelper(Context context){                     super(context, DATABASE_NAME, null, DATABASE_VERSION);             }             @Override             public void onCreate(SQLiteDatabase db){                     db.execSQL(DATABASE_CREATE);             }             @Override             public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){                     Log.w(""Content Provider Database"",                                     ""Upgrading database from version "" +                                     oldVersion + "" to "" + newVersion +                                     "", which will destroy all old data"");                     db.execSQL(""DROP TABLE IF EXISTS terms"");                     onCreate(db);             }     }     @Override     public String getType(Uri uri){             switch (uriMatcher.match(uri)){             //---get all terms---             case TERMS:                     return ""vnd.android.cursor.dir/vnd.vortex.rules.terms "";             //---get a particular book             case TERM_ID:                     return ""vnd.android.cursor.item/vnd.vortex.rules.terms "";             default:                     throw new IllegalArgumentException(""Unsupported URI: "" + uri);             }     }     @Override     public boolean onCreate(){             Context context = this.getContext();             DatabaseHelper dbHelper = new DatabaseHelper(context);             rulesDB = dbHelper.getWritableDatabase();             return (rulesDB == null)? false:true;     }     @Override     public Cursor query(Uri uri, String[] projection, String selection,                     String[] selectionArgs, String sortOrder){             SQLiteQueryBuilder sqlBuilder = new SQLiteQueryBuilder();             sqlBuilder.setTables(DATABASE_TABLE);             if (uriMatcher.match(uri) == TERM_ID)                     //---if getting a particular term---                     sqlBuilder.appendWhere(_ID + ""="" + uri.getPathSegments().get(1));             if (sortOrder == null || sortOrder=="""")                     sortOrder = TITLE;             Cursor c = sqlBuilder.query(rulesDB, projection, selection, selectionArgs, null, null, sortOrder);             //---register to watch a content URI for changes---             c.setNotificationUri(getContext().getContentResolver(), uri);             return c;     }     @Override     public Uri insert(Uri uri, ContentValues values){             //---add a new term---             long rowId = rulesDB.insert(DATABASE_TABLE, """", values);             //---if added successfully---             if (rowId &gt; 0)             {                     Uri _uri = ContentUris.withAppendedId(CONTENT_URI, rowId);                     getContext().getContentResolver().notifyChange(_uri, null);                     return _uri;             }             throw new SQLException(""Failed to insert row into "" + uri);     }     @Override     public int delete(Uri arg0, String arg1, String[] arg2){             // arg0 = uri             // arg1 = selection             // arg2 = se;ectionArgs             int count = 0;             switch (uriMatcher.match(arg0)) {             case TERMS:                     count = rulesDB.delete(DATABASE_TABLE, arg1, arg2);                     break;             case TERM_ID:                     String id = arg0.getPathSegments().get(1);                     count = rulesDB.delete(DATABASE_TABLE, _ID + ""="" + id +                                     (!TextUtils.isEmpty(arg1)? "" AND ("" +                                                     arg1 + ')' : """"), arg2);                     break;             default:                     throw new IllegalArgumentException(""Unknown URI: "" + arg0);             }             getContext().getContentResolver().notifyChange(arg0, null);             return count;     }     @Override     public int update(Uri uri, ContentValues values,                     String selection, String[] selectionArgs)     {             int count = 0;             switch (uriMatcher.match(uri)){                     case TERMS:                             count = rulesDB.update(DATABASE_TABLE, values, selection, selectionArgs);                             break;                     case TERM_ID:                             count = rulesDB.update(DATABASE_TABLE, values, _ID + ""="" + uri.getPathSegments().get(1) +                                             (!TextUtils.isEmpty(selection) ? "" AND ("" +                                                             selection + ')' : """"), selectionArgs);                             break;                     default:                             throw new IllegalArgumentException(""Unknown URI: "" + uri);             }     getContext().getContentResolver().notifyChange(uri, null);     return count;     } }</code></pre><p>As you can see, it is a basic Content Provider. </p><p>Any help on this issue would be greatly appreciated.  I would have posted this on StackOverflow, but the ""Ask A Question"" link was throwing errors. </p>","405246","","299797","","2012-10-26 17:35:28","2012-10-26 17:35:28","custom ContentProvider loading, but not firing onCreate()","<android><android-contentprovider><oncreate>","0","4","","",""
"3384011","1","","","2010-08-01 22:36:50","1","1646","<p>I am attempting to learn Android development and have modified a sample app that loads a web page in a WebView. The web page contains a text input.  I want to use the Android DatePicker to input a value instead of the keyboard.  </p><p>The code below almost works. The DatePicker is displayed but throws an unknown error when I select a date and call loadUrl on the WebView in the onDateSet handler to update the value of the text input (end of code sample). I suspect a cross thread issue but I'm not sure.  Any guidance is appreciated.</p><pre><code>package com.freeze.android.hellowebview;import java.util.Calendar;    import android.app.Activity;import android.app.DatePickerDialog;import android.app.Dialog;import android.os.Bundle;import android.view.KeyEvent;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.DatePicker;public class HelloWebView extends Activity {    WebView webview;    class DateJavaScriptInterface      {          public void pickDate() {              showDialog(0);                  }      }    public void loadScript(String script){              webview.loadUrl(""javascript:(function() { "" + script + ""})()"");                 }    private class HelloWebViewClient extends WebViewClient {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            view.loadUrl(url);            return true;        }        @Override        public void onPageFinished(WebView view, String url) {                       loadScript(""document.getElementById('trips_dateandtime').onfocus = function(){this.blur();window.DateInterface.pickDate();};"");              }    }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        webview = (WebView) findViewById(R.id.webview);        webview.setWebViewClient(new HelloWebViewClient());        webview.getSettings().setJavaScriptEnabled(true);          webview.addJavascriptInterface(new DateJavaScriptInterface(), ""DateInterface"");         webview.loadUrl(""http://127.0.0.1:8000/mileage/default/index"");    }    @Override    public boolean onKeyDown(int keyCode, KeyEvent event) {             if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {            webview.goBack();            return true;        }        return super.onKeyDown(keyCode, event);    }    @Override    protected Dialog onCreateDialog(int id) {        switch (id) {        case 0:            final Calendar c = Calendar.getInstance();            int mYear = c.get(Calendar.YEAR);            int mMonth = c.get(Calendar.MONTH);            int mDay = c.get(Calendar.DAY_OF_MONTH);            return new DatePickerDialog(this,                        mDateSetListener,                        mYear, mMonth, mDay);        }        return null;    }    private DatePickerDialog.OnDateSetListener mDateSetListener =        new DatePickerDialog.OnDateSetListener() {            @Override            public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {                loadScript(""document.getElementById('trips_dateandtime').value = 'test';""); //ERROR            }        };}</code></pre>","84178","","","","","2010-08-17 02:53:27","How can I force a DatePicker to be used for input instead of the keyboard on an HTML text input inside a WebView in Android","<java><javascript><android><datepicker><webview>","1","1","","",""
"3384030","1","","","2010-08-01 22:44:28","1","254","<p>i have a listview with a bunch of items in it, each item has its own background, the problem is that if i only have one item in a list, the rest of the ""empty"" slots of the list is black. I tried applying a background around the listview and also on the view that sorrounds it (relativeView) and i get a strange margin around the whole list like the picture at the bottom. The question i have is, how can i remove the actual ""borders"" around the list so it still fills upp its parent ? .  </p><p><img src=""http://4.bp.blogspot.com/_9l0GmPwgCzk/SWOps9T_PKI/AAAAAAAAABM/89oBTVMLShE/s400/list_fade_2.png"" alt=""alt text""></p>","267822","","267822","","2010-08-01 23:13:32","2013-04-18 09:32:41","backgrounds in listview","<android><android-listview>","4","0","2","",""
"3384070","1","3384140","","2010-08-01 22:59:09","17","8971","<p>I installed all the <a href=""http://developer.android.com/sdk/requirements.html"" rel=""nofollow"">prerequisites for Android development</a>. I created a virtual device through Eclipse and tried to run the Hello World sample application in that device. I received the following error message.</p><blockquote>  <p>emulator: ERROR: unknown virtual device name: 'Android21Device'<br>  emulator: could not find virtual device named 'Android21Device'</p></blockquote><p>I get the same error when I try to start the device from the command line and through the SDK program.</p><p>I can see the device directory and files at </p><blockquote>  <p><code>D:\Users\anthony\.android\avd\Android21Device.avd</code></p></blockquote>","3619","","3619","","2011-07-28 14:24:51","2011-12-16 18:33:34","Why does the Android emulator report ""unknown virtual device"", when the device is in my user directory?","<android><windows><android-emulator>","4","0","10","",""
"3384087","1","","","2010-08-01 23:03:08","0","459","<p>Is it possible to detect (in real time) if somebody is blowing into the microphone ?Thanks</p>","346665","","","","","2013-11-21 17:08:27","Android microphone issue","<android><audio><microphone>","2","0","1","",""
"3384109","1","3384608","","2010-08-01 23:11:44","0","824","<p>I have a simple LinearLayout. When I add the <strong>android:background</strong> to the LinearLayout, the <strong>TextView</strong> is no longer visible. </p><p>What am I not understanding?</p><pre><code>&lt;LinearLayout    android:id=""@+id/LinearLayout01""    android:layout_width=""fill_parent""    android:layout_height=""53px""   android:background=""@drawable/glossy_black_top_bar""   &gt;       &lt;TextView android:text=""This is the Title""        android:id=""@+id/TextView01""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""       android:gravity=""center_vertical""       android:textColor=""#FFFFFF""&gt;       &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre>","172861","","","","","2010-08-02 02:11:36","Android background hides child view text","<android>","1","0","","",""
"3384146","1","3470861","","2010-08-01 23:24:09","5","1788","<p>I'm looking for a way to allow a user to press a button to browse the contents of the SD card, and then select a folder, whose path will be returned to the application. Similar to how you pull up the ""Browse..."" dialog on Windows for installations.</p>","321697","","","","","2010-10-03 07:39:48","Allow a user to select a folder on an SD card","<android>","3","0","2","",""
"3384179","1","3384226","","2010-08-01 23:42:13","0","595","<p>I'm working on my first game, and it works fine, but clearly needs some optimizing. Initially, I had everything running on one thread (I used the LunarLander API to get started on gaming). Since then, I've added 2 new threads to the game. It still works just fine, but I see no improvement. I must be doing something wrong..</p><p>This is the basic setup:</p><pre><code>class GameView extends SurfaceView implements SurfaceHolder.Callback {    private Mover mover;    private Collider collider;    private GameThread thread;    class Mover extends Thread{             //methods    }    class Collider extends Thread{             //methods    }    class GameThread extends Thread{             //methods    }    public GameView(Context context, AttributeSet attrs) {            mover = new Mover();            collider = new Collider();            thread = new GameThread();            thread.start();    }}</code></pre><p>Then, in the GameThread class I call methods on other threads when needed:</p><pre><code>collider.checkCollision();</code></pre><p>Is this the proper way to reduce load on the main thread?</p>","408178","","","","","2010-08-03 19:28:32","How to thread in Android?","<android><multithreading>","2","0","","",""
"3384291","1","3384333","","2010-08-02 00:25:22","0","638","<p>I am working on a media player for an example application... and things are moving along great... except that when I add my AlbumAdapter to the Gallery Widget... it never calls getView.</p><p>Isn't this right?</p><pre><code>albumList = getAlbums(mCurrentArtist);    // updateAlbumArt();    if (albumList.size() &gt; 0) {        Log.v(""Log"", ""got here"");        AlbumAdapter coverImageAdapter = new AlbumAdapter();        Gallery gallery = (Gallery) player.findViewById(R.id.covers);        gallery.setSpacing(5);        gallery.setAdapter(coverImageAdapter);        Log.v(""coverImageAdapter"", ""Count is: ""+coverImageAdapter.getCount());        Log.v(""Gallery"", ""Object: ""+gallery.toString()+"" Child count: ""+gallery.getChildCount());</code></pre><p>There are 13 items in the adapter... I checked. No call to getView is ever made... I have a Log item there that never gets called.</p><p>Here is my Adapter class</p><pre><code>public class AlbumAdapter extends BaseAdapter {    class ViewHolder {        ImageView cover;    }    public int getCount() {        return coverImages.size();    }    public Object getItem(int position) {        return coverImages.get(position);    }    public long getItemId(int position) {        // TODO Auto-generated method stub        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        ViewHolder holder;        Album album;        BitmapFactory.Options options = new BitmapFactory.Options();        options.inSampleSize = 3;        Log.v(""Gallery"", ""Position : ""+position);        if (convertView == null) {            convertView = inflater.inflate(R.layout.cover, null);            holder = new ViewHolder();            holder.cover = (ImageView) convertView                    .findViewById(R.id.albumcover);            holder.cover                    .setLayoutParams(new Gallery.LayoutParams(120, 170));            holder.cover.setScaleType(ImageView.ScaleType.CENTER_INSIDE);            convertView.setTag(holder);        } else {            holder = (ViewHolder) convertView.getTag();        }        if (position &gt; getCount()) {            Bitmap empty = BitmapFactory.decodeResource(getResources(),                    R.drawable.empty, options);            Drawable cover = new BitmapDrawable(getResources(), empty);            cover.setDither(true);            holder.cover                    .setLayoutParams(new Gallery.LayoutParams(120, 170));            holder.cover.setScaleType(ImageView.ScaleType.CENTER_INSIDE);            holder.cover.setImageDrawable(cover);            Log.v(""AlbumAdapter"", ""Adding cover to fill empty spot"");        } else {            album = albumList.get(position);            if (album.cover == null) {                holder.cover                        .setLayoutParams(new Gallery.LayoutParams(120, 170));                holder.cover.setScaleType(ImageView.ScaleType.CENTER_INSIDE);                holder.cover.setImageDrawable(createReflectedResource(R.drawable.albumart_unknown, album, position));                BitmapDrawable drawable = (BitmapDrawable) holder.cover                        .getDrawable();                drawable.setAntiAlias(true);                Log.v(""AlbumAdapter"", ""Missing cover... adding default"");            } else {                holder.cover.setLayoutParams(new Gallery.LayoutParams(120,                        170));                holder.cover                        .setScaleType(ImageView.ScaleType.CENTER_INSIDE);                holder.cover                        .setImageDrawable(coverImages.get(position));                BitmapDrawable drawable = (BitmapDrawable) holder.cover                        .getDrawable();                drawable.setAntiAlias(true);                Log.v(""AlbumAdapter"", ""adding artist cover..."");            }        }        return convertView;    }</code></pre><p>Here is the log:</p><pre><code>08-02 01:10:46.821: VERBOSE/Album:(562): Adding Alice In Chains Alice In Chains</code></pre><p>08-02 01:10:46.821: VERBOSE/Album:(562): Adding Alice In Chains Black Gives Way To Blue08-02 01:10:46.821: VERBOSE/Album:(562): Adding Alter Bridge Blackbird08-02 01:10:46.831: VERBOSE/Album:(562): Adding Alice In Chains Dirt08-02 01:10:46.831: VERBOSE/Album:(562): Adding Alice In Chains Facelift08-02 01:10:46.831: VERBOSE/Album:(562): Adding Alice In Chains Jar Of Flies08-02 01:10:46.831: VERBOSE/Album:(562): Adding August Burns Red Messengers08-02 01:10:46.831: VERBOSE/Album:(562): Adding As I Lay Dying An Ocean Between Us08-02 01:10:46.831: VERBOSE/Album:(562): Adding Alter Bridge One Day Remains08-02 01:10:46.842: VERBOSE/Album:(562): Adding Alice In Chains SAP08-02 01:10:46.852: VERBOSE/Album:(562): Adding As I Lay Dying Shadows Are Security08-02 01:10:46.852: VERBOSE/Album:(562): Adding August Burns Red Thrill Seeker08-02 01:10:46.852: VERBOSE/Album:(562): Adding Alice In Chains Unplugged08-02 01:10:46.871: VERBOSE/Log(562): got here</p><p>08-02 01:10:49.311: VERBOSE/coverImageAdapter(562): Count is: 13</p><p>08-02 01:10:49.321: VERBOSE/Gallery(562): Object: android.widget.Gallery@439558c0 Child count: 0</p><p>08-02 01:10:49.571: INFO/ActivityManager(222): Displayed activity com.androidworkz.andamp/.andAMP: 4062 ms (total 4062 ms)</p>","386654","","58792","","2010-08-16 13:21:10","2010-08-16 13:21:10","Weird issue: Gallery Widget never calls getView","<android>","1","2","","",""
"3384362","1","3384461","","2010-08-02 00:56:36","1","1955","<p>I'm trying to get my current location and show it on a map.</p><p>Class <code>com.google.android.maps.MyLocationOverlay.MyLocationOverlay</code> does most of the work for you.</p><p>But it's coming back with a very coarse result that's off by a couple of clicks.</p><p>I'm listening for <code>onAccuracyChanged()</code> but that never gets called.</p><p>How can I get a more accurate location when using <code>MyLocationOverlay</code>?</p><p>P.S. manifest has:</p><pre><code> &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""    android:debuggable=""true""&gt;    &lt;uses-library android:name=""com.google.android.maps"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""/&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""/&gt;    </code></pre>","253661","","496830","","2011-11-08 13:00:51","2011-11-08 13:00:51","How can I get a more accurate location?","<android><map><gps><mylocationoverlay>","1","0","","",""
"3384457","1","3385780","","2010-08-02 01:23:08","8","1137","<p>I have a free application that has a number of paid-for upgrade applications you can buy for it. The base game is free and remains the application that the user always launches, it detects the presence of the other applications and unlocks various upgrade features as appropriate.</p><p>I wanted to use the new licensing service to detect whether the bought applications were licensed, and pass the name of the package to the licensing service to verify if it is authorised (and blindly following the sample I stupidly assumed that passing in the package name to the obfuscator meant that the package name was passed to the licensing server - oops). However I've just realised how dumb that was, and in any case I have hit a brick wall: ""If you already published your application as free, you won't be able to upload an updated version that includes licensing (that is, an application that uses the same package name and that includes the licensing permission)"".</p><p>So, a two-part question: is there any plan to implement what I'm looking for: to check from inside a free application whether any of my other paid published applications are licensed?</p><p>If not, then what would be the best way of achieving what I'm seeking? I'm thinking of maybe sending an intent to each of the installed upgrades, getting them to perform the licensing check, and then getting the upgrades to pass the response back into my base application. Sounds a bit messy - any better ideas?</p><p>Thanks loads!</p>","408227","","","","","2010-08-02 07:24:16","How to check Android licensing permission of other applications","<android><licensing>","1","0","4","",""
"3384484","1","3384501","","2010-08-02 01:32:21","1","511","<p>In Android, is it possible to share files between 2 different apps running in separate processes?</p>","440093","","","","","2010-08-02 01:39:08","Android: Possible to share files between different apps?","<android>","2","0","","",""
"3384692","1","3384718","","2010-08-02 02:44:47","2","821","<p>Can you please tell me how can I get the photo data if I have a list of photo_ids?</p><p>I try this:</p><pre><code>cursor = mResolver.query(Contacts.Photos.CONTENT_URI, null, ""_id IN (?)"" , new String[] {""458""}, null);</code></pre><p>But the cursor return null.</p><p>Any idea How to troubleshoot?  </p><p>Thank you.</p>","286802","","12707","","2010-08-02 14:39:06","2011-02-04 19:49:41","How can I get the photo data (the blob of contact photo) if I have photo_ids","<android>","2","0","2","",""
"3384733","1","3385050","","2010-08-02 03:01:33","0","111","<p>I've built a dialog that asks the user to pick a city from the list provided when the application first opens. The dialog works perfectly, however I want to store the user's choice so that when the app is opened a second time, it checks to see if the user has already made a selection previously. If they have, it doesn't display the dialog and defines the city variable as their previously chosen preference. And obviously, if they haven't made a selection previously (because its their first time opening the app or for some reason the app couldn't read the stored preference), it displays the dialog.</p><p>Here's my dialog in case this helps:</p><pre><code>final CharSequence[] CityChoice = {""Austin"", ""Dallas/Fort Worth"", ""Houston"", ""San Antonio""}; AlertDialog.Builder alt_bld = new AlertDialog.Builder(this); alt_bld.setIcon(R.drawable.icon); alt_bld.setTitle(""Select your city""); alt_bld.setSingleChoiceItems(CityChoice, -1, new DialogInterface.OnClickListener() {  public void onClick(DialogInterface dialog, int item) {   Toast.makeText(getApplicationContext(), ""Your city is now set to ""+CityChoice[item]+"". To change this, go to Menu -&gt; Preferences."", Toast.LENGTH_LONG).show();   dialog.dismiss();              }          });AlertDialog alert = alt_bld.create();alert.show();</code></pre><p>edit: Oh, and by the way, although I'm picking up android programming fairly quickly (at least I think I am haha) I have to admit I'm quite new to it. So the more detailed your response the better. Thanks a ton in advance.</p>","407775","","11808","","2012-05-04 08:34:28","2012-05-04 08:34:28","storing a user selection that stores itself for use on reload in android app","<android><selection><store>","1","0","","",""
"3384876","1","3386782","","2010-08-02 03:50:36","0","632","<p>i would like to show data from my database onto a spinner. how would that be possible?As there is an null error in my logcat.</p><p>Booking.java</p><pre><code>public class Booking extends Activity {    private DBAdapter db;     private Spinner colourSpinner;    private String txtArrival;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        db = new DBAdapter(this);        db.open();        setContentView(R.layout.booking);        Cursor c = db.getSpinnerData();        startManagingCursor(c);        String[] from = new String[]{txtArrival};        int[] to = new int[]{android.R.id.text1};        SimpleCursorAdapter adapter =        new SimpleCursorAdapter(this, android.R.layout.simple_spinner_item, c, from, to );        adapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );        Spinner colourSpinner = (Spinner) findViewById( R.id.spinner );        colourSpinner.setAdapter(adapter);        }}</code></pre><p>DBAdapter.java</p><pre><code>public Cursor getSpinnerData() throws SQLException         {            Cursor mCursor =                    db.query(DATABASE_TABLE_2, new String[] {                              KEY_ROWID2,                            KEY_ARRIVAL,},                             null,                            null,                             null,                             null,                             null);            if (mCursor != null) {                mCursor.moveToFirst();            }            return mCursor;        }</code></pre><p>Logcat</p><pre><code>08-02 08:39:27.123: ERROR/AndroidRuntime(746): Uncaught handler: thread main exiting due to uncaught exception08-02 08:39:27.174: ERROR/AndroidRuntime(746): java.lang.RuntimeException: Unable to start activity ComponentInfo{one.two/one.two.Booking}: java.lang.NullPointerException08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.os.Handler.dispatchMessage(Handler.java:99)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.os.Looper.loop(Looper.java:123)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.app.ActivityThread.main(ActivityThread.java:3948)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at java.lang.reflect.Method.invokeNative(Native Method)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at java.lang.reflect.Method.invoke(Method.java:521)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at dalvik.system.NativeStart.main(Native Method)08-02 08:39:27.174: ERROR/AndroidRuntime(746): Caused by: java.lang.NullPointerException08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.database.sqlite.SQLiteCursor.getColumnIndex(SQLiteCursor.java:311)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:312)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.widget.SimpleCursorAdapter.findColumns(SimpleCursorAdapter.java:336)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.widget.SimpleCursorAdapter.&lt;init&gt;(SimpleCursorAdapter.java:88)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at one.two.Booking.onCreate(Booking.java:27)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)08-02 08:39:27.174: ERROR/AndroidRuntime(746):     ... 11 more</code></pre><p>Thank you.</p>","358218","","358218","","2010-08-02 08:41:13","2010-08-02 10:16:02","Help with showing data on spinner","<android><database><eclipse><sqlite><spinner>","1","2","0","",""
"3384878","1","","","2010-08-02 03:51:19","5","4631","<p>i have downloaded the phonegap example from its website.but it doesn't run.i can't find the reason.help me to get the solution please.when i run it shows</p><p>""The Web page at file:///andriod_asset/www/index.html could not be loaded as:The requested file was not found.www/index.html""</p>","402980","","","","","2012-05-22 14:11:03","phonegap doesn't work","<android><android-emulator><phonegap>","5","0","2","",""
"3384941","1","","","2010-08-02 04:14:31","2","1017","<p>I am just starting to learn Android development using the Android SDK and Eclipse. I can get my HelloWorld starting app to run in the device emulator, but not on my Verizon Droid handset. I have downloaded the drivers for Windows 7 and I can see the files on the handset in Windows Explorer, so I'm assuming I have the drivers working. I have enabled the USB Debugging on the handset.  </p><p>The problem is that when I set the Debug mode to Manual in Eclipse, I do not see my device in the ""Choose device"" list.  What am I missing?</p>","408288","","379693","","2010-08-02 05:00:12","2012-11-21 08:15:12","Debugging an Android app in Eclipse using the handset","<android><eclipse><debugging><mobile>","2","2","1","",""
"3385004","1","3385850","","2010-08-02 04:31:31","1","588","<p>I have an app which has a section that needs to convert the temperature from Celsius to Fahrenheit, but for some reason on only a couple phone models (like the htc desire and Sony Ericsson X10) it crashes at this part, but I have no idea why.  can anyone help?</p><pre><code>double cel = x/10;  finalTFF = 9.0f/5.0f * cel + 32.0;   DecimalFormat twoDForm = new DecimalFormat(""##.0"");  double NfinalTFF = Double.valueOf(twoDForm.format(finalTFF));  return twoDForm.format(NfinalTFF);</code></pre>","274365","","","","","2010-08-02 09:28:53","Android temperature conversion force close","<android><temperature>","2","0","1","",""
"3385059","1","","","2010-08-02 04:46:40","7","11877","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3641920/how-to-encode-a-wav-to-a-mp3-on-a-android-device"">How to encode a WAV to a mp3 on a Android device</a>  </p></blockquote><p>I want to record audio in MP3 format in my android application. I know I can read PCM audio using the audioRecord class. Is there a java library compatible with android that will encode PCM to MP3? Is it possible to use the Lame mp3 encoder library?</p>","408306","","","","","2011-08-10 01:22:29","Mp3 encoder for android, record audio in mp3 format","<android><mp3><audio-recording>","0","2","2","2012-12-18 20:20:06",""
"3385075","1","","","2010-08-02 04:49:57","3","3327","<p>I need help in geting results back from intent launched from preference screen </p><pre><code>   // Intent preference    DevicePref =    getPreferenceManager().createPreferenceScreen(this);    // Show a Screen with list of Devices Discovered    Intent i = new Intent(this,getDevice.class);    DevicePref.setIntent(i);    DevicePref.setTitle(""Select Device"");    DevicePref.setSummary(mSelectedDevice);    deviceOptionsCat.addPreference(DevicePref); </code></pre><p>I want user to select device... In preference screeen I show ""Select Device"" .. when user clicks that, another screen is launched by intent where all devices are listed. User selects the device. </p><p>Now how do I know user selected which device? And I want to update that in the summary. </p><p>Pls. let me know Thanks </p>","408309","","201393","","2010-08-02 04:51:57","2010-08-02 05:38:57","[Android]How to get results from intent launched from preference screen?","<android><android-preferences>","1","0","3","",""
"3385085","1","3385342","","2010-08-02 04:53:05","1","1473","<p>I've got the following node in my XML layout:</p><pre><code>&lt;com.x.y.view.TagLayout android:id=""@+id/TagLayout"" android:layout_width=""fill_parent"" android:layout_height=""170dip"" /&gt;</code></pre><p>TagLayout is a class that extends ViewGroup, and basically holds a bunch of buttons with text (a custom object that act as tags, but that's neither here or there).</p><p>The problem is that when there are too many buttons, the view no longer scrolls. I can confirm that I am adding tags but I can't see anything.</p><p>If I wrap the above within a <code>ScrollView</code>, the layout never renders. I tried adding the attributes android:isScrollContainer and android:scrollbars, but that doesn't change anything. Is there something I'm missing here?</p><p>I should also add that TagLayout is overriding the onMeasure() event. I guess I need to implement a scrolling mechanism there...?</p>","213345","","213345","","2010-08-02 05:25:08","2011-12-20 22:58:43","Adding scroll bar to a custom ViewGroup?","<android><uiview><scrollbar>","2","0","","",""
"3385106","1","3386495","","2010-08-02 04:57:48","1","3168","<p>I've a local service that is started in my main activity. The service is responsible for network I/O. It also interacts with other activities in my application. Till, now the service was only ""providing"" data to activity (using callbacks and not Intents.)</p><p>Now I need to send data (custom objects) from my activities to the service. I understand one way to do it using Intents. I know it is possible to receive an Intent in the service by overriding the <code>onStartCommand()</code> in my service. But it's not clear to me if the onStartCommand will be invoked every time I broadcast an Intent from my sending activity. Can a Service also be <code>BroadcastReceiver</code> ? If yes - how ? </p><p>Thanks. </p>","306346","","","","","2010-08-02 09:28:12","Android - Sending data from an activity to a service","<android><service><android-intent><broadcastreceiver>","1","0","3","",""
"3385117","1","","","2010-08-02 05:01:26","6","7889","<p>When I develop an Android map application, I want to draw a circle on the map whose radius is 1 meter. As you known, I can't draw 1 meter directly, I should convert 1 meter to the distance of two pixels depend on the zoom level. How to I convert it, is there anything API I can use.</p><p>Canvas.draw(x, y, radius), what value should I put to this method ?</p>","389204","","","","","2012-07-04 06:54:17","How to change 1 meter to pixel distance?","<android>","5","2","8","",""
"3385381","1","","","2010-08-02 06:01:13","2","2801","<p>I'm trying to set a system property in Android 2.2. Using Android for eclipse plug-in. The line that's causing the exception is:</p><pre><code>Settings.Secure.putString(getContentResolver(),                          Settings.Secure.HTTP_PROXY, ""127.0.0.1:8099"")</code></pre><p>And while running in the emulator I'm getting:</p><blockquote>  <p>08-01 22:48:44.338: ERROR/DatabaseUtils(58): java.lang.SecurityException: Permission denial: writing to secure settings requires android.permission.WRITE_SECURE_SETTINGS</p></blockquote><p>I have already in my AndroidManifest.xml the following lines in front of the 'application' tag:</p><pre><code>&lt;uses-permission android:name=""android.permission.WRITE_SECURE_SETTINGS"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_SETTINGS"" /&gt;</code></pre><p>What else am I missing?</p>","408343","","234938","","2010-08-02 07:00:46","2011-05-27 22:10:52","Android java.lang.SecurityException on Settings.Secure.putString()","<android><android-manifest>","1","0","0","",""
"3385457","1","","","2010-08-02 06:21:16","1","1372","<p>Embedded Application (GUI) written in QT and communicating (Via IPC, SPI some other mechanism) with an Android based application (the primary application). Would like to know 1. The overall pros and cons of such design 2. Re usability of the GUI (would it be better to write your GUI on Android?)3. Consider the two apps will be running on different machines (Linux and windows), how feasible it would be for them to communicate.</p><p>What is the best way to do this sort of design. I am new(in QT and Android) and do not know of the other preferred practice.</p><p>Any info would be useful.thanks</p>","398728","","","","","2012-08-15 02:54:32","GUI in Qt OR GUI in Android","<android><gui><qt4>","2","0","1","2013-04-17 20:38:19",""
"3385504","1","3385965","","2010-08-02 06:30:21","0","508","<p>I have a main class which has edittext box. And i have another class in the same source folder. Now i want to use the text typed in main class accessible to the another class. </p><p>any help is greatly appreciated</p>","401983","","","","","2010-08-02 08:02:44","how to call an object of another class","<android>","1","0","","",""
"3385511","1","3385619","","2010-08-02 06:31:43","0","1685","<p>Android: i am using twitter authentication by launching webview</p><pre><code>Intent authIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl));startActivity(authIntent);</code></pre><p>after successfull authentication onNewintent get call and control returns to my activity.</p><p>problem is webview still remain open after control return to my activity and if user press back button user can access that page again, how can i finish webview activity after control return to my actiivyt.</p><p>i would like to call finish on ""authIntent"" how can i ?</p>","216431","","","","","2012-06-12 20:38:38","android calling finish on intent","<android><webview><android-intent>","1","0","1","",""
"3385554","1","5054882","","2010-08-02 06:40:43","11","7366","<p>In my Android app, I call both <code>startService</code> and <code>bindService</code>:</p><pre><code>Intent intent = new Intent(this, MyService.class);ServiceConnection conn = new ServiceConnection() { ... }startService(intent)bindService(intent, conn, BIND_AUTO_CREATE);</code></pre><p>Later, I attempt to both <code>unbindService and</code>stopService`:</p><pre><code>unbindService(conn);stopService(intent);</code></pre><p>However, I get an exception on the call to <code>unbindService</code>.  If I remove this call, the app seems to run properly through the <code>stopService</code> call.</p><p>Am I doing something wrong?  I thought a <code>bindService</code> call had to be associated with an <code>unbindService</code> call, and a <code>startService</code> call had to be associated with a <code>stopService</code> call.  This doesn't seem to be the case here, though.</p>","107277","","","","","2011-04-20 16:41:28","Do I need to call both unbindService and stopService for Android services?","<android><serviceconnection>","3","1","4","",""
"3385631","1","3385689","","2010-08-02 06:55:44","16","5844","<p>How to restrict special characters from an Android EditText field?</p>","313613","","2153784","","2011-09-13 13:50:47","2011-09-13 13:50:47","How to restrict special characters from an Android EditText field?","<android><edittext>","1","0","3","",""
"3385682","1","","","2010-08-02 07:08:15","1","846","<p>I'm trying to schedule my AlarmManager to wake up every day with a diffrent random time which occurs between 22:00 - 06:00.</p><p>I've tried this technic, but it doesnt seems to work:</p><pre><code> public class AlarmReciver extends BroadcastReceiver {   @Override   public void onReceive(Context context, Intent intent)   {     try          {             System.out.println(TAG+"": Alert recieved"");              schedualeNextTimeAlarming(context);          } catch (Exception e)          {            } private void schedualeNextTimeAlarming(Context context){       AlarmManager am = (AlarmManager) context   .getSystemService(Context.ALARM_SERVICE);    Intent intent = new Intent(context, AlarmReciver.class);   PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, 0);    am.cancel(pi);    getNextTime(am, pi); } private void getNextTime(AlarmManager am, PendingIntent pi) {   int max = 8;   int min = 1;   final Random myRandom = new Random();   int result = myRandom.nextInt(max - min) + min;   int hourOfDay = 0;  switch (result)  {    case 0:         hourOfDay = 22;         break;    case 1:         hourOfDay = 23;        break;    case 2:        hourOfDay = 24;        break;    default:         hourOfDay = result;   }   hourOfDay = 15; //for testing  System.out.println(""next time alert: ""+hourOfDay+"" seconds"");  Calendar cal = Calendar.getInstance();   //  cal.add(Calendar.DAY_OF_YEAR, 1); if i disable this line, the Alarm wont work at all.  cal.set(Calendar.HOUR_OF_DAY, 0);  cal.set(Calendar.MINUTE, 1);  cal.set(Calendar.SECOND, hourOfDay);  am.cancel(pi);  am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pi);</code></pre><p>}</p><p>my expected result is, that every 15 secodns ill have an alarm.this is the output:</p><pre><code>08-02 11:56:48.188: INFO/System.out(9138): InformationReceiver: Alert recieved08-02 11:56:48.198: INFO/System.out(9138): next time alert: 15 seconds08-02 11:56:48.218: INFO/System.out(9138): InformationReceiver: Alert recieved08-02 11:56:48.228: INFO/System.out(9138): next time alert: 15 seconds08-02 11:56:48.248: INFO/System.out(9138): InformationReceiver: Alert recieved08-02 11:56:48.248: INFO/System.out(9138): next time alert: 15 seconds08-02 11:56:48.278: INFO/System.out(9138): InformationReceiver: Alert recieved08-02 11:56:48.278: INFO/System.out(9138): next time alert: 15 seconds08-02 11:56:48.308: INFO/System.out(9138): InformationReceiver: Alert recieved</code></pre><p>As you can see, it doesnt Alarm every 15 seconds.</p><p>I wanna achive the situation of re-scheduale a new Alarm time, every time it gets into this function</p><p>any solution or other effective suggestions would be very welcome.</p><p>Thanks.</p>","273550","","273550","","2010-08-02 09:11:02","2013-08-06 11:59:17","Random schedule of Alarm Manager with Calendar","<android><alarmmanager>","1","2","1","",""
"3385692","1","3391317","","2010-08-02 07:08:52","0","1079","<p>I want to <a href=""http://stackoverflow.com/questions/3375615/search-box-on-home-screen"">build a search widget</a>. Clicking on the widget should open search activity inside my  app. Here is the code from widget provider's onUpdate().</p><pre><code>public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds){    /* as their may be many widget instances for this widget. we get an array. */    for(int i=0;i&lt; appWidgetIds.length; i++)    {        Intent intent = new Intent(context, SearchActivity.class);        intent.setAction(""android.intent.action.SEARCH"");        PendingIntent pdIntent = PendingIntent.getActivity(context, 0, intent, 0);        RemoteViews view = new RemoteViews(context.getPackageName(), myPackage.R.layout.search_appwidget);         view.setOnClickPendingIntent(R.id.search_widget_textbox,pdIntent );        appWidgetManager.updateAppWidget(appWidgetIds[i], view);    }}</code></pre><p>Inside my SearchActivity.onCreate(), I am checking for intent action as <code>Intent.ACTION_SEARCH.equals( this.getIntent().getAction())</code>. However, when an intent is posted using PendingIntent via widget provider the <code>this.getIntent().getAction()</code> returns null. When SearchActivity (which is a default SearchManager handler for the app) is invoked via SearchManager it gets valid action as <code>android.intent.action.SEARCH</code>.</p><p>What am I doing wrong with pending intent?</p>","229106","","","","","2010-12-10 19:44:59","Post Intent action from widget provider","<android><android-widget><android-pendingintent><android-searchmanager>","1","0","1","",""
"3385744","1","","","2010-08-02 07:17:56","0","1182","<p>I use the following manifest file:</p><pre><code> &lt;intent-filter&gt;      &lt;action android:name=""android.intent.action.VIEW"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;       &lt;data android:mimeType=""text/calendar"" /&gt;    &lt;data android:pathPattern=""\\*.ics"" /&gt; &lt;/intent-filter&gt;&lt;uses-permission android:name=""android.permission.INTERNET""/&gt;&lt;uses-permission android:name=""android.permission.READ_OWNER_DATA""/&gt;&lt;uses-permission android:name=""com.android.email.permission.ACCESS_PROVIDER""/&gt;  &lt;uses-permission android:name=""android.permission.READ_FRAME_BUFFER""/&gt;</code></pre><p>It supports to download the outlook calendar file in the android browser. But if i configure the email in the android it doesn't supports to open the attachment file from the mail. The Log cat Response for the Brower download is below</p><pre><code>08-02 12:41:54.448: INFO/ActivityManager(53): Starting activity: Intent { act=android.intent.action.VIEW dat=file:///sdcard/download/Todaycheck.ics typ=text/calendar flg=0x4000000 cmp=com.GcalTest/.GoogleCalendarActivity }08-02 12:41:54.518: INFO/ActivityManager(53): Start proc com.GcalTest for activity com.GcalTest/.GoogleCalendarActivity: pid=3326 uid=10024 gids={3003, 1015}</code></pre><p>If i open from the email configuration Logcat:</p><pre><code>08-02 12:44:57.848: INFO/NotificationService(53): enqueueToast pkg=com.android.email callback=android.app.ITransientNotification$Stub$Proxy@43ce7e28 duration=008-02 12:44:57.908: INFO/ActivityManager(53): Starting activity: Intent { act=android.intent.action.VIEW dat=content://com.android.email.attachmentprovider/1/11/RAW flg=0x1 }08-02 12:44:57.968: INFO/NotificationService(53): enqueueToast pkg=com.android.email callback=android.app.ITransientNotification$Stub$Proxy@43cfdc88 duration=008-02 12:44:57.999: WARN/InputManagerService(53): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43d21a48</code></pre><p>How to open ics file in the Email Configuration in android?<br> Can any one help me to solve this?</p><p><strong>Note</strong>: If I use <code>&lt;data android:mimeType=""*/*"" /&gt;</code> I can able to open the ics file in Email canfiguration. But it supports to open all the file format to open from my application. I need to open ics file only.</p>","380019","","380019","","2010-08-02 10:42:16","2010-08-02 10:42:16","How to open ICS file from mail attachment in own app?","<android><android-intent>","0","2","","",""
"3385869","1","3415204","","2010-08-02 07:39:21","0","1088","<p>I am new to android and I want to read a binary file extension .AMF file.</p><p>I really need your help this is really urgent.</p><p>Thanks in advance.</p><p>I  made a folder in RES named raw.  Here is the code I tried, it says file not found.</p><pre><code> FileInputStream in = new FileInputStream(""R.raw.hello.txt""); StringBuffer inLine = new StringBuffer();  InputStreamReader isr = new InputStreamReader(in);     BufferedReader inRd = new BufferedReader(isr);  String text;  while ((text = inRd.readLine()) != null) {   inLine.append(text);   inLine.append(""\n""); } in.close(); return inLine.toString();</code></pre>","397901","","256793","","2010-08-05 13:42:28","2010-08-05 13:45:43","how to read binary .AMF file in android","<android>","1","3","","",""
"3385964","1","3392350","","2010-08-02 07:54:56","8","3354","<p>I'm trying to decide on whether to primarily use floats or ints for all 3D-related elements in my app (which is C++ for the most part). I understand that most ARM-based devices have no hardware floating point support, so I figure that any heavy lifting with floats would be noticeably slower.</p><p>However, I'm planning to prep all data for the most part (i.e. have vertex buffers where applicable and transform using matrices that don't change a lot), so I'm just stuffing data down OpenGL's throat. Can I assume that this goes more or less straight to the GPU and will as such be reasonably fast? (Btw, the minimum requirement is OpenGL ES 2.0, so that presumably excludes older 1.x-based phones.)</p><p>Also - how is the penalty when I mix and match ints and floats? Assuming that all my geometry is just pre-built float buffers, but I use ints for matrices since those do require expensive operations like matrix multiplications, how much wrath will I incur here?</p><p>By the way, I know that I should keep my expectations low (sounds like even asking for floats on the CPU is asking for too much), but is there anything remotely like 128-bit VMX registers? </p><p>(And I'm secretly hoping that fadden is reading this question and has an awesome answer.)</p>","345717","","345717","","2011-02-08 23:54:36","2011-02-08 23:54:36","Floating point or fixed-point for Android NDK OpenGL apps?","<android><opengl-es><android-ndk>","2","0","3","",""
"3385980","1","","","2010-08-02 07:58:36","9","2051","<p>I'm currently playing around with 2D graphics in android and have been using a plain old SurfaceView to draw Drawables and Bitmaps to the screen. This has been working alright, but there's a little stutter in the sprite movement, and I'm wondering the feasibility to do a real time (but not terrible fast) game with this. </p><p>I know GLSurfaceView exists which uses OpenGL, but I'm curious as to the extent to which this makes a difference. Is a plain SurfaceView hardware accelerated, or do I need to use OpenGL? What type of speed difference could I expect from switching to OpenGL, and how much altering of code would it require to switch (the game logic is all in a separate object that provides an ordered array of drawables to the SurfaceView)?</p>","408424","","44729","","2010-08-02 16:33:18","2010-08-02 16:33:18","Differences and advantages of SurfaceView vs GLSurfaceView on Android?","<android><graphics><opengl-es>","1","0","1","",""
"3386081","1","","","2010-08-02 08:17:59","1","1771","<p>all,when i open jumpNote project in eclipse,i encounter some mistakes like the following description.</p><p>many variables related with c2dm likeConfig.C2DM_ACCOUNT_EXTRA,Config.C2DM_MESSAGE_SYNC,Config.C2DM_SENDER etc<strong>*<em>cannot be resolved.</em>*</strong>i uses the latest sdk(2.2).any one konws the reasons, i think that if i miss some jar files?any help is grateful.</p>","361973","","80901","","2010-08-10 10:49:16","2010-10-28 23:42:58","android c2dm navigate the jumpNote source code","<android><android-c2dm>","3","0","1","",""
"3386116","1","3386402","","2010-08-02 08:23:51","6","12210","<p>I am using overridePendingTransition method to do custom Activity animations, i would like to know when the animation ends ( a callback/listener ). Is there any direct way of achieving this, if not please suggest me some work around.</p><p>Thanks</p>","226946","","","","","2011-04-27 20:37:41","Set animation listener to Activity animations","<android><animation><activity>","2","0","1","",""
"3386129","1","3386716","","2010-08-02 08:25:51","3","2867","<p>I'm writing a widget that pulls data from a web page every 5 minutes, using a timer. This works fine for an hour or two, then the process is killed.</p><pre><code>I/ActivityManager(81): No longer want bellander.android.widget (pid 1118): hidden #16</code></pre><p>and the system kills of the process. How do I prevent this? Is the use of a timer wrong?</p>","272736","","114066","","2010-08-02 08:29:20","2010-08-02 10:05:40","My Android widget is killed, ""No longer want bellander.andro....""","<android><widget><android-widget>","1","0","1","",""
"3386438","1","3386608","","2010-08-02 09:18:25","0","3621","<p>I want my arrows to continuously move left and right with a delay of certain milliseconds dynamically. Any clue? </p><p>Here's my code:</p><pre><code>import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.Handler;import android.widget.ImageView;public class PlayWithGraphics extends Activity {    /** Called when the activity is first created. */ public final int delay = 2500;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final ImageView iv = (ImageView)findViewById(R.id.iv);        iv.setBackgroundResource(R.drawable.back_two);        new Handler().postDelayed(new Runnable(){            public void run(){           //iv.setPadding(30, 0, 10, 0);               }        }, delay);   }    }</code></pre>","2355649","","","","","2010-08-02 09:48:36","Android: How to change the position of ImageView dynamically?","<android>","1","0","","",""
"3386468","1","3386531","","2010-08-02 09:22:13","1","964","<p>I've got a mapview that I want to put some markers on top of. I'll retrieve these from a webservice when I start the activity, so I need to know the minimum and maximum lat/lng pairs for the current viewport. I'm calling </p><pre><code>mMapView.getWidth()mMapView.getHeight()</code></pre><p>But they both return 0 while the activity is starting. I tried putting it in onAttachedToWindow, onResume, onPostCreate, onPostResume, onStart and so on, but to no avail. How can I know that the activity has finished laying out all the views and is ready to give me the correct height and width measurements?</p>","397060","","","","","2013-03-15 11:43:24","How to know when activity is laid out?","<android><layout><android-mapview>","2","0","1","",""
"3386667","1","3386736","","2010-08-02 09:57:41","19","20504","<p>I have created a database for my android app which contains static data and does not require update/delete functionality thus when the app starts, I want to check if the db exists and if not then execute my dbAdapter class. I know its a simple if statement but I was just wondering the most efficient way to query whether the db exists. </p><p>Cheers </p>","397085","","179850","","2011-02-21 18:44:29","2014-04-03 15:23:22","Query if Android database exists!","<android><database>","4","1","12","",""
"3386834","1","3387056","","2010-08-02 10:22:22","3","713","<p>I'm very new to android, in fact only started yesterday. I managed to get an application setup with tabs. It works fine on a 2.2 virtual avd (i think it is called). But the version my HTC has is 2.0.1I'm posting snippets of the code below as well as debug info.</p><p>Logcat shows the following error</p><pre><code>08-02 09:56:05.946: WARN/dalvikvm(414): threadid=3: thread exiting with uncaught exception (group=0x4001b188)08-02 09:56:05.956: ERROR/AndroidRuntime(414): Uncaught handler: thread main exiting due to uncaught exception08-02 09:56:06.196: ERROR/AndroidRuntime(414): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.hyperActiveSolutions/org.hyperActiveSolutions.Organizer}: java.lang.NullPointerException08-02 09:56:06.196: ERROR/AndroidRuntime(414):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2481)08-02 09:56:06.196: ERROR/AndroidRuntime(414):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2497)</code></pre><p>There is more to that but i thought this was the relevant bit, the rest is just the long stack trace.</p><p>My android manifest file looks like this</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""org.hyperActiveSolutions""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:label=""@string/app_name""                  android:theme=""@android:style/Theme.NoTitleBar"" android:name=""Organizer""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;activity android:name=""Home"" &gt;&lt;/activity&gt;&lt;activity android:name=""Account""&gt;&lt;/activity&gt;&lt;activity android:name=""Agenda"" &gt;&lt;/activity&gt;&lt;activity android:name=""Lists"" &gt;&lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""6"" android:targetSdkVersion=""6""&gt;&lt;/uses-sdk&gt;&lt;/manifest&gt; </code></pre><p>As you can see the minimum sdk and the target have been set to my phone's version. This is the start of my entry class. Below where this snippet ends is 3 other tabs being added in exactly the same way as Home.</p><pre><code>public class Organizer extends TabActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);             this.setContentView(R.layout.main);        final TabHost tabHost = getTabHost();  // The activity TabHost   // Create an Intent to launch an Activity for the tab (to be reused)   // Initialize a TabSpec for each tab and add it to the TabHost   tabHost.addTab(tabHost.newTabSpec(""home"").setIndicator(""Home"",            getResources().getDrawable(R.drawable.home)).setContent(new Intent().setClass(this, Home.class)));</code></pre><p>All my resources exists including the classes i'm instantiating with each tab. The only other thing i can think of that might be relevant is my main.xml for the layout.It was copied from the android dev site, in one of the tutorials.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/tabhost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>As i said it works fine on version 2.2 but dies on 2.0.1 and the message displayed on screen is just ""Organizer termintated unexpectedly""....part of the message anyway.</p><p>So can anyone spot anything i have that would make it not compatible with the 2.0.1 SDK.</p><p>thanks in advance</p><p>full stack trace</p><pre><code>08-02 11:47:54.006: WARN/dalvikvm(2588): threadid=3: thread exiting with uncaught exception (group=0x4001b188)08-02 11:47:54.016: ERROR/AndroidRuntime(2588): Uncaught handler: thread main exiting due to uncaught exception08-02 11:47:54.256: ERROR/AndroidRuntime(2588): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.organizer/com.organizer.Organizer}: java.lang.NullPointerException08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2481)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2497)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1848)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.os.Handler.dispatchMessage(Handler.java:99)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.os.Looper.loop(Looper.java:123)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.app.ActivityThread.main(ActivityThread.java:4338)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at java.lang.reflect.Method.invokeNative(Native Method)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at java.lang.reflect.Method.invoke(Method.java:521)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at dalvik.system.NativeStart.main(Native Method)08-02 11:47:54.256: ERROR/AndroidRuntime(2588): Caused by: java.lang.NullPointerException08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.widget.TabWidget.onFocusChange(TabWidget.java:351)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.View.onFocusChanged(View.java:2622)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.View.handleFocusGainInternal(View.java:2445)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.ViewGroup.handleFocusGainInternal(ViewGroup.java:403)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.View.requestFocus(View.java:3562)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.ViewGroup.requestFocus(ViewGroup.java:975)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1020)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.ViewGroup.requestFocus(ViewGroup.java:976)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1020)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.ViewGroup.requestFocus(ViewGroup.java:979)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1020)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.ViewGroup.requestFocus(ViewGroup.java:976)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1020)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.ViewGroup.requestFocus(ViewGroup.java:979)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.View.requestFocus(View.java:3513)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.view.View.requestFocus(View.java:3491)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.widget.TabHost.setCurrentTab(TabHost.java:334)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.widget.TabHost.addTab(TabHost.java:213)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at com.organizer.Organizer.onCreate(Organizer.java:25)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2444)08-02 11:47:54.256: ERROR/AndroidRuntime(2588):     ... 11 more08-02 11:47:54.476: INFO/Process(62): Sending signal. PID: 2588 SIG: 308-02 11:47:54.476: INFO/dalvikvm(2588): threadid=7: reacting to signal 308-02 11:47:54.476: ERROR/dalvikvm(2588): Unable to open stack trace file '/data/anr/traces.txt': Permission denied08-02 11:48:01.446: INFO/dalvikvm(2588): Debugger has detached; object registry had 306 entries08-02 11:48:02.466: DEBUG/ddm-heap(2588): Got feature list request</code></pre>","400048","","400048","","2010-08-02 12:24:11","2010-12-09 10:37:31","Android java app works on one version but not the next","<java><android><android-manifest>","2","2","1","",""
"3386903","1","","","2010-08-02 10:33:54","1","549","<p>I am loading a webpage in WebView and am required to recognize a word (any word from the page, not just URL) being clicked by user. Is it possible? how?</p><p>Thanks a lot.</p><p>EDIT:This is done in Aldiko 2.0. No Javascript.</p>","367677","","15187","","2011-05-11 18:10:15","2011-05-16 12:37:33","Android Webview - how to capture a word being clicked?","<android><webkit><android-widget>","2","3","","",""
"3387016","1","3387625","","2010-08-02 10:51:12","0","430","<p>I have facing problem in scrolling webview in verticlly, actually i have scroll view with in the layout have defined webview in layout so when i scroll the webview vertically it scroll whole layout,so i want to enable scroll for webview,anybody help me solve this.</p>","407506","","","","","2010-08-02 12:17:17","Enabling scrolling for particular layout","<android>","1","0","","",""
"3387271","1","3387278","","2010-08-02 11:30:00","2","516","<p>My layout files are growing and growing. So I came up with an idea of putting them in subdirectories. Is it possible? Simple code:</p><pre><code>&lt;include android:id=""@+id/mLayout"" layout=""@layout/subdirectory/blahblah""&gt;</code></pre><p>seem not to work.</p>","403324","","","","","2012-12-19 22:05:02","Is it possible to put layout xml's in subdirectories under /res/layout?","<android>","1","0","","",""
"3387337","1","","","2010-08-02 11:41:27","1","157","<p>I am quite new to Android</p><p>I use Instrumentation and adb shell commands to launch tests from my apk file on target. </p><p>I wish to create an intent from Command Line and make some operation in code on target upon it. </p><p>I know that I need to add an intent filter within my Manifest.xml filebut can I add it if I have no activity in manifest. </p><p>I also know that I must monitore intent receive in my code on target but what should be writen in switch(msg.what) in handler ? </p><p>my manifest file: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""           package=""com.android.phonetests""          android:sharedUserId=""android.uid.myphonetest""&gt;     &lt;application&gt;     &lt;uses-library android:name=""android.test.runner"" /&gt;  &lt;/application&gt;  &lt;instrumentation android:name="".PhoneInstrumentationTestRunner""      android:targetPackage=""com.android.phone""      android:label=""Test runner for all the Phone tests that are instrumented.""&gt;  &lt;/instrumentation&gt;&lt;/manifest&gt;</code></pre>","268121","","244296","","2010-08-02 12:35:37","2010-08-02 12:35:37","Creating an intent in application without Activity","<java><android><adb>","0","1","1","",""
"3387478","1","","","2010-08-02 11:57:49","2","6910","<p>When I am adding jxl.jar in my eclipse project, it saw convertion error to dalvik format into the console.</p><p>Error display in console:</p><p>[2010-08-02 19:11:22 - TestApp] trouble writing output: shouldn't happen</p><p>[2010-08-02 19:11:22 - TestApp] Conversion to Dalvik format failed with error 2</p><p>Code is ok</p><p>Below is my code:</p><pre><code>import java.io.File;import java.io.IOException;import jxl.Cell;import jxl.CellType;import jxl.Sheet;import jxl.Workbook;import jxl.read.biff.BiffException;public class ReadExcel {    private String inputFile;    public void setInputFile(String inputFile) {        this.inputFile = inputFile;    }    public void read() throws IOException  {        File inputWorkbook = new File(inputFile);        Workbook w;        try {            w = Workbook.getWorkbook(inputWorkbook);            // Get the first sheet            Sheet sheet = w.getSheet(0);            // Loop over first 10 column and lines            for (int j = 0; j &lt; sheet.getColumns(); j++) {                for (int i = 0; i &lt; sheet.getRows(); i++) {                    Cell cell = sheet.getCell(j, i);                    CellType type = cell.getType();                    if (cell.getType() == CellType.LABEL) {                        System.out.println(""I got a label ""                                + cell.getContents());                    }                    if (cell.getType() == CellType.NUMBER) {                        System.out.println(""I got a number ""                                + cell.getContents());                    }                }            }        } catch (BiffException e) {            e.printStackTrace();        }    }}</code></pre><p>Is there anyway to solve this problem?</p><p>ThanksMintu</p>","162644","","162644","","2010-08-02 13:50:52","2012-12-07 07:40:53","How to read excel file using JXL 2.6.12 jar","<android>","1","2","","",""
"3387484","1","3388361","","2010-08-02 11:58:37","0","826","<p>I am new to android.. just started writing service using activity..i want to know if there are any other ways to trigger a service without the use of activity? like when a new message arrives, the service need to start running..</p><p>if so, how?</p><p>Thank you..</p>","365184","","365184","","2010-08-02 12:24:27","2010-08-02 13:47:25","Service without Activity. how?","<android><service>","1","2","","",""
"3387556","1","","","2010-08-02 12:09:30","12","2082","<p>My app allows you to specify a different ringtone for different incoming events. EG: incoming call, incoming sms etc etc.</p><p>What I am trying to accomplish is when I receive for example an incoming call, I check my apps database if a specific option is selected and if there is a ringtone option set play that ringtone.</p><p>However the problem I am having is I am unable to override / stop the default phone ringtone from playing.  </p><p>I have tried several different ways, but from the docs most of those methods only stop the current instance and are not global methods.</p><p>I can't set the ringtone in the default phones ringtone settings as it needs to be dynamic based on the incoming call.</p><p>If anyone knows of a trick or a way to accomplish this that would be great.I hope that makes sense, thanks in advanced.</p>","408588","","1088908","","2012-03-26 01:55:01","2012-08-30 10:18:02","Incoming call dynamically override default ringtone","<android><ringtone>","2","0","7","",""
"3387742","1","4007103","","2010-08-02 12:28:22","7","3875","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1860901/removing-widget-from-home-screen-when-uninstalled"">Removing Widget from Home Screen when Uninstalled</a>  </p></blockquote><p>In Android, I have created a widget for my application. When I uninstall the app, the widget shows ""problem loading widget"" error in home screen. I need a scenario where widget should be removed by the developer through code (and not by the drag and drop to the trash) when I uninstall the app. Is it possible? If so, what changes we need to do? Is there anything that can be set in the manifest so that it removes all references of the app once it is uninstalled? </p>","404196","","1288","","2011-06-22 15:56:39","2011-08-26 09:30:11","How to remove widget when the app is uninstalled in Android?","<android><widget><uninstall>","2","1","2","2012-06-29 14:58:50",""
"3387894","1","3387955","","2010-08-02 12:48:17","2","9521","<p>I am writing a application that needs to draw a ""route"" comprised of lots of GPS points (long+lat). The points are close together and don't follow roads, simply drawing a line between each point is ideal.</p><p>The current implementation I have is very slow as I am looping over all the GPS coordinates and creating a new Point and overlayitem in an itemized overlay. This takes around 20 seconds for it to load all of these points and draw them to the mapview. Is there a way in which I can construct a series of lines or point from the GPS coordinates and draw them onto the mapview?</p><p>Example of current implementation:</p><pre><code> for each set of long+lats // removed to simplify    point= new GeoPoint(latitude,longitude);    overlayitem = new OverlayItem(point,"""","""");    itemizedOverlay.addOverlay(overlayitem); mapOverlays.add(itemizedOverlay); mMapController.setCenter(point);</code></pre><p>Thanks in advance, hope I've explained it well enough.</p>","315998","","","","","2010-08-02 13:05:16","Android draw a path on a mapView from a large amount of longitude/latitude points","<android><gps><android-mapview>","2","0","","",""
"3387897","1","","","2010-08-02 12:48:43","0","1865","<p>How to get a selected item from a spinner in android?</p>","655814","","151019","","2011-12-17 14:43:47","2012-08-02 03:50:24","How to get the selected item of Android Spinner?","<android><android-spinner>","3","0","","",""
"3388038","1","","","2010-08-02 13:08:25","0","3657","<p>I have to scroll the webview content vertically  with in scrollview surrounded tag ,in the sense that webview hided initially and when touch event occured the webview contained have to visible the scroll control in both  directions but its not scrolling vertically,anybody help me to solve it...here xml code </p><p>                                                        +++++++++++++++++++design at initial loading +++++++++++                                                                                                    </p><pre><code>                    &lt;/RelativeLayout&gt;</code></pre><p>++++++++++++++++Design being shown after click event occuered its visible and above part is hided-----------------                  <pre><code>                android:layout_width=""fill_parent"" android:layout_height=""fill_parent""                android:layout_above=""@+id/jr_lb_view_preview_gallery""&gt;                &lt;ProgressBar android:id=""@+id/jr_lb_progress_small""                    android:layout_centerInParent=""true"" android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:indeterminateDrawable=""@drawable/pb"" /&gt;                &lt;WebView android:id=""@+id/jr_lb_view_preview_switcher""                    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""                    android:scrollbars=""none"" /&gt;            &lt;/RelativeLayout&gt;                &lt;/LinearLayout&gt;                &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""                    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""                    android:layout_marginBottom=""5dip"" android:gravity=""center""&gt;                    &lt;TextView android:layout_width=""wrap_content""                        android:layout_height=""wrap_content"" android:id=""@+id/jr_lb_content_price""                        android:textSize=""12sp"" android:textColor=""@color/white""                        android:background=""@drawable/black_r_corner"" android:typeface=""sans"" /&gt;                    &lt;TextView android:layout_width=""wrap_content""                        android:layout_height=""wrap_content"" android:text=""Free Shipping!""                        android:textSize=""12sp"" android:textColor=""@color/author_color""                        android:typeface=""sans"" android:layout_marginLeft=""15dip"" /&gt;                &lt;/LinearLayout&gt;                &lt;View android:layout_width=""310dip"" android:layout_height=""1dip""                    android:background=""#FF909090"" /&gt;                &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""                    android:id=""@+id/jr_lb_summary_grid"" android:layout_width=""fill_parent""                    android:layout_height=""wrap_content"" android:numColumns=""4""                    android:columnWidth=""75dip"" android:scrollbars=""none""                    android:gravity=""center"" android:listSelector=""@drawable/corner_orange1""                    android:layout_marginTop=""5dip"" /&gt;                &lt;View android:layout_width=""310dip"" android:layout_height=""1dip""                    android:background=""#FF909090"" /&gt;                &lt;TextView android:layout_width=""fill_parent""                    android:layout_height=""wrap_content"" android:text=""Details""                    android:textSize=""20sp"" android:textColor=""@color/author_color""                    android:typeface=""sans"" /&gt;                &lt;View android:layout_width=""310dip"" android:layout_height=""1dip""                    android:background=""#FF909090"" /&gt;                &lt;WebView android:id=""@+id/jr_lb_content_tv""                    android:textSize=""15sp"" android:textColor=""@color/black""                    android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" /&gt;            &lt;/LinearLayout&gt;        &lt;/ScrollView&gt;</code></pre>","407506","","283647","","2010-08-02 13:10:22","2013-09-07 02:48:44","How to add zoom controls for image view","<android>","2","1","1","",""
"3388205","1","","","2010-08-02 13:28:59","7","635","<p>I've got the following method that is called when the user clicks a position on the screen:</p><pre><code>        public void setup(int xi, int yi){    int f = 0;      PerspectiveCamera camera = new PerspectiveCamera();    camera.setViewport(320, 508);    camera.update();    Ray touch = camera.getPickRay(xi, yi);    while(f &lt; GLCamTest.array.length){        //Vertex 1        float x1 = GLCamTest.array[f];        f++;        float y1 = GLCamTest.array[f];        f++;        float z1 = GLCamTest.array[f];        f++;        //Vertex 2        float x2 = GLCamTest.array[f];        f++;        float y2 = GLCamTest.array[f];        f++;        float z2 = GLCamTest.array[f];        f++;        //Vertex 3        float x4 = GLCamTest.array[f];        f++;        float y4 = GLCamTest.array[f];        f++;        float z4 = GLCamTest.array[f];        f++;        //Vertex 4        float x5 = GLCamTest.array[f];        f++;        float y5 = GLCamTest.array[f];        f++;        float z5 = GLCamTest.array[f];        f++;        Intersector sect = new Intersector();        float z3 = 10;        //Mid-point formula        float x3 = (x2+x4)/2;        float y3 = (y2+y4)/2;        //Triangle one is (x1,y1), (x2,y2), (x3, y3)        //Triangle two is (x4, y4), (x5, y5), (x3, y3)        //Now, I have my 2 tri-angles I need for the        // Polygon test..        Vector3 t1 = new Vector3(x1,y1,z1);        Vector3 t2 = new Vector3(x2,y2,z2);        Vector3 t3 = new Vector3(x3,y3,z3);        Vector3 t4 = new Vector3(x4,y4,z4);        Vector3 t5 = new Vector3(x5,y5,z5);        if(sect.intersectRayTriangle(touch, t1, t2, t3, t4)            == true){            System.out.println(""TOUCHED AN OBJECT!!"");            if (f &lt;= 12){                System.out.println(""SQUARE 1"");            } else if(f &lt;= 24 &amp;&amp; f &gt;=13){                System.out.println(""SQUARE 2"");            } else if(f &lt;= 36 &amp;&amp; f &gt;= 25){                System.out.println(""SQUARE 3"");            }         }        if(sect.intersectRayTriangle(touch, t4, t5, t3, t1)                 == true){            System.out.println(""TOUCHED AN OBJECT!!"");            if (f &lt;= 12){                System.out.println(""SQUARE 1"");            } else if(f &lt;= 24 &amp;&amp; f &gt;=13){                System.out.println(""SQUARE 2"");            } else if(f &lt;= 36 &amp;&amp; f &gt;= 25){                System.out.println(""SQUARE 3"");            }         }else{            System.out.println(""NO TOUCH"");        }    }    f = 0;}</code></pre><p>Basically the class takes in the screen co-ords that were clicked, sets up the viewport and all the matrices it then generates the Ray. Once the ray is generated it takes each vertex and puts it in its own <code>Vector3</code> it then tests does the ray intersect any of the points. The method says the ray intersects <code>""SQUARE2""</code> at certain points on the screen regardless if there is an object there or not.. why? what could be causing this? How do I fix it?</p><p>edit:</p><p>It's hitting the if statement ""SQUARE2"" every time it thinks it ""finds"" an object.It only finds an intersection when I hit the ""middle"" of the screen (this is where objects could be drawn) but It's only showing an intersection for the first if statement on the left hand side of the middle of the screen and the second for the right hand side of the middle of the screen</p><p>So for example it only thinks it's touched square 2 at the points marked X where the Rectangle is the phones screen.</p><pre><code>  _________  |       |  |       |  |X     X|  |       |  |_______|</code></pre><p>The other methods I'm calling to for the ray tracing are located in another project.. <a href=""http://code.google.com/p/libgdx/source/browse/#svn/trunk/gdx/src/com/badlogic/gdx/math"" rel=""nofollow"">http://code.google.com/p/libgdx/source/browse/#svn/trunk/gdx/src/com/badlogic/gdx/math</a> (The folder Graphics has Perspective Camera which contains <code>getPickRay();</code> and <code>Intersector</code> contains the other).</p><p>edit2:It appears it is picking up right location where objects COULD be but they currently may not be due to the world rotating so it appears to be just having issues with the world rotating.. Here's how I'm rotating the world...</p><pre><code>    public void onDrawFrame(GL10 gl) {    onDrawFrameCounter++;    gl.glEnable(GL10.GL_TEXTURE_2D);    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    bindCameraTexture(gl);    float bear = Global.bearing;    gl.glLoadIdentity();    gl.glNormal3f(0,0,1);    gl.glRotatef(bear, 0, 1, 0);    int e = 0;      for(int q=0; q &lt; Global.cubes;q++){    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, e, 4);    e = e+4;    }}</code></pre><p>How would I adjust my code so that it'll recognise when objects are ACTUALLY on the screen?</p>","358438","","119895","","2010-08-10 12:25:16","2010-08-11 11:42:14","picking object not working?","<java><android><opengl-es>","1","0","","",""
"3388296","1","","","2010-08-02 13:40:03","5","1823","<p>i made a extended a View, overwrote the 3 View Contructors and tried to insert it on my xml of a widget.</p><p>The Exception is:</p><blockquote>  <p>java.lang.ClassNotFoundException: com.mypackage.myView in loader dalvik.system.PathClassLoader@4001e710</p></blockquote><p>is it possible to use custom views in Widgets?</p>","408699","","","","","2010-08-02 13:50:29","Android - Using custom View in Widget","<android><view><widget>","1","0","","",""
"3388464","1","","","2010-08-02 14:01:05","0","482","<p>I have problem in scrolling of webview vertically when it's scrolled along vertically,where this webview is with in scrollview tag,how can i enable the scrolling for webview and to disable the scrolling of whole layout when its on webview contained layout.</p>","407506","","","","","2010-08-02 14:27:19","how to enable vertical scroling of web view layout with in scrollview tag","<android>","1","0","","",""
"3388474","1","","","2010-08-02 14:02:22","1","952","<p>I have modified onAirplaneModeChanged() in AirplaneModeEnabler.java.The method now reads the status of airplane mode directly from thedatabase. When i enter the wireless settings screen, the checkbox ischecked/unchecked as expected.</p><p>But when I switch the airplane mode to ON, the airplane mode checkboxgets checked instantly. But the list-item ""airplane mode"" is disabled.</p><p>The disabling happens through setAirplaneModeOn() called inonAirplaneModeChanged().</p><p>This behaviour is not observed when SIM is inserted.</p><p>In short, here is my question: setAirplaneModeOn() sets the summaryand disables the item. When and where will the item get enabled again?</p><p>Regards,Webgenius</p>","308131","","","","","2012-07-09 10:16:09","Android Airplane mode setting","<android>","0","0","1","",""
"3388593","1","3388619","","2010-08-02 14:15:42","0","1142","<p>Im currently  developing a program that uses a scrollable/zoomable image as the main user interface. It uses a canvas which is manipulated by a matrix to traverse a large area. Instead of loading a super large bitmap into memory, i wanted to employ a tile system to load 256 by 256 squares. My problem is that the app will lag when the images are being loaded into memory. I use a simple outer and inner for loop to load the tiles if they are null, and if the user zooms out to a certain extent the tiles all disappear and a lower res version of the whole image is shown. Ive been steered into the direction of asynchronous image loading, which seems like it would prevent the lag while the image loads into memory but i have no idea how to start this, and was wondering if anyone had any advice on how to generally asynchronously load bitmaps into the canvas. Thanks!</p>","385051","","","","","2010-08-02 14:19:09","asynchronous image loading and the android canvas","<android><image><asynchronous><canvas><bitmap>","1","0","","",""
"3388606","1","3388616","","2010-08-02 14:17:08","1","261","<p>I am trying to add a yes/no confirmation popup to an android OnClickListener. Is it OK to use an AlertDialog.Builder in a setOnClickListener or should I be taking a different approach? I have stepped through the following code using the eclipse/android debug environment and expect the popup to appear at the .create, awaiting user response, but it does not. I am new to android and java so I may be missing something obvious. Any advice, ideas, or direction would be appreciated.</p><pre><code>public class Controller extends Activity {...        buttonOn.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                new AlertDialog.Builder(Controller.this)                    .setIcon(R.drawable.ic_menu_help)                    .setMessage(""Are You Sure?"")                    .setPositiveButton(""OK"",                             new DialogInterface.OnClickListener() {                        public void onClick(DialogInterface dialog,                                 int whichButton) {                        // Positive response code                    }                })                .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int whichButton) {                        // Negative response code                    }                })                .create();            }        });</code></pre>","398460","","","","","2010-08-02 14:18:56","Where is my AlertDialog?","<android><alertdialog>","1","1","","",""
"3388898","1","3389007","","2010-08-02 14:51:06","1","13242","<p>Saving the file:</p><pre><code>    FileOutputStream fo = null;     try {             fo = this.openFileOutput(""test.png"", Context.MODE_WORLD_READABLE);     } catch (FileNotFoundException e) {             e.printStackTrace();     }     bitmap.compress(CompressFormat.PNG, 100, fo)</code></pre><p>Loading the file:</p><pre><code>        String fname = this.getFilesDir().getAbsolutePath()+""/test.png"";         Bitmap bMap = BitmapFactory.decodeFile(fname);        i.setImageBitmap(bMap);</code></pre><p>The last line gives a null pointer exception, why is BitmapFactory.decodeFile returning null? I can verify that the file is getting saved correctly as I can pull it using adb and see the png displaying properly.</p>","315998","","1943671","","2014-03-25 12:13:29","2014-03-25 12:13:29","BitmapFactory.decodeFile returns null even image exists","<android><bitmap><imageview><fileoutputstream>","1","2","","",""
"3388988","1","3390707","","2010-08-02 15:02:25","1","111","<p>I want to implement 4 threads as services in  android. How di i do that. Can anyone suggest a good example for the same.?</p>","396437","","","","","2010-08-02 18:35:46","4 threads as services in Android","<java><android><multithreading>","1","2","","",""
"3389002","1","3389688","","2010-08-02 15:03:16","6","1729","<p>I've seen some apps like dolphin browser (not the HD version, the normal one) utilizing a cache-to-sd for webview but i can't seem to figure out how to do this, does anyone know how to do this or point me in the right direction? Any help is greatly appreciated! Thanks :)</p>","222795","","","","","2012-12-26 21:15:42","How to move webView cache to SD?","<android><caching><webview>","2","0","","",""
"3389011","1","3389191","","2010-08-02 15:03:33","2","1733","<p>I'm a web designer by nature, accustomed to changing resolutions and font sizes, but I'm unsure how to design for the Android platform without knowledge of screen sizes, especially when the screen rotates from portrait mode to landscape. </p><p>Should I just do generic things that tile, or is there a way to design things of static size?</p><p>By this, I mean for the GUI and graphics, not element nodes of the XML.</p><p>Thanks!</p>","312390","","","","","2010-08-02 15:27:05","How to design for Android apps ever-changing screen dimensions","<android><xml>","1","0","0","",""
"3389061","1","3395280","","2010-08-02 15:09:01","11","17508","<p>Is there a good sample application for creating android services that run in the background?</p>","25282","","","","","2013-11-10 15:34:04","Good sample application for android service","<android><android-service>","2","0","6","",""
"3389141","1","","","2010-08-02 15:20:23","0","594","<p>I am quite new to Android and JavaI am looking for example of how to use this class:</p><p>SingleLaunchActivityTestCase</p><p>Till now I am using class InstrumentationTestCase but the problem is that for each launched test case Android calling onSetup() and TearDown()</p><p>Need help urgently</p>","268121","","","","","2010-08-03 07:38:10","Need an example of how to use class -> SingleLaunchActivityTestCase<T extends Activity>","<android><class>","1","0","","",""
"3389201","1","3389960","","2010-08-02 15:28:16","6","4893","<p>I need to know when the user touches/taps/clicks the edittext in my activity.</p><p>How can I do this without interrupting the events, so the keypad still displays properly?</p><p>(And I need to know about it before the OS displays the keypad...if possible)</p>","386541","","","","","2010-08-02 16:55:22","Detect touch on EditText, but not interrupt it?","<android>","2","0","","",""
"3389303","1","","","2010-08-02 15:39:18","2","2872","<p>I am trying to set up Eclipse 3.5 with the Android plugin. I followed all the steps and everything installed fine. However, running the SDK and AVD Manager throws a connection refused error. I am behind a firewall at work and can not bypass it.</p><p>How can I install the Android platforms without using the manager?</p>","408810","","356440","","2013-01-03 10:00:07","2013-01-03 10:00:07","Connection refused by Android SDK and AVD manager","<android><eclipse><eclipse-plugin>","1","0","","",""
"3389446","1","","","2010-08-02 15:56:33","6","10627","<p>Yeap. I want to change my ** webview's background color and font size.**How i can for it?  </p>","389389","","133203","","2010-08-02 16:01:39","2011-01-06 04:19:40","Android WebView Changing Backcolor and font color","<android><android-webview>","3","0","3","",""
"3389501","1","3389558","","2010-08-02 16:03:20","71","83965","<p>Is it possible to define the transition between two activities for Android 1.5 and better? I would like an activity to fade in.</p>","143378","","844882","","2012-07-02 04:00:46","2014-02-15 23:37:10","Activity transition in Android","<android><android-activity><transition>","6","1","46","",""
"3389685","1","3390303","","2010-08-02 16:25:41","1","331","<p>I download</p><blockquote>  <p>android-sdk_r06-windows_2</p>    <p>eclipse-java-helios-win32</p>    <p>ADT-0.9.7</p>    <p>jdk-6u21-windows-i586</p>    <p>apache-ant-1.8.1-bin</p></blockquote><p>and i follow google guide but i can't install android becausewhen i want to run android sdk below error occur</p><blockquote>  <p>Failed to fetch URL <a href=""https://dl-ssl.google.com/android/repository/repository.xml"" rel=""nofollow"">https://dl-ssl.google.com/android/repository/repository.xml</a>, reason: dl-ssl.google.com</p></blockquote><p>when i want to run eclipse below error occur</p><blockquote>  <p>JDK need </p></blockquote><p>but i installed jdk before</p><p>How can i install it ?Do i need other files accept these files?</p>","379683","","617450","","2013-06-20 07:10:32","2013-06-20 07:10:32","Android Installation on Windows","<android><windows>","1","1","","",""
"3389736","1","","","2010-08-02 16:32:21","0","790","<p>I'm trying to implement an persistent TCP connection between an Android phone and a desktop server.</p><p>I've got heartbeat threads on both ends which are sending keepalive-packets on application level successfully.</p><p>The problem is that after a while (varies between 5-20min) the phone is starting to send TCP keepalives to the server, which the server does not seem to respond to. (I'm using Wireshark to monitor this).</p><p>This results in an exception on the server thread which is reading from the phone:java.net.SocketException: Connection reset</p><p>Why are the phone sending TCP keepalives so early? Even when there's constantly activity on application level? And why doesn't the desktop server respond to this keepalives?</p><p>I've checked my Android phone's settings with ""sysctl -A | grep net.ipv4"" and ""net.ipv4.tcp_keepalive_time"" is set to 7200 (2 hours).</p>","366330","","366330","","2010-08-03 13:37:58","2010-08-03 13:37:58","TCP keepalive sent almost right after connection","<java><android><sockets><tcp><keep-alive>","0","3","","",""
"3389829","1","3389952","","2010-08-02 16:41:57","1","186","<p>I was testing a webpage that I designed on my Android 2.1 browser but it complains with the following:</p><blockquote>  <p>error on line 1 at Column 39: Unsupported encoding ISO8859-1</p></blockquote><p>Is there anyway to solve this problem?</p>","184046","","53114","","2010-08-02 16:57:58","2010-08-02 16:57:58","Character encoding problem?","<php><android><character-encoding>","1","2","","",""
"3390280","1","4484693","","2010-08-02 17:38:56","11","2239","<p>I have a service which creates a notification and then updates it with certain information periodically. After about 12 mins or so the phone crashes and reboots, I believe it is caused by a memory leak in the following code to do with how I am updating the notification, could someone please check/advise me if this is the case and what I am doing wrong.</p><p>onCreate:</p><pre><code>mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);</code></pre><p>createNotification:</p><pre><code>private void createNotification() {  Intent contentIntent = new Intent(this,MainScreen.class);  contentIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);  PendingIntent appIntent =PendingIntent.getActivity(this,0, contentIntent, 0);  contentView = new RemoteViews(getPackageName(), R.layout.notification);  contentView.setImageViewResource(R.id.image, R.drawable.icon);  contentView.setTextViewText(R.id.text, """");  notification = new Notification();  notification.when=System.currentTimeMillis();  notification.contentView = contentView;  notification.contentIntent = appIntent;}</code></pre><p>updateNotification:</p><pre><code>private void updateNotification(String text){  contentView.setTextViewText(R.id.text, text);  mNotificationManager.notify(0, notification);}</code></pre><p>Thanks in advance.</p>","315998","","65977","","2010-08-30 00:39:32","2013-05-10 12:28:44","android memory leak in notification service","<android><memory-leaks><notifications><notificationmanager>","2","8","4","",""
"3390400","1","3390606","","2010-08-02 17:53:56","0","564","<p>This question actually has two parts.</p><p>The first part:</p><p>I've been developing my first app for a couple of weeks now. I have 5 screens and everything seems well. However, I'm considering changing the app's navigation to a TabView.</p><p>I haven't delved much into it, but I'm hoping someone can save me a little bit of time. It seems that people don't generally place Activities inside each tab. They simply point the tab content to a View. This is where my major setbacks are. 1) I already have Activity classes full of code and 2) I can't quickly guess how the structure of an app using TabView looks. For example, where do I put the handler code for clicking a button on a View? Does it all just get dumped into the TabView Activity somehow?</p><p>What I would like is if you could please give me a quick synopsis of what I'm looking at doing, answers to any questions you think I may have, and point me toward some resources for creating TabView applications. A quick Google search really just shows me how to create a TabView Activity and add a couple tabs to it. The code doesn't go any deeper.  For example, say I have a layout xml to show in one of my tab's content pane, where does the code go for clicking a button I have in that layout?</p><p>The second part:</p><p>I've added a TabActivity to wrap the Activities I currently have in.  At the moment I have Activities populating the content of my tabs (though ultimately I'd like to do this in the most efficient fashion, which doesn't seem to be having Activities be tab content). I've noticed something rather annoying. My MAIN Activity is an Activity I wrote for my user to log in to their account. After logging in, they are taken to my Tab Activity. Here is what happens:</p><p>When I am on my Tab Activity and I ""minimize"" the app by clicking the Home button and then launch it again, I don't get taken back to the Tab Activity. I get taken to my log in Activity. Why? I don't have the launchMode of my Tab Activity set to singleInstance... or is it singleInstance by default? How can I make the app re-launch showing the Tab Activity (ideally by setting some parameter, assuming I'm doing something wrong, and not having to save this data off somewhere and reading it and programmatically telling it what to go to)?</p><p>Thank you for all your time and help</p>","406790","","","","","2010-08-02 18:22:15","Modifying application workflow to use TabActivity","<android><tabactivity>","1","5","","",""
"3390441","1","3390462","","2010-08-02 18:00:27","1","3892","<p>Ok, so currently I have this code in my program:</p><pre><code>public void delete(String id, String name, String phonenumber, String time, String message){    String[] args={id};    getWritableDatabase().delete(""texts"", ""_ID=?"", args);}</code></pre><p>It works fine, and deletes the specified row. However, I also want to implement it so that I can delete the most recent (earliest date) entry in the database, which should be at the top of the table. I know I can do this by altering the last 2 parameters of delete, but I cannot figure out what to change them to. </p>","413394","","","","","2011-12-10 08:35:42","Delete top row in Android SQlITE database","<android><sqlite><delete><row>","1","0","","",""
"3390711","1","","","2010-08-02 18:35:56","1","1013","<p>I have an EditText area that is not showing due to the keyboard covering it when the focus is on the EditText area.  What I want to do is use a button to call an activity that will display a editable text area that overlays the main display and returns the value to the main activity which stores it in a separate class variable.  </p><p>I added the activity to the main manifest xml. </p><p>I added an onClickListener to a button. </p><p>Here is some code:</p><p>TextEntryActivity class:</p><pre><code>public class TextEntryActivity extends Activity{@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.text_entry);    EditText edit = (EditText)findViewById(R.id.editable);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,              WindowManager.LayoutParams.FLAG_BLUR_BEHIND);}</code></pre><p>}</p><p>I have a separate XML file for the layout of the blurr.</p><p>Originally I had an onClickListerner for an onSave button that stored all the info:</p><pre><code> private View.OnClickListener onSave = new View.OnClickListener() {    @Override    public void onClick(View v) {        Log.d(DEB_TAG, ""INSIDE ONCLICK"");        mCurrent = new Restaurant();        mCurrent.setName(mName.getText().toString());        mCurrent.setAddr(mAddr.getText().toString());        mCurrent.setDate(mDateDisplay.getText().toString());        mCurrent.setNotes(mNotes.getText().toString());        switch (mTypes.getCheckedRadioButtonId()){            case R.id.fast_food:                mCurrent.setType(""fast_food"");                break;.........</code></pre><p>The new activity is to provide a different view to add a ""note""</p><p>Does this make sense?  I am fairly new to this and know what I want to do in my head, but describing it can be a challenge.</p>","2186261","","","","","2010-08-02 18:35:56","Start new activity from onClickListener","<android>","0","4","","",""
"3391019","1","11023213","","2010-08-02 19:17:35","2","2760","<p>I have a web application to be hosted on android device. I am currently using the emulator available with android sdk. My application will serve both static as well as dynamic data. I am currently using jetty version 6.1.22. I wanted to ask what will be a better option to be used.1. Jetty webserver with stripped off code.2. I-Jetty.</p><p>My application uses following features-</p><ul><li>ResourceHandler to serve static resources.</li><li>A Generic servlet to serve synchronous data requests.</li><li>An extension to CometServlet to serve asynchronous data requests. </li></ul><p>I am looking forward to following criteria for comparison.</p><ul><li>Application size. Size of apk which will contain the code.</li><li>Memory and CPU usage under a maximum load of 30 requests/sec. These are short bursts which occur very few times in app-life cycle. The average load would be approximately 5 requests/sec.</li><li>Ease of maintenance. Including important upgrades of Jetty in application.</li><li>Any other side-effects which I probably am missing out at.</li></ul>","378200","","378200","","2010-08-02 19:49:28","2012-06-13 21:00:28","I-Jetty or Jetty","<android><embedded-jetty>","4","2","2","",""
"3391160","1","16618811","","2010-08-02 19:39:03","80","16022","<p>Is there anyway to copy/paste (desktop's) clipboard content to <code>EditView</code> on Android Emulator?  </p><p><em>(just for the sake to ease development/test)</em></p>","229106","","229106","","2011-02-28 04:49:08","2014-01-15 17:04:32","Paste text on Android Emulator","<android><copy-paste>","5","3","33","",""
"3391272","1","3391287","","2010-08-02 19:56:25","5","12267","<p>I have an application that is performing HTTP Requests (specifically calling the FogBugz API) when the user clicks certain buttons. Right now, I am just creating a service when the application starts, and then calling different methods in that service to complete requests. However, when I do this, there is the usual hang in the UI thread. I have looked at AsyncTask, but am not sure it will do what I want to accomplish. Because I need to instantly parse the XML that the HTTP Request returns, I need to have a process that is able to return this data to the UI thread. Will ASyncTask be able to accomplish this, or is there some other way?</p><pre><code>    public static InputStream makeRequest(String httpRequest)    {        In a separate thread, run HTTP Request, get back and process, return inputstream    }</code></pre><p>This method is called by several others to perform HttpRequests. Once the inputstream is returned, the other methods parse for specific information. </p>","381508","","381508","","2010-08-02 20:18:43","2012-09-19 07:52:35","How to use separate thread to perform http requests","<android><http><android-asynctask>","2","0","4","",""
"3391316","1","","","2010-08-02 20:03:33","0","82","<p>I have problem in displaying content in Linearlayout,how to extend layout height.when large number layout used for displaying content..</p>","407506","","","","","2010-08-02 20:27:44","Extending Linenarlayout height","<android>","1","0","","",""
"3391329","1","","","2010-08-02 20:05:31","1","4236","<pre><code>public void Connect() throws Exception{ InetAddress dest; dest = InetAddress.getByName(""192.168.1.100""); DatagramSocket socket = new DatagramSocket(); socket.connect(new InetSocketAddress(15900)); byte[] message = ""Oh Hai!"".getBytes(); DatagramPacket packet = new DatagramPacket(message, message.length,dest,15900); socket.send(packet);}</code></pre><p>Using the above code on Android SDK 1.5, when attaching the debugger to the android emulation, I step through the above sample (obtained from a tutorial), and the debugger returns control to the user when it reaches the DatagramSocket line... as soon as I hit F8 (Eclipse Galileo) to continue, I immediately have control again.. basically it never reaches socket.connect.... What is going wrong here? If I surround it in a try/catch block, nothing is caught so it's not an exception. Why is it dying like this?</p><p>Thanks! </p>","409007","","","","","2010-08-03 00:52:29","Android DatagramSocket not working correctly","<java><android>","1","0","","",""
"3391378","1","3391447","","2010-08-02 20:14:54","0","240","<p>I need to play mp3 at 1.4 (or other) times the normal speed. How can I do that?Thank you!</p>","124411","","","","","2010-08-02 20:25:17","Android - To play audio at 1.4 times the normal speed","<android>","1","0","","",""
"3391395","1","3447139","","2010-08-02 20:18:34","10","979","<p>I am creating an android app that is basically a listing of information on Mushrooms.  I get this information from an sqlite database.  I have a global singleton with a services class inside it in which I use to access my db.  Almost every activity accesses the db.  Is it better to leave my db open all the time or open and close it as I need the data?</p><p>If the best practice is to leave it open all the time, where do I need to make sure to close it and what is the worst case scenario if I left it open when the activity was destroyed?</p>","1491425","","","","","2010-08-10 08:16:40","Database Access in Android","<java><android><database><sqlite><activity>","3","0","4","",""
"3391522","1","","","2010-08-02 20:34:46","1","573","<p>Hey, I've just started to learn Android development and ran into a problem.</p><p>Controls in the game I'm making work on virtual device, but not on phone:</p><ul><li>I have an Xperia X10 Mini Pro</li><li>I'm making a basic Pong game to learn droid software development</li><li>The game works just fine on my Android virtual device, you can move the paddles up and down smoothly</li><li>On my phone I've figured that the onKeyDown event doesn't run until I release the button or after I've held down the button for a second or two, but then it only registers it as a brief press of the button, not like if I was holding it down</li><li>I believe that it's a feature of my phone to quickly access special characters, because some keys register different key codes when pressed quickly and when held down</li><li>The problems this results in is that I can not move the paddles, but I can do single press things, like pause the game</li></ul><p>I can also add:</p><ul><li>Game is heavily built around sample app LunarLander from the SDK</li><li>Lunar lander works fine in virtual device but has same issues as my pong when put in my phone</li></ul><p>How could I force my phone to register onKeyDown events like it should? (Or at least like the virtual device does?)</p><p>Code from my view class that extends surfaceView:</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent msg) {    return thread.doKeyDown(keyCode, msg);}@Overridepublic boolean onKeyUp(int keyCode, KeyEvent msg) {    return thread.doKeyUp(keyCode, msg);}</code></pre><p>Code from within the thread:</p><pre><code>boolean doKeyDown(int keyCode, KeyEvent msg) {    synchronized (mSurfaceHolder) {        mP1Score = keyCode;//For debugging        boolean okStart = false;        if (keyCode == KeyEvent.KEYCODE_SPACE) okStart = true;        if (mMode == STATE_PAUSE &amp;&amp; okStart) {            setState(STATE_RUNNING);            return true;        } else if (mMode == STATE_READY &amp;&amp; okStart) {            setState(STATE_RUNNING);            return true;        } else if (mMode == STATE_GOAL &amp;&amp; okStart) {            return true;        }else if (mMode == STATE_END_GAME &amp;&amp; okStart) {            doStart();            return true;        } else if (mMode == STATE_RUNNING) {            if (keyCode == KeyEvent.KEYCODE_Q) {                mP1dY = -PLAYER_SPEED;//Player 1 up                return true;            } else if (keyCode == KeyEvent.KEYCODE_A) {                mP1dY = PLAYER_SPEED;//Player 1 down                return true;            } else if (keyCode == KeyEvent.KEYCODE_O) {                mP2dY = -PLAYER_SPEED;//Player 2 up                return true;            } else if (keyCode == KeyEvent.KEYCODE_L) {                mP2dY = PLAYER_SPEED;//Player 2 down;                return true;            } else if (keyCode == KeyEvent.KEYCODE_SPACE) {                pause();//Space is pressed in game                return true;            }        }        return false;    }}boolean doKeyUp(int keyCode, KeyEvent msg) {    boolean handled = false;    mP2Score = keyCode;//For debugging    synchronized (mSurfaceHolder) {        if (mMode == STATE_RUNNING) {            if (keyCode == KeyEvent.KEYCODE_Q                    || keyCode == KeyEvent.KEYCODE_A) {                mP1dY = 0;                handled = true;            } else if (keyCode == KeyEvent.KEYCODE_O                    || keyCode == KeyEvent.KEYCODE_L) {                mP2dY = 0;                handled = true;            }        }    }    return handled;}</code></pre><p></p><p><a href=""http://www.svanrog.se/files/droid/thaipong.zip"" rel=""nofollow"">Complete source available here</a></p>","409027","","409027","","2010-08-03 11:40:28","2010-08-03 14:21:53","Making Android game, key input registered weirdly on X10 Mini Pro","<android><event-handling>","1","2","0","",""
"3391585","1","3391855","","2010-08-02 20:43:41","6","5692","<p>This is not a question about how to sign an .apk file. I want to know what does signing actually means and how it is implemented.</p><p>Inside the .apk file there is META-INF folder and inside that there are two files.</p><p>First one is CERT.SF contains SHA1 hashes for various components and looks like this:</p><pre><code>Name: res/layout/main.xmlSHA1-Digest: Cox/T8fN1X9Hv4VqjH9YKqc/MsM=Name: AndroidManifest.xmlSHA1-Digest: wZ418H9Aix1LNch3ci7c+cHyuZc=Name: resources.arscSHA1-Digest: P+uoRrpFyVW6P3Wf+4vuR2ZSuXY=Name: classes.dexSHA1-Digest: cN3zXtGii9zuTOkBqDTLymeMZQI=</code></pre><p>There is also a file called CERT.RSA. I assume it is the public key to verify the signature.</p><p>My question is, where is the signature for the whole .apk file is stored? And what is actually signed? It could be either</p><ul><li>.apk file used as a single binary object and this is signed</li><li>or CERT.SF is signed which contains individual hashes for different components</li></ul><p>It would be also much better if you can point me to the documentation of the detailed signing and verification process.</p>","33885","","","","","2012-02-21 20:48:17","How does an .apk files get signed","<android><code-signing>","2","0","2","",""
"3391643","1","3400341","","2010-08-02 20:52:27","2","3842","<p>I need your help to add some insight into JNI on Android.  I've been looking at the /libcore/x-net package in Android and notice that Apache Harmony is the default provider for SSL functionality (using OpenSSL).</p><p>Everywhere I've found on the internet says that when you use JNI in Android you must load the native code by using the System.loadLibrary(...) method, but I can't see where Apache Harmony uses this at all.  I am confused as to how their native code is ever loaded.  Nowhere in their Java code do they ever load their native library.</p><p><strong>/libcore/x-net/src/main/java/org...</strong>   [Java Code of JNI]<br/><strong>/libcore/x-net/src/main/native/...</strong>    [C++ Code for JNI]<br/><br/></p><p>Chris</p>","175280","","","","","2011-02-25 14:56:48","Android JNI System.loadLibrary not needed?","<java><c++><android><jni>","2","1","1","",""
"3391993","1","3394162","","2010-08-02 21:37:55","4","2706","<p>I would like to change language (locale of application) programmatically.</p><p>The main problem for me is updating menu labels. </p><p>I tried the following method:</p><pre><code> @Overridepublic boolean onMenuOpened(int featureId, Menu menu) {    if (shouldChangeMenuLabels) {        for (int i = 0; i &lt; menu.size(); i++) {            MenuItem menuItem = menu.getItem(i);            switch (menuItem.getItemId()) {                case R.id.menu_main_about:                    menuItem.setTitle(R.string.menu_about);                    break;                case R.id.menu_main_preferences:                    menuItem.setTitle(R.string.menu_prefs);                    break;            }        }        shouldChangeMenuLabels = false;    }</code></pre><p>But I'm sure it bad idea. I want to avoid using switch-case statement as this is not universal method (I can't simply port the snipped to other activities / I can't make abstract class which would do that). </p><hr><p>BTW, all menus have been described into menu/*.xml files so I don't want duplicating the code. Anybody has ideas?</p><p>Concerned to first answer: I hae changed locale with the following code:</p><pre><code>            Locale locale = new Locale((String)newValue);            Locale.setDefault(locale);            Configuration config = new Configuration();            config.locale = locale;            getApplication().getResources().updateConfiguration(config, getApplication().getResources().getDisplayMetrics());</code></pre><p>But as I want to control rotating for each activity, they are never finished. Maybe I did something wrong?</p>","332311","","332311","","2010-08-03 05:31:26","2010-08-05 11:36:11","Android & menu localization","<android><localization><menu>","3","0","1","",""
"3392006","1","3392098","","2010-08-02 21:39:46","3","8623","<p>I have a Tabview with 3 tabs (each having their own activity). I have a tab that parses a RSS feed. How can I refresh this feed via a menu button? I tried doing the following but I lose the tabs above of course.  Thanks!</p><pre><code>  Intent UpdateFeedIntent = new Intent(classA.this, classA.class);</code></pre><p>startActivity(UpdateFeedIntent);   finish();</p>","394241","","","","","2010-08-04 15:33:48","How can I reload an Activity that exists within a TabView?","<android><view><refresh><tabs>","2","0","5","",""
"3392036","1","","","2010-08-02 21:44:19","0","2907","<p>I am trying to set up a ViewFlipper that changes a SlidingDrawers content each time a button is pressed. So far every view I set up worked fine, but now I am trying to create a ListView (including single_choice_mode) within a child view of the ViewFlipper, but my attempt only let to a NullPointerException. As I only discovered ViewFlipper today, I am not yet familiar with it and may not have understood it completely...if someone could give me a hand and help me find out what I have done wrong, that would be great.</p><p>Thank you in advance. </p><hr><p>Here is what I have done: </p><p>The code for the onClick event of the ImageButtons:</p><pre><code>public void onClick(View v) {    if (v == btnExposure) {        mFlipper.setDisplayedChild(0);    } else if (v == btnProperties) {        mFlipper.setDisplayedChild(1);    } else if (v == btnSpecialEffects) {        mFlipper.setDisplayedChild(2);        String[] specialEffects = getResources().getStringArray(R.array.special_effects_array);        lv.setAdapter(new ArrayAdapter &lt; String &gt; (this, R.layout.specialeffectsview, specialEffects));        lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);    }}</code></pre><p>The XML code of the ViewFlipper within my main xml file:</p><pre><code>&lt;ViewFlipper   android:layout_width=""wrap_content""    android:layout_height=""wrap_content""   android:id=""@+id/flipper""   android:layout_toRightOf=""@id/button_exposure""&gt;   &lt;include android:id=""@+id/view_exposure"" layout=""@layout/exposureview"" /&gt;   &lt;include android:id=""@+id/view_properties"" layout=""@layout/propertiesview"" /&gt;   &lt;include android:id=""@+id/view_special_effects"" layout=""@layout/specialeffectsview""/&gt;  &lt;/ViewFlipper&gt;</code></pre><p>The string array within my strings.xml: </p><pre><code>&lt;string-array name=""special_effects_array""&gt;        &lt;item&gt;None&lt;/item&gt;        &lt;item&gt;Greyscale&lt;/item&gt;        &lt;item&gt;Sepia&lt;/item&gt;        &lt;item&gt;Negative&lt;/item&gt;        &lt;item&gt;Solarize&lt;/item&gt;        &lt;item&gt;Polarize&lt;/item&gt;    &lt;/string-array&gt;</code></pre><p>And finally the specialeffectsview.xml (the layout file for the ListView):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/view_special_effects_list"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ListView android:id=""@+id/special_effects_list""  android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre>","390782","","2218452","","2013-05-24 09:14:01","2013-05-24 09:14:01","How to populate a ViewFlipper child View with a ListView?","<android><listview><viewflipper>","1","0","","",""
"3392132","1","3392453","","2010-08-02 21:58:42","1","933","<p>I have a widget that shows some data fetched from the Internet. I may have multiple widgets visible on the screen, each displaying some data, partly the same as the other widgets.</p><p>From time to time I re-fetch the data from the Internet and update the widget views.</p><p>I've modeled this in an MVC style: I have a model which I can invoke a ""re-fetch-data"" on, and which the views listen on.</p><p>My questions:</p><p><strong>A)</strong> Is it wise to let my model be a singleton?</p><p><strong>B)</strong> Can I rely on that all widgets are served by the same AppWidgetProvider? Or may some of my widgets get served by a different AppWidgetProvider instance? Or, more generally: Is there any guarantee that there will be only one instance of my AppWidgetProvider?</p><p>If there is only one instance of my AppWidgetProvider, then I could use an instance variable here for the model, and pass either my AppWidgetProvider or the model around where needed. Perhaps a better option?</p><p><strong>C)</strong> In the AppWidgetProviders <code>onUpdate</code> method, can I be sure that the same ""context"" object is passed as argument each invocation?</p>","276052","","","","","2010-08-02 23:01:12","Model for an AppWidgetProvider","<android><widget>","1","0","","",""
"3392139","1","3392615","","2010-08-02 22:00:13","1","9497","<p>I am working on Android App and unable to synchronize View with Hardware.Let me explain.</p><p>1) I mute and unmute microphone of Android based on random values (which are random sleeps) stored in array A, from within run  method of Thread 1.</p><p>2) I draw  blue pulses that reflects the mutes of microphone. This is done by independent View class. </p><p>3)I move a red line across the graph drawn in above view, by calling from within onTick of a countdown timer. </p><p>I start the two threads one after other, this way:</p><p>Thread1.start</p><p>counter.start();</p><p>How to synchronize both of these, I want to do three things at a time and avoid multiple threads. Three things are: Draw the pulses (which is constant) , make the red line move across x axis and touch the blue pulse as soon as the phone is muted, and keep moving every second, the width of pulse reflects duration of delay. as soon as microphone is about to be unmuted, red line should leave the pulse and move forward.</p><p>Currently, code is doing what I want. but there is no synchroization. Either microphone does its job first, or graph moves fast. They are not in Sync. </p><p>Is there a way to hold a thread, force it to behave as coutdowntimer or sync both of them.I cannot embed the red line movement in thread 1 because, it will have to progress across x axis every second.</p>","357349","","","","","2012-09-14 02:24:11","Thread synchronization Java","<java><android>","1","2","3","",""
"3392147","1","3392175","","2010-08-02 22:01:56","5","37723","<p>I have an app that shows a disclaimer at the beginning of the program. I want a button to remain invisible for a set amount of time, and then become visible.I set up a thread that sleeps for 5 seconds, and then tries to make the button visible. However ,I get this error when I execute my code:</p><p>08-02 21:34:07.868: ERROR/AndroidRuntime(1401): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</p><p>How can I count 5 seconds, and then make the button visible?THanks.</p><pre><code>Thread splashTread = new Thread() {           @Override           public void run() {            try {                   int waited = 0;                   while(_active &amp;&amp; (!_ok2)) {                       sleep(100);                       if(_active) {                           waited += 100;                           if(waited &gt;= _splashTime)                           {                            turnButtonOn();                           }                       }                   }               } catch(InterruptedException e) {                   // do nothing               } finally {                   finish();                   startActivity(new Intent(""com.lba.mixer.Choose""));               }    };    splashTread.start();      public static void turnButtonOn() {         okButton.setVisibility(View.VISIBLE);      }</code></pre>","413394","","2764108","","2014-01-07 16:32:59","2014-01-07 16:32:59","android set visibility of a button on timer","<android><multithreading><button><view><timer>","2","0","4","",""
"3392189","1","","","2010-08-02 22:08:14","0","1824","<p>Is there a way to read META-INF\MANIFEST.MF file of the currently running application using Android API?</p><p>I want to read SHA1 for classes.dex file and use it as an encrpytion key to one of my assets. </p><p>I cannot use the signature for .apk file because everytime I create a new apk I need to re-encrpyte my asset and put in to apk file which requires re-signing the .apk and it becomes a chicken and egg problem.</p>","33885","","","","","2013-03-07 12:11:38","Reading android MANIFEST.MF file","<android><manifest>","2","0","","",""
"3392256","1","3392874","","2010-08-02 22:22:08","18","9609","<p>I'm developing an android app and need to know how to change the positioning of a progress dialog. I need it to be positioned at the bottom of the screen instead of at the center like it is by default.</p>","378272","","","","","2012-12-24 08:01:17","How to change the positioning of a progress dialog?","<android><position><alignment><progressdialog>","3","0","4","",""
"3392351","1","3392606","","2010-08-02 22:39:40","3","3116","<p>Here is the XML for the layout in which I want my custom view to appear.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayoutandroid:id=""@+id/widget273""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""xmlns:rs=""http://schemas.android.com/apk/res/com.bookcessed.booksearch""&gt;&lt;TextViewandroid:id=""@+id/csp_tv_title""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Choose Your Source""android:textSize=""40sp""android:textColor=""#ffc83200""android:gravity=""center""android:paddingTop=""15dip""android:paddingBottom=""75dip""android:layout_alignParentTop=""true""android:layout_centerHorizontal=""true"" /&gt;&lt;com.bookcessed.booksearch.SearchProviderButtonandroid:id=""@+id/csp_spb_1""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_centerHorizontal=""true""android:layout_below=""@+id/csp_tv_title""rs:providerName=""BOOKP"" /&gt;&lt;/RelativeLayout&gt;&gt;</code></pre><p>Here is the custom view's XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android""xmlns:rs=""http://schemas.android.com/apk/res/com.bookcessed.booksearch""android:layout_width=""fill_parent""android:layout_height=""wrap_content"" &gt;&lt;RelativeLayoutandroid:id=""@+id/pv_rl_strings""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:gravity=""center""android:layout_alignParentTop=""true"" &gt;&lt;TextViewandroid:id=""@+id/pv_tv_search""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Search""android:layout_toRightOf=""@+id/pv_tv_and""android:textSize=""18sp""android:textColor=""#ff11ab37""android:layout_alignParentTop=""true"" /&gt;&lt;TextViewandroid:id=""@+id/pv_tv_and""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text="" and ""android:textSize=""18sp""android:paddingLeft=""6dip""android:paddingRight=""6dip""android:textColor=""#ff000000""android:layout_centerHorizontal=""true"" /&gt;&lt;TextViewandroid:id=""@+id/pv_tv_browse""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Browse""android:textSize=""18sp""android:textColor=""#ff0077bb""android:layout_alignParentTop=""true""android:layout_toLeftOf=""@+id/pv_tv_and"" /&gt;&lt;ImageViewandroid:id=""@+id/pv_logo""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_below=""@+id/pv_tv_search""android:layout_centerInParent=""true""android:layout_alignTop=""@+id/pv_tv_and""android:src=""@drawable/bookp_logo""/&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayoutandroid:id=""@+id/pv_rl_genres""android:layout_width=""wrap_content""android:layout_below=""@+id/pv_rl_strings""android:layout_height=""wrap_content""android:layout_centerHorizontal=""true""&gt;&lt;ImageViewandroid:id=""@+id/pv_genre1""android:layout_width=""30dip""android:layout_height=""30dip""android:layout_alignParentTop=""true""android:layout_alignParentLeft=""true""&gt;&lt;/ImageView&gt;&lt;ImageViewandroid:id=""@+id/pv_genre2""android:layout_width=""30dip""android:layout_height=""30dip""android:layout_alignParentTop=""true""android:layout_toRightOf=""@+id/pv_genre1""&gt;&lt;/ImageView&gt;&lt;ImageViewandroid:id=""@+id/pv_genre3""android:layout_width=""30dip""android:layout_height=""30dip""android:layout_alignParentTop=""true""android:layout_toRightOf=""@+id/pv_genre2""&gt;&lt;/ImageView&gt;&lt;ImageViewandroid:id=""@+id/pv_genre4""android:layout_width=""30dip""android:layout_height=""30dip""android:layout_alignParentTop=""true""android:layout_toRightOf=""@+id/pv_genre3""&gt;&lt;/ImageView&gt;&lt;ImageViewandroid:id=""@+id/pv_genre5""android:layout_width=""30dip""android:layout_height=""30dip""android:layout_alignParentTop=""true""android:layout_toRightOf=""@+id/pv_genre4""&gt;&lt;/ImageView&gt;&lt;ImageViewandroid:id=""@+id/pv_genre6""android:layout_width=""30dip""android:layout_height=""30dip""android:layout_alignParentTop=""true""android:layout_toRightOf=""@+id/pv_genre5""&gt;&lt;/ImageView&gt;&lt;ImageViewandroid:id=""@+id/pv_genre7""android:layout_width=""30dip""android:layout_height=""30dip""android:layout_alignParentTop=""true""android:layout_toRightOf=""@+id/pv_genre6""&gt;&lt;/ImageView&gt;&lt;ImageViewandroid:id=""@+id/pv_genre8""android:layout_width=""30dip""android:layout_height=""30dip""android:layout_alignParentTop=""true""android:layout_toRightOf=""@+id/pv_genre7"" /&gt;&lt;ImageViewandroid:id=""@+id/pv_genre9""android:layout_width=""30dip""android:layout_height=""30dip""android:layout_alignParentTop=""true""android:layout_toRightOf=""@+id/pv_genre8"" /&gt;&lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>Here is the class SearchProviderButton:</p><pre><code>public class SearchProviderButton extends LinearLayout { private Connector connector; private Context context; private View inflatedView; public SearchProviderButton(Context context, AttributeSet attrs) {  super(context, attrs);  TypedArray a = getContext().obtainStyledAttributes(attrs,R.styleable.SearchProviderButton);  connector = SearchProvider.valueOf(a.getString(R.styleable.SearchProviderButton_providerName)).getConnector();  this.context = context;  setFocusable(true);  setBackgroundColor(Color.WHITE);  setVisibility(VISIBLE);  //setOnClickListener(listenerAdapter);  setClickable(true); } @Override protected void onFinishInflate() {  super.onFinishInflate();  LayoutInflater li = LayoutInflater.from(context);  inflatedView = li.inflate(R.layout.provider_view, null);  ImageView logo = (ImageView)inflatedView.findViewById(R.id.pv_logo);  logo.setImageResource(connector.getLogoDrawableID());  TextView searchTV = (TextView)inflatedView.findViewById(R.id.pv_tv_search);  TextView andTV = (TextView)inflatedView.findViewById(R.id.pv_tv_and);  if(!connector.isSearchSupported()){   andTV.setText("""");   searchTV.setVisibility(GONE);  }  setgenreIcons(); } public Connector getConnector(){  return connector; } public void setConnector(Connector connector){  this.connector = connector; } private void setgenreIcons(){  int[] genreIconDrawables = {R.id.pv_genre1,R.id.pv_genre2, R.id.pv_genre3,    R.id.pv_genre4, R.id.pv_genre5, R.id.pv_genre6, R.id.pv_genre7,     R.id.pv_genre8, R.id.pv_genre9};    ArrayList&lt;Genre&gt; availgenre = connector.getAvailablegenres();  availgenre.remove(Genre.ALL);  int counter = 0;  for(int genreIVid : genreIconDrawables){   ImageView curgenreImageView = (ImageView)inflatedView.findViewById(genreIVid);   if(counter &lt; availgenre.size() - 1){    curgenreImageView.setImageResource(availgenre.get(counter).getDrawable());   } else {    curgenreImageView.setVisibility(GONE);   }   counter++;   } } protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {  if (gainFocus == true){   this.setBackgroundColor(Color.rgb(255, 165, 0));  } else {   this.setBackgroundColor(Color.WHITE);  } }}</code></pre><p>Here is the code for the class loading the xml that contains my custom component:</p><pre><code>bookPServiceProviderButton = (SearchProviderButton)findViewById(R.id.csp_spb_1);bookPServiceProviderButton.setOnClickListener(SPBOnClickListener);bookPServiceProviderButton.setConnector(new bookPConnector());bookPServiceProviderButton.setVisibility(View.VISIBLE);</code></pre><p>EDIT: After the first comment, I added this code:</p><pre><code>@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {      super.onMeasure(widthMeasureSpec, heightMeasureSpec);        int widthSpec = MeasureSpec.getMode(widthMeasureSpec);        int width = MeasureSpec.getSize(widthMeasureSpec);        int heightSpec = MeasureSpec.getMode(heightMeasureSpec);        int height = MeasureSpec.getSize(heightMeasureSpec);    setMeasuredDimension(width, height);}</code></pre><p>Now it has a width and a height, but nothing is showing up inside of it!</p>","325081","","325081","","2010-08-02 23:41:18","2010-08-03 03:37:17","Custom View not appearing","<java><android><xml><layout><custom-controls>","2","2","3","",""
"3392701","1","3392768","","2010-08-03 00:03:28","6","8445","<p>I have a question about implementing OnClickListeners for developing with the ADT. I'm unsure of which way is more efficient, can anyone please provide me with pro's and con's of each approach?</p><pre><code>class x extends Activity implements OnClickListener{  button.SetOnClickListener(this);  OnclickListener(View v)  {    switch(v.getGetId());    {      case R.id.y:      //do stuff here      break;      .      .      .    }  }}</code></pre><p>&lt;-VERSUS-></p><pre><code>class a extends Activity{   .   .   .   btn.setOnClickListener(new Button.OnClickListener()   {    OnClickListener(View v)    {      //do stuff here    }   });}</code></pre>","120854","","6391","","2010-08-03 04:31:22","2010-08-03 04:31:22","implements OnClickListener VS. new Button.OnClickListener() {};","<java><android>","1","2","4","",""
"3392789","1","3393023","","2010-08-03 00:25:18","1","1386","<p>I wish to have an 80% by 80% sized view popup, grey out the background and take focus?</p><p>In essence it's a ""sub"" view that is model.</p><p>Strategies ?</p>","172861","","6391","","2010-08-03 04:30:23","2010-08-03 04:30:23","Android Floating popup 'window' options?","<android><dialog><popup>","1","0","2","",""
"3392933","1","3393097","","2010-08-03 01:09:33","1","260","<p>Booking.java</p><pre><code>package one.two;import android.app.Activity;import android.database.Cursor;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.SimpleCursorAdapter;import android.widget.Spinner;public class Booking extends Activity{    private DBAdapter db;     private Spinner colourSpinner;    private String txtArrival;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        db = new DBAdapter(this);        db.open();        setContentView(R.layout.booking);        Cursor c = db.getSpinnerData();        startManagingCursor(c);        String[] from = new String[]{DBAdapter.KEY_ARRIVAL};        int[] to = new int[]{R.id.txtArrival};        SimpleCursorAdapter adapter =        new SimpleCursorAdapter(this, android.R.layout.simple_spinner_item, c, from, to );        adapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );        Spinner colourSpinner = (Spinner) findViewById(R.id.myspinner);        colourSpinner.setAdapter(adapter);        }</code></pre><p>Where would i declare my {KEY_ARRIVAL} as i already have my KEY_ARRIVAL declared in my DBAdapter.java. But there is an error stating KEY_ARRIVAL cannot be resolved?</p>","358218","","6391","","2010-08-03 04:29:47","2010-08-03 04:29:47","Error with taking spinner data from database","<java><android>","1","0","1","",""
"3393028","1","3393792","","2010-08-03 01:35:04","2","2275","<p>Is there a way to access and query the android SMS/MMS log? To clarify, the SMS/MMS Log is all the SMS/MMS messages sent by the host phone. It can be aquired by reading a cursor to the message inbox.</p>","200477","","200477","","2010-08-03 13:26:01","2010-08-03 13:26:01","Query Android SMS Log","<java><android><sms><mms><telephony>","1","0","","",""
"3393337","1","3394096","","2010-08-03 03:04:22","0","322","<p>I've completed my login page. My problem now is I can only log in using the first account created. I found out that I have not complete my login page. The missing item is the while..loop code so that the application will check the other existing user instead of only looking for a match for the first user.</p><pre><code>if(username.equals(c.getString(1)))            {                if(password.equals(c.getString(2)))                {                    Context context = getApplicationContext();                    int duration = Toast.LENGTH_LONG;                    Toast toast = Toast.makeText(context, ""LOGIN SUCCESS"", duration);                    toast.show();                    Intent intent=new Intent(Login.this,Test.class);                    startActivity(intent);                }</code></pre><p>I do know that the code is something like  <code>while (c.moveToNext())</code> but I do not know how to apply it on my if..else statement.</p><p>I hope you can help me out on this simple task. Thank you!</p>","380770","","","","","2010-08-03 09:49:09","while loop login","<android>","1","3","","",""
"3393356","1","3399627","","2010-08-03 03:08:39","1","388","<p>I'm working on a one-time password application, using the hotp algorithm (RFC 4226).  I've got an Android app (via simulator) for otp generation, and a server-side app for validation.  On their own, both are working fine and passing tests.</p><p>However, the secret key I'm generating on my device is not the same as the secret key I'm generating on the server, even when the inputs are hardcoded and the same between them.  This leads to different one-time passwords being generated on the device and the server, which ruins my ability to generate valid one-time passwords.  I'm trying to figure out why this is happening, and if there's anything I can do about it.  </p><p>The code is identical between the server and the device simulator for constructing SecretKeys and generating one-time passwords from the keys.  I've checked the bytes in the keyspecs on the device and the server, and they're identical.  However, the keys generated by the SecretKeyFactories (both from DESedeKeySpecs) have subtle off-by-one differences when I view the bytes from secretKey.getEncoded().  I see similar differences if I use DES instead of triple DES.  </p><p>What's interesting is that in my Android project, the bytes in the KeySpec and the generated SecretKey are consistent (though truncated), but on the server, there are occasional off-by-one differences in the bytes between the KeySpec and generated SecretKey.  Is this normal?  I read something about parity bit alterations when using DES and triple DES, so I'm not sure if this is a problem.</p><p>I also know that Android is using Bouncy Castle, but my server is using SunJCE.  My understanding was that this shouldn't present a problem, and I'd like to know if this is a known occurence when using two different providers.  I have very limited ability to get Bouncy Castle server-side.  </p><p>Advice and enlightenment, please?</p>","92359","","92359","","2010-08-03 19:49:31","2010-08-03 19:49:31","Secret keys differ between Android and server","<java><android><cryptography><bouncycastle><otp>","1","2","","",""
"3393385","1","3393842","","2010-08-03 03:19:12","8","9611","<p>I'm trying to implement a login view where several EditTexts and a logo are displayed on the screen with a ButtonBar at the bottom, something like this:</p><p><img src=""http://russellhaering.com/media/addAccount.png"" alt=""alt text""></p><p>The problem is that on very small screens, especially when they are rotated sideways, the entire main view doesn't fit onto the screen.</p><p>I currently have</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""#234C59""  &gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:paddingTop=""5dip""        android:paddingLeft=""15dip""        android:paddingRight=""15dip""        android:orientation=""vertical"" &gt;        &lt;ImageView            android:id=""@+id/logo""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:scaleType=""fitCenter""            android:layout_centerHorizontal=""true""            android:src=""@drawable/logo"" /&gt;        &lt;EditText            android:id=""@+id/input_email""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_marginTop=""10dip""            android:inputType=""textEmailAddress""            android:singleLine=""true""            android:hint=""Username or email"" /&gt;        &lt;EditText            android:id=""@+id/input_password""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_marginTop=""""            android:inputType=""textPassword""            android:singleLine=""true""            android:hint=""Password"" /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:id=""@+id/buttonbar_login""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:orientation=""horizontal""        style=""@android:style/ButtonBar"" &gt;        &lt;Button            android:id=""@+id/button_signup""            android:layout_width=""0dip""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:text=""Sign Up"" /&gt;        &lt;Button            android:id=""@+id/button_login""            android:layout_width=""0dip""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:text=""Log In"" /&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>I've tried encapsulating the first LinnearLayout in a ScrollView that looks like this:</p><pre><code>&lt;ScrollView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;            &lt;!-- Linear Layout Here --&gt;&lt;/ScrollView&gt;</code></pre><p>But that introduces two problems:</p><ol><li><p>The ScrollView doesn't scroll, even on screens where the data doesn't all fit</p></li><li><p>The ButtonBar floats on top of the onscreen keyboard, obscuring even more of the screen when the keyboard comes up.</p></li></ol><p>Everything worked great when I had the buttons inside the ScrollView, but now that I have them in the ButtonBar I'm having a lot of trouble figuring this out.</p>","232332","","","","","2010-08-03 05:36:25","Android Scrollview in RelativeLayout with ButtonBar","<android><scrollview><relativelayout><buttonbar>","2","0","2","",""
"3393404","1","3394200","","2010-08-03 03:29:04","0","163","<p>Alright, so I have an application that has a tabbed interface.  What I would like to know is how I can change the currently active View in the tab, and then when I'm done with that View, go back the the original View, exactly as it was.</p>","362857","","","","","2010-08-03 06:50:07","Using Views in a tabbed application","<android>","2","0","","",""
"3393462","1","","","2010-08-03 03:49:09","0","231","<p>When I copy the Different Xml Files From Another Projects(Downloaded From the Net), The R class is not Resolving the Error, because the id is not generated in R.java.There is Some Problem In Accessing The layouts in res folders. What Should I Do in that case? </p>","409261","","","","","2010-08-03 10:02:44","R.layout.anylayoutname can not be resolved after copy-paste from another project","<android>","1","1","","",""
"3393494","1","3393536","","2010-08-03 03:59:30","2","3893","<p>My application requires that when a snapshot is taken it must store in memory and next time when I restart the phone I must get a thumbnail of that photo in list of photos and the full scale photo when I click on it. </p><p>There are 2 ways I know. </p><ol><li>Store images directly. Concern here is every time it has to hit directory to get image which takes some time.</li><li>Store all images in single xml. Concern here is XML will be too big and takes time to parse</li></ol><p>Which is more efficient ?</p>","368084","","180538","","2011-04-20 11:15:15","2011-04-20 11:15:15","Efficient Way to store images in android","<android><image><storage>","1","0","1","",""
"3393520","1","3393559","","2010-08-03 04:09:37","0","4516","<p>I am trying to create a basic datasheet in my application using a TableLayout. The first row contains the titles of each column. Every row thereafter is data. I would like the data to be scrollable while keeping the first <em>title row</em> visible (i.e. the first row would not scroll with the rest).</p><p>I have tried something like the following (unsuccessfully):</p><pre><code>&lt;TableLayout&gt;  &lt;TableRow&gt;    &lt;!-- The headers --&gt;    &lt;TextView android:text=""Header #1""/&gt;    &lt;TextView android:text=""Header #2""/&gt;    &lt;TextView android:text=""Header #3""/&gt;  &lt;/TableRow&gt;  &lt;ScrollView&gt;    &lt;!--The rest of the data --&gt;    &lt;TableRow&gt;    &lt;TableRow&gt;    ...  &lt;/ScrollView&gt;&lt;/TableLayout&gt;</code></pre><p>This causes the program to crash. Any other suggestions?</p>","382252","","6391","","2010-08-03 04:26:32","2012-06-23 07:12:21","Scrollable TableLayout & Column Headers","<android><layout><scrollview><tablelayout>","3","0","","",""
"3393603","1","3454365","","2010-08-03 04:38:11","0","493","<p>My application has some data which I would like to keep secure. I have also enabled the application to use text-to-speech. Unfortunately, the application writes out whatever it says to the log file. This means that a third party application (with permissions to access the logs) could gain access to the data. Is there any way I can disable Android logging the text to speech data?</p>","165495","","","","","2010-08-10 23:55:30","Android - Disabling Text To Speech Logging for Data Security","<android><text-to-speech>","1","0","","",""
"3393609","1","3401888","","2010-08-03 04:39:31","1","2728","<p>How would you implement different color themes in your app?All I can see now is plain set color onCreate every activity and control...</p><p>Also, how would you store different color schemes in xml? Just an entries of  with different  names?</p><p>Thank you!</p>","67407","","","","","2010-08-04 11:47:12","Android easy switch color-scheme of application","<android><gui><colors><themes><color-scheme>","1","0","","",""
"3393613","1","","","2010-08-03 04:40:10","1","335","<p>I need to open attachment files from the mail client(as loke Outlook) in Android. I use android2.1 Emulator.In the manifest file if i give the  <code>&lt;data android:mimeType=""*/*"" /&gt;</code> i can able to open all the attachment files from my application.But I need to open .ics files only from my application.I try this also <code>&lt;data android:mimeType=""text/calendar"" /&gt;</code> .But it's not support to open the ics file from my application.How to solve this ? Can anyone guide me to solve this..? It's very urgent So please ....</p>","398981","","","","","2010-08-03 04:40:10","how to restrict the MIME type in Android Mail client?","<android>","0","0","","",""
"3393626","1","3393651","","2010-08-03 04:43:36","1","659","<p>I think this is a pretty simple question but I'm having trouble finding the answer out there...</p><p>I'm developing an android application (currently developing against v1.5 API) and one of the activities use a ListView. I want to be able to set the properties of each List Item based on the state of an in memory object rather than the state of the view or list item.</p><p>Here is a simple example....say I have a Person class who's public members are defined as follows:</p><pre><code>public class Person {           public string getName() {...}    public boolean isYoung() {...}            public boolean isMiddleAged() {...}    public boolean isOld() {...}}</code></pre><p>Just like the example outlined above the properties in my class are mutually exclusive (so only <strong>one</strong> of the three boolean values may be true).  Now say each List Item in my ListView is created from a Person object. I'm currently using a custom ArrayAdapter&lt; Person> class to bind the Person objects to the List View (not sure if that matters or not but thought I'd mention it). </p><p>I want to be able to set various List Item properties (text color and style and background color) based on the values of each Person object that is bound in the List View. Like possibly making the background color of all young people green, middle aged people orange, and old people black. How can I achieve these results?</p><p><strong>UPDATE:</strong> Thanks for your speedy reply Cristian C. I have been trying to implement your solution and keep getting this exception:</p><blockquote>  <p>Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #6: <code>&lt;item</code>> tag requires a 'drawable' attribute or child tag defining a drawable</p></blockquote><p>...every time the setBackgroundResource() executes: </p><pre><code>public View getView(int index, View convertView, ViewGroup parent) {    //...stuff here...   if(person.isYoung())      view.setBackgroundResource(R.drawable.green);}</code></pre><p>Where the selector 'green.xml' is defined as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:background=""@color/green"" /&gt;&lt;/selector&gt;</code></pre><p>Do you see any glaring mistakes with what I'm trying to do?</p><p>Thanks for your responses!</p>","176728","","176728","","2010-08-04 07:15:28","2010-08-04 20:42:11","Can an Android <selector> be based on an object's state instead of a view's state?","<android><listview><selectors>","1","0","","",""
"3393774","1","","","2010-08-03 05:19:44","2","1073","<p>I have a ListActivity which uses a custom ArrayAdapter defining 2 view types, for example</p><dl>parent 1<dt>  - child 11</dt><dt>  - child 12</dt>parent 2<dt>  - child 21</dt>parent 3<dt>  - child 31</dt><dt>  - child 32</dt></dl><p><br/>I have successfully implemented the display functionality I want, but when I register the list view with registerForContextMenu( getListView() ) in the ListActivity the only views that open the Context Menu are the child views, instead I want a long click on the parent views to open the Context Menu.  I've defined the parent view types as enabled and the child as disabled, this only makes both of them ignore the long press event.  Any ideas?  I was going to define the OnLongClick event on the parent views, but I'm not sure how to get ahold of the MenuInflator for the Activity (I have my ArrayAdapter defined in it's own class), should I pass the MenuInflator into my ArrayAdapter??  This seems a little heavy handed, but it may work.</p><p>Here's my onCreate call</p><pre><code>@Overrideprotected void onCreate( Bundle savedInstanceState ) {    super.onCreate( savedInstanceState );    setContentView( R.layout.workout_activity );    _pactAdapter = new WorkoutItemAdapter( this );     setListAdapter( _pactAdapter );    registerForContextMenu( getListView() );}</code></pre>","135048","","","","","2010-08-03 05:19:44","registerForContextMenu not working for a parent/child list view","<android>","0","0","","",""
"3393877","1","3398798","","2010-08-03 05:45:30","0","1732","<p>I am having some trouble in using a rawQuery to get a cursor for use in an ExpandableListView. I have an adapter class called ExpandableDataAdapter which extends SimpleCursorTreeAdapter. Here is the line I have to create an instance of the ExpandableDataAdapter:</p><pre><code>ExpandableDataAdapter confDataAdapter = new ExpandableDataAdapter(       this,       groupCursor,       R.layout.detaillist_group,       new String[]{ ""TrackName"" },       new int[]{ R.id.rowText },       R.layout.detaillist_child,       new String[]{ ""Title"", ""Speakers"", ""TrackName"", ""Room"" },       new int[]{ R.id.sessionTitle, R.id.sessionSpeakers, R.id.sessionTrack, R.id.sessionRoom }      );</code></pre><p>Inside the ExpandableDataAdapter class definition, I have the following method to get the children cursor for a group cursor:</p><pre><code>protected Cursor getChildrenCursor(Cursor groupCursor) {     // Given a group, return a cursor for all the children in that group.     Cursor talksCursor = _db.rawQuery(""SELECT t1.TalkID as _id, t1.Title,"" +     "" 'None' as Speakers, t2.TrackName, t1.Room"" +     "" from talks t1, tracks t2"" +     "" where t1.TrackID = t2.TrackID"" +     "" and t2.TrackID=?"", new String[]{ groupCursor.getString(groupCursor.getColumnIndex(""_id"")) });      startManagingCursor(talksCursor);   return talksCursor;}</code></pre><p>The above query works, and the ExpandableListView shows up. But, of course, the above is a simpler version of the actual query which I want to execute. When I replace it with the actual (and somewhat more complicated) query, I get an exception. First, the query:</p><pre><code>protected Cursor getChildrenCursor(Cursor groupCursor) {   // Given a group, return a cursor for all the children in that group.   Cursor talksCursor = _db.rawQuery(""SELECT t1.TalkID as _id, t1.Title,"" +     "" group_concat(t3.Speaker, ', ') as Speakers, t2.TrackName, t1.Room"" +     "" from talks t1, tracks t2, talkspeaker t3"" +     "" where t1.TalkID = t3.TalkID"" +     "" and t1.TrackID = t2.TrackID"" +     "" and t2.TrackID=?"" +     "" group by _id, t1.Title, t2.TrackName, t1.Room"",       new String[]{ groupCursor.getString(groupCursor.getColumnIndex(""_id"")) });   startManagingCursor(talksCursor);   return talksCursor;}</code></pre><p>The exception I get is: column 'Room' does not exist. This latest query works fine from a database prompt, so I am guessing that something is happening when being executed by android engine. Also, the exception statement has me stumped as well. Am I using too many tables? Is the group_concat function creating trouble?Any pointers?</p><p>More notes: the exception is thrown from the constructor of the adapter, which is defined as follows. I am calling the constructor as shown in the first snippet in this post.</p><pre><code>public ExpandableDataAdapter(Context context, Cursor cursor,      int groupLayout, String[] groupFrom, int[] groupTo,      int childLayout, String[] childFrom, int[] childTo)  {       super(context, cursor, groupLayout, groupFrom, groupTo,                              childLayout, childFrom, childTo); }</code></pre>","194742","","194742","","2010-08-03 16:15:35","2010-08-03 16:54:55","Trouble with Cursor from rawQuery in SimpleCursorTreeAdapter: too many tables?","<android><sqlite>","2","1","","",""
"3393903","1","","","2010-08-03 05:55:31","0","230","<p>I have written an application in android 1.5 to take a snapshot using SurfaceView. The image taken will have pink color fill at center. When we use a default camera application the photos are fine. I know there are some issues in android 1.5, also some hardware issues in some devices, however is there any workaround or settings to overcome this ?</p>","368084","","","","","2010-08-03 06:11:34","Pink color fill on photos taken by camera in android 1.5","<android>","1","0","","",""
"3393906","1","3394370","","2010-08-03 05:56:10","0","780","<p>I am using two ListView in a screen. I want to divide the height of each ListView but I want it to be screen independent. For this I need to know the Height of the screen. I am using xml to do this.Can any one please help me to achieve this?</p><p>Thank YouDeepak</p>","406494","","","","","2010-08-03 07:21:29","Set the Layout according to the Height of Screen","<android>","2","0","","",""
"3393908","1","3394267","","2010-08-03 05:56:39","8","7254","<p>I have a service and its behavior must change when topmost Activity changes. Say, Activity A is active and then service starts some kind of processing. This processing must stop when Activity A is no longer visible: user pressed ""Back"", ""Home"" or did anything else that makes Activity A invisible. This Activity A must not be aware of the service -- i.e. it must not have to explicitly inform the Service that it is going away.</p><p>In the nutshell, is there a way to:</p><ul><li>Get any kind of identification (object reference, class name, ID, etc.) of the topmost Activity,</li><li>Receive notification when topmost Activity changes?</li></ul><p>P.S. This may sound like malware behavior, but it is not! It is legitimate use-case!</p><p>Edit: Activities are not in my application. They can be just about anything -- browser, maps app, settings, etc.</p>","2877","","2877","","2010-08-03 07:12:26","2010-08-03 17:35:38","How to get any identifier of the topmost activity?","<android>","1","0","6","",""
"3393918","1","3394241","","2010-08-03 05:59:00","9","9145","<p>I am using a gallery layout in my application. It is working when the user moves the pictures in the gallery from left to right (it is infinite that means elements are repeated again). But when the user moves from right to left and reaches the first element, it doesn't. After then no elements are coming. But I want to repeat elements from this side also. Can you give me some suggestions?</p><pre><code> Gallery g = (Gallery) findViewById(R.id.gallery);        g.setAdapter(new ImageAdapter(this));        g.setFocusable(true);        g.setSelection((int)(Integer.MAX_VALUE / 2) - (Integer.MAX_VALUE / 2)% mImageIds.length);                g.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id)             {                try {                    imageid=position;                    ((ImageView)findViewById(R.id.ImageViewlarge)).setImageResource(mImageIds[position]);                    ((TextView)findViewById(R.id.TextViewImageName)).setText(imgNames[position]);                     mp = MediaPlayer.create(SeaSpell.this,audioTrack[position]);                        } catch (Exception e) {                                // TODO Auto-generated catch block                                e.printStackTrace();                            }                }            });        }</code></pre><p><img src=""http://i.stack.imgur.com/4DwIV.png"" alt=""Screenshot Frontgallery""></p><p>How can I make my gallery view circular? I am able to do it from left to right infinitely,  but when I drag from right to left it is showing the end point.</p>","254790","","368354","","2013-01-11 13:38:16","2014-02-27 13:11:24","How to implement an endless gallery in Android?","<android><gallery><adapter>","5","0","11","",""
"3393963","1","","","2010-08-03 06:07:53","0","2012","<p>how adt knows that emulator is now fully loaded and i can transfer application now for installation?</p><p><strong>Edit:</strong></p><p>I am trying to develop a batch file which first create avd, start emulator with that avd, then install my application (.apk) to emulator running my avd.</p><p>But install apk (ie. adb install my.apk) requires fully loaded emulator. (even adb wait-for-device doest not help in this case).</p><p>So I was asking about how ADT knows that device is fully loaded. So i can implement same thing in my bat file and automate the whole thing.</p>","409323","","119114","","2012-07-18 11:13:15","2012-07-18 11:13:15","eclipse ADT : now i can transfer application to install on android emulator","<android><android-emulator><adt>","2","0","","",""
"3394028","1","3394220","","2010-08-03 06:24:08","2","1426","<p>what is the difference between setHeight and setTextSize?</p>","381699","","","","","2011-05-23 15:03:18","TextView- difference between setHeight and setTextSize: Android","<android><textview>","2","1","","",""
"3394082","1","","","2010-08-03 06:32:53","4","2272","<blockquote>  <p>Sorry I am new, stackoverflow does not  allow me to post image and links...</p></blockquote><p>I try to use Official Android SDK (http://github.com/facebook/facebook-android-sdk/). I install the SDK and try to run the Example</p><p>At first, it fails at ""build"", it cannot find the Facebook SDK, so I try to follow the steps found in SDK page:</p><blockquote>  <p>Add a dependency on the Facebook  Android SDK library on your  application:</p>    <ol>  <li>from the File menu, select ""Properties""</li>  <li>once the project Properties are displayed, open the Android section,  which should list the build targets  and libraries</li>  <li>in the bottom ""Library"" section, click ""Add..."" and select the Facebook  SDK project</li>  <li>refer to <a href=""http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject"" rel=""nofollow"">http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject</a>  for more details</li>  </ol></blockquote><p>I check the link at #4, it shows a Mac OS X version Eclipse, which has Library section, but on my Vista PC, with Eclipse 3.5.2, it does not have Library section...</p><p>-http://developer.android.com/images/developing/adt-props-isLib.png</p><p>-http://farm5.static.flickr.com/4138/4852346022_fc8f6bedbe_b.jpg</p><p>I try to add the Facebook SDK in Java Build Path. Now it can ""build"" and start, on both Emulator and Device. However, once it started, it crash, the logcat shows:</p><p>ERROR/AndroidRuntime(518): java.lang.NoClassDefFoundError: com.facebook.android.Util</p><p>-http://farm5.static.flickr.com/4138/4852346048_f4a3b998a3_b.jpg)</p><p>I searched around, about ""NoClassDefFoundError"" program, but seems those solution is solving external JARs files. I have no problem adding other JARs files, and this Facebook SDK is not JAR...</p><p>I tried Clean, rebuild, delete everything and config again, but can't solve this problem yet.</p><p>Anyone have idea please help, Thanks.</p>","409350","","","","","2010-08-25 08:13:08","NoClassDefFoundError when running Facebook official example","<java><android><eclipse><facebook>","1","0","1","",""
"3394207","1","3394718","","2010-08-03 06:51:47","2","2576","<p>I'm using eclipse, and I have two android projects which have different topics. And I want to connect these project. I mean, I want to run one android project from other. </p><p>I tried to reference one project to other, and then run but it didn't work.Also I looked related questions and answers but it didn't work either.</p><p>Thanks</p><p>According to BennySkogberg's answer I edit my content:</p><p>The sample code in order to call different project as starting an activity is like that:</p><pre><code>Intent intent = new Intent(this, FBFeedActivity.class);startActivityForResult(intent, MESSAGEPUBLISHED);</code></pre><p>And xml code:</p><pre><code>&lt;activity android:name=""com...fbconnect.FBFeedActivity"" /&gt;</code></pre><p>I created 3 test project to try this code. two of them android project and one of them java project. When I use this code with android project and java project it works. However when I tried with two android project I get these errors: It says it couldn't find the class but there is, and I did the same thing.</p><pre><code>08-03 14:37:23.803: ERROR/dalvikvm(1131): Could not find class 'com.androidref.ReferenceAndroidSub', referenced from method android.reference.ReferenceAndroidMain.onCreateOptionsMenu08-03 14:37:23.823: ERROR/AndroidRuntime(1131): Uncaught handler: thread main exiting due to uncaught exception08-03 14:37:23.873: ERROR/AndroidRuntime(1131): java.lang.VerifyError: android.reference.ReferenceAndroidMain08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at java.lang.Class.newInstanceImpl(Native Method)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at java.lang.Class.newInstance(Class.java:1472)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at android.app.Instrumentation.newActivity(Instrumentation.java:1097)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at android.os.Handler.dispatchMessage(Handler.java:99)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at android.os.Looper.loop(Looper.java:123)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at android.app.ActivityThread.main(ActivityThread.java:4203)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at java.lang.reflect.Method.invokeNative(Native Method)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at java.lang.reflect.Method.invoke(Method.java:521)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)08-03 14:37:23.873: ERROR/AndroidRuntime(1131):     at dalvik.system.NativeStart.main(Native Method)08-03 14:37:23.903: ERROR/dalvikvm(1131): Unable to open stack trace file '/data/anr/traces.txt': Permission denied</code></pre>","404308","","404308","","2010-08-03 11:42:33","2012-04-30 05:45:48","How can I combine two android project","<android>","2","0","","",""
"3394217","1","3395004","","2010-08-03 06:52:39","0","311","<p>can we do gif animation in android web view.... i want to run some images step by step in continues way........</p><p>if this is possible then please tell how ??? </p>","304961","","","","","2010-08-03 08:57:44","Web view Android","<android>","1","0","","",""
"3394511","1","3448759","","2010-08-03 07:44:50","4","4665","<p>Just back from a very nice vacation in Iceland, and await the data roaming bill from my phone company. I hope for the best having limited my traffic as much as possible, but I want to know in advance. I used the very nice app <a href=""http://www.jaqpot.net/netcounter/"" rel=""nofollow"">NetCounter</a> but it didn't measure roaming data traffic at all.</p><p>So I want to build my own app measuring just roaming data traffic. I have a few booleans to start with ( <a href=""http://developer.android.com/reference/android/net/NetworkInfo.html#isRoaming%28%29"" rel=""nofollow"">NetworkInfo.IsRoaming()</a> &amp; <a href=""http://developer.android.com/reference/android/telephony/TelephonyManager.html#isNetworkRoaming%28%29"" rel=""nofollow"">TelephonyManager.isNetworkRoaming()</a> ), but I'm not sure how to measure the traffic if <code>true</code>.</p><p>So the question is: How do I measure data traffic while roaming? <em>(Something like API level 8 <a href=""http://developer.android.com/reference/android/net/TrafficStats.html"" rel=""nofollow"">TrafficStats</a> functionality is what I'm after, but for API level 3). The used SmartPhone is Samsung Galaxy i7500 (Android 1.6)</em></p><p>Thanx for your time!</p>","286244","","286244","","2010-08-03 11:58:28","2013-11-18 05:36:37","Measure data roaming traffic on Android?","<android><measurement><traffic><roaming>","2","6","4","",""
"3394571","1","3394616","","2010-08-03 07:52:40","1","1216","<p>I'm trying to send MMS using code sample from <a href=""http://stackoverflow.com/questions/2972845/i-want-send-image-through-using-mms-in-android/2973016#2973016"">How to send image via MMS in Android?</a>, but the last step <code>HttpUtils.httpConnection</code> throws an exception:</p><blockquote>  <p><code>java.lang.RuntimeException</code>: This thread forbids HTTP requests</p></blockquote><p>What's the problem? Please help me.</p>","409421","","707111","","2012-01-11 18:53:16","2012-01-11 18:53:16","Sending MMS in Android","<java><android><mms>","1","0","0","",""
"3394626","1","","","2010-08-03 08:01:34","2","2320","<p>Does anyone know how to provide your own LocationProvider and publish it to the system,so other apps may fetch a reference to it from the LocationManager?</p>","411520","","","","","2013-11-03 19:22:34","How to provide your own LocationProvider on Android?","<android>","4","1","1","",""
"3394700","1","","","2010-08-03 08:10:37","0","445","<p>Hi I am creating an App that gives sound notification to user when he gets msg from gtalk.Thought there is no direct access to gtalk,is there any way to get the latest notification title and data from notification status bar?</p>","286831","","","","","2010-08-03 09:08:37","Android get GTALK notification data","<android>","1","0","","",""
"3394765","1","3395002","","2010-08-03 08:18:46","18","11377","<p>How do I check to see how much MB or GB is left on the android device ? I am using JAVA and android SDK 2.0.1.</p><p>Is there any system service that would expose something like this ?</p>","110287","","1679187","","2013-09-05 09:34:41","2014-04-14 14:19:27","How to Check available space on android device ? on mini sd card?","<java><android>","7","0","12","",""
"3394814","1","","","2010-08-03 08:25:15","0","331","<pre><code>Resources r1 = getResources();String[] refrigerant = r1.getStringArray(R.array.refrigerant);if (refrigerant == """"){    if (et1.getText().toString() == refrigerant[i3]    {         flag = true;                                   }</code></pre><p>I got the error incompatible  operand types String[] and stringplease give me solution.</p>","398721","","16883","","2010-08-03 08:28:56","2010-08-03 08:31:18","Incompatible types in string","<android>","4","0","","",""
"3394832","1","3411866","","2010-08-03 08:27:56","0","1110","<p>i'm creating a lazy load of image in ListView.i was followed the tutorial from <a href=""http://open-pim.com/tmp/LazyList.zip"" rel=""nofollow"">this source</a> which i found in <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012"">Stack Overflow</a>It was run successful.</p><p>But, when i join the code together with my project then i face a problem. the program was no perform the OnItemClickListener :(</p><p>my project have a TabHost and it had 5 tab contents. 2 contents is using the ListActivity and run perfectly.</p><p>here is my coding, Main.java:</p><pre><code>public class ProductListing extends Activity {ListView list;MyListAdapter adapter;Controller c;ImageLoader imageLoader;TextView select;//========== JSON ===========ArrayList&lt;String&gt; strName = new ArrayList&lt;String&gt;();ArrayList&lt;String&gt; strImage = new ArrayList&lt;String&gt;();ArrayList&lt;String&gt; strDesc = new ArrayList&lt;String&gt;();ArrayList&lt;String&gt; strSize = new ArrayList&lt;String&gt;();JSONObject jsonObject;  String[] listItem;Context context;    @Override    protected void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            LoadJSON();            setContentView(R.layout.productlisting_tab);            list=(ListView)findViewById(R.id.ListView01);            c = new Controller(this);            adapter=new MyListAdapter(this,this, strName, strImage,strDesc,strSize);            list.setAdapter(adapter);             list.setOnItemClickListener(new OnItemClickListener(){        @Override    public void onItemClick(AdapterView&lt;?&gt; parent, View view,            int position, long id) {        // TODO Auto-generated method stub        System.out.println(""Item Clicked"");    }        });    }    public void LoadJSON(){        try {            InputStream is = this.getResources().openRawResource(R.raw.premium);            byte[] buffer;            buffer = new byte[is.available()];            while(is.read(buffer) != -1);            String jsonText = new String(buffer);            jsonObject = new JSONObject(jsonText);            JSONObject premium_tab = jsonObject.getJSONObject(""premium_tab"");                           int totalItem = premium_tab.getInt("".total"");            for (int i = 1; i &lt;= totalItem; i++) {                JSONObject premium = premium_tab.getJSONObject(""premium_""+i);                String tempName =premium.getString("".name"").toString();                String tempImg = premium.getString("".image"").toString();                String tempDesc = premium.getString("".desc"").toString();                String tempSize = premium.getString("".size"").toString();                strName.add(tempName);                strImage.add(tempImg);                strDesc.add(tempDesc);                strSize.add(tempSize);            }        } catch (Exception e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }  }</code></pre><p>MyListAdapter.java:</p><pre><code> public MyListAdapter(Context b,Activity a, ArrayList&lt;String&gt; strName, ArrayList&lt;String&gt; strImage,            ArrayList&lt;String&gt; strDesc, ArrayList&lt;String&gt; strSize) {    activity = a;    name = strName;    image = strImage;    desc = strDesc;    size = strSize;            inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    imageLoader=new ImageLoader(activity.getApplicationContext());}public int getCount() {    return image.size();}public Object getItem(int position) {    return position;}public long getItemId(int position) {    return position;}public static class ViewHolder{    public TextView ProductName,ProductSize, ProductDesc;    public ImageView ProductIcon;}public View getView(int position, View convertView, ViewGroup parent) {    View vi=convertView;    ViewHolder holder;    if(convertView==null){        vi = inflater.inflate(R.layout.productlisting, null);        holder=new ViewHolder();        holder.ProductName=(TextView)vi.findViewById(R.id.text);        holder.ProductIcon=(ImageView)vi.findViewById(R.id.image);        holder.ProductDesc=(TextView)vi.findViewById(R.id.textdesc);        holder.ProductSize=(TextView)vi.findViewById(R.id.textsize);        vi.setTag(holder);    }    else        holder=(ViewHolder)vi.getTag();    holder.ProductName.setText(name.get(position));    holder.ProductDesc.setText(desc.get(position));    holder.ProductIcon.setTag(image.get(position));    holder.ProductSize.setText(size.get(position));    imageLoader.DisplayImage(image.get(position), activity, holder.ProductIcon);    return vi;  }    }</code></pre><p>Another class which name ImageLoader.java please refer the source link above.May i know where is my mistake? i understand my code will very ugly, i'm a new in android please help me to solve the problem. it was stuck me for few days.your reply is very appreciated !!!</p><p>P/S: I'm sorry about my bad english, hope you guys understand what i'm talking about.Thank you.</p><p>RegardWynix</p>","409419","","","","","2010-08-05 04:58:42","OnItemClickListener Problem","<android><listviewitem>","2","3","","",""
"3394894","1","4221154","","2010-08-03 08:38:06","3","2535","<p>The question is given, I want a smaller font to display these lines in the Android Console window (NOT the Logcat window). I've changed the <em>other</em> console's font (cvs, svn, ...) in the preferences, but this window still has same font size. I want this window to be much smaller and put it on the side of my screen, not on the bottom, this way I would have vertically more space in Eclipse.</p><p><code>[2010-08-02 16:26:58 - project1] ------------------------------<br/>[2010-08-02 16:26:58 - project1] Android Launch!<br/>[2010-08-02 16:26:58 - project1] adb is running normally.<br/>[2010-08-02 16:26:58 - project1] Performing ...Activity activity launch<br/>[2010-08-02 16:26:59 - project1] Uploading project1.apk onto device 'xxxxxxxxxxxx'<br/>[2010-08-02 16:27:03 - project1] Installing project1.apk...<br/>[2010-08-02 16:27:20 - project1] Success!<br/></code><br/>Could any of you change this window's font size?</p>","231507","","","","","2010-11-19 00:43:36","How to change the font of the Android console in Eclipse?","<android><eclipse><configuration><console><font-size>","2","0","2","",""
"3394983","1","","","2010-08-03 08:54:10","2","585","<p>Is there any way to hook a plugin in the default SMS messaging application so that it invokes our code for sending SMS.</p><p>Can our app become an alternate SMS sender for default Messaging sending operations.</p>","319549","","","","","2011-01-30 07:25:44","Alternate SMS Sender","<android>","1","0","1","",""
"3395105","1","3395168","","2010-08-03 09:12:49","1","991","<p>I would like to show a menu with icons with text below every icon in Android.</p><p>The menu should fill the entire activity, like the launcher menu. For example: </p><p><img src=""http://i.stack.imgur.com/byzED.jpg"" alt=""enter image description here""></p><p>I want the user to choose from a set of options (static options) with icons.</p><p>I was thinking about a grid view with buttons or images, but how to get the text in without burning them into the icons (translation later on)?</p>","373207","","63550","","2011-12-30 11:39:49","2011-12-30 11:41:55","Icon menu in application","<android><text><menu><icons><fill>","1","2","1","",""
"3395154","1","3397889","","2010-08-03 09:21:50","8","30784","<p>I need to explore for my project use of web services on Android. I know that there is no official library for XML - RPC web service.</p><p>But there is for REST XML and i need to test it.  </p><p>I would like to read XML on my web page (Where i have to pass username and Password) from Android with HTTP GET.</p><p><strong>OR</strong> </p><p>Suppose, i follow <a href=""http://www.androidpeople.com/android-xml-parsing-tutorial-using-saxparser/""> <strong>This link</strong></a>, then where do i pass username and password?</p><p>Can anybody help me on this.</p>","379693","","114066","","2010-08-06 12:03:35","2014-03-01 14:41:58","Android - Read an XML file with HTTP GET","<android><xml><get>","3","1","8","",""
"3395165","1","","","2010-08-03 09:23:54","0","259","<p>I need to make a Screen with Header(Will contain ImageView and TextView) and Footer(Navigation Menu, will consists of ImageView), in the between I need to have Preference screen with all the default action like scrolling and setting preferences.</p><p>Which approach should I take to achieve this?</p><p>Right now, I have made a View with FrameLayout in the middle where I can put the View I want in it. But how can I put a PreferenceActivity in it?</p>","271736","","","","","2010-08-03 09:45:41","How to put Preference into a View?","<android><preferences><android-preferences>","1","0","0","",""
"3395166","1","3395332","","2010-08-03 09:23:58","0","1173","<p>I'm a complete noob to regex and I need help with splitting a string. I am inputing the following data </p><pre><code>665  11% R     1    908K    388K  fg root     top 61   1% S    42 152404K  29716K  fg system   system_server 38   0% S     1    840K    340K  fg root     /system/bin/qemud114   0% S    16 120160K  19156K  fg radio    com.android.phone</code></pre><p>which is nothing but your regular top output. What I intend to do is select on entries like</p><pre><code>655 11% R 1 fg root top</code></pre><p>Now the code which I use to do the following is</p><pre><code>while ((inputLine = in.readLine()) != null) {  String[] segs= inputLine.split(""[ ]+"");  str[i] = segs[0]+"" ""+segs[1]+"" ""+segs[2]+"" ""+           segs[3]+"" ""+segs[6]+"" ""+segs[7]+"" ""+segs[8];  Log.v(""TOP Output"", str[i]);  i++; j++;}</code></pre><p>But the problem I face is, that I get on logcat is</p><pre><code>java.lang.ArrayIndexOutOfBoundsException</code></pre><p>Where am I going wrong, and what could I do different to prevent this. Thanks for helping.</p><p>EDIT: After reading the comments I realize i have a couple of empty line in my output. So in such a case how am I supposed to ignore those line. I know I am supposed to match a case, but I am not sure about the expression or syntax!</p>","393459","","393459","","2010-08-03 10:19:43","2010-08-03 11:27:44","Java regex help needed to split string please! How to ignore an empty line?","<java><android><regex>","4","4","","",""
"3395178","1","3396650","","2010-08-03 09:26:26","1","359","<p>I'm trying to implement tab buttons bar and a navigation bar in my android application. The problem is, that I would like the navigation elements to persist. When starting a child activity, the nav bar moves.</p><p>How can I make these two elements ""non-movable""?</p>","403324","","114066","","2010-08-03 13:06:31","2010-08-03 13:06:31","Layout issue - how to start an activity without moving certain UI elements?","<android><layout>","1","2","0","",""
"3395201","1","3395295","","2010-08-03 09:29:44","0","236","<p>I am planning to store a password in my Native app (Android and iPhone). Should I store them after encrypting it ? or  can I store it without any encryption? Are they really secure? </p>","189006","","","","","2010-08-09 09:28:20","Can data stored in iPhone App be taken from sqlite or Preferences list file?","<iphone><android><encryption>","3","0","","",""
"3395276","1","4200967","","2010-08-03 09:39:53","1","1940","<p>Please find the code sample below:</p><pre><code>    public class Abc extends Activity implements OnClickListener{    private ListView displayList;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.mainlayout);        displayList =(ListView)findViewById(R.id.addressbooklistview);        addressbookAdapter = new CustomListAdapter(this,addressbookList);        displayList.setAdapter(addressbookAdapter);        registerForContextMenu(displayList);    }    @Override    public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo)     {          Log.e("""", ""Entered Context Menu"");    }    public void onClick(View v) {        Log.e("""", ""Click Detected"");    }}</code></pre><p>I am not able to invoke the context menu on long press.Please let me know any solution for the same.</p>","366053","","410487","","2011-05-16 08:33:32","2011-05-16 08:33:32","Issue Invoking a context menu when an onClickListener is applied to an activity","<android>","1","2","","",""
"3395328","1","3395510","","2010-08-03 09:47:20","3","3774","<p>Hi allI have to images say image1 and image2I want to display both images on timer, only one image should be visible at a time. Both images are overlapped, meaning, image1 is over image2.</p><p>So, if I use timer, I want to be able to show one image at a time.How do I do this.I hope I am clear with my problem</p>","1497488","","237917","","2012-03-20 12:25:12","2012-03-20 12:25:12","how to change images with timer","<android><image>","2","0","5","",""
"3395336","1","3395380","","2010-08-03 09:47:55","1","2456","<p>I want to use two list view in one ListActivity. How can I do this? Please help me to create two different list view in one ListActivity.</p><p>ThanksDeepak</p>","406494","","","","","2012-05-31 19:44:52","How to use Two ListView in one screen?","<android>","2","1","1","",""
"3395729","1","3395811","","2010-08-03 10:42:10","30","43751","<p>Is there a way to convert JSON Array to normal Java Array for android ListView data binding?</p>","409557","","106224","","2010-08-03 10:59:41","2012-11-22 10:02:28","Convert Json Array to normal Java Array","<java><android><json>","4","0","9","",""
"3395791","1","","","2010-08-03 10:51:16","0","44","<p>I'm currently developing an android app that is going to render posts from an online forum. </p><p>This is the layout I had in mind for rendering the posts:</p><p><a href=""http://data.fuskbugg.se/skogsturken/component.png"" rel=""nofollow"">http://data.fuskbugg.se/skogsturken/component.png</a></p><p>My question is what the easiest way is to accomplish the above layout? The hardest part is the text area that should be able to display small images, hotlinks and some kind of spoiler system.</p><p>Ideas?</p>","242348","","","","","2010-08-03 10:51:16","Easiest way to render this component?","<android><layout><drawing>","0","2","","",""
"3395829","1","3396107","","2010-08-03 10:57:54","4","1123","<p>Every time i used the @inheritDoc tag in javadoc, I see the following warning (example):</p><pre><code>@inheritDoc used but getCount() does not override or implement any method.</code></pre><p>Does anybody know how to avoid that? I'm sure that the methods implement/override another method, because I also set the @override tag, and Eclipse doesn't complain about that.</p><p>I had a similair warning concering @link where the reference could'nt be found. This is solved by using absolute identifiers (e.g. android.content.Intent instead of Intent). Is there any similar solution to this problem?</p>","","anon","","","","2010-08-13 23:44:09","Android&Javadoc: @inheritDoc is not working","<java><android><eclipse><javadoc>","3","3","","",""
"3396007","1","3414215","","2010-08-03 11:28:48","3","5749","<p>I have two devices - HTC Tattoo and Sony Ericsson Xperia X10. One has 145 DPI, the other 245 DPI.</p><p>When I specify font size for a TextView in points, like this:</p><pre><code>textView.setTextSize(TypedValue.COMPLEX_UNIT_PT, 6.5f);</code></pre><p>I get different physical size of text on these two devices. On 245 DPI, the text is barely readable.</p><p>Now, ""pt"" size is supposed to be physical. I.e., in my test, both text blocks should have letters of the same physical height. Which is not the case.</p><p>What can be wrong here?</p><p>Thanks for the help,Yuri.</p>","375225","","","","","2010-08-05 11:28:20","Physical size of font in points in Android","<android><text><fonts><size><points>","2","0","","",""
"3396194","1","","","2010-08-03 11:54:24","0","834","<p>I use <code>&lt;data android:mimeType=""text/calendar"" /&gt;</code> in my manifest file it doesn't supports to open ics file in Android default email application.Is there any other way to open ics file? I use <code>&lt;data android:mimeType=""*/*""&gt;</code> But it supports to open all file format.I need to restrict my application to open ics file only.I am new to android.Can anyone help me to solve this????  </p>","389404","","","","","2010-08-03 13:44:25","Download ics file in android?","<android>","2","0","","",""
"3396235","1","","","2010-08-03 12:00:18","3","503","<p>I have written a widget with size 74x74 in version 1. In version 2 I want to change the size to 148x74. I want this to happen during upgrade, is this possible? or does the user have to remove and add the widget again?</p>","272736","","272736","","2010-08-03 16:58:05","2011-05-19 06:51:00","Change Android widget size on upgrade","<android><android-widget><widget>","1","0","1","",""
"3396274","1","3396361","","2010-08-03 12:06:41","0","5851","<p>I have a service component (common task for all my apps), which can be invoked by any of the apps. I am trying to access the service object from the all activities, I noticed that the one which created the service [startService(intent)] has the right informaion. But rest does not get the informaion needed. My Code is as below:</p><pre><code>// Activity.javapublic void onCreate(Bundle savedInstanceState) {    ...    Intent intent = new Intent (this.context, Service.class) ;    this.context.startService(intent) ;    this.context.bindService(intent, this, Context.BIND_AUTO_CREATE) ;    ...    String result = serviceObj.getData() ;}public void onServiceConnected(ComponentName name, IBinder service) {    serviceObj = ((Service.LocalBinder)service).getService();    timer.scheduleAtFixedRate(task, 5000, 60000 ) ;}// Service.javaprivate final IBinder mBinder = new LocalBinder();public class LocalBinder extends Binder {    Service getService() {        return Service.this;    }}public void onCreate() {    super.onCreate();    context = getApplicationContext() ;}public void onStart( Intent intent, int startId ) {... some processing is done here...}public IBinder onBind(Intent intent) {    return mBinder;}</code></pre><p>If I invoke startService(intent). it creates a new service and runs in parallel to the other service.</p><p>If I don't invoke startService(intent), serviceObj.getData() retuns null value.</p><p>Can any one enlighten me where have I gone wrong.</p><p>Any kind of pointer will be very useful..</p><p>Thanks and regards,Vinay</p>","362416","","","","","2010-08-03 12:21:52","Multiple activities binding to a service","<android><binding><service><activity>","1","0","3","",""
"3396871","1","3396931","","2010-08-03 13:24:23","1","677","<p>How do you space ImageButtons?</p><p>With RelativeLayout, I can have them side by side but I want a gap between them.How do I place the buttons in the center and at the bottom of the screen?</p>","381699","","","","","2010-08-03 13:30:11","Spacing ImageButtons in Android","<android><layout><imagebutton><relativelayout>","1","0","","",""
"3396950","1","","","2010-08-03 13:32:18","0","748","<p>While parsing I am getting some special character and I couldn't parse that character.</p><p>If I try the char â€¨ in java I can parse it. But in android I am not able to parse that char. In the simlator/device I am getting it as (box), In log i am getting like â¨.</p><p>Manually I have tried changing the encoding format in eclipse (Right click the project -> set the ""text file encoding"" as ""UTF-8""), even though its not working.</p>","262523","","20938","","2010-08-04 01:43:46","2011-04-03 12:02:30","char encoding problem in android","<android><character-encoding>","0","3","","",""
"3397071","1","3397739","","2010-08-03 13:44:18","34","36952","<p>I'm currently working on an Android application that connects to an instrument via Bluetooth and need to write string commands and receive string responses back. Currently I have the connect/read/write working for TCP/IP over Wi-Fi and now trying to implement Bluetooth. But I am running into some roadblocks. I have been searching the web trying to find examples of something similar and haven't had any luck. I have been using the Android developer resource example: Bluetooth Chat as my main reference point.</p><p>My current code seems to work.. Then it throws a Service Discovery Failed exception at the point of the connection. I am using the <code>DeviceListActivity</code> class to do the discovery and selecting of the device I want to connect to. It returns anActivityResult and then my Bluetooth class waits for it to handle that and then does the connect to it.  The code beneath is almost identical to the Bluetooth Chat App.</p><pre><code>public void onActivityResult(int requestCode, int resultCode, Intent data) {    if(!m_BluetoothAdapter.isEnabled())    {        m_BluetoothAdapter.enable();    }    switch (requestCode) {        case REQUEST_CONNECT_DEVICE:            // When DeviceListActivity returns with a device to connect            if (resultCode == Activity.RESULT_OK) {                // Get the device MAC address                String address = data.getExtras()                                     .getString(DeviceListActivity.EXTRA_DEVICE_ADDRESS);                // Get the BLuetoothDevice object                BluetoothDevice device = m_BluetoothAdapter.getRemoteDevice(address);                // Attempt to connect to the device                connect(device);            }            break;        case REQUEST_ENABLE_BT:            // When the request to enable Bluetooth returns            if (resultCode == Activity.RESULT_OK) {                // Bluetooth is now enabled, so set up a chat session            }            else {                // User did not enable Bluetooth or an error occured                Toast.makeText(this, ""Bluetooth not enabled"", Toast.LENGTH_SHORT).show();                finish();            }    }}</code></pre><p>This is my connect function:</p><pre><code>private static final UUID MY_UUID = UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB"");private void connect(BluetoothDevice device) {    m_Device = device;    BluetoothSocket tmp = null;    // Get a BluetoothSocket for a connection with the    // given BluetoothDevice    try {        tmp = device.createRfcommSocketToServiceRecord(MY_UUID);    }    catch (IOException e) {    }    m_Socket = tmp;    m_BluetoothAdapter.cancelDiscovery();    try {        // This is a blocking call and will only return on a        // successful connection or an exception        m_Socket.connect();    }    catch (IOException e) {        try {            m_Socket.close();        }        catch (IOException e2) {        }        return;    }}</code></pre><p>Hopefully, whatever I am doing wrong is simple, but I'm afraid it's never that easy.  This is my first time doing any Bluetooth development, and maybe I'm doing something blatantly wrong... But I'm not sure why I get the service discovery failed exception.</p><p>You can pair/find the device at all times manually on the phone... It does require a passcode, but I don't think that is the problem that I am having.</p>","409686","","63550","","2011-12-04 00:58:06","2013-07-07 08:54:33","Service discovery failed exception using Bluetooth on Android ","<java><android><bluetooth>","3","0","38","",""
"3397074","1","3397270","","2010-08-03 13:44:20","2","732","<p>I have an application that I will run on two separate emulators.</p><p>This application uses httpclient to communicate to the server application, that I will run on the same computer as the emulators are running.</p><p>""localhost"" for the android emulator wont work as local would be the emulator itself.  The computer will not be connected to a laptop.</p><p>Which address should I specify?</p>","409709","","","","","2010-08-03 14:05:25","Android emulator to communicate with pc emulator running on","<android><http><networking><httpclient>","1","0","1","",""
"3397286","1","","","2010-08-03 14:07:17","3","1507","<p>I want to launch an android application from a remote server, i can see that in J2ME there is a class called PushRegistry, this class resolve this problem in ME but in android I cant do it.</p><p>Thanks in advance</p>","409733","","","","","2010-08-03 16:07:13","Android, launch an app from remote server","<android><push><notifications>","2","0","1","",""
"3397370","1","4781370","","2010-08-03 14:15:49","6","3544","<p>I have 2 <code>ImageView</code>s that I translate from the top of the screen to the bottom. these views are infalted from xml and the animation is added from java code. The animation works perfectly, but the <code>onClickListener</code> I added in java code doesn't seem to work. I used <code>fillAfter</code> attribute of the animation to make the iamges stay at their arrival after the translation, but THESE images aren't clickable anymore... However, their position before translation remains clickable...I can't see the logic of this. Could anyone give me some piece of advice about that?</p>","263521","","","","","2011-08-11 12:07:23","TranslateAnimated ImageView not clickable after animation [Android]","<android><animation><clickable>","1","3","4","",""
"3397426","1","3397630","","2010-08-03 14:22:08","0","845","<p>What method need I @Overload in order to change the size of the Activity when it is first loaded?</p>","172861","","","","","2010-08-03 14:42:22","Android Activity Resize","<android><activity>","1","0","","",""
"3397512","1","3397538","","2010-08-03 14:30:15","0","130","<p>i wonder what is the name of the service in ClientLogin for Android cloud to device, i found <a href=""http://code.google.com/apis/gdata/faq.html#clientlogin"" rel=""nofollow"">this link</a> for all the service but i didnt find C2DM in it . </p>","302707","","","","","2011-08-29 08:59:08","what the name of service in ClientLogin for Android cloud to device?","<java><android>","2","0","","",""
"3397539","1","","","2010-08-03 14:32:51","0","2492","<p>I am loading image url on to webview it fetching the image as well but i need to display it in resizeable it means te height to be reduced,help me to get reduced height of the image.</p>","407506","","","","","2012-11-29 07:34:35","Resizing the webview content","<android>","2","0","","",""
"3397567","1","3398004","","2010-08-03 14:35:49","0","671","<p>I have ListView, where any item is HorizontalLayout on wchich there are 3 TextView.I can realize interface AdapterView.OnItemClickListener:</p><pre><code>public void onItemClick(AdapterView parent, View view, final int position, long id) {        final long iid = this.id;        new Thread(                new Runnable() {                    public void run() {                        long PlaylistId = PlayerServiceBridge.getPlaylistId();                        if (PlaylistId == iid)                            PlayerServiceBridge.setTrackByPosition(position);                    }                }        ).start();    }</code></pre><p>Everything is right.But now, I would like to scroll second out of 3 TextView horizontally.I just add some code:<pre><code>title.setSingleLine(true);title.setMovementMethod(new ScrollingMovementMethod());</pre></code>And now, when I click on Item where my TextView is, nothing occurs. When I click and move mouse - text on TextView is scrolled. It's ok. But onItemClick has never been called.What do I need: 1. I need just listen onItemClick when user just click on Item. 2. When user push down mouse on Item->TextView and then move mouse - just scroll text on thzt TextView. Second point is realized and works well. I need first at the same time with second) 2. Added: public boolean onItemLongClick(AdapterView parent, View view, int position, long id) and public void onItemSelected(AdapterView parent, View view, int position, long id) are correctly listened and handled by my code. Why not onItemSelect?</p>","206350","","206350","","2010-08-03 15:07:32","2010-08-03 15:21:42","How can I register several listeners on item click at ListView?","<android><listview><click><listener><item>","1","0","1","",""
"3397995","1","3398050","","2010-08-03 15:21:01","0","422","<p>I have this code:</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    Log.i(TAG, ""The id of the selected note is "" + id);    Intent editNote = new Intent(this, TaskEditActivity.class);    editNote.putExtra(TasksDBAdapter.KEY_ID, id);    startActivityForResult(editNote, EDIT_TASK_REQUEST);}</code></pre><p>And this code that retrieves the extra <b><i>FROM A DIFFERENT ACTIVITY</b></i>:</p><pre><code> if (savedInstanceState != null) {        id = savedInstanceState.getLong(TasksDBAdapter.KEY_ID);    } Log.i(TAG, ""Id of note = "" + id);</code></pre><p>In the first code snippet, Logcat says: <code>The id of the selected note is 2</code>, but in the second code snippet, Logcat says: <code>Id of note = 0</code>. What just happened here? Any solutions to this VERY annoying problem.</p>","200477","","200477","","2010-08-03 16:45:47","2010-08-03 16:45:47","Intent not extracting extra","<java><android><android-intent><extras>","2","0","","",""
"3398055","1","3398163","","2010-08-03 15:27:35","0","295","<p>I have a question about working with time in java, more specificly in Android.</p><p>I am developing a device that needs to check to see if an update with a remote server has been done today. I do this by comparing the time (in milliseconds) at midnight last night/this morning with the current time in milliseconds.. </p><p>so my code is as follows:</p><pre><code>Calendar now = Calendar.getInstance();  long milliseconds = now.getTimeInMillis();  long since_midnight = milliseconds%(86400000);  long checkpoint = (milliseconds - since_midnight); </code></pre><p>however when I convert the checkpoint variable to date using:</p><pre><code>SimpleDateFormat formatter = new SimpleDateFormat(""dd/MM/yyyy hh:mm:ss"");  last_logged_text=formatter.format(checkpoint);</code></pre><p>I get a time represention corresponding to 1 am this morning.</p><p>I realise that this has something to do with daylight savings time but Im unsure how to work around it.</p><p>Any help greatly appreciated.</p><p>Thanks</p><p>Kev</p>","409826","","119365","","2010-08-03 15:32:58","2010-08-03 15:39:27","A question of time.. and how to manipulate it in java","<java><android><time>","1","4","","",""
"3398079","1","3398438","","2010-08-03 15:30:41","0","1043","<p>Is it possible to make changes to the sdcard being used in an Android Emulator? For instance, I'd like to change the size of the SD card being used in the emulator. </p>","301991","","","","","2010-08-03 16:08:51","Android: Change Emulator's SD Card","<android>","2","0","1","",""
"3398330","1","3398374","","2010-08-03 15:56:30","1","259","<p>I made an image button in eclipse and I tested it out (ran it) with the emulator in the android sdk package. </p><pre><code> &lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:state_pressed=""true"" android:drawable=""@drawable/cat1"" /&gt; &lt;!-- pressed --&gt; &lt;item android:state_focused=""true""  android:drawable=""@drawable/cat2"" /&gt; &lt;!-- focused --&gt; &lt;item android:drawable=""@drawable/cat3"" /&gt; &lt;!-- default --&gt; &lt;/selector&gt;</code></pre><p>Pressed and Default work with the mouse, but how do you focus it? Or if you can't, do you need to get an android phone?</p>","394842","","","","","2010-08-03 16:00:30","How Do You Focus The Android Developer Emulator?","<android><eclipse><sdk><focus><emulator>","1","0","","",""
"3398336","1","","","2010-08-03 15:57:13","2","341","<p>I am trying to develop an application which will require a service torun in the background. I am relatively new to android programming,and after reading many posts, blogs, how-to's and books on creatingand managing services, I am still pretty confused about which model Ishould try to use.</p><p>First, let me present (in general) the application requirements: Ineed an application which will spawn a background process (service?)which will connect to a bluetooth device. The bluetooth device isdesigned to deliver data to the android device. The issue is that thedata could come in at any moment, so the bluetooth connection has tostay active.  Note that the application is a VERY SPECIFIC app and isNOT intended for public use.  I do understand the arguments for nothaving background apps running all the time, but please understandthat this is a very specific application for a very specific client.</p><p>Now, in general, I think the program flow would be to start theapplication (and launch a UI activity). Then I need to configure andconnect to the bluetooth device.  At this point, the user should beable to do other things - make phone calls, check their email, etc.,while the bluetooth connection is still active and potentiallyreceiving data.  If data comes in, a notification is fired, etc.</p><p>So here are my questions and concerns:</p><ol><li><p>If I start an app (which spawns a UI activity and ultimately mybluetooth connection service) but the app is killed, apparently, theservice handling the bluetooth connection is killed as well.  How canI keep that alive?  I read that Service.setForeground() wasdepricated, but even if I were to set it to the foreground, if the appis killed, the service is killed as well.  I need to have it run inthe background with as high of a priority as possible (again, I dounderstand that this is considered ""bad form"", but this is a specificapp and this functionality has been requested by the client).</p></li><li><p>If I started the app (and the service, etc.), but the user, say,answers a phone call, the app is put into the background.  However,let's say the user goes back to the home screen and starts a DIFFERENTinstance of the app, i.e., he doesn't hold down the home key to selectthe already running app from the task manager but starts a completelynew one.  If the service handling the bluetooth connection is stillrunning, how will this new instance behave?  i.e., how can I get it toconnect to the bluetooth service which is ALREADY running in the FIRSTinstance of the app instead of this new instance?  Do I have to usesome form of a Remote service instead of a local service?  This iswhere I'm a little confused by things as it seems remote services anddefining an AIDL seems to create a lot of extra overhead, and sinceI'm already creating a lot of overhead with the service running in thebackground all the time, I want to keep that as small as possible.How can I insure I am connecting to the same service already running?</p></li></ol>","319247","","119895","","2010-08-03 16:24:54","2010-08-03 16:35:59","Which background model to run","<android>","1","0","","",""
"3398363","1","3398416","","2010-08-03 15:59:18","49","53034","<p>During the most recent google io there was a presentation about implementing restful client applications. Unfortunately it was only a high level discussion with no source code of the implementation. There is one sticking point for me that I can't seem to find any information about and it's not necessary to have seen the presentation to be able to answer this question. In this diagram ( <a href=""http://i.imgur.com/GlYQF.gif"">http://i.imgur.com/GlYQF.gif</a> ) <strong>on the return path there are various different callbacks to other methods. What I don't understand is how I declare what these methods are</strong>. In other words I understand the idea of a callback (a piece of code that gets called after a certain event has happened), but I don't know how to implement it and I haven't been able to find a suitable explanation for android online yet. The only way I've implemented callbacks so far have been overriding various methods (onActivityResult for example).</p><p>I feel like I have a basic understanding of the design pattern, but I keep on getting tripped up on how to handle the return path. Thank you for any help.</p>","409841","","","","","2012-10-19 15:20:05","How to Define Callbacks in Android?","<android><callback>","4","1","34","",""
"3398404","1","","","2010-08-03 16:04:38","1","661","<p>I have an XML resource file:</p><pre><code>&lt;resources&gt;    &lt;section&gt;        &lt;category value=""1"" resourceId=""@xml/categoryData1"" /&gt;        &lt;category value=""2"" resourceId=""@xml/categoryData2"" /&gt;        &lt;category value=""3"" resourceId=""@xml/categoryData3"" /&gt;    &lt;/section&gt;&lt;/resources&gt;</code></pre><p>Using XmlPullParser, on the <code>START_TAG</code>, I can use:</p><p><code>int value = parser.getAttributeIntValue(null, ""value"", 0);</code></p><p>to get values 1, 2, 3...however:</p><p><code>int resourceId = parser.getAttributeIntValue(null, ""resourceId"", 0);</code></p><p>doesn't work...it just yields the default value 0, or whatever I change the default value (3rd parameter) to be...</p><p>Does anyone know what I am doing wrong or if this is possible?</p>","409853","","119895","","2010-08-03 16:38:08","2010-08-03 16:38:08","How can I use a resource within a custom Xml resource file?","<android><resources><xmlpullparser>","1","1","","",""
"3398599","1","3398729","","2010-08-03 16:31:41","1","454","<p>I'd like to replicate the search bar in Contacts app > Favorites > Search (sans icon). Could someone give me a few tips?</p><p>A linear layout maybe with some top, left and bottom padding, width is fill_parent, and a weight of 1? With a button next to it with some right padding? How do I make the button look like that? Is there a parameter I can set to get the gradient background of the back? Or do I need to supply an image?</p><p><a href=""http://i34.tinypic.com/nltsgx.png"" rel=""nofollow"">Screen shot</a></p>","406790","","","","","2010-08-03 16:46:49","Contacts favorites search bar","<android><view><searchbar>","1","0","","",""
"3398625","1","3399149","","2010-08-03 16:33:58","1","1313","<p>I want to get the size of a view that is in my activity but I am not able to get that information in any of the activity lifecycle callbacks (onCreate, onStart, onResume).  I'm assuming this is because the views have not been drawn yet. At what point are views drawn and is there a callback I can put my code so I can get the size of the view?</p><pre><code>findViewById(R.id.header).getHeight();</code></pre>","335617","","","","","2010-08-03 17:43:32","When are views drawn in android?","<android>","2","2","","",""
"3398716","1","","","2010-08-03 16:44:42","6","1654","<p>Is any <a href=""http://www.amqp.org"">amqp</a> libraries for Android?</p>","409907","","119895","","2010-08-03 16:50:56","2012-10-03 16:14:04","AMQP + Android libraries","<android><amqp>","2","2","","",""
"3398988","1","3399158","","2010-08-03 17:22:02","6","725","<p>As my app matures, I find myself finding more and more uses for threads. By now I must have about 25 threads, all doing important things and working together in symphony. </p><p>I notice however that my app is sitting around 15.5MB resident. Compared to the browser (+/-35MB) I feel pretty safe, but I do notice the resident size of my app ever increasing. </p><p>The question is, how much overhead is involved with adding a thread? </p><p>I'm also wondering if the <code>synchronized</code> keyword encounters more and more latency with each new thread that is present?</p><p>Thanks!</p>","268803","","","","","2010-08-04 02:06:19","Do Threads Add A Lot Of Overhead To An App?","<java><android><multithreading>","4","6","1","",""
"3399170","1","","","2010-08-03 17:46:31","0","217","<p>I have some custom views that load when I start an activity with an XML layout containing them. They can be found in another thread, <a href=""http://stackoverflow.com/questions/3392351/custom-view-not-appearing"">here</a>. The custom views take forever to load, and the Logcat is throwing a million warnings.</p><p>I am considering just using a text button at this point due to how impossibly long the UI is hanging to load the views. This warning is posted repeatedly. It's always the same hex also.</p><pre><code>08-03 18:49:10.041: WARN/ResourceType(403): No package identifier when getting value for resource number 0xffffffff</code></pre><p>Anyway to inflate before showing the next screen, so I don't have a blank screen while transitioning to the next <code>Activity</code>? I am calling the screen with slow custom views from a loading screen.</p>","325081","","1616443","","2013-04-23 14:34:00","2013-04-23 14:34:00","Custom Views take forever to inflate; inflate before show next screen possible?","<java><android><performance><user-interface><custom-controls>","0","3","","",""
"3399438","1","3399958","","2010-08-03 18:14:13","1","958","<p>I need to install an android application running in my local machine on to my new android htc handset, how to do this,and i also need to give this application to someones htc device who is not near to me.</p>","407506","","","","","2010-08-31 11:09:43","steps to install new android application onto new htc device","<android>","3","3","","",""
"3399593","1","3400947","","2010-08-03 18:31:46","1","1931","<p>I've created an inbox Activity and I'm mirroring some functionality of the default Mail application that comes with Android.</p><p>In Mail, the background color of a message that has not been read is a lighter color than the rest of the items in the list.  I've mirrored this by setting calling setBackgroundResource in the getView method of my Adapter.  setBackgroundColor doesn't do anything.</p><pre><code>        if (!msgSum.getIsRead()) {            LinearLayout l = (LinearLayout) v.findViewById(R.id.inbox_background);            if (l != null) {                l.setBackgroundResource(R.color.inbox_unread);            }        }        else {            LinearLayout l = (LinearLayout) v.findViewById(R.id.inbox_background);            if (l != null) {                l.setBackgroundResource(R.color.inbox_read);            }        }</code></pre><p>The problem is, the items then lose the ability to highlight.  What I mean is, typically if you scroll your mouse wheel while using the emulator (or if your Android device has some sort of scrolling capability, you use that), the list items will turn yellow like they have focus.</p><p>How do I accomplish what I'm trying to do without losing the ability to highlight a list item?</p><p>Thanks for your help</p>","406790","","","","","2010-09-10 10:26:14","Setting list item background color loses highlighting","<android><listview><highlight><listactivity><background-color>","2","0","1","",""
"3399642","1","3399898","","2010-08-03 18:36:14","21","5723","<p>If an Activity is a singleton in practice, I think I can gain some efficiency by declaring appropriate members ""static"", with zero risk.  Yes?</p>","294973","","229106","","2010-08-03 20:17:04","2011-12-20 15:14:46","Does Android ensure that an Activity is a singleton?","<android><static><singleton><activity>","5","1","3","",""
"3399667","1","3420005","","2010-08-03 18:38:23","11","31256","<p>I am trying to create a custom dialog in Android. But whatever I tried to do, I am not able to change the width of the dialog. It just remains the same. The following is the view that I am setting as the content for the dialog. </p><pre><code>&lt;RelativeLayout  android:id=""@+id/current_stats""android:layout_width=""wrap_content""android:layout_height=""wrap_content"" android:visibility=""visible""&gt;&lt;ImageView android:id=""@+id/player_image""     android:src=""@drawable/person""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_centerHorizontal=""true""/&gt;&lt;TextView       android:id=""@+id/player_name""    android:layout_below=""@id/player_image""    android:layout_centerHorizontal=""true""    android:text=""Raja Ram""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;&lt;ImageButton android:id=""@+id/dialog_close""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentTop=""true""    android:layout_alignParentRight=""true""    android:background=""#00000000""    android:src=""@drawable/close_button_selector""/&gt;&lt;ImageButton android:id=""@+id/dialog_flip""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentTop=""true""    android:layout_alignParentLeft=""true""    android:background=""#00000000""    android:src=""@drawable/rotate""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>As you can see, everywhere I am using wrap_content in this code sample. Also I tried the following options</p><p>1) Setting a custom style while creating the Dialog like this. </p><pre><code>dialog = new Dialog(this,R.style.Theme_Dialog);</code></pre><p>And the style as follows</p><pre><code>&lt;resources&gt;&lt;style name=""Theme"" parent=""android:Theme""&gt;&lt;/style&gt;&lt;style name=""Theme.Dialog""&gt;    &lt;item name=""android:layout_width""&gt;wrap_content&lt;/item&gt;    &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;    &lt;item name=""android:windowIsFloating""&gt;true&lt;/item&gt;    &lt;item name=""android:windowContentOverlay""&gt;@null&lt;/item&gt;    &lt;item name=""android:windowAnimationStyle""&gt;@android:style/Animation.Dialog&lt;/item&gt;    &lt;item name=""android:windowSoftInputMode""&gt;stateUnspecified|adjustPan&lt;/item&gt;&lt;/style&gt;&lt;/resources&gt;</code></pre><p>2) Setting the parameters for the view in the onCreateDialog() like this</p><pre><code>LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);v = inflater.inflate(R.layout.player_info, null, false);ViewGroup.LayoutParams p = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);dialog.setContentView(v,p);</code></pre><p>3) I also tried to set the Window parameters like this in the onCreateDialog() method</p><pre><code>WindowManager.LayoutParams params = dialog.getWindow().getAttributes();params.width=WindowManager.LayoutParams.WRAP_CONTENT;dialog.getWindow().setAttributes(params);</code></pre><p>But again no luck. Can someone help me out with this issue. Am I doing something wrong?? Also can you please suggest me how to set the x and y postions for the Dialog window?</p><p>Thanks</p>","386123","","","","","2013-05-08 10:39:22","Creating a custom dialog in Android","<android><dialog>","5","0","8","",""
"3399721","1","3407355","","2010-08-03 18:43:34","2","2359","<p>I am developing a simple app that sets wallpapers based on some user inputs 'I am almost done with my app , I am only missing the code for setting wallpapers .I have been looking for it in lots of websites in vain .Can anybody post a sample code that sets as a wallpaper  a drawable that is saved in res folder.</p><p>Thanks a lot !</p>","410019","","","","","2013-12-21 19:07:33","setting Wallpaper in android","<java><android><wallpaper>","2","1","4","",""
"3399774","1","3399817","","2010-08-03 18:50:32","5","10755","<p>Both activities are in the same package</p><p>Second activity uses second layout file</p><pre><code>setContentView(R.layout.main2);</code></pre><p>Errors on this line in the Second_Activity.</p><pre><code>EditText text1 = (EditText) findViewById(R.id.EditText03);</code></pre><p>Here is the layout file for the Second_Activity.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical"" &gt;    &lt;LinearLayout        android:id=""@+id/LinearLayout01""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" &gt;        &lt;TextView            android:id=""@+id/TextView01""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Answer Is : "" &gt;        &lt;/TextView&gt;        &lt;EditText            android:id=""@+id/EditText03""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" &gt;        &lt;/EditText&gt;    &lt;/LinearLayout&gt;    &lt;Button        android:id=""@+id/Button01""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:onClick=""onClick""        android:text=""Calling an intent"" &gt;    &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>Here are the errors in the LogCat window</p><pre><code>08-01 19:32:20.340: WARN/ResourceType(8875): No package identifier when getting value for resource number 0x0000000508-01 19:32:20.390: ERROR/AndroidRuntime(8875): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x5 </code></pre><p>mail.xml</p><p></p><p></p><pre><code>&lt;TextView     android:id=""@+id/TextView01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" android:text=""First Number : ""&gt;&lt;/TextView&gt;&lt;EditText     android:id=""@+id/EditText01""     android:inputType=""number""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;</code></pre><p></p><p></p><pre><code>&lt;TextView     android:id=""@+id/TextView02""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" android:text=""Second Number: ""&gt;&lt;/TextView&gt;&lt;EditText     android:id=""@+id/EditText02""     android:inputType=""number""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;</code></pre><p></p><p></p><p></p><p></p><p>secondscreen.xml</p><p></p><pre><code>&lt;TextView     android:id=""@+id/TextView03""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" android:text=""Answer Is : ""&gt;&lt;/TextView&gt;&lt;EditText     android:id=""@+id/main2EditText01""     android:inputType=""number""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;</code></pre><p></p><p></p><p></p><p>manifest xml file                                                                            </p><pre><code>    &lt;activity android:name="".ActivityTwo""/&gt;</code></pre><p></p><p> </p>","408112","","821173","","2014-03-17 12:40:51","2014-03-17 12:40:51","ERROR No package identifier when getting value for resource number","<android><android-layout><android-resources>","6","0","","",""
"3399844","1","3400014","","2010-08-03 18:58:24","0","640","<p>Will the following code cause a memory leak? Essentially I switch between various layouts in my application using setContentView(), and I have member variables of my activity that maintain references to various views (buttons/textviews...) on the layouts. </p><p>Am I correct in thinking that if the activity class has a reference to a button and then changes layouts the layout wont be garbage collected because it will still hold a button reference? If this is the case, can I just null the button variable before changing layouts?</p><p>Thanks.</p><pre><code>public class MyApp extends Activity  {    private Button startBtn;    protected void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);    // Set main layout    setContentView(R.layout.main);    startBtn = (Button) findViewById(R.id.startBtn);    startBtn.setOnClickListener(new OnClickListener() {    @Override    public void onClick(View v) {                doStart();            }        });     }    private void doStart()    {        // Change to starting screen layout        setContentView(R.layout.begin);        /// .. Work with more views here and change layouts in a bit .. //    }}</code></pre>","354890","","","","","2010-08-04 00:26:59","Will this cause memory leaks?","<android>","3","0","","",""
"3399891","1","","","2010-08-03 19:03:37","3","1413","<p>I'm using a SAX parser (on android) to parse an xml file from an WebService. On some elements the CDATA is truncated and not complete, e.g. the XML-file contains data like </p><pre><code> &lt;name&gt;&lt;![CDATA[Gölsder und Ginck GmbH]]&gt;&lt;/name&gt; </code></pre><p>and after parsing the xml file with </p><pre><code>public void characters(char[] ch, int start, int length)   throws SAXException {   super.characters(ch, start, length);   String text = new String(ch, start, length);</code></pre><p>the text only contains ""Gölsder und Gin"" (the first 15 characters). I debugged it with eclipse and i see that the whole string is not contained in the ""char[] ch"" argument of the method. so the parsing itself seems to have an error</p>","410041","","410041","","2010-08-03 19:09:19","2010-08-03 19:17:16","CDATA XML is truncated while parsing","<java><android><xml><sax><cdata>","1","1","1","",""
"3400013","1","3561223","","2010-08-03 19:20:31","0","352","<p>When on android default browser long press on the back key opens the history tab. Is there a way to open my own app instead of the history tab by similar user action? </p>","349161","","","","","2010-08-24 21:35:05","How can I open another app from inside the android default the browser?","<android><browser>","2","0","","",""
"3400028","1","3736853","","2010-08-03 19:22:23","35","29859","<p>I have an Activity with an EditText, a button and a ListView.  The purpose is to type a search screen in the EditText, press the button and have the search results populate this list.</p><p>This is all working perfectly, but the virtual keyboard is behaving strange.  If I click the EditText, I get the virtual keyboard.  If I click the ""Done"" button on the virtual keyboard, it goes away.  However, if I click my search button before clicking ""Done"" on the virtual keyboard, the virtual keyboard stays and I can't get rid of it.  Clicking the ""Done"" button does not close the keyboard.  It changes the ""Done"" button from ""Done"" to an arrow and remains visible.</p><p>Thanks for your help</p>","406790","","","","","2013-06-03 19:53:01","Close virtual keyboard on button press","<android><virtual-keyboard>","3","0","11","",""
"3400072","1","8599921","","2010-08-03 19:28:18","14","5245","<p>I see numerous examples of using pathPattern to define an intent-filter for a specific file extension/type; for example, <code>pathPattern="".*\\.xyz""</code>.</p><p>Unfortunately, this does not appear to work properly if the file in question has a period elsewhere in the path; for example ""my.filename.xyz"".   </p><p>Is there a pathPattern syntax that will match both ""myfilename.xyz"" and ""my.filename.xyz""?</p>","262119","","","","","2011-12-22 06:02:09","pathPattern to match file extension does not work if a period exists elsewhere in the file name?","<android>","3","0","7","",""
"3400109","1","","","2010-08-03 19:32:17","3","3619","<p>How do I simulate a WiFi network using the Emulator?</p>","409089","","115145","","2010-08-03 21:47:05","2011-05-20 23:30:15","Simulate Wireless Network in Emulator","<android>","3","0","","",""
"3400122","1","","","2010-08-03 19:33:40","1","287","<p>When I tap (click) a link (or any selectable item) in a web page on Android web browser, the link/item is being highlighted (a thin orange line is draw around the selected item).Does anyone know whether this behavior can be eliminate and how.</p><p>Thanks in advanced,Oded</p>","146634","","","","","2010-08-03 20:33:57","Selecting an item on Android web browser","<android><mobile-webkit>","1","0","","",""
"3400144","1","","","2010-08-03 19:37:01","3","1015","<p>All,</p><p>I am familiar with the ability to fake GPS information to the emulator through the use of the <code>geo fix long lat altitude</code> command when connected through the emulator.</p><p>What I'd like to do is have a simulation running on potentially a different computer produce lat, long, altitudes that should be sent over to the Android device to fake the emulator into thinking it has received a GPS update.  </p><p>I see various solutions for <a href=""http://stackoverflow.com/questions/709801/creating-a-script-for-a-telnet-session"">scripting a telnet session</a>; it seems like the best solution is, in pseudocode:</p><pre><code>while true:    if position update generated / received        open subprocess and call ""echo 'geo fix lon lat altitude' | nc localhost 5554""</code></pre><p>This seems like a big hack, although it works on Mac (not on Windows).  Is there a better way to do this?  (I cannot generate the tracks ahead of time and feed them in as a route; the Android system is part of a real time simulation, but as it's running on an emulator there is no position updates.  Another system is responsible for calculating these position updates).  </p><p>edit:Alternative method, perhaps more clean, is to use the telnetlib library of python.</p><pre><code>import telnetlibtn = telnetlib.Telnet(""localhost"",5554)while True:    if position update generated / received        tn.write(""geo fix longitude latitude altitude\r\n"")</code></pre>","155392","","155392","","2010-08-03 19:58:07","2013-01-01 13:29:41","Android - scripting telnet session for sending GPS tracks","<android><geolocation><telnet>","3","0","1","",""
"3400245","1","3418924","","2010-08-03 19:48:38","3","8136","<p>I'm new to Android development. I'm trying to get a simple HelloWorld app going on my (rooted) phone - and the app is trying to enable Bluetooth.</p><p>I've set the Bluetooth permissions in my manifest is as follows, but I'm getting a Permission Denial exception when I try to run the application on my phone via Eclipse:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""          package=""com.example.helloandroid""          android:versionCode=""1""          android:versionName=""1.0""&gt;              &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true"" android:permission=""android.permission.BLUETOOTH_ADMIN""&gt;            &lt;activity android:name="".HelloAndroid""                      android:label=""@string/app_name""&gt;                &lt;intent-filter&gt;                    &lt;action android:name=""android.intent.action.MAIN"" /&gt;                    &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;                &lt;/intent-filter&gt;            &lt;/activity&gt;        &lt;/application&gt;&lt;uses-permission android:name=""android.permission.BLUETOOTH"" /&gt;&lt;uses-permission android:name=""android.permission.BLUETOOTH_ADMIN"" /&gt;&lt;uses-sdk android:targetSdkVersion=""7"" android:minSdkVersion=""5""&gt;&lt;/uses-sdk&gt;&lt;/manifest&gt;</code></pre><p>Is there something obvious I'm missing?</p>","7486","","","","","2013-08-29 07:26:05","How to set permissions for Android Bluetooth","<android><permissions><bluetooth><manifest>","2","0","","",""
"3400264","1","3479482","","2010-08-03 19:51:15","2","4589","<p>I am getting the following error while obfuscating my application.How can i define the output jar in my build.xml?</p><pre><code> [java] Shrinking... [java] java.io.IOException: The output jar is empty. Did you specify the proper '-keep' options? [java]     at proguard.shrink.Shrinker.execute(Shrinker.java:148) [java]     at proguard.ProGuard.shrink(ProGuard.java:294) [java]     at proguard.ProGuard.execute(ProGuard.java:100) [java]     at proguard.ProGuard.main(ProGuard.java:499)</code></pre>","242769","","","","","2011-02-14 16:58:46","Android ==> ant and proguard?","<android><obfuscation><proguard><build.xml>","2","0","","",""
"3400319","1","3402083","","2010-08-03 20:00:06","1","2480","<p>How can I do this? There's a setAlpha but no getAlpha.</p>","92259","","","","","2013-05-30 01:17:47","Get the alpha of an ImageView","<android>","4","0","","",""
"3400373","1","","","2010-08-03 20:07:22","1","1356","<p>OK, I have updated my android application with android:installLocation=""auto"" in the manifest.  If I install it on my N1 via the USB cable, it works and allows me to move the application to my SD Card.</p><p>However, I have a friend that has downloaded the application through the market, and the option is grayed out for him even though it is the same version of the APK.  We uninstalled the market version and installed it through the USB cable and he had the option to move the app to the SD Card.  We uninstalled and reinstalled the market version, and again it was grayed out.</p><p>Any ideas?</p>","336681","","","","","2010-08-03 20:17:12","Android installLocation does not work through market","<android>","1","0","","",""
"3400470","1","","","2010-08-03 20:20:34","1","695","<p>I'm attempting to fade between two background images on my Droid, but the animation seems to get 5fps if not less. Is there any method I can use other than fading in\out a couple image views that would be smoother?</p>","92259","","","","","2010-08-03 20:20:34","Create a smooth fade animation in android?","<android>","0","2","","",""
"3400499","1","3400570","","2010-08-03 20:25:06","2","916","<p>How can I make the Device sound a beep when socket connection has been established. In other words, how to set a notification tone when an event occurs in Android sdk? </p>","357349","","","","","2010-08-03 20:37:05","Beep sound notification on Socket connection establishment","<android>","1","0","","",""
"3400550","1","","","2010-08-03 20:33:52","0","357","<p>I'm rather new to android programming and right now I'm playing with the media store for a personal test project.  I've run into a couple double-edge problems..</p><ol><li><p>I need to query the mediastore for a list of all music files, simple enough - <em>but</em> i need to restrict the results to certain folders only.  I accomplished this (rather easily) using the SQL-*LIKE- where clauses and all's well on this aspect.</p></li><li><p>I now need a unique (if this were actually using SQL, I could simply use the DISTINCT modifier and be done with this) list of all artists.  Now this is based off the songs in a given path.  Therefore I cannot filter the list returned from querying the URI:MediaStore.Audio.Artists.EXTERNAL_CONTENT_URI, and adding in where clauses based off the file path as I did in the first step.</p></li></ol><p>So, what this leaves me with is using my initial query and getting a cursor back then stripping the dupes from the cursor (which is where i am now - too slow, especially with 1000+ songs) - based on a query of artists instead of songs, obviously.</p><p>Is is possible to override the actual query that fills the cursor, maybe?  As in: override the query and filter how the data is initially put into the cursor (remove recursive entries) and return the proper cursor immediately?  Content providers and how they were never built with a distinct function is beyond me, but whatever.  Is the returned cursor from a URI query command filled in a manner that can be overridden or not?  That's what I'm unclear of at the moment on this.  I would like to be able to wrap the getContentResolver().query(xxx..)) command directly to remove the entries on cursor fill, if possible - i do async queries and using a single query statement (well, one for the artist query) would be great.</p><p>My other alternative thought is to just preload the data and manipulate my view's data by creating a new cursor based off the preloaded dataset (cursor) - which may be the way to go, and if so - would a cursor be the best way to store this data?  Also worried about ram with larger libraries.</p><p>Maybe there's simply a way to do a DISTINCT query on the URI - I just do not know.</p><p>I've seen this question (or the ilk there-of) asked many times with no good answers that were meant for a URI as opposed to a SQL back-end.</p><p>Thank You all, appreciate the help.</p>","410071","","218196","","2010-08-03 20:36:06","2010-08-18 20:05:00","Advice needed for manipulating the mediastore","<android>","1","0","","",""
"3400571","1","","","2010-08-03 20:37:08","0","347","<p>TranslucentActivity.java doesn't do anything.  There is no translucence, nothing special about it.  It just shows an activity screen.</p>","398275","","102937","","2012-07-11 17:19:48","2012-07-11 17:19:48","Android API Demos 8 Translucent the class is TranslucentActivity.java doesn't do anything","<android><transparency>","2","2","","",""
"3400757","1","3401082","","2010-08-03 21:07:45","1","357","<p>Is there another way than doing our own counter to know how many times an animation has been repeated? (to produce different effects depending on the times it has been repeated.)</p>","263521","","12388","","2010-08-03 21:23:34","2010-08-03 21:56:13","Get a repetition count of an animation","<android><animation>","1","0","","",""
"3400801","1","3402277","","2010-08-03 21:14:24","0","1286","<p>I have developed an application on Android which makes use of the Smack API to connect to XMPP server.In this application I hardcode the User Sign-In information i.e. Username and Password.</p><blockquote>  <p>xmpp.login(""admin"", ""tigase"");</p></blockquote><p>and I get packets from a different user</p><blockquote>  <p>PacketFilter filter = new  AndFilter(new  PacketTypeFilter(Message.class),                   new FromContainsFilter(""ameya@mwbn43-1""));</p></blockquote><p>Now I am facing the problem that when I run the same app on 2 different android devices one device overwrites the other devices credentials and thus when I am trying to send the data,only one of them gets it.AFAIK in normal Google Chat, user can log into same account from 2 different places and can receive messages on both places at same time.</p><p>Can anyone tell me what could be the problem?Has it got something to do with Smack API?</p><p>Thanks,</p><p>Ameya</p>","355833","","","","","2012-08-22 07:53:45","Logging into same jabber account from 2 different android devices using Smack","<android><gmail><xmpp><smack>","3","0","","",""
"3400839","1","3401061","","2010-08-03 21:21:38","0","815","<p>I have an application that consist of several Activities.  When the application starts, some alarms are scheduled using <code>AlarmManager</code> and some services are started:</p><pre><code>AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);a.setInexactRepeating(...)....</code></pre><p>I would like to know any way to <strong>guarantee every service is stopped and every alarm is unscheduled when the user exits the application</strong>.</p><p>The problem is that the user can leave the application from different Activities, and  I don't like the idea of overriding the <code>onDestroy</code> method in every Activity.  Is there any known <code>Intent</code> I can receive when the application ends? </p><p>I've also found that an Android application can have a class that extends from <code>Application</code>, with a <code>onTerminate</code> method:</p><pre><code>public class MyApplication extends Application {     @Override    public void onTerminate() {        ...    }}</code></pre><p>But the documentation is very clear: <em>""never depend on this method being called; in many cases an unneeded application process will simply be killed by the kernel without executing any application code""</em></p><p>Any suggestion is highly appreciated.</p>","12388","","12388","","2010-08-03 21:27:48","2010-08-03 21:52:54","Android: stop services and alarms when the application ends","<android><android-alarms>","1","0","","",""
"3400843","1","","","2010-08-03 21:22:01","0","458","<p>Instead of displaying home screen for the first time I want to display my activity for device setup when device_provisioned == 0. </p><p>How can I override the code that launches the home screen activity.</p><p>Thanks,</p><p>Yousuf</p>","410151","","","","","2010-08-04 08:03:34","Launch of My Activity at startup with out using Action_boot_complete","<android>","1","0","","",""
"3400968","1","3401727","","2010-08-03 21:41:54","3","725","<p>The company I work for is wary of Android app development because the default cryptography library, Bouncy Castle, is not FIPS-140 certified.  Nothing I can do to change their minds or policies.</p><p>I'm wondering what options I have for installing (or at least bundling) SunJCE with my app.  </p><p>For one, I can't find where I would download the latest version of this jar.  I tried grabbing the jce jar from my desktop and setting it as an internal jar in my Android project and received this amusing, if ominous, message:</p><blockquote>  <p>Attempt to include a core class  (java.* or javax.*) in something other  than a core library. It is likely that  you have attempted to include in an  application the core library (or a  part thereof) from a desktop virtual  machine. This will most assuredly not  work. At a minimum, it jeopardizes the  compatibility of your app with future  versions of the platform. It is also  often of questionable legality.</p>    <p>If you really intend to build a core  library -- which is only appropriate  as part of creating a full virtual  machine distribution, as opposed to  compiling an application -- then use  the ""--core-library"" option to  suppress this error message.</p>    <p>If you go ahead and use  ""--core-library"" but are in fact  building an application, then be  forewarned that your application will  still fail to build or run, at some  point. Please be prepared for angry  customers who find, for example, that  your application ceases to function  once they upgrade their operating  system. You will be to blame for this  problem.</p>    <p>If you are legitimately using some  code that happens to be in a core  package, then the easiest safe  alternative you have is to repackage  that code. That is, move the classes  in question into your own package  namespace. This means that they will  never be in conflict with core system  classes. If you find that you cannot  do this, then that is an indication  that the path you are on will  ultimately lead to pain, suffering,  grief, and lamentation.</p></blockquote><p>I'm not one for pain, suffering, grief, OR lamentation, so I'd like to know the proper way to go about this task, provided it's something I should attempt at all.</p>","92359","","","","","2010-08-04 00:21:35","Installing SunJCE on Android?","<java><android><encryption><cryptography>","1","0","1","",""
"3401059","1","","","2010-08-03 21:52:37","3","4836","<p>On the android, when the built in browser comes across an email or a phone number and it is pressed, a dialog box comes up for each. </p><p>However, if i navigate to that url inside my Application's webview, this no longer is the case.</p><p>Is there anyway for my webview to exhibit the same properties as the browser application in detecting emails and phone numbers and popping up the respective default dialogs when pressed?</p><p>I know that the iPhone can do this with a checkbox in the Interface Builder very easily, I am hoping the android can do the same.</p><p>I have taken a look into such links as:</p><p><a href=""http://stackoverflow.com/questions/1744091/is-there-any-way-to-have-webview-auto-link-urls-and-phone-numbers-in-android"">Is there any way to have WebView auto-link URLs and phone numbers in Android?</a></p><p>and using the function that interrupts the link click but that doesn't really help me because phone numbers and emails don't necessarily have to be linked.</p>","410154","","759866","","2014-04-01 11:10:44","2014-04-01 11:10:44","Having Android WebView detect and popup email dialog or phone call dialog","<android><email><webview><detect><phone>","3","0","","",""
"3401111","1","3539216","","2010-08-03 22:00:37","1","806","<p>I'm using the SAX xml parser to parse some xml data which contains newlines. When using Attributes#getValue, the newline data is lost. How can keep the newlines?</p>","240251","","","","","2012-12-28 14:47:32","Preserve newlines when parsing xml","<android><xml><newline><sax>","2","6","","",""
"3401247","1","3404781","","2010-08-03 22:31:48","0","963","<p>When I do a ListActivity my ListView works correctly : I can scroll by dragging with the TouchScreen or with the Mouse Wheel.However when I incorporate a ListView in a layout (with buttons, textview, linearLayouts, ect... ) I can't scroll it by dragging, I can just scroll with the mouse wheel.</p><p>How can I enable the ""touch"" scroll of a listView (outside a list activity) ?</p><p>Thanks</p>","400695","","","","","2010-08-04 10:52:06","Set ListView Scrolable","<android>","3","1","","",""
"3401336","1","3401609","","2010-08-03 22:51:51","2","3246","<p>I've been working in Eclipse programming for Android for about a year now. I suddenly have an enormous problem. Here is the error:</p><blockquote>  <p>""Content Assist"" did not complete  normally.  Please see the log for more  information.  java.lang.NullPointerException</p></blockquote><p>I go to Help>About Eclipse SDK>Installation Details>Configuration>View Error Log and it is nothing but a blank page. No errors at all.</p><p>I tried researching online. The most relevant pages I could find are <a href=""http://forums.adobe.com/thread/455543"" rel=""nofollow"">http://forums.adobe.com/thread/455543</a> and <a href=""http://www.themorphicgroup.com/blog/2009/10/27/content-assist-did-not-complete-normally/"" rel=""nofollow"">http://www.themorphicgroup.com/blog/2009/10/27/content-assist-did-not-complete-normally/</a> and <a href=""http://www.airtightinteractive.com/2010/01/fix-for-flash-builder-content-assist-did-not-complete-normally/"" rel=""nofollow"">http://www.airtightinteractive.com/2010/01/fix-for-flash-builder-content-assist-did-not-complete-normally/</a> . All of these pages say to close FB, delete the .metadata folder,restart FB, import/export some SWC file, and/or delete some file with ""flexbuilder"" in it's name. None of these work and I see nothing on my whole machine with any of ""Flash Builder"", ""FB"", ""flex"", or ""flexbuilder"" in it's name.</p><p>As a desperate last resort I deleted all traces of Eclipse, Android, Adobe <em>anything</em>, and Java from my machine.</p><p>Absolutely no difference what-so-ever. Besides exhaustion and heartache for me.</p><p>The content assist features seem to work fine in java files (for now anyway). It seems that only .xml files are affected.</p><p>What can I do to resolve or work around this issue?</p>","402682","","","","","2013-05-27 20:11:08","Content Assist not working in Eclipse for Android","<android><eclipse><eclipse-plugin>","4","0","","",""
"3401388","1","","","2010-08-03 23:03:10","0","1962","<p>I am somewhat of a new android developer and have a question regarding changing the background dynamically at runtime. </p><p>What I want to do is set a background color in a LinearLayout Tag, and later change that background color in my activity class. This code below is not working. Am I missing something or is this the wrong approach for trying to change the background color in a linear layout</p><pre><code>LinearLayout lv = (LinearLayout)findViewById(R.id.ChoiceLayout);lv.setBackgroundColor(0x000080);</code></pre><p>Thanks in advance</p>","410223","","82118","","2010-08-03 23:04:23","2012-05-13 23:45:52","Android dynamic background","<android><layout><dynamic><background><linear>","3","1","","",""
"3401437","1","","","2010-08-03 23:14:29","0","190","<p>How can i check my application works with 3G. since in my app I need to connect to a URL to get data.</p><p>Thanks</p>","341443","","950427","","2014-02-17 03:49:44","2014-02-17 03:49:44","How to check application works with 3G internet?","<android><android-emulator>","0","5","","",""
"3401579","1","3414749","","2010-08-03 23:46:43","107","73261","<p>I have an onActivityResult returning from an mediastore image selection which I can get a URI for an image using the following:</p><pre><code>  Uri selectedImage = data.getData();</code></pre><p>Converting this to a string gives this:</p><pre><code>  content://media/external/images/media/47</code></pre><p>Or to a path gives:</p><pre><code>  /external/images/media/47</code></pre><p>However I can't seem to find a way to convert this into an absolute path, as I want to load the image into a bitmap without having to copy it somewhere. I know this can be done using the URI and content resolver but this seems to break on rebooting of the phone, I guess MediaStore doesn't keep its numbering the same between reboots.</p>","315998","","244296","","2011-08-16 14:04:17","2014-01-23 15:28:23","Get filename and path from uri from mediastore","<android><uri><absolute-path><mediastore>","7","0","74","",""
"3401840","1","3401855","","2010-08-04 00:54:35","4","4353","<p>Is it possible to start an <code>Activity</code> in the background? I need such an <code>Activity</code> that can operate in the background and spawn other Activities as needed in response to user commands issued to my Home Screen widget.</p>","440093","","","","","2010-08-04 00:58:28","Android: How to start an Activity in the background?","<android>","1","1","","",""
"3401916","1","","","2010-08-04 01:19:59","0","504","<p>For example if a WebView loaded ""test.html?PageId=10"", how would I get that PageId is equal to 10?</p>","363591","","","","","2010-08-04 01:31:59","How do I get the querystring from a web page loaded in an Android WebView?","<android><webview>","1","0","","",""
"3401919","1","3402962","","2010-08-04 01:20:25","0","2357","<p>I have been trying to optimize my single thread app which loads a bunch of tiles that makeup a large bitmap. The app was becoming very sluggish when it would load the new tiles into system memory. Im now looking trying to use Async Tasks for this purpose. The app detects which tile is in the top left in a method called by onDraw, creates a string that contains the path of the bitmap in the Assets folder, and then checks to see if the bitmap is null before drawing. If it is null, it will load it into memory. My idea was to process the bitmap in DoBackground, and in postExecute trigger a view invalidate to display the async loaded bitmap. Few questions:</p><p>1.) can i execute my aSync task for each bitmap? (this statement:       new myAsyncTaskManager().execute(bitmapPath);  if not, what is the best way to go about it since the only thing aSync will do is just load bitmaps into memory?</p><p>2.) Is it possible to set the priority aSyncTask if the bitmaps load too slow?</p><p>3.) Is there a better way to go about this? im certain it is the bitmap loading, and not the canvas drawing that slows down the app.</p><p>My temporary aSync code:</p><pre><code>private class myAsyncTaskManager extends AsyncTask&lt;String, Void, String&gt; {@Overrideprotected String doInBackground(String... bitmapPath) {      Log.e(""sys"",""i ran using aTask"");        try {            bitmapArray[rectBeingDrawn] = BitmapFactory.decodeStream(assetManager.open(imagePathToLoad));        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }       return null;}@Overrideprotected void onPostExecute(String result) {    // execution of result of Long time consuming operation    mCampusMap.invalidate();}}</code></pre>","385051","","385051","","2010-08-04 04:39:06","2010-08-04 05:56:21","optimizing bitmap loading by using aSyncTask","<android><multithreading><bitmap><android-asynctask><runnable>","2","0","","",""
"3402020","1","","","2010-08-04 01:46:49","0","362","<p>When I run my application on a physical phone from within Eclipse, my Google MapView works perfectly. If export the app to an apk file and install it to the same phone from the command line with adb then the MapView comes up but shows only the Google logo and grid - no map tiles appear. I'm using a debug application key and a GMaps API key generated with that debug key. I've verified that this happens on both the Droid and N1 phones. The logcat looks identical in both the working and non-working cases - no obvious error messages.</p><p>Any ideas what might be wrong?</p>","409849","","","","","2011-05-02 22:13:27","MapView works with Eclipse install but not adb install","<android>","2","2","","",""
"3402165","1","3402463","","2010-08-04 02:26:49","4","2411","<p>I have a 100 meg zip file that I need to download when the app first starts. It needs to unzip to the SD card (400 meg).</p><p>I'd rather not have to have it touch the phone's storage as many phones won't have 400 meg free on the phone's storage.</p><p>Can this be done (any one have an example?)</p><p>Thanks,ian</p>","172861","","","","","2011-01-13 10:59:49","Android Download Zip to SD card?","<android><zip>","1","0","4","",""
"3402238","1","","","2010-08-04 02:44:51","0","1365","<p>I encounter an issue of INSTALL_FAILED_DUPLICATE_PACKAGE, when trying to deploy an apk into an emulator.</p><p>The following is the console display message:</p><pre><code>[XXX] Installation error: INSTALL_FAILED_DUPLICATE_PACKAGE[XXX] Please check logcat output for more details.[XXX] Launch canceled!</code></pre><p>However, when I check with the logcat, I saw a similar things here.</p><pre><code>WARN/PackageManager(51): *************************************************WARN/PackageManager(51): Application package com.xxx.xxx.xxx already installed.  Skipping duplicate.WARN/PackageManager(51): *************************************************WARN/PackageManager(51): Package couldn't be installed in /data/app/com.xxx.xxx.xxx.apk</code></pre><p>When I open the ddms to check with whether the package is available, it is actually not available.</p><p>What I did before this is:</p><ol><li><p>Changing the android SDK location. (Window > Preferences > Android > SDK Location)Reason: Our team is customizing the android SDK, and I would like to point it into a new android SDK location instead of the default android SDK.</p></li><li><p>After changing the android SDK location from Eclipse, the Build of the particular project does not completed.</p><blockquote>  <p>Note: I forgot the exact error,  because it is not reproducible after  one night. If not mistaken, the end of  the compilation complains that the  ""aapt"" in  /platforms/android-7/tools is  missing or could not execute. Note:  Initially, it is my problem that do  not set the ""chmod"" of the file  properly. But after I change the chmod  of ""aapt"", it is still not able to  execute with same error.</p></blockquote></li><li><p>Therefore, I plan to check out my changes again from svn and migrate the changes tonew location. After the migration tonew location. Compilation is perfectand working fine, but problem occurswhen trying to deploy and run inemulator.</p></li></ol><p>Tested method:</p><ol><li><p>Using ""ddms"" to check the package, I could not see the mentioned package.</p></li><li><p>Try remove blindly using ""adb"" command:</p><p>./adb shell rm data/app/$APK</p><p>$APK is com.xxx.xxx.xxx.apkHowever, the return value is ""failure""</p></li><li><p>a. Changing the android SDK back to original SDK.b. Extract a new android SDK to use.c. Get a new eclipse to use.d. Get a new Android Emulatore. Restart PC...</p></li></ol><p>All the method above has been tried, but no luck. Any suggestion?Currently, I would like to know how android check the duplicate package. Anyone can shed me some light on where is the explanation of this available?</p><p>Thank you for any kinds of help.</p>","410320","","2504283","","2010-08-04 05:35:48","2010-08-04 05:35:48","Duplicate package when deploy apk into Emulator, INSTALL_FAILED_DUPLICATE_PACKAGE error","<android>","1","0","","",""
"3402255","1","3402658","","2010-08-04 02:50:02","7","27599","<p>so im trying to set up a setOnClickListener for my ListView but its causing a crash in my program for some reason when i try.. im quite new to programming so when it comes to troubleshooting i cant really do anything sadly :( my code is below so any ideas on what could be wrong would be extremely helpful</p><pre><code>public class HomePageActivity extends Activity {    //ListView that holds the items    ListView lstTest;    //Array Adapter that holds the ArrayList and displays the items on the ListView    AlertsAdapter arrayAdapter;    //List that hosts the items    ArrayList&amp;lt;Alerts&amp;gt; alrts = null;    /** Called when the activity is first created. */    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.homepage);        //Initialize the ListView        lstTest = (ListView)findViewById(R.id.lstText);        //Initialize the ArrayList        alrts = new ArrayList&amp;lt;Alerts&amp;gt;();        //Initialize the array adapter        arrayAdapter = new AlertsAdapter(HomePageActivity.this, R.layout.listitems,alrts);        //Set the above adapter as the adapter of choice for our list        lstTest.setAdapter(arrayAdapter);        lstTest.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                Intent intent = new Intent(                HomePageActivity.this,                PromotionActivity.class                );                startActivity(intent);            }        });        //... ... ...    }} </code></pre><p>any thoughts? im stuck :(</p><p>edit: posting error log file from ddms</p><pre><code>08-04 04:14:26.351: ERROR/AndroidRuntime(8882): FATAL EXCEPTION: main08-04 04:14:26.351: ERROR/AndroidRuntime(8882): java.lang.RuntimeException: Unable to start activity ComponentInfo{hypenyte.bdutcher.promopost/hypenyte.bdutcher.promopost.HomePageActivity}: java.lang.RuntimeException: Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at android.os.Handler.dispatchMessage(Handler.java:99)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at android.os.Looper.loop(Looper.java:123)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at java.lang.reflect.Method.invokeNative(Native Method)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at java.lang.reflect.Method.invoke(Method.java:521)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at dalvik.system.NativeStart.main(Native Method)08-04 04:14:26.351: ERROR/AndroidRuntime(8882): Caused by: java.lang.RuntimeException: Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at android.widget.AdapterView.setOnClickListener(AdapterView.java:750)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at hypenyte.bdutcher.promopost.HomePageActivity.onCreate(HomePageActivity.java:58)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)08-04 04:14:26.351: ERROR/AndroidRuntime(8882):     ... 11 more</code></pre><p>i saw that it said i probably want setOnItemClickListener which is originally what i had it coded as but that it wouldnt work since eclipse told me my code was wrong with it</p>","407775","","407775","","2010-08-04 04:20:54","2012-10-16 10:46:34","setOnClickListener of a ListView not working","<android><listview>","2","6","2","",""
"3402267","1","","","2010-08-04 02:55:32","1","442","<p>Right now I have an AlphaAnimation that fades out, the problem is that my fade out animation run on something already faded out, causes it to appear and fade out, when I'd rather it simply stay faded out. Is there a way to do this?</p>","92259","","6391","","2010-08-04 03:49:43","2011-05-18 19:31:37","Android AlphaAnimation that only fades out?","<android><animation>","1","0","","",""
"3402268","1","3402429","","2010-08-04 02:55:34","0","2482","<p>I am trying to open a Resource by passing the result of context.getResources().getString(R.drawable.myimage) to another class that is not an activity.  context.getResources().getString(R.drawable.myimage) returns res/drawable-mdpi/myimage.png  However, when I try and open this file, it throws a FileNotFoundException.</p><p>What is the proper way to open a resource outside an activity?</p>","207795","","","","","2010-08-04 03:45:46","Opening a resource outside an activity in Android","<android><resources><activity><drawable>","1","0","","",""
"3402303","1","","","2010-08-04 03:09:47","0","562","<p>this method can update photo to my android emulator but could not sync to gmail contacts, I think this method is not correct, who can tell me how to do that?  I think android photo could not be sync to gmail contact, is this thinking correct?this is my code:</p><pre><code>Bitmap photo = getMyPhoto();ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();ByteArrayOutputStream baos = new ByteArrayOutputStream();photo.compress(Bitmap.CompressFormat.PNG, 100, baos);ops.add(ContentProviderOperation.newInsert(Data.CONTENT_URI).withValue(Data.RAW_CONTACT_ID, rawId).withValue(Data.MIMETYPE, ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE).withValue(ContactsContract.CommonDataKinds.Photo.PHOTO, baos.toByteArray()).build());</code></pre>","408273","","950427","","2014-02-17 03:48:02","2014-02-17 03:48:02","How to sync my contact's photo to Gmail contacts?","<android><sync>","0","2","0","",""
"3402434","1","","","2010-08-04 03:46:55","0","2143","<p>i am developing phone-gap app in android. In app I am calling a servlet returning JSON. Under app code I am calling following method through javascript in index.html  </p><p>JQuery.getJSON(servleturl,function(data){alert(data)});</p><p>When running in emulator the alert is getting displayed, but data is always null. However if i launch the index.html (main application file in phonegap) from browser, I am able to get Json.</p><p>same thing happens even if I use $ajax.please help me and let me know what I am doing wrong.</p>","410340","","","","","2010-12-07 05:43:59","getJSON returning null phonegap(android)","<android><android-emulator><getjson><phonegap>","2","1","","",""
"3402509","1","","","2010-08-04 04:06:54","0","800","<p>I wanna try an example of storing images into sdcard and displaying out to see if it works. However, my images can't be shown. Please help me check my problem. </p><pre><code>public class SDCard_Image {//read drawable files Resources res = getResources();Drawable drawable = res.getDrawable(R.drawable.mood_1);//insert into sd card(?)  public static boolean StoreByteImage(Context mContext, byte[] imageData,            int quality, String expName) {         File sdImageMainDirectory = new File(""/sdcard/myImages"");        FileOutputStream fileOutputStream = null;               FileOutputStream fileOutputStream2 = null;        FileOutputStream fileOutputStream3 = null;        FileOutputStream fileOutputStream4 = null;        FileOutputStream fileOutputStream5 = null;        FileOutputStream fileOutputStream6 = null;        FileOutputStream fileOutputStream7 = null;        FileOutputStream fileOutputStream8 = null;        FileOutputStream fileOutputStream9 = null;        FileOutputStream fileOutputStream10 = null;        FileOutputStream fileOutputStream11 = null;        FileOutputStream fileOutputStream12 = null;        FileOutputStream fileOutputStream13 = null;        FileOutputStream fileOutputStream14 = null;        FileOutputStream fileOutputStream15 = null;        FileOutputStream fileOutputStream16 = null;        String mood_1 = null;        String mood_2 = null;         String mood_3 = null;        String mood_4 = null;         String mood_5 = null;        String mood_6 = null;         String mood_7 = null;        String mood_8 = null;         String mood_9 = null;         String mood_10 = null;         String mood_11 = null;         String mood_12 = null;         String mood_13 = null;         String mood_14 = null;         String mood_15 = null;         String mood_16 = null;         try {            BitmapFactory.Options options=new BitmapFactory.Options();            options.inSampleSize = 5;            Bitmap myImage = BitmapFactory.decodeByteArray(imageData, 0,                    imageData.length,options);            fileOutputStream = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_1 + "".jpg"");            fileOutputStream2 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_2 + "".jpg"");            fileOutputStream3 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_3 + "".jpg"");            fileOutputStream4 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_4 + "".jpg"");            fileOutputStream5 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_5 + "".jpg"");            fileOutputStream6 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_6 + "".jpg"");            fileOutputStream7 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_7 + "".jpg"");            fileOutputStream8 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_8 + "".jpg"");            fileOutputStream9 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_9 + "".jpg"");            fileOutputStream10 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_10 + "".jpg"");            fileOutputStream11 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_11 + "".jpg"");            fileOutputStream12 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_12 + "".jpg"");            fileOutputStream13 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_13 + "".jpg"");            fileOutputStream14 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_14 + "".jpg"");            fileOutputStream15 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_15 + "".jpg"");            fileOutputStream16 = new FileOutputStream(                    sdImageMainDirectory.toString() +""/"" + mood_16 + "".jpg"");            BufferedOutputStream bos = new BufferedOutputStream(                    fileOutputStream);            myImage.compress(CompressFormat.JPEG, quality, bos);            bos.flush();            bos.close();        } catch (FileNotFoundException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        return true;    }private Resources getResources() {    // TODO Auto-generated method stub    return null;}</code></pre><p>}</p><p>And this is the part whereby i wanna show my images: </p><pre><code>public class SDCardImagesActivity extends Activity {private Cursor cursor;private int columnIndex;private DBAdapter db; @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.mood);    db = new DBAdapter(this);     db.open();    // Set up an array of the Thumbnail Image ID column we want    String[] projection = {MediaStore.Images.Thumbnails._ID};    // Create the cursor pointing to the SDCard    cursor = managedQuery( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,            projection, // Which columns to return            null,       // Return all rows            null,            MediaStore.Images.Thumbnails.IMAGE_ID);    columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID);    GridView sdcardImages = (GridView) findViewById(R.id.gridview);    sdcardImages.setAdapter(new ImageAdapter(this));    // Set up a click listener    sdcardImages.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView parent, View v, int position, long id) {            // Get the data location of the image            String[] projection = {MediaStore.Images.Media.DATA};            cursor = managedQuery( MediaStore.Images.Media.EXTERNAL_CONTENT_URI,                    projection, // Which columns to return                    null,       // Return all rows                    null,                    null);            columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);            cursor.moveToPosition(position);            // Get image filename            String imagePath = cursor.getString(columnIndex);            // Use this path to do further processing, i.e. full screen display        }    });}private class ImageAdapter extends BaseAdapter {    private Context context;    public ImageAdapter(Context localContext) {        context = localContext;    }    public int getCount() {        return cursor.getCount();    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        ImageView picturesView;        if (convertView == null) {            picturesView = new ImageView(context);            // Move cursor to current position            cursor.moveToPosition(position);            // Get the current value for the requested column            int imageID = cursor.getInt(columnIndex);            // Set the content of the image based on the provided URI            picturesView.setImageURI(Uri.withAppendedPath(                    MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, """" + imageID));            picturesView.setScaleType(ImageView.ScaleType.FIT_CENTER);            picturesView.setPadding(8, 8, 8, 8);            picturesView.setLayoutParams(new GridView.LayoutParams(100, 100));        }        else {            picturesView = (ImageView)convertView;        }        return picturesView;    }}</code></pre><p>}</p><p>Sorry the code is really long, but thanks! </p>","372750","","","","","2011-02-16 23:34:45","My images did not show from the sdcard","<android><sd-card>","2","1","","",""
"3402525","1","","","2010-08-04 04:15:27","2","2626","<p>I want to implement a search method in my application. I have a database, I want to search in that database using a quick search box.  Please help me to achieve this task.</p>","406494","","23897","","2010-08-04 04:17:59","2011-05-22 17:01:46","How to use QuickSearchBox in my Android application?","<android>","1","1","6","",""
"3402559","1","3402629","","2010-08-04 04:26:06","0","478","<p>Hi i want to move my gallary elements without tracking.for this give me some suggestions and example code.Thanks in adavance</p>","454808","","","","","2010-08-04 04:42:14","move the gallary elements automatically","<android>","1","1","","",""
"3402582","1","","","2010-08-04 04:32:28","0","90","<p>supposing that i have created an application ""MyApp"" and it contains a button.When this button is clicked it should start another application say""App"".this application ""App"" should not be available in any other part of the phone.                          please help me with this.                              thank you.</p>","410362","","","","","2010-08-04 08:29:14","how to start android application from my application but the application should not be visible to others","<android>","1","1","","",""
"3402693","1","3402918","","2010-08-04 04:55:10","0","2646","<p>I have set input type to be numberdecimal but also want to populate the editText with a ""-"" programmatically. I can add the text but then I am unable to edit the text as it doesn't confirm to the number decimal format. Any idea on how I can say inputtype is numberdecimal but a ""-"" can be allowed?</p>","207552","","","","","2013-12-20 20:38:52","how to set input type to be numberdecimal but also allow a ""-""","<android>","4","0","2","",""
"3402752","1","","","2010-08-04 05:08:22","0","241","<p>I can't connect Motorola Droid and Nexus One using BluetoothChat It's always return ""Unnable to connect"". So the socket is always close. </p><p>But when I try to connect Motorola Droid and Nokia N97 They are always connect.</p><p>How can I connect Motorola Droid and Nexus One ? Where is the problem?</p>","410380","","","","","2010-08-04 05:47:08","BluetoothChat doesn't work","<android><bluetooth>","1","0","","",""
"3402787","1","3402803","","2010-08-04 05:15:18","170","104957","<pre><code>&lt;ImageButton android:id=""@+id/previous""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:src=""@drawable/media_skip_backward""android:background=""@drawable/transparent""&gt;&lt;/ImageButton&gt;</code></pre><p>This is what I tried to get a transparent ImageButton so as to place those buttons on a SurfaceView. But Eclipse, gives me an error in the project as soon as I include the transparent line in xml.</p><p>Please help.</p>","381699","","","","","2013-11-21 18:38:14","How to have a transparent ImageButton: Android","<android><transparent><imagebutton><surfaceview>","8","4","40","",""
"3402871","1","","","2010-08-04 05:34:00","11","4276","<p>Recently,i search for articles about renderscript,but it seems that there's none. can any one give me some articles talking about renderscript? </p>","410390","","880054","","2011-12-30 06:53:45","2012-02-13 04:19:14","About RenderScript","<android><scripting><3d><renderscript>","4","0","6","",""
"3402929","1","","","2010-08-04 05:49:30","1","438","<p>Is it possible to write service that can catch any user's click on the touch screen and read text of the click no matter what application currently is active?For example user click on browser  or any other application and that service will know what word is written in the location of the screen.</p><p>Thank you.</p>","278107","","","","","2010-08-04 06:04:33","How to catch user's click on the android screen of any application?","<android>","1","1","","",""
"3402935","1","","","2010-08-04 05:51:20","1","462","<p>Hi i am working on one kid application in that application i want to show 1+1 =2 ,1+2=3 etc.For this i want tio display the number images one by one .That means fiorst display the 1 after + after some time another number.For this give me some suggestions.Please give me some example code .Thanks in advance</p>","454808","","","","","2010-08-04 06:18:34","display the images vies one by one","<android>","1","0","","",""
"3402945","1","","","2010-08-04 05:52:58","-6","644","<pre><code>08-04 12:22:42.692: DEBUG/EAS SyncManager(223): !!! EAS SyncManager, onCreate08-04 12:22:42.852: DEBUG/EAS SyncManager(223): !!! EAS SyncManager, onStartCommand08-04 12:22:42.920: DEBUG/EAS SyncManager(223): !!! EAS SyncManager, stopping self08-04 12:22:43.281: DEBUG/Eas Debug(223): Logging: 08-04 12:22:43.311: DEBUG/EAS SyncManager(223): !!! EAS SyncManager, onDestroy08-04 12:22:43.961: DEBUG/PackageParser(58): Scanning package: /data/app/vmdl64595.tmp08-04 12:22:44.410: DEBUG/MediaScanner(197):  prescan time: 1014ms08-04 12:22:44.430: DEBUG/MediaScanner(197):     scan time: 28ms08-04 12:22:44.451: DEBUG/MediaScanner(197): postscan time: 1ms08-04 12:22:44.461: DEBUG/MediaScanner(197):    total time: 1043ms08-04 12:22:44.490: DEBUG/MediaScannerService(197): done scanning volume internal08-04 12:22:45.060: INFO/PackageManager(58): Removing non-system package:com.ExtraCharge08-04 12:22:45.390: DEBUG/PackageManager(58): Scanning package com.ExtraCharge08-04 12:22:45.390: INFO/PackageManager(58): Package com.ExtraCharge codePath changed from /data/app/com.ExtraCharge-2.apk to /data/app/com.ExtraCharge-1.apk; Retaining data and using new08-04 12:22:45.421: INFO/PackageManager(58): /data/app/com.ExtraCharge-1.apk changed; unpacking08-04 12:22:45.450: DEBUG/installd(34): DexInv: --- BEGIN '/data/app/com.ExtraCharge-1.apk' ---08-04 12:22:45.861: INFO/Launcher.Model(128): not binding apps: no Launcher activity08-04 12:22:45.991: DEBUG/dalvikvm(128): GC_EXPLICIT freed 4375 objects / 244016 bytes in 125ms08-04 12:22:46.700: DEBUG/dalvikvm(245): DexOpt: load 154ms, verify 317ms, opt 14ms08-04 12:22:46.741: DEBUG/installd(34): DexInv: --- END '/data/app/com.ExtraCharge-1.apk' (success) ---08-04 12:22:46.861: WARN/PackageManager(58): Code path for pkg : com.ExtraCharge changing from /data/app/com.ExtraCharge-2.apk to /data/app/com.ExtraCharge-1.apk08-04 12:22:46.890: WARN/PackageManager(58): Resource path for pkg : com.ExtraCharge changing from /data/app/com.ExtraCharge-2.apk to /data/app/com.ExtraCharge-1.apk08-04 12:22:46.890: DEBUG/PackageManager(58):   Activities: com.ExtraCharge.ExtraCharg com.ExtraCharge.ExactLogic com.ExtraCharge.Superheat com.ExtraCharge.Refri com.ExtraCharge.Help com.ExtraCharge.Info com.ExtraCharge.Subcooling com.ExtraCharge.Actual com.ExtraCharge.Actual1 com.ExtraCharge.Temprature com.ExtraCharge.Pressure08-04 12:22:47.411: INFO/installd(34): move /data/dalvik-cache/data@app@com.ExtraCharge-1.apk@classes.dex -&gt; /data/dalvik-cache/data@app@com.ExtraCharge-1.apk@classes.dex08-04 12:22:47.671: DEBUG/PackageManager(58): New package installed in /data/app/com.ExtraCharge-1.apk08-04 12:22:48.171: DEBUG/dalvikvm(128): GC_EXPLICIT freed 8934 objects / 434544 bytes in 81ms08-04 12:22:48.851: INFO/ActivityManager(58): Force stopping package com.ExtraCharge uid=1003808-04 12:22:48.851: INFO/ActivityManager(58): Force stopping package com.ExtraCharge uid=1003808-04 12:22:48.970: INFO/ActivityManager(58): Force stopping package com.ExtraCharge uid=1003808-04 12:22:49.111: INFO/ActivityManager(58): Start proc com.android.quicksearchbox for broadcast com.android.quicksearchbox/.SearchWidgetProvider: pid=246 uid=10012 gids={3003}08-04 12:22:49.531: DEBUG/dalvikvm(58): GC_FOR_MALLOC freed 8230 objects / 503368 bytes in 213ms08-04 12:22:49.822: DEBUG/dalvikvm(163): GC_EXPLICIT freed 4393 objects / 264552 bytes in 876ms08-04 12:22:50.011: INFO/ActivityThread(246): Publishing provider com.android.quicksearchbox.google: com.android.quicksearchbox.google.GoogleSuggestionProvider08-04 12:22:50.220: DEBUG/dalvikvm(58): GC_EXPLICIT freed 3195 objects / 161488 bytes in 130ms08-04 12:22:50.341: INFO/installd(34): unlink /data/dalvik-cache/data@app@com.ExtraCharge-2.apk@classes.dex08-04 12:22:50.390: DEBUG/AndroidRuntime(116): Shutting down VM08-04 12:22:50.390: DEBUG/jdwp(116): adbd disconnected08-04 12:22:50.470: INFO/AndroidRuntime(116): NOTE: attach of thread 'Binder Thread #3' failed08-04 12:22:50.670: WARN/RecognitionManagerService(58): no available voice recognition services found08-04 12:22:50.840: INFO/ActivityManager(58): Start proc com.android.music for broadcast com.android.music/.MediaAppWidgetProvider: pid=256 uid=10022 gids={3003, 1015}08-04 12:22:52.090: INFO/ActivityManager(58): Start proc com.example.android.apis for broadcast com.example.android.apis/.appwidget.ExampleAppWidgetProvider: pid=264 uid=10034 gids={3003, 1015, 1006}08-04 12:22:52.500: DEBUG/AndroidRuntime(259): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;08-04 12:22:52.500: DEBUG/AndroidRuntime(259): CheckJNI is ON08-04 12:22:52.930: INFO/ActivityThread(264): Publishing provider com.example.android.apis.SuggestionProvider: com.example.android.apis.app.SearchSuggestionSampleProvider08-04 12:22:53.202: DEBUG/ExampleAppWidgetProvider(264): onEnabled08-04 12:22:53.270: DEBUG/ExampleAppWidgetProvider(264): onUpdate08-04 12:22:53.311: DEBUG/ExampleAppWidgetProvider(264): updateAppWidget appWidgetId=4 titlePrefix=Oh hai08-04 12:22:53.372: DEBUG/AndroidRuntime(259): --- registering native functions ---08-04 12:22:53.461: DEBUG/ExampleAppWidgetProvider(264): onUpdate08-04 12:22:53.461: DEBUG/ExampleAppWidgetProvider(264): updateAppWidget appWidgetId=4 titlePrefix=Oh hai08-04 12:22:54.131: INFO/ActivityManager(58): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=273 uid=10028 gids={}08-04 12:22:55.001: INFO/ActivityThread(273): Publishing provider com.svox.pico.providers.SettingsProvider: com.svox.pico.providers.SettingsProvider08-04 12:22:55.770: INFO/ActivityManager(58): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.ExtraCharge/.ExtraCharg }08-04 12:22:55.940: DEBUG/AndroidRuntime(259): Shutting down VM08-04 12:22:55.952: DEBUG/jdwp(259): adbd disconnected08-04 12:22:56.071: INFO/AndroidRuntime(259): NOTE: attach of thread 'Binder Thread #3' failed08-04 12:22:56.210: INFO/ActivityManager(58): Start proc com.ExtraCharge for activity com.ExtraCharge/.ExtraCharg: pid=283 uid=10038 gids={}08-04 12:22:57.420: INFO/ActivityManager(58): Displayed activity com.ExtraCharge/.ExtraCharg: 1278 ms (total 32925 ms)08-04 12:22:57.420: INFO/ActivityManager(58): Displayed activity com.android.launcher/com.android.launcher2.Launcher: 32930 ms (total 32930 ms)08-04 12:23:05.762: DEBUG/KeyguardViewMediator(58): pokeWakelock(5000)08-04 12:23:06.031: INFO/ARMAssembler(58): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x3482f0:0x3483fc] in 5410717 ns08-04 12:23:06.091: INFO/ARMAssembler(58): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x348400:0x3485c8] in 1399141 ns08-04 12:23:07.401: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.ExtraCharge/.ExactLogic }08-04 12:23:07.520: WARN/dalvikvm(283): VFY: invalid switch start: at 4, switch offset -25522, count 4055008-04 12:23:07.520: WARN/dalvikvm(283): VFY:  rejected Lcom/ExtraCharge/ExactLogic;.onClick (Landroid/view/View;)V08-04 12:23:07.520: WARN/dalvikvm(283): Verifier rejected class Lcom/ExtraCharge/ExactLogic;08-04 12:23:07.530: WARN/dalvikvm(283): Class init failed in newInstance call (Lcom/ExtraCharge/ExactLogic;)08-04 12:23:07.540: DEBUG/AndroidRuntime(283): Shutting down VM08-04 12:23:07.540: WARN/dalvikvm(283): threadid=1: thread exiting with uncaught exception (group=0x4001d800)08-04 12:23:07.571: ERROR/AndroidRuntime(283): FATAL EXCEPTION: main08-04 12:23:07.571: ERROR/AndroidRuntime(283): java.lang.VerifyError: com.ExtraCharge.ExactLogic08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at java.lang.Class.newInstanceImpl(Native Method)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at java.lang.Class.newInstance(Class.java:1429)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at android.os.Handler.dispatchMessage(Handler.java:99)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at android.os.Looper.loop(Looper.java:123)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at java.lang.reflect.Method.invokeNative(Native Method)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at java.lang.reflect.Method.invoke(Method.java:521)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-04 12:23:07.571: ERROR/AndroidRuntime(283):     at dalvik.system.NativeStart.main(Native Method)08-04 12:23:07.632: WARN/ActivityManager(58):   Force finishing activity com.ExtraCharge/.ExactLogic08-04 12:23:07.651: WARN/ActivityManager(58):   Force finishing activity com.ExtraCharge/.ExtraCharg08-04 12:23:07.951: INFO/ARMAssembler(58): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x3511c0:0x35127c] in 544577 ns08-04 12:23:08.150: WARN/ActivityManager(58): Activity pause timeout for HistoryRecord{44021928 com.ExtraCharge/.ExactLogic}08-04 12:23:09.370: INFO/Process(283): Sending signal. PID: 283 SIG: 908-04 12:23:09.400: INFO/ActivityManager(58): Process com.ExtraCharge (pid 283) has died.08-04 12:23:09.400: INFO/WindowManager(58): WIN DEATH: Window{44012078 com.ExtraCharge/com.ExtraCharge.ExtraCharg paused=true}08-04 12:23:09.511: WARN/InputManagerService(58): Got RemoteException sending setActive(false) notification to pid 283 uid 1003808-04 12:23:18.781: WARN/ActivityManager(58): Activity destroy timeout for HistoryRecord{44020e70 com.ExtraCharge/.ExtraCharg}08-04 12:23:18.833: WARN/ActivityManager(58): Activity destroy timeout for HistoryRecord{44021928 com.ExtraCharge/.ExactLogic}</code></pre>","398721","","6335","","2010-08-04 23:02:59","2010-08-04 23:02:59","please tell me about this exception","<android>","1","2","","",""
"3403038","1","","","2010-08-04 06:13:48","0","212","<p>Hi  i want to execute one method  and take some time and then ececute run another method.Is there any possibility for this in handler .Give me some suggestions.Thanks in advance.I am using the below code  in handlers but it is not working properly.</p><pre><code>            RefreshHandler extends Handler {    public void handleMessage(Message msg) {                    FirstLevelMaths.this.updateUI();        FirstLevelMaths.this.updateUI1();    }    public void sleep(long delayMillis) {        this.removeMessages(0);                 if(isUpdateUI)            sendMessageDelayed(obtainMessage(0), delayMillis);    }</code></pre><p>}</p><pre><code> private void updateUI(){    try    {        getimages();        mRedrawHandler.sleep(5000);    }    catch (Exception e) {        e.printStackTrace();    }    finally    {            System.gc();            System.runFinalization();    }}</code></pre><p>public void updateUI1() {    try    {        getimages1();        mRedrawHandler.sleep(5000);</p><pre><code>}catch (Exception e) {    e.printStackTrace();}finally{        System.gc();        System.runFinalization();}</code></pre><p>}</p><pre><code> public void updateUI1() {try{    getimages1();    mRedrawHandler.sleep(5000);}catch (Exception e) {    e.printStackTrace();}finally{        System.gc();        System.runFinalization();}</code></pre><p>}</p><p>I this getImages() and getimages1() are two methods  </p>","454808","","454808","","2010-08-04 09:06:59","2010-08-04 09:06:59","execute 2 methods one by one using handlers","<android>","1","2","","",""
"3403105","1","","","2010-08-04 06:29:55","0","400","<p>the account is not set , how to insert a new contact, and after inserted , the contact can be shown in the conatcts' application?</p>","408273","","","","","2011-02-27 18:51:39","I want to insert new contact into android contacts, that the account is not set","<android><contacts>","1","0","","",""
"3403134","1","3413178","","2010-08-04 06:34:22","0","224","<p>I was looking at the API, and Ive tried to determine this:</p><p>On a given port, check if it's available or already some application listens to it.</p><p>Thanks,</p><p>ray.</p>","260511","","","","","2010-08-05 09:02:10","Determine free ports","<android>","2","0","","",""
"3403204","1","","","2010-08-04 06:46:04","4","3508","<p>Now i want to use a ExpandableListView display my data , i want to change the itme left icon  or  let it disappear. can some on give me a suggestion . thx.</p>","404112","","683261","","2012-06-27 05:20:08","2014-02-18 01:07:29","how to change ExpandableListview left icon to others (android ExpandableListView)","<android>","4","0","1","",""
"3403209","1","3403224","","2010-08-04 06:46:45","-3","510","<p>How do I start a project wherein I can design an application which fetches weather forecasts from existing web sites?</p>","335429","","19746","","2010-08-04 07:00:22","2010-08-04 07:00:22","Creating a web service project","<android>","1","1","1","",""
"3403232","1","3403279","","2010-08-04 06:50:58","1","1334","<p>I create an application of user registration. When user registers in the application, I want to save the user data on an HTTP server. How can I do this?</p>","406494","","851273","","2012-06-15 06:51:57","2012-06-15 06:51:57","Connecting Android application to HTTP Server","<android><webserver>","1","0","1","",""
"3403290","1","","","2010-08-04 07:03:43","1","1873","<p>I am having two different data in two different adapters.Now i want to merge both data in a single adapter.is this possible??How can I do that?</p><p>Regards,</p><p>vani</p>","342873","","","","","2012-03-16 09:11:42","Merging adapters in android","<android>","1","1","","",""
"3403343","1","3403635","","2010-08-04 07:11:43","1","2680","<p>I was fooling around with Android and my Java knowledge is limited at best (for instance, I'm perplexed by the fact that it allows inline classes!?).</p><p>My question is as follows:</p><p>I have a layout where there are three dropdown menus. I initialise all three of them inside onCreate().</p><p>The first one takes its values from a string-array. The second one, however, depends on the choice of the first one and the third one depends on the choice of the second one in turn!</p><p>I have a few string-arrays for the second Spinner but I was wondering what would be the correct way to implement a list of successively enabled Spinners. I'm tempted to just hack into it and make it work but I don't want to run the risk of it being malformed and unstable.</p><p>So for example's sakes, my case is as if I had the <a href=""http://developer.android.com/guide/tutorials/views/hello-spinner.html"" rel=""nofollow"">Google Spinner tutorial</a> with an extra Spinner for the moons of each planet (and then maybe for craters on each of the moons).</p><p>In my resources, I have an arrays.xml such as:</p><pre><code>&lt;resources&gt;&lt;string-array name=""planets""&gt;    &lt;item&gt;Mercury&lt;/item&gt;    &lt;item&gt;Venus&lt;/item&gt;    &lt;item&gt;Earth&lt;/item&gt;    &lt;item&gt;Mars&lt;/item&gt;    &lt;item&gt;Jupiter&lt;/item&gt;    &lt;item&gt;Saturn&lt;/item&gt;    &lt;item&gt;Uranus&lt;/item&gt;    &lt;item&gt;Neptune&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""earth""&gt;    &lt;item&gt;The Moon&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""mars""&gt;    &lt;item&gt;Deimos&lt;/item&gt;    &lt;item&gt;Phobos&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""jupiter""&gt;    &lt;item&gt;Metis&lt;/item&gt;    &lt;item&gt;Adrasthea&lt;/item&gt;    &lt;item&gt;Amalthea&lt;/item&gt;    &lt;item&gt;Thebe&lt;/item&gt;    &lt;item&gt;Io&lt;/item&gt;    &lt;item&gt;Europa&lt;/item&gt;    &lt;item&gt;Ganymede&lt;/item&gt;    &lt;item&gt;Callisto&lt;/item&gt; [...] etc. etc. &lt;/resources&gt;</code></pre><p>In the onCreate method I initialise all  three:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  Spinner spinner1 = (Spinner) findViewById(R.id.planetSpinner);  Spinner spinner2 = (Spinner) findViewById(R.id.moonSpinner);  Spinner spinner3 = (Spinner) findViewById(R.id.craterSpinner);  spinner2.setEnabled(false);  spinner3.setEnabled(false);  ArrayAdapter adapter1 = ArrayAdapter.createFromResource(        this, R.array.planets, android.R.layout.simple_spinner_item);  adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);  spinner1.setAdapter(adapter1);  spinner1.setOnItemSelectedListener(new MyOnPlanetSelectedListener());}</code></pre><p>My listener class is</p><pre><code>public class MyOnPlanetSelectedListener implements OnItemSelectedListener {public void onItemSelected(AdapterView&lt;?&gt; parent,    View view, int pos, long id) {  Toast.makeText(parent.getContext()), ""The planet is "" +      parent.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show(); }public void onNothingSelected(AdapterView parent) {  // Do nothing.  }}</code></pre><p>So there it is. My question is where and how to implement the listeners for the successive Spinners so that they're enabled once the first one is selected. My first guess is:</p><pre><code>    public class MyOnPlanetSelectedListener implements OnItemSelectedListener {public void onItemSelected(AdapterView&lt;?&gt; parent,    View view, int pos, long id) {  Toast.makeText(parent.getContext()), ""The planet is "" +      parent.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show();  spinner2.setEnabled(true); }public void onNothingSelected(AdapterView parent) {  // Do nothing.  }}</code></pre><p>But obviously this is wrong since spinner2 is not encapsulated here.</p><p>Then, the successive spinners should pick a string-array for their adapters depending on what the choice of the Spinners before it are. I tried encapsulating the spinners in the activity class, in the constructor, but the application crashes before running.</p><p>Thank you very much in advance for your help.</p>","410433","","","","","2010-10-04 22:32:37","Enable a currently disabled Spinner in Android","<java><android><spinner>","2","0","","",""
"3403385","1","","","2010-08-04 07:17:00","0","1527","<p>First time poster, new to Android, and I seem to have hit a roadblock on this problem:</p><p>I'm creating a dynamic layout, consisting of several identical ""composite"" objects (these are basically ""floating"" LinearLayouts, each containing an icon (ImageView) and a caption (TextView)).  The (x,y) coordinates of each LinearLayout are subject to change, based on user actions, and require precise placement (ie: can't use RelativeLayout, etc), so I'm positioning them inside an AbsoluteLayout.</p><p>During onCreate(), I'm adding each of these objects as a child View inside an AbsoluteLayout object, then setting the (x,y) manually.  No problems so far, works great, initial layout is perfect.</p><p>The problem:</p><p>After the initial onCreate(), I can't get the (x,y) positions of these objects to change on the screen.  I can update their layoutParams, but the on-screen layout (inside the AbsoluteLayout) is never refreshed.  I've tried forceLayout(), invalidate(), requestLayout(), none of them work.</p><p>Is there a problem with my basic approach here, or is there something I'm just missing?</p><p>I'm thinking of changing to a SurfaceView and just doing the rendering the hard way, but my code works 99% great right now and I don't want to change it if I don't have to.  The only problem is that the layout manager simply refuses to register the position changes for my child objects.</p><p>Help, what am I doing wrong?</p>","410441","","","","","2010-08-04 08:19:31","Changing View properties after onCreate()","<android><layout><dynamic><oncreate><absolutelayout>","1","0","","",""
"3403413","1","","","2010-08-04 07:22:10","0","179","<p>I can't connect to OBDKey sometimes . I use BluetoothChat example to connect to OBDKey.I can connect to it and read data, but sometimes socket is closed.</p><pre><code>m = mmDevice.getClass().getMethod(""createRfcommSocket"", new Class[] { int.class });mmSocket = (BluetoothSocket) m.invoke(mmDevice, 1);mmSocket.connect();</code></pre><p>Before this OBDKey is paired succesfully. Why does socket close sometimes?</p>","410461","","12707","","2010-08-04 07:23:37","2011-09-13 21:03:07","Can't connect to OBDKey sometimes","<android><bluetooth>","1","0","","",""
"3403465","1","","","2010-08-04 07:32:28","9","16071","<p>I need to generate/trigger a long key press event of a button in Android.</p><p>Any help regrading this? </p>","405521","","68805","","2011-07-12 13:39:14","2014-03-09 04:02:42","Android long key press","<android>","2","0","6","",""
"3403566","1","","","2010-08-04 07:50:26","0","440","<p>Hi i am new to android , I hope so u guys will help me to obtain my requirement.</p><p>I am using an Android API Level 2.1</p><p>I need to create a new field such as user@domain not as e-mail format for every contacts. So i need to create a new MIME type now i got struck how to create this MIME type. Please help me to recover on implementing new MIME type to Contacts App.</p>","410399","","243782","","2010-08-04 07:53:35","2010-08-05 09:14:52","how to add new field (such as user@domain) in Contacts on Android API 2.1","<android>","1","2","","",""
"3403598","1","3405907","","2010-08-04 07:54:44","0","4202","<p>So, i'm trying to start activity by sweeping across the screen, it works fine for all the other screens, just this screen that doesn't fire the onTouch at all? Would you mind helping me? I've tried debugging it and still have no idea at all. Below are the codes, sorry for not putting snippets only as I thought I might did something wrong elsewhere   </p><p>Btw, I'm also looking for advice on implementing sweeping to change screen. I've read about ViewFlipper and I know it will work very well, but I've around 8 screens with different backend coding needed. Anyways, I really need advice on this.</p><p>Thanks alot!!</p><p>Alvin</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>    &lt;TextView android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:textSize=""20dip""            android:padding=""5dip"" android:textStyle=""bold"" android:text=""@string/skills"" /&gt;    &lt;TextView android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:padding=""5dip""            android:textSize=""12dip"" android:layout_marginLeft=""10dip""            android:text=""@string/proficiency"" /&gt;    &lt;LinearLayout android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:orientation=""horizontal""            android:gravity=""center""&gt;            &lt;Button android:id=""@+id/cSharp"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/cSharp"" /&gt;            &lt;Button android:id=""@+id/cLang"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/cLang"" /&gt;            &lt;Button android:id=""@+id/visualC"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/visualC"" /&gt;            &lt;Button android:id=""@+id/java"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/java"" /&gt;            &lt;Button android:id=""@+id/vb"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/vb"" /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:orientation=""horizontal""            android:gravity=""center""&gt;            &lt;Button android:id=""@+id/perl"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/perl"" /&gt;            &lt;Button android:id=""@+id/win"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/win"" /&gt;            &lt;Button android:id=""@+id/unix"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/unix"" /&gt;            &lt;Button android:id=""@+id/linux"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/linux"" /&gt;            &lt;Button android:id=""@+id/php"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/php"" /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:orientation=""horizontal""            android:gravity=""center""&gt;            &lt;Button android:id=""@+id/oracle"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/oracle"" /&gt;            &lt;Button android:id=""@+id/mysql"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/mysql"" /&gt;            &lt;Button android:id=""@+id/mssql"" android:layout_height=""60dip""                    android:layout_width=""80dip"" android:text=""@string/mssql"" /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" android:padding=""5dip""            android:orientation=""horizontal"" android:gravity=""bottom|right""&gt;            &lt;ImageButton android:id=""@+id/skillsPrevious""                    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                    android:background=""@null"" android:paddingRight=""3dip"" android:src=""@drawable/left"" /&gt;            &lt;ImageButton android:id=""@+id/skillsNext""                    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                    android:background=""@null"" android:src=""@drawable/right"" /&gt;    &lt;/LinearLayout&gt;</code></pre><p></p><pre><code>    private float oldTouchValue;    private FormDbAdapter mDbHelper;    private Long mRowId;    private Button cSharp, cLang, visualC, java, vb, perl, win, unix;    private Button linux, php, oracle, mysql, mssql;    private ImageButton nextButton, previousButton;    private LinearLayout skillsView;    @Override    protected void onCreate(Bundle savedInstanceState) {            // TODO Auto-generated method stub            super.onCreate(savedInstanceState);            mDbHelper = new FormDbAdapter(this);            mDbHelper.open();            setContentView(R.layout.skills);            cSharp = (Button)findViewById(R.id.cSharp);            cLang = (Button)findViewById(R.id.cLang);            visualC = (Button)findViewById(R.id.visualC);            java = (Button)findViewById(R.id.java);            vb = (Button)findViewById(R.id.vb);            perl = (Button)findViewById(R.id.perl);            win = (Button)findViewById(R.id.win);            unix = (Button)findViewById(R.id.unix);            linux = (Button)findViewById(R.id.linux);            php = (Button)findViewById(R.id.php);            oracle = (Button)findViewById(R.id.oracle);            mysql = (Button)findViewById(R.id.mysql);            mssql = (Button)findViewById(R.id.mssql);            nextButton = (ImageButton)findViewById(R.id.skillsNext);            previousButton = (ImageButton)findViewById(R.id.skillsPrevious);            skillsView = (LinearLayout)findViewById(R.id.skillsView);            mRowId = (savedInstanceState == null)? null:                    (Long)savedInstanceState.getSerializable(FormDbAdapter.KEY_ID);            if(mRowId == null){                    Bundle extras = getIntent().getExtras();                    mRowId = extras.getLong(FormDbAdapter.KEY_ID);            }            populateFields();            nextButton.setOnClickListener(onClick);            previousButton.setOnClickListener(onClick);            cSharp.setOnClickListener(onClick);            cLang.setOnClickListener(onClick);            visualC.setOnClickListener(onClick);            java.setOnClickListener(onClick);            vb.setOnClickListener(onClick);            perl.setOnClickListener(onClick);            win.setOnClickListener(onClick);            unix.setOnClickListener(onClick);            linux.setOnClickListener(onClick);            php.setOnClickListener(onClick);            oracle.setOnClickListener(onClick);            mysql.setOnClickListener(onClick);            mssql.setOnClickListener(onClick);            skillsView.setOnTouchListener(new View.OnTouchListener() {                    @Override                    public boolean onTouch(View v, MotionEvent event) {                            // TODO Auto-generated method stub                            switch(event.getAction()){                            case MotionEvent.ACTION_DOWN:                                    oldTouchValue = event.getX();                                    break;                            case MotionEvent.ACTION_UP:                                    if(event.getX() - oldTouchValue &lt; -200){                                            createIntent(true);                                            return true;                                    }else if(event.getX() - oldTouchValue &gt; 200){                                            createIntent(false);                                            return true;                                    }                            }                            return false;                    }            });    }    protected View.OnClickListener onClick = new View.OnClickListener() {            @Override            public void onClick(View v) {                    // TODO Auto-generated method stub                    switch(v.getId()){                    case R.id.skillsNext:                            createIntent(true);                            break;                    case R.id.skillsPrevious:                            createIntent(false);                            break;                    default:                            addSkillDialog(v.getId());                    }            }    };    /** direction = true =&gt; next page     *  direction = false =&gt; previous page*/    protected void createIntent(boolean direction){            if(direction){                    Intent i = new Intent();                    i.putExtra(FormDbAdapter.KEY_ID, mRowId);                    i.setClass(skills.this, languages.class);                    startActivityForResult(i, 0);            }else{                    setResult(RESULT_OK);                    finish();            }    }    /** Create custom dialog for user to input skills info.     * @param id: id of the button clicked by user. */    protected void addSkillDialog(int id) {            // TODO Auto-generated method stub            final Button button = (Button)findViewById(id);            AlertDialog.Builder builder = new AlertDialog.Builder(this);            AlertDialog alertDialog;            LayoutInflater inflater = (LayoutInflater)this.getSystemService(LAYOUT_INFLATER_SERVICE);            final View layout = inflater.inflate(R.layout.skillsdialog,                            (ViewGroup)findViewById(R.id.skillsDialogId));            builder.setView(layout);            final RadioGroup radioExp = (RadioGroup)layout.findViewById(R.id.radioExp);            final RadioGroup radioPro = (RadioGroup)layout.findViewById(R.id.radioPro);            Cursor c = mDbHelper.fetchSkills(mRowId, button.getId());            if(c.moveToFirst()){                    startManagingCursor(c);                    if(c.getString(c.getColumnIndexOrThrow(FormDbAdapter.KEY_SKILL_YEARS)).equals(""0"")){                            radioExp.check(R.id.zeroYear);                    }else if (c.getString(c.getColumnIndexOrThrow(FormDbAdapter.KEY_SKILL_YEARS)).equals(""1-2"")){                            radioExp.check(R.id.onetotwo);                    }else if (c.getString(c.getColumnIndexOrThrow(FormDbAdapter.KEY_SKILL_YEARS)).equals(""3-4"")){                            radioExp.check(R.id.threetofour);                    }else{                            radioExp.check(R.id.five);                    }                    if(c.getString(c.getColumnIndexOrThrow(FormDbAdapter.KEY_SKILL_PRO)).equals(""B"")){                            radioPro.check(R.id.B);                    }else if(c.getString(c.getColumnIndexOrThrow(FormDbAdapter.KEY_SKILL_PRO)).equals(""I"")){                            radioPro.check(R.id.I);                    }else{                            radioPro.check(R.id.A);                    }            }            builder.setTitle(button.getText().toString())            .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {                    @Override                    public void onClick(DialogInterface dialog, int which) {                            // TODO Auto-generated method stub                            String years = null;                            String pro = null;                            int expId = radioExp.getCheckedRadioButtonId();                            int proId = radioPro.getCheckedRadioButtonId();                            switch(expId){                            case R.id.zeroYear:                                    years = ""0"";                                    break;                            case R.id.onetotwo:                                    years = ""1-2"";                                    break;                            case R.id.threetofour:                                    years = ""3-4"";                                    break;                            case R.id.five:                                    years = ""&gt;5"";                            }                            switch(proId){                            case R.id.B:                                    pro = ""B"";                                    break;                            case R.id.I:                                    pro = ""I"";                                    break;                            case R.id.A:                                    pro = ""A"";                            }                            mDbHelper.newSkill(mRowId, button.getId(), pro, years);                            button.setTypeface(Typeface.DEFAULT_BOLD);                    }            })            .setNeutralButton(""Undo Selection"", new DialogInterface.OnClickListener() {                    @Override                    public void onClick(DialogInterface dialog, int which) {                            // TODO Auto-generated method stub                            mDbHelper.deleteSkill(mRowId, button.getId());                            button.setTypeface(Typeface.DEFAULT);                    }            })            .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {                    @Override                    public void onClick(DialogInterface dialog, int which) {                            // TODO Auto-generated method stub                            dialog.cancel();                    }            });            alertDialog = builder.create();            alertDialog.show();    }    /** Populate the fields in View if existed in database. */    protected void populateFields(){            Cursor c = mDbHelper.fetchAllSkills(mRowId);            while (c.moveToNext()){                    startManagingCursor(c);                    Button skillBtn = (Button)findViewById(c.getInt(c.getColumnIndexOrThrow(FormDbAdapter.KEY_SKILL_NAME)));                    skillBtn.setTypeface(Typeface.DEFAULT_BOLD);            }    }    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {            // TODO Auto-generated method stub            super.onActivityResult(requestCode, resultCode, data);            switch (resultCode){            case MainPage.ACTIVITY_BACK:                    populateFields();                    break;            case MainPage.ACTIVITY_DONE:                    setResult(MainPage.ACTIVITY_DONE);                    finish();            }    }    @Override    protected void onResume() {            // TODO Auto-generated method stub            super.onResume();            populateFields();    }    @Override    protected void onSaveInstanceState(Bundle outState) {            // TODO Auto-generated method stub            super.onSaveInstanceState(outState);            outState.putSerializable(FormDbAdapter.KEY_ID, mRowId);    }</code></pre>","410487","","","","","2010-08-04 13:21:34","Android: onTouch not called","<android>","1","2","","",""
"3403770","1","3405738","","2010-08-04 08:22:22","0","1334","<p>friends,</p><p>i am trying to display image from gallerynow i want to put check if selected file is image then it should be displayed.</p><p>using following code any one help me out how to achieve this?</p><p>User can select video file, image file etc.. anything so i want to allow only images.</p><pre><code>ON button click  private void SelectImageFromGallery()            {                 startActivityForResult(new Intent(Intent.ACTION_PICK,                 android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI),0);            } @Override            protected void onActivityResult(int requestCode, int resultCode, Intent data)             {                   switch( resultCode )                {                    case 0:                        Log.i( ""MakeMachine"", ""User cancelled"" );                        break;                    case -1:                        _data = data;                        ShowImageInActivity();                        break;                }            }</code></pre>","249991","","","","","2012-05-01 19:32:49","how to check selected file is an image?","<android><image-processing>","1","0","","",""
"3403841","1","3405334","","2010-08-04 08:34:26","0","558","<p>My MAIN activity is spawning a child activity that contains a <code>ListView</code>.  While this <code>ListView</code> is being populated (through an <code>AsyncTask</code>), an indeterminate progress bar is shown.</p><p>However, assuming that I am an impatient user and I press the BACK button, the progress bar is cancelled but I am left with a blank screen. I have to press BACK one more time to go back to the MAIN activity.</p><p>I would like the app to go back directly to the MAIN activity by pressing BACK only once. Can somebody point me in the right direction?  I am thinking I should call <code>finish()</code> somewhere but I don't know where to put it. Thanks in advance!</p>","395576","","","","","2012-04-05 14:24:11","How do I return to a calling activity if the user presses BACK?","<android><activity>","3","0","","",""
"3403885","1","","","2010-08-04 08:40:30","4","3929","<p>I'm trying to  retrieve the password of google account, but gettingsecurity exception at String pwd = AccountManager.get(mContext).getPassword(account).Also i have given permissions in androidManifest.xml toaccount_manager, aunthenticator, get_account, manage account.</p><h1>code :</h1><pre><code>android.accounts.Account[] gaccounts = AccountManager.get(mContext).getAccounts();Log.i(""parul"", ""2222()len :""+ gaccounts.length);for (android.accounts.Account account: gaccounts) {   String pwd = AccountManager.get(mContext).getPassword(account);   Log.i(""parul"", ""google pwd: "" + pwd);   AccountManager.get(mContext).setPassword(account, null);   String pwdcleared = AccountManager.get(mContext).getPassword(account);   Log.i(""parul"", ""google pwdcleared: "" + pwdcleared);}</code></pre><p>=============================================================================</p><h1>Exception:</h1><p>08-04 06:38:30.821: WARN/AccountManagerService(2248): caller uid 1000is different than the authenticator's uid</p><p>08-04 06:38:30.821: INFO/parul(2804): exception thrown for accountmanager try block</p><p>08-04 06:38:30.821: WARN/System.err(2804): java.lang.SecurityException: caller uid 1000 is different than theauthenticator's uid</p><p>08-04 06:38:30.821: WARN/System.err(2804):     atandroid.os.Parcel.readException(Parcel.java:1218)</p><p>08-04 06:38:30.821: WARN/System.err(2804):     atandroid.os.Parcel.readException(Parcel.java:1206)</p><p>08-04 06:38:30.821: WARN/System.err(2804):     atandroid.accounts.IAccountManager$Stub$Proxy.getPassword(IAccountManager.java:397)</p><p>08-04 06:38:30.821: WARN/System.err(2804):     atandroid.accounts.AccountManager.getPassword(AccountManager.java:157)</p><p>=============================================================================</p><p>If anybody is aware why i'm getting this problem plz help.Thanks</p>","400301","","229106","","2010-08-04 08:48:40","2011-07-13 15:59:57","SecurityException in getPassword of accountManager in android","<android><google-account><accountmanager><getpasswd>","2","0","2","",""
"3404024","1","3413438","","2010-08-04 09:00:52","1","86","<p>I need to have a layout that has a view above a set of tabs. I've gotten the tabs working fine, but as soon as I try to add a view outside of them I'm left with that view and no visible tabs.</p><p>This works fine:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TabHost         android:id=""@android:id/tabhost""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_weight=""1""&gt;        &lt;LinearLayout  ... /&gt;</code></pre><p>But this doesn't:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TextView  ... /&gt;  &lt;!--  THIS LINE HERE!!!  --&gt;    &lt;TabHost         android:id=""@android:id/tabhost""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_weight=""1""&gt;        &lt;LinearLayout  ... /&gt;</code></pre><p>What can I do to make my tabs co-exist with other views?</p><hr><p>For the sake of completeness, my Activity extends <a href=""http://developer.android.com/reference/android/app/TabActivity.html"" rel=""nofollow"">TabActivity</a>.</p>","76835","","","","","2010-08-05 09:37:35","How to have Android tabs coexisting with other views?","<android><gui>","2","0","","",""
"3404072","1","3460721","","2010-08-04 09:07:47","1","938","<p>Is there anyone using git in such a fashion? </p><p>I would like to distribute some <strong>multimedia</strong> content from a server to some <a href=""http://www.archos.com/products/ht/archos_7/index.html?country=it&amp;lang=it"" rel=""nofollow"">Android remote devices</a>. I would like them sending back a log file with device usage statistics (provided by an android app I will write).</p><p>The server could be anything but I would prefer a linux box.</p><p>I thought that since git handle and sych only differences between files, It would be a nice tool for this purpose and I would have content revision history as a bonus.</p><p>I need some piece of advice on how the repositories architecture could be organized: does It have to be a star topology or something different?</p><p>The remote end of the sistem don't need any interactivity, in other words the remote git repository could pull and push whatever It needs to, autonomously and automatically.</p><p><strong>UPDATE:</strong> I've found <a href=""http://stackoverflow.com/questions/1863491/how-to-use-git-as-content-distribution-network"">here</a> on SO the author of git internals (I'm downloading It right now), Scott Chacon talking about the architecture I would like to implement. </p><p><strong>UPDATE 2:</strong> OK I read the chapter about ""Non-SCM uses of Git"" and here is what the author says about a Peer to Peer CDN:</p><blockquote>  <p>You have to get new content [...]  consist of any combination of xml  files, images, animations, text and  sound. You need to build a content  distribution framework that will  easily and efficiently transfer all  the necessary content to the machines  on your network. You need to  constantly determine what content each  machine has and what it needs to have  and transfer the difference as  efficiently as possible.[...]   It turns out that Git is an  excellent solution to this problem.</p></blockquote><p>I don't find anything about mentioning little portions of the book inside it, so I hope that I'm not violating any copyright. In any case I will delete It if someone complain.</p>","204159","","204159","","2010-08-04 15:43:37","2010-08-11 16:45:02","Git for Peer to Peer content distribution network","<android><git><cdn>","3","4","1","",""
"3404080","1","3404144","","2010-08-04 09:08:22","1","776","<p>Maybe you remember the draggable window in android donut. You have something like a tab. If you tap on this tab with your finger a window slides up an reveals all the applications that are installed on your android phone. </p><p>Has anyone an idea how to realize this in a layout?</p>","401025","","114066","","2010-08-04 09:32:54","2010-08-04 09:32:54","Android Layout, move window","<android><slidingdrawer>","1","0","","",""
"3404251","1","","","2010-08-04 09:34:03","3","2909","<p>I trying to do XML parsing program.I also used <strong>FileInputStream</strong> for my XML file.I placed XML file under android's assets folder,META-INF folder.That's file name is ""container.XML"".</p><p>Here is my code parseXML,</p><pre><code> public void parseXMLinfoBook() throws FileNotFoundException, ParserConfigurationException, SAXException{        FileInputStream in = new FileInputStream(""file:///android_asset/META-INF/container.xml"");        StringBuffer inLine = new StringBuffer();        InputStreamReader isr = new InputStreamReader(in);        BufferedReader inRd = new BufferedReader(isr);        SAXParserFactory spf=SAXParserFactory.newInstance();        SAXParser spr=spf.newSAXParser();        XMLReader xmlreader = spr.getXMLReader();        XmlHandler xmlhe=new XmlHandler();        xmlreader.setContentHandler(xmlhe);        }</code></pre><p>Here is Button.SetonClick code,</p><pre><code>public void onClick(View v) {                // TODO Auto-generated method stub                try {                    parseXMLinfoBook();                } catch (FileNotFoundException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                    tv.setText(""ErrorPath ""+e.getMessage());                } catch (ParserConfigurationException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } catch (SAXException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }        });</code></pre><p>I got only error message.Hope help!</p>","389389","","","","","2010-08-04 10:01:20","Android File Path NOT Found","<android>","1","1","","",""
"3404289","1","","","2010-08-04 09:39:59","2","2988","<p>I am new to android,i need to zoom an selected imageview given statically in array defined in my code how can i get it.Thanks in advance </p>","407506","","","","","2010-08-04 12:56:46","Setting zoom controls for Image View","<android>","1","0","","",""
"3404314","1","","","2010-08-04 09:43:02","5","3583","<p>I need in my Android Application the Distance and the Driving Time between Two cities.</p><p>Is there a possibility to calculate this things for example via Google Navigator or Google Maps? (the driving distance, not the air-line distance)</p>","408699","","","","","2012-07-11 06:22:46","Android - Distance between two Cities","<android><maps><location><distance><navigator>","2","0","4","",""
"3404348","1","","","2010-08-04 09:48:52","8","849","<p>I'm in need to serializing a comprehensive application (game) state to be transmitted over a network or saved to disk and retrieved at a later time.</p><p>Bundles, of course, are used to save/restore states in several use cases, so using them would be ideal. However, for some reason, Bundle isn't serializable.</p><p>Searching for a solution has only turned up the unacceptable hack of turning the Bundle into a Parcel and then marshalling that, but it is not an acceptable solution because there is no guarantee that it will be possible to unmarshall the data at a later date or on a remote device.</p><p>So as it looks now, the only solution appears to be to get the entire set of keys from the Bundle, get each contained Object, do a rather huge switch/case on each Object.Class and manually construct a giant ByteBuffer or similar from all this data, along with size and type information in order to successfully reconstruct the whole thing on the other side.</p><p>Not exactly smooth.</p><p>Does anyone know of a better way? Perhaps someone has already created a utility function for Bundle that does this?</p>","349189","","","","","2010-08-04 09:59:24","Serializing Android Bundle for network and/or persistent storage?","<android><bundle>","1","1","1","",""
"3404573","1","3404621","","2010-08-04 10:21:15","1","605","<p>I have a listview say in this instance has the values:</p><p>UK,USA,FRANCE</p><p>These values are pulled from a static array held within my string.xml file. Additionally, within the string.xml is 3 arrays each referring to UK, USA and FRANCE &amp; basically I want to load these arrays into a new listview depending on the users onclick event.</p><p>Essentially I dont know how to pass the users selection to the new listview and populate accordingly. I know the process incorporates the use of an intent but being an android newbie I am not exactly sure how!   </p><p>Any help is much appreciated! </p><p>Cheers    </p>","397085","","","","","2010-08-04 10:30:48","Display android listview based upon listview selection","<android><listview><android-intent>","1","0","","",""
"3404582","1","","","2010-08-04 10:22:47","12","29144","<p>Hi I have one ImageView. I want to show this image view for showing some message in fancy way. So I want to add text to that ImageView. Can Anybody tell me how can I do this.</p>","360538","","21234","","2010-08-04 10:37:14","2014-03-02 23:23:21","Adding text to ImageView in Android","<android><text><imageview>","10","0","4","",""
"3404658","1","3405670","","2010-08-04 10:36:12","0","1578","<p>My problem is, that I have got a TabActivity, which has 4 Tabs right now. The first Tab is a special Details-Tab, where the user could modify some data.</p><p>The problem is, that if I add a OptionsMenu for the Activity, that the OptionsMenu is appearing on every Tab.I tried to check the current <strong>mTabHost.getCurrentTabTag()</strong> in the <strong>onCreateOptionsMenu</strong> but that changed nothing.So, how to do that?</p><p>(The following code, which still shows the OptionsMenu on every Tab)</p><pre><code> public boolean onCreateOptionsMenu(Menu menu) {      if(mTabHost.getCurrentTabTag()==getString(R.string.tab_details)) {   boolean result = super.onCreateOptionsMenu(menu);   menu.add(0, EDIT_ID, 0, R.string.menu_edit).setIcon(R.drawable.edit);   return result;  }      return true; } public boolean onMenuItemSelected(int featureId, MenuItem item) {  switch (item.getItemId()) {       case EDIT_ID: {           Toast.makeText(this, ""o.O"", Toast.LENGTH_LONG).show();          }  }  return super.onMenuItemSelected(featureId, item); } </code></pre>","381036","","","","","2011-09-07 07:21:39","Optionsmenu in an TabActivity for a specific Tab","<android><menu><tabactivity>","1","2","","",""
"3404724","1","","","2010-08-04 10:44:29","2","428","<p>I created one login screen but before login screen to appear I wanted a image to flash on the screen. For this I use Toast.But the problem is before flashing the Image Login screen appears for a while and the image flashes after that again Login Screen appears. I wants to flash the image first before any thing appears in the screen. Here is my code :</p><pre><code>    setContentView(R.layout.main);    ImageView iv = new ImageView(this);    iv.setImageDrawable(getResources().getDrawable(R.drawable.start));    Toast t = new Toast(this);    t.setView(iv);    t.show();    t.setDuration(5);</code></pre><p>ThanksDeepak</p>","406494","","","","","2010-08-09 11:46:38","Login Screen blinks with Toast","<android>","2","0","","",""
"3404886","1","3404959","","2010-08-04 11:04:39","1","2613","<p>So I've recently completed <a href=""http://www.screaming-penguin.com/node/7742"" rel=""nofollow"">this tutorial</a> and it works great, but I'm a little stuck on reading the data from my database.</p><p>I'm now reading from the database file thanks to <a href=""http://stackoverflow.com/users/238123/orsol"">Orsol</a> by using <a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/"" rel=""nofollow"">this tutorial</a> but I'm looking now for a method I can call which will return me the values of a given field. Or at least a method that let's me execute SQL.</p><p>The closest I have is by calling this:</p><pre><code>public List&lt;String&gt; SelectAll(){    List&lt;String&gt; list = new ArrayList&lt;String&gt;();    Cursor cursor = myDataBase.rawQuery(""SELECT * FROM androidtable"", null);    if (cursor.moveToFirst())    {        do        {        list.add(cursor.getString(0));         }        while (cursor.moveToNext());    }    if (cursor != null &amp;&amp; !cursor.isClosed())    {        cursor.close();    }    return list;}</code></pre><p>But this just throws a SQLiteException:</p><blockquote>  <p>android.database.sqlite.SQLiteException: no such table: androidtable: , while compiling: SELECT * FROM androidtable</p></blockquote><p>I do however know that I am loading the correct file (which does have this table), as if I change the directory path or database name, it will fire a run time error.</p><p>Can anyone help?</p><p>Thanks</p>","143979","","143979","","2010-08-04 14:31:23","2010-08-04 14:31:23","Executing SQL in SQLite on the Android SDK","<java><android><sqlite><android-emulator>","1","0","","",""
"3405081","1","","","2010-08-04 11:36:14","4","1110","<p>I intend to develop an app on android that can help people selecting the best pizza/ice cream/hot dog in a certain town based on their ratings through a poll.</p><p>Now what resources do I need to achieve the desired solution? Do I need a web service or website/device connectivity for the desired poll? I would like to start off with a simple application that just shows polls or ratings for a certain item.</p><p>Can somebody shed some light on this idea?</p>","2355649","","61974","","2010-08-04 11:38:23","2010-08-10 12:34:40","Any guidelines to create a polling app on android?","<android>","2","0","2","",""
"3405109","1","","","2010-08-04 11:39:36","1","2917","<p>I am loading some sequence of pages while the user swipes/flings on the webview, using the animation effect of the viewflipper - to bring that iphone transition effect.</p><p>I have two webviews added to a viewflipper.</p><p>Added setOnTouchListener to both the webviews and using gesture detector for fling.</p><p>After detecting the fling direction, I am setting the next/previous page and then calling the flipper's shownext/showprevious.</p><p>What happens is that the webview is not showing the content whatever that I pass through loadDataWithBaseURL ? - it shows the old content.</p><p>If I remove the touch listener(setOnTouchListener), and add a button to navigate, then the same process/logic works.</p><p>My code is similar to this one - <a href=""http://pastie.org/1065119.txt"" rel=""nofollow"">http://pastie.org/1065119.txt</a></p><p>why this is happening ? could anyone help me out ?</p>","410694","","","","","2010-12-04 22:40:29","when a setOnTouchListener is set to webview - loadDataWithBaseURL does not work or shows the same old content","<android><webview><touch><listener>","2","0","1","",""
"3405161","1","3405348","","2010-08-04 11:46:09","5","1753","<p>How do you use the Android default font sizes in xml?</p><p>I tried:</p><pre><code>android:textAppearance=""@android:style/TextAppearance_Large""</code></pre><p>But I get:</p><blockquote>  <p>error: Error: No resource found that  matches the given name (at  'textAppearance' with value  '@android:style/TextAppearance_Large').</p></blockquote>","143378","","","","","2013-04-17 01:55:46","Using default font styles in Android","<android><text><coding-style><android-layout>","1","0","3","",""
"3405183","1","","","2010-08-04 11:49:51","1","886","<p>Hi i want to display the number of images according to one number.That means if number is 1 i want to displat only one imageview in grid,if number is 3 i want to display the 3 images in grid .But i take only one image that means depending on the number  that image will be displayed th</p>","454808","","","","","2011-02-03 08:07:30","Display the grid view images according to a number","<android>","1","0","","",""
"3405189","1","","","2010-08-04 11:50:25","1","547","<p>I have two list, that need to be processed and displayed, I have used the following technique -</p><p>I get the data from 2 sources, process it and have 2 Custom Adapters, that take the data and place it in the relvant View.</p><p>However I only can view one list (the one at the top of in the view xml) - and not the other one,</p><p>Can someone please help me fix this prob. Its driving me insane.</p><p>Main Activity code belwo:</p><pre><code>   public class TestList extends Activity {   private final static String TAG = ""ListSample"";   private List&lt;String&gt; items;   private List&lt;String&gt; items2;   private CustomTeamListAdapter m_adapter;   private CustomTeamListAdapterTwo t_adapter;   public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      items = new ArrayList&lt;String&gt;();      for (int i = 0; i &lt; 20; i++) {         items.add(i + ""|||&gt;&gt;"");      }      ListView list = (ListView) findViewById(R.id.customlist);      this.m_adapter = new CustomTeamListAdapter(this, R.layout.listitem,            (ArrayList&lt;String&gt;) items);      list.setAdapter(m_adapter);      /******************************************************************************/      items2 = new ArrayList&lt;String&gt;();      for (int i = 0; i &lt; 20; i++) {         items2.add(i + ""&gt;&gt;----"");      }      ListView list_two = (ListView) findViewById(R.id.customlisttwo);      this.t_adapter = new CustomTeamListAdapterTwo(this, R.layout.listitem,            (ArrayList&lt;String&gt;) items2);      list_two.setAdapter(t_adapter);   }   private class CustomTeamListAdapter extends ArrayAdapter&lt;String&gt; {      private ArrayList&lt;String&gt; items;      public CustomTeamListAdapter(Context context, int textViewResourceId,            ArrayList&lt;String&gt; items) {         super(context, textViewResourceId, items);         this.items = items;      }      public View getView(int position, View convertView, ViewGroup parent) {         View v = convertView;         LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);         v = vi.inflate(R.layout.listitem, null);         String o = items.get(position);         if (o != null) {            TextView tt = (TextView) v.findViewById(R.id.sampletext);            tt.setText(o + ""FirstSet"");            tt.setId(position);         }         return v;      }   }   private class CustomTeamListAdapterTwo extends ArrayAdapter&lt;String&gt; {      private ArrayList&lt;String&gt; items;      public CustomTeamListAdapterTwo(Context context, int textViewResourceId,            ArrayList&lt;String&gt; items) {         super(context, textViewResourceId, items);         this.items = items;      }      public View getView(int position, View convertView, ViewGroup parent) {         View v = convertView;         LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);         v = vi.inflate(R.layout.listitem, null);         String o = items.get(position);         if (o != null) {            TextView tt = (TextView) v.findViewById(R.id.sampletext);            tt.setText(o + ""SecondSet"");            tt.setId(position);         }         return v;      }   }}</code></pre><p>Main layout XML below</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""   android:orientation=""vertical"" android:layout_width=""fill_parent""   android:layout_height=""fill_parent""&gt;   &lt;ListView android:id=""@+id/customlisttwo""      android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;   &lt;TextView android:id=""@+id/randomtext"" android:layout_width=""fill_parent""      android:layout_height=""wrap_content"" android:background=""#CCCCCC""      android:text=""Random Text"" /&gt;   &lt;ListView android:id=""@+id/customlist"" android:layout_width=""fill_parent""      android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Item Layout</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""   android:orientation=""vertical"" android:layout_width=""fill_parent""   android:layout_height=""fill_parent""&gt;   &lt;ListView android:id=""@+id/customlisttwo""      android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;   &lt;TextView android:id=""@+id/randomtext"" android:layout_width=""fill_parent""      android:layout_height=""wrap_content"" android:background=""#CCCCCC""      android:text=""Random Text"" /&gt;   &lt;ListView android:id=""@+id/customlist"" android:layout_width=""fill_parent""      android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Thanks in advance for your thoughts</p>","410718","","867603","","2011-10-06 09:41:21","2011-10-06 09:41:21","Android - Multiple lists not showing","<android><listview><listadapter>","1","1","1","",""
"3405211","1","","","2010-08-04 11:53:29","11","20304","<p>I have 9 listviews which should come under single activity. All the lists may/maynot display at a time on the screen (all at a time is nice)</p>","410720","","201393","","2010-08-04 11:56:34","2014-03-07 12:47:47","How to use multiple listviews in a single activity on android?","<android>","3","2","6","",""
"3405257","1","","","2010-08-04 11:59:21","1","492","<p>I have a problem with the Android emulator. After I run my application on a device it disappear from DDMS at some moment with no reason, even if it is still started. The only way to run again is to close the previous emulator and reopen it by running my application.</p><p>Do you have any solution for this strange error ? I must say that I can't deactivate my firewall if that is the problem. Also I tried to reset ADB but still doesn't work.</p>","410726","","","","","2012-02-15 10:01:01","ECLIPSE ANDROID DEVICES DISAPPEAR","<android>","1","4","","",""
"3405369","1","3405410","","2010-08-04 12:15:35","1","789","<p>I want to get the index of the Selected Item ( Clicked ) in a ListView.</p><p>Can any one please tell me?</p><p>ThanksDeepak</p>","406494","","","","","2010-08-04 12:21:03","getting the index of clicked item in a listview","<android>","1","0","","",""
"3405468","1","3405489","","2010-08-04 12:29:45","1","8542","<p>Can I apply zoom control in imageview </p>","410757","","940096","","2011-11-21 11:47:30","2011-11-21 11:47:30","Android: Can I use a zoom control in an imageview?","<android><zooming>","3","0","3","",""
"3405579","1","","","2010-08-04 12:43:11","0","2302","<p>I am tring to invote internal media player of android from my activity.Seems there is some problem in menifest file .</p><p>Please look into this issue .</p><p>08-04 18:08:47.825: ERROR/AndroidRuntime(1386): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file:///sdcard/audiodata.wav }</p>","410777","","21234","","2010-08-04 12:47:01","2010-11-17 16:06:32","Activity found to handle Intent","<android><android-manifest>","1","0","","",""
"3405916","1","3406102","","2010-08-04 13:22:57","1","993","<p>Can anybody give me some clue that how to convert binary string into a string(english). I have tried and googled so much but couldn't find an answer.</p><p>Here is my code:</p><pre><code>InputStream iStream = getApplicationContext().getResources().openRawResource(R.raw.map);InputStreamReader input;String line = """";//char character[] = null;//String res = """";input = new InputStreamReader(iStream); BufferedReader bf = new BufferedReader(input);Log.i(""Helloo i am above variable"", ""Variable"");try {    line = bf.readLine();} catch (IOException e) {    // TODO Auto-generated catch block    e.printStackTrace();}Log.i(""hello helloo"", line.toString());</code></pre><p>Thanks in advance.</p>","397901","","2598","","2010-08-04 13:28:47","2010-08-04 13:42:14","how to convert binary string data into String in android","<java><android>","1","5","0","",""
"3405928","1","3406005","","2010-08-04 13:25:06","11","27571","<p>This should be simple, but I have tried if statements checking for null values and also ones checking the .length of it:</p><pre><code>EditText marketValLow = (EditText) findViewById(R.id.marketValLow);            EditText marketValHigh = (EditText) findViewById(R.id.marketValHigh);            if (marketValLow.getText().length() != 0 &amp;&amp; marketValHigh.getText().length() != 0) {                Intent intent = new Intent();                intent.setClass(v.getContext(), CurrentlyOwe.class);                startActivity(intent);            } else {                Toast.makeText(CurrentMarketValue.this, ""You need to enter a high AND low."", Toast.LENGTH_SHORT);            }</code></pre><p>But it doesn't detect nothing was entered. Any ideas?</p><p>Thanks!</p>","312390","","","","","2014-02-01 21:36:48","How to check if EditText has a value in Android / Java","<java><android>","7","0","4","2013-03-08 12:11:03",""
"3405935","1","3578239","","2010-08-04 13:25:50","2","1823","<p>Is there a way to attach dynamic adapter to EditText?</p><p>What I want is - when a key is pressed on EditText, my code to do a search in (some) custom store and provide suggestions (instead of static Xml-list or array). This store is not a database; I think CursorAdapter is for database results only. Example code snippets are welcomed.</p>","229106","","229106","","2010-08-26 18:27:35","2010-08-26 18:27:35","Dynamic data for Adapter attached to EditText","<android><autocomplete><adapter><edittext>","1","2","4","",""
"3406260","1","3407018","","2010-08-04 13:59:29","3","1488","<p>There are few built in ways to invoke a timer using the Android stack,A good example is the Chronometer. (http://developer.android.com/reference/android/widget/Chronometer.html)</p><p>I would like to integrate piece of code (A thread)that implements timer using the Thread.sleep() method</p><p>I plan to have a Service tat invoke this thread and communicate with it.</p><p>Are there any disadvantages of using the sleep() method over Chronometer?</p>","381211","","","","","2010-08-04 15:20:02","Android sdk & timers (Chronometer vs. Thread)","<java><android><multithreading><timer>","1","0","","",""
"3406354","1","","","2010-08-04 14:10:09","0","182","<p>Can we able to store recorded files in hidden form apart from SDcard in android.It should be shown only to particular user and third party should not open the recorded files(ie-songs,images,messages)</p>","410871","","410871","","2010-08-12 14:43:52","2010-08-16 13:50:15","Android Storing AV files","<android>","1","2","","",""
"3406498","1","3406971","","2010-08-04 14:27:21","7","3009","<p>For example, I want my users to be able to click a button ""Get new quote"" which will start a new row in the the database for data to start being stored, but I'm unsure of how to store activity independent (or cross activity) data, like the _id of the row, which I will need to requery and update the row when new data becomes available on subsequent activities. What's the name of this mechanism and how is it done?</p>","312390","","851273","","2012-06-15 15:17:31","2012-06-15 15:17:31","What's the closest equivalent to a Session / Cookie variable in Android?","<java><android><sqlite><session>","1","1","7","",""
"3406534","1","3444882","","2010-08-04 14:30:57","80","11380","<p>When an EditText is in password mode, it seems that the hint is shown in a different font (courrier?). How can I avoid this? I would like the hint to appear in the same font that when the EditText is not in password mode.</p><p>My current xml:</p><pre><code>&lt;EditText android:hint=""@string/edt_password_hint""android:layout_width=""fill_parent""android:layout_height=""wrap_content"" android:password=""true""android:singleLine=""true"" /&gt;</code></pre>","143378","","143378","","2010-08-04 19:26:36","2013-10-11 06:13:39","Password hint font in Android","<android><fonts><passwords><edittext>","9","1","15","",""
"3406581","1","3406632","","2010-08-04 14:35:13","6","4127","<p>Is the assets folder only accessible to the app or can the user see it too? For my app I want to store a credential certificate and video files on local storage but I am not sure how to hide these items from the users. The assets folder seems like the only choice.</p>","366539","","","","","2010-08-04 14:40:22","Security of Android assets folder","<android><security><assets>","1","0","","",""
"3406587","1","","","2010-08-04 14:35:26","1","471","<p>I have an Activity running as a Theme.Dialog. Can I set its title to an ""ellipsize"" style? Currently, the text is being populated in onCreate() with setText(). There's no this.setEllipsize() like on TextView.</p><p>Or, is my only option to write <a href=""http://blog.androgames.net/10/custom-android-dialog/"" rel=""nofollow"">a Custom Dialog</a> and set the title style there? I'd like to know if that's possible before heading down that path.</p>","213345","","","","","2013-08-01 09:26:03","Can I ellipsize a dialog title?","<android><dialog><title>","2","2","","",""
"3406704","1","3436000","","2010-08-04 14:48:01","1","691","<p>I have an app which uses a large amount of data which has been compiled outside the app (on my main PC). The app is for my personal use so there are no complications with having to distribute data updates to other users. However, I am currently following a very convoluted and time-consuming procedure each time I want to update the data, and I wonder if anyone can suggest any ways to streamline it.</p><p>The procedure I follow whenever I want to add new data is as follows:</p><ul><li><p>I enter the new data into a csv file which I maintain as the source of the relevant table in the database</p></li><li><p>I use SQLite Database Browser to import the data into an existing SQLite database. (This program does not seem to have the ability to append imported data into an existing table, so whenever a table needs updating I have to delete the existing table, then import data from the csv file into a new table, then manually edit the data types for all the fields in the table.)</p></li><li><p>I drag the icon for the database file onto the 'assets' folder of my project in Eclipse.</p></li><li><p>I export the project from Eclipse as an apk file.</p></li><li><p>I copy the apk file to my phone</p></li><li><p>(using Astro File Manager) I uninstall the old version of the app and install the new apk.</p></li><li><p>when the app is run, code based on the example set out <a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/"" rel=""nofollow"">here</a> copies the data from the 'assets' folder into the app's data folder; this means that each byte of data takes up two bytes in the phone's internal memory; at present this is not a problem, but could be as the volume of data grows; I wonder if there is a more memory-efficient method?</p></li></ul><p>I should be very grateful for any guidance.</p>","250845","","","","","2010-08-09 06:07:52","How to update a database used as a source of data by an Android app","<android><database><sqlite>","2","0","","",""
"3406733","1","","","2010-08-04 14:50:52","2","1400","<p>How can I open a context menu for a view without registering it using <code>registerForContextMenu()</code>?</p><p>My activity overrides <code>onTouchEvent</code> to detect motion, and if I use <code>registerForContextMenu()</code> it stops working. I'm detecting a long press, so I'd like to forward that request to a method that would build the menu for me, but don't know if it can work that way.</p>","35501","","35501","","2010-08-04 16:14:51","2013-11-29 11:21:47","Opening a context menu without registering the view","<android><view><contextmenu>","2","1","","",""
"3406782","1","3406932","","2010-08-04 14:57:14","1","758","<p>I have a database with a field for a stored date. I would like to be able calculate the days between the recorded date and today.</p><p>I ended up using:</p><pre>mDb.execSQL(""UPDATE ""+DATABASE_PLANTS_TABLE+"" SET ""+ KEY_PLANT_DAYS+             "" = (SELECT julianday('now') - julianday(""+KEY_DATE+"") FROM""+ DATABASE_PLANTS_TABLE+"")"");</pre>","393328","","393328","","2010-08-22 17:07:37","2010-08-22 17:07:37","How do I calculate days since a record entry? Android, SQLite, Java","<java><android><sqlite3>","2","0","","",""
"3406871","1","3407528","","2010-08-04 15:05:15","1","1284","<p>I have an edit text and I'd like to put the following constrains (in the XML code if possible):</p><ul><li>Disable all the capital Letters (the inverse of android:capitalize or the same fonction than toLowerCase())</li><li>Block to EditText to 1 line max. (for instance avoid that when I press enter the editTextget bigger to create a new line)</li></ul><p>In fact , my editText is a Search Field (but in my case I don't want to use the special Search Widget).</p><p>Thanks</p>","400695","","","","","2011-11-06 17:41:14","Put constrains to an EditText","<android><edittext>","2","0","","",""
"3406910","1","3408641","","2010-08-04 15:09:44","1","2292","<p>I have searched for quite a few hours and have not been able to find a concise definite andswer to my question. I have an application where I need to draw a sports field (including all pitch lines) to the screen. So far, I have extended the SurfaceView and pretty much copied the rest of the LunarLander demo as well.All the data the application requires to draw the pitch to the correct dimensions is being received from a socket which works fine too. However, at the minute in the onDraw() function, I am drawing all lines each frame which is causing a fairly slow framerate in the emulator (e.g. ~10fps). Here is my onDraw() function:</p><pre><code>@Overridepublic void onDraw(Canvas canvas) {canvas.drawARGB(255,0,144,0);canvas.drawLine(canvas, getFirstLine(), mPaint);canvas.drawRect(canvas, getFirstRect(), mPaint);canvas.drawRect(canvas, getSecondRect(), mPaint);...canvas.drawRect(canvas, getSecondRect(), mPaint);drawAnimatedObjects();}</code></pre><p>I then draw circles and different positions over this background. My question is how do I make this more efficient? Is there a way that I can draw the lines at the application initialisation and not have to redraw them every frame?</p><p>Thanks for any help.</p>","410921","","","","","2010-08-04 18:33:38","Efficient 2D drawing in Android","<java><android><performance><canvas><ondraw>","2","2","2","",""
"3407055","1","7447625","","2010-08-04 15:22:54","1","928","<p>I have a custom CursorAdapter which I'm using to inflate a custom item layout and style accordingly, as shown in the code below.  My issue is that sometimes the wrong style information is supplied even though the data coming from the DB is correct (so for the below example I'll get <code>isEvent == true</code> but it'll go on to style as if <code>isEvent == false</code>.  </p><p>Is this a known bug?  Am I doing something wrong or is there something I can do which will fix this?</p><pre><code>private class EventAdapter extends CursorAdapter {    public EventAdapter(Context context) {        super(context, null);    }    @Override    public View newView(Context context, Cursor cursor, ViewGroup parent) {        return getLayoutInflater().inflate(R.layout.event_view_list_item, parent, false);    }    @Override    public void bindView(View view, Context context, Cursor cursor) {        final boolean isEvent = cursor.getInt(EventQuery.IS_EVENT) == Event.EVENT;        final String eventName = cursor.getString(EventQuery.NAME);        final TextView eventNameView = (TextView) view.findViewById(R.id.event_name);        if (isEvent) {            eventNameView.setText(eventName);            view.findViewById(R.id.arrow).setVisibility(View.VISIBLE);            view.findViewById(R.id.in_play_icon).setVisibility(View.GONE);        } else {            eventNameView.setText(cursor.getString(EventQuery.NAME));        }    }}</code></pre>","264276","","","","","2011-09-16 16:14:35","android: styling ListView items from custom CursorAdapter","<android><listview><coding-style><adapter><listviewitem>","1","0","","",""
"3407146","1","3516570","","2010-08-04 15:32:32","1","1565","<p>I <em>sometimes</em> get ""Host is unresolved: imap.gmail.com:993"" when I try the javamail/gmail store.connect in the Android development environment using GMailReader below. Why might this fail sometimes and not others?</p><pre><code>public class GMailReader extends javax.mail.Authenticator {    private String user;    private String password;    public GMailReader(String user, String password) {        this.user = user;        this.password = password;    }    public int getUnreadMessageCount() throws Exception {        try {            Properties props = new Properties();            props.setProperty(""mail.store.protocol"", ""imaps"");             Session session = Session.getInstance(props, this);             Store store = session.getStore(""imaps"");            store.connect(""imap.gmail.com"", user, password);            Folder inbox = store.getFolder(""Inbox"");             inbox.open(Folder.READ_ONLY);             int unreadMessageCount = inbox.getUnreadMessageCount();             return unreadMessageCount;        } catch (Exception e) {            Log.e(""getUnreadMessageCount"", e.getMessage(), e);            return -1;        }    }</code></pre>","398460","","","","","2010-08-18 20:50:46","Host is unresolved: imap.gmail.com:993","<android><gmail><javamail>","1","1","1","",""
"3407192","1","3407269","","2010-08-04 15:37:36","15","8016","<p>Information:My device is a Nexus One with 2.2 and I have tested two projects, one on 1.5 and one on 2.1.</p><p>Problem:I have trouble to understand the life cycle of my application when the screen is turned off and on.</p><p>Here is my output</p><pre><code>// activity starts08-04 17:24:17.643: ERROR/PlayActivity(6215): onStart executes ...08-04 17:24:17.643: ERROR/PlayActivity(6215): onResume executes ...// screen goes off08-04 17:24:28.943: ERROR/PlayActivity(6215): onPause executes ...08-04 17:24:32.113: ERROR/PlayActivity(6215): onStop executes ...08-04 17:24:32.113: ERROR/PlayActivity(6215): onDestroy executes ...08-04 17:24:32.983: ERROR/PlayActivity(6215): onStart executes ...08-04 17:24:32.983: ERROR/PlayActivity(6215): onResume executes ...08-04 17:24:32.983: ERROR/PlayActivity(6215): onPause executes ...// screen goes on08-04 17:24:47.683: ERROR/PlayActivity(6215): onResume executes ...// lock removed08-04 17:24:56.943: ERROR/PlayActivity(6215): onPause executes ...08-04 17:24:59.663: ERROR/PlayActivity(6215): onStop executes ...08-04 17:24:59.663: ERROR/PlayActivity(6215): onDestroy executes ...08-04 17:25:00.943: ERROR/PlayActivity(6215): onStart executes ...08-04 17:25:00.943: ERROR/PlayActivity(6215): onResume executes ...</code></pre><p>I am totally confused. Why restarting the activity when the screen goes off? And why stop and restarting it again when the screen was already on and only the lock was removed?</p><p>To make sure I haven't done anything wrong, I created a new project with only this activity. The output is identically...</p><pre><code>public class LifeCycleTest extends Activity {    private final static String DEBUG_TAG = ""FirstLifeLog"";    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Log.e(DEBUG_TAG, ""onCreate executes ..."");        setContentView(R.layout.main);    }    protected void onRestart() {        super.onRestart();        Log.e(DEBUG_TAG, ""onRestart executes ..."");    }    protected void onStart() {        super.onStart();        Log.e(DEBUG_TAG, ""onStart executes ..."");    }    protected void onResume() {        super.onResume();        Log.e(DEBUG_TAG, ""onResume executes ..."");    }    protected void onPause() {        super.onPause();        Log.e(DEBUG_TAG, ""onPause executes ..."");    }    protected void onStop() {        super.onStop();        Log.e(DEBUG_TAG, ""onStop executes ..."");    }    protected void onDestroy() {        super.onDestroy();        Log.e(DEBUG_TAG, ""onDestroy executes ..."");    }}</code></pre><p>Does someone have an idea?</p><p>Update from today (dont understand why it behaves not like last time, maybe more free resources?)</p><pre><code>// activity starts08-09 12:14:03.122: ERROR/FirstLifeLog(15406): onCreate executes ...08-09 12:14:03.132: ERROR/FirstLifeLog(15406): onStart executes ...08-09 12:14:03.132: ERROR/FirstLifeLog(15406): onResume executes ...// screen off08-09 12:14:07.412: ERROR/FirstLifeLog(15406): onPause executes ...// screen on08-09 12:14:11.722: ERROR/FirstLifeLog(15406): onResume executes ...// no log for removed screen lock</code></pre>","180538","","180538","","2010-08-09 10:16:53","2013-04-30 11:31:48","Problems understanding the life cycle when screen goes off and on","<android><screen><lifecycle>","3","2","5","",""
"3407256","1","3410200","","2010-08-04 15:44:16","73","84650","<p>What's the height of the status bar in Android? Is it always the same?</p><p>From my measurements it seems that it's 25dp, but I'm not sure if it has the same height on all platforms.</p><p>(I want to know this to properly implement a fade transition from an activity that doesn't have status bar to one that does)</p>","143378","","143378","","2010-08-06 12:08:41","2014-04-14 10:44:33","Height of status bar in Android","<android><statusbar>","11","3","35","",""
"3407566","1","","","2010-08-04 16:20:16","1","915","<p>On Android, is there a way to force a particular request to go through WAP instead of wifi?</p><p>I want to leave wifi turned on, so that it can continue to be used for other connections.</p>","410951","","592182","","2011-05-20 10:00:02","2011-05-20 10:00:02","Android: How to force a request to use WAP","<android><wap>","1","2","","",""
"3407582","1","","","2010-08-04 16:22:49","2","2436","<p>I see that it's possible to <a href=""http://stackoverflow.com/questions/2799761/making-the-user-change-the-time-in-android"">launch the date &amp; time settings</a> via an intent in Android, but what I'd like to do is launch just the list that shows the time zones (clicking ""Select time zone"") and get back the selected value <em>without</em> having the selection modify the user's date &amp; time settings. Any idea how to do this?</p>","244104","","244104","","2010-08-04 19:02:27","2011-11-09 09:25:43","Launch Time Zone list in Android for pick/result","<android>","3","0","4","",""
"3407619","1","3408569","","2010-08-04 16:26:51","1","506","<p>I have 2 Android Databases in my app. For the sake of an example, lets say Database #1 is called JOBS and has the following columns: <code>""Jobs Primary Key"" - ""Job Title"" - ""Job Description""</code></p><p>Database #2 is called PEOPLE and has the following columns: <code>""People Primary Key"" - ""First Name"" - ""Last Name"" - ""Jobs ID Key""</code></p><p>(Yes I know these are not the greatest of designs from a database perspective, this is just to help paint a picture for my question).</p><p>Within a ListView, I'd like to display columns ""First Name"" - ""Last Name"" - ""Job Title"" (1 column from Database #1, 2 columns from Database #2). Using a SimpleCursorAdapter, is it possible to somehow accomplish this?</p><p>If I don't use a SimpleCursorAdapter, the only way that I can think to accomplish this is to use an ArrayAdapter, where I use a StringBuilder to concatenate the 3 columns together, and fill the ListView, but I'm wondering if there is a better way to accomplish this.</p>","377507","","234938","","2010-08-05 08:33:46","2013-03-23 10:32:42","Android Adapter for 2 Database Sources","<sql><android><cursor>","2","0","","",""
"3407741","1","","","2010-08-04 16:41:52","0","2813","<p>I've got a place I want to add on my map at a particular lat / lng. I'd like to display that on my map when the activity starts. How would I do this?</p><p>Thanks.</p>","358438","","","","","2010-08-04 20:40:13","Adding markers to a Google map on Android","<android><google-maps>","1","0","1","",""
"3407764","1","","","2010-08-04 16:44:48","2","6070","<p>I am able to use the example here: <a href=""http://www.androidsnippets.org/snippets/36/index.html"" rel=""nofollow"">http://www.androidsnippets.org/snippets/36/index.html</a> and successfully get the ""HTTP/1.1 OK"" response for a webesite I am sending the HttpPost along with the user credentials. However, I am unable to use an HttpGet to further browse other pages on this site. </p><p>Can anyone please let me know, what's going wrong. I am sorry - I am very new to Java. </p>","407627","","","","","2012-07-19 05:12:08","Android: Example for using a cookie from HttpPost for HttpGet","<android>","1","1","3","",""
"3407793","1","","","2010-08-04 16:48:18","12","19034","<p>I am working on Android application (Droid Incredible).</p><p>I am planning to read passive RFID tags using Android phone but I found that there is no slot for Android to connect to RFID reader.</p><p>After some research, I found out that I will have to get RFID reader which can send RF data over bluetooth to Android. But I am not sure which company manufactures it or what will be cost of such RFID reader.</p><p>Is there any one who can help me or throw some light on this issue? </p><p>ThanksSiddhesh</p>","451655","","","","","2014-04-03 07:24:29","How to read passive RFID cards using Android?","<android>","2","3","5","",""
"3407916","1","","","2010-08-04 17:04:22","0","517","<p>Is there a way to retrieve the user's phone number in an mobile app? I'm looking to build some sort of addressbook utility that builds phone numbers and let them dial the numers etc by making use of their current phone number. Is there a way to retrieve this information? </p><p>I've found some ways to retrieve it in blackberry and android from the sim card, but apparently the value in the sim card does not guarantee that its actually their number. </p>","56952","","","","","2010-08-05 13:47:57","Is there a way to retrieve the user's phone number in an mobile app?","<android><blackberry><java-me>","2","0","","",""
"3408008","1","","","2010-08-04 17:16:26","1","823","<p>I have a ScrollView which contains 1 button and 3 TextViews. Currently the button and the first TextView is shown on the screen and they occupy the whole screen. The second TextView is below the first TextView and is outside of the screen. When user clicks the button, I want the code to scroll the second TextView to be shown on the top of the screen. Could someone tell me how to make it? Thanks!</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""wrap_content"" android:orientation=""vertical""&gt;&lt;ScrollView android:id=""@+id/scrllvw""          android:layout_width=""fill_parent""           android:layout_height=""wrap_content""          android:fadingEdge=""none""           &gt;       &lt;LinearLayout android:layout_width=""fill_parent""           android:layout_height=""wrap_content""          android:orientation=""vertical"" &gt;           &lt;Button android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:id=""@+id/test"" /&gt;           &lt;TextView android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:id=""@+id/text1"" /&gt;           &lt;TextView android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:id=""@+id/text2"" /&gt;                      &lt;TextView android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:id=""@+id/text3"" /&gt;                   &lt;/LinearLayout&gt;&lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre>","256239","","","","","2010-08-04 17:16:26","How to scroll from code to make a view shown in the screen?","<android>","0","2","","",""
"3408352","1","3438207","","2010-08-04 18:00:28","1","807","<p>ok so i have an array adapted listview (the array adapting is done in another class).. i just got the click listener working for the list but now i want set it up so that when i click an item it pulls the strings from the clicked item and piggybacks them on the intent to a new activity.. i figure im supposed to use intent.putextra however im not sure how to pull the correct strings corresponding to the item that i click on.. my code is below.. im simply lost to be honest</p><pre><code>//Initialize the ListView        lstTest = (ListView)findViewById(R.id.lstText);         //Initialize the ArrayList        alrts = new ArrayList&lt;Alerts&gt;();        //Initialize the array adapter notice with the listitems.xml layout        arrayAdapter = new AlertsAdapter(this, R.layout.listitems,alrts);        //Set the above adapter as the adapter for the list        lstTest.setAdapter(arrayAdapter);        //Set the click listener for the list        lstTest.setOnItemClickListener(new AdapterView.OnItemClickListener() {            public void onItemClick(AdapterView adapterView, View view, int item, long arg3) {                Intent intent = new Intent(                        HomePageActivity.this,                        PromotionActivity.class                        );                finish();                startActivity(intent);            }        });</code></pre><p>my alerts class..</p><pre><code>public class Alerts {public String cityid;public String promoterid;public String promoshortcontent;public String promocontent;public String promotitle;public String locationid;public String cover;@Overridepublic String toString() {    return ""City: "" +cityid+ "" Promoter: "" +promoterid+ ""Short Promotion: "" +promoshortcontent+ ""Promotion: "" +promocontent+ ""Title: "" +promotitle+ ""Location: "" +locationid+ ""Cover: "" +cover+ ""$"";}</code></pre><p>}</p><p>anddddd my alertsadapter class..</p><pre><code>public class AlertsAdapter extends ArrayAdapter&lt;Alerts&gt; {int resource;String response;Context context;//Initialize adapterpublic AlertsAdapter(Context context, int resource, List&lt;Alerts&gt; items) {    super(context, resource, items);    this.resource=resource;}@Overridepublic View getView(int position, View convertView, ViewGroup parent){    LinearLayout alertView;    //Get the current alert object    Alerts al = getItem(position);    //Inflate the view    if(convertView==null)    {        alertView = new LinearLayout(getContext());        String inflater = Context.LAYOUT_INFLATER_SERVICE;        LayoutInflater vi;        vi = (LayoutInflater)getContext().getSystemService(inflater);        vi.inflate(resource, alertView, true);    }    else    {        alertView = (LinearLayout) convertView;    }    //Get the text boxes from the listitem.xml file    TextView textPromo =(TextView)alertView.findViewById(R.id.txtPromo);    TextView textPromoter =(TextView)alertView.findViewById(R.id.txtPromoter);    TextView textLocation =(TextView)alertView.findViewById(R.id.txtLocation);    //Assign the appropriate data from our alert object above    textPromo.setText(al.promocontent);    textPromoter.setText(al.promoterid);    textLocation.setText(al.locationid);    return alertView;}</code></pre><p>}</p>","407775","","407775","","2010-08-04 20:32:38","2010-08-09 07:49:35","how to pull strings from an array adapted listview for a clicked list item","<android><listview><android-arrayadapter><clickable>","2","0","","",""
"3408388","1","3408740","","2010-08-04 18:04:37","10","5980","<p>I have activity A that starts activity B which starts activity C</p><p>A -> B -> C</p><p>When a user clicks on a button in activity C, i want to bring A to the top of the stack and take B &amp; C completely out of the stack.  Is there a way to do this ? ? </p>","202064","","","","","2010-08-04 18:43:58","how to kill sub activities and bring activity to top of stack","<android><activity>","1","0","1","",""
"3408513","1","","","2010-08-04 18:20:34","2","1585","<p>I'm investigating the possiblity of writing an app for Android/iOS4/both that would use GPS in the background. I found the <a href=""http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5-SW4"" rel=""nofollow"">""Receiving Location Events in the Background""</a> section of the  iphone developer documentation, which recommends that I only register for ""significant location change"" events. I'm not aware of any such capability in the Android SDK, but it still seems like a good idea to do it this way if I can (so as not to drain the battery).</p><p>My question is this: has anyone done any sort of benchmarking for this on and iPhone/Android phone? So far, I've seen a lot posts/documentation saying that listening for GPS events in the background is a VERY BAD THING and I should AVOID IT AT ALL COSTS, but I haven't been able to find any numbers for just how much power a background application listening on GPS changes would drain (i.e. % battery drain per time app is running in the background).</p><p>This information might be helpful for me (and possibly others too) because I might be able to poll less frequently or even register/unregister my GPS listener based on power drain. Essentially, I could try to put a ceiling on how much battery life my app could drain while in the background.</p><p>Thanks!</p>","195625","","","","","2010-08-04 19:09:49","iOS/Android GPS battery draw?","<android><geolocation><gps><ios4><battery>","1","0","1","",""
"3408675","1","3434488","","2010-08-04 18:37:03","2","4249","<p>Folks -</p><p>I'm trying to implement a Gallery widget that displays an ArrayList of images, and I have started with the <a href=""http://developer.android.com/guide/tutorials/views/hello-gallery.html"" rel=""nofollow"">Hello, Gallery example</a> on the dev site.  This part is all working great.</p><p>I need to have the gallery display an empty view (a special view when the ArrayList has no contents), but I cannot seem to get the Gallery to do this.  I have done this with ListView and other AdapterViews in the past, but I cannot get it to work with Gallery.  What do I need to override/implement in the Adapter, Gallery, or both to get an empty view displayed?  This is my adapter code:</p><pre><code>public class ImageAdapter extends BaseAdapter {     int mGalleryItemBackground;     private Context mContext;     private ArrayList&lt;Drawable&gt; images;     public ImageAdapter(Context c) {      mContext = c;      TypedArray a = c.obtainStyledAttributes(R.styleable.Gallery1);      mGalleryItemBackground = a.getResourceId(R.styleable.Gallery1_android_galleryItemBackground, 0);      a.recycle();      images = new ArrayList&lt;Drawable&gt;();     }     public void addImage(Drawable d) {      images.add(d);     }     public boolean isEmpty() {      return getCount() == 0;     }     public int getCount() {      return images.size();     }     public Drawable getItem(int position) {      return images.get(position);     }     public long getItemId(int position) {      return position;     }     public View getView(int position, View contentView, ViewGroup parent) {      ImageView i = new ImageView(mContext);      i.setImageDrawable(images.get(position));      i.setLayoutParams(new Gallery.LayoutParams(160, 120));      i.setScaleType(ImageView.ScaleType.FIT_XY);      i.setBackgroundResource(mGalleryItemBackground);      return i;     }}</code></pre><p>When the view is to be displayed with an empty ArrayList, getCount() does get called (returning 0), but the Gallery never checks isEmpty, and when I had defined <code>getEmptyView()</code> in the Gallery, it was never called either.  Did I miss another required method in BaseAdapter to properly notify the empty state?</p><p>Thanks!</p>","246461","","234039","","2010-08-04 18:55:28","2010-08-08 13:34:16","Display Empty View in Android Gallery","<android><gallery>","1","1","0","",""
"3408985","1","3411454","","2010-08-04 19:13:48","44","66029","<p>I am building an android app that needs to download and synchronise with an online database, I am sending my query from the app to a php page which returns the relevant rows from a database in JSON format. </p><p>can someone please tell me the best way to iterate through a JSON array?</p><p>I receive an array of objects:</p><p><code>[{json object},{json object},{json object}]</code></p><p>What is the simplest piece of code I could use to access the JSONObjects in the array?</p><p>EDIT: now that I think of it the method I used to iterate the loop was:</p><pre><code>for (String row: json){     id = row.getInt(""id"");     name = row.getString(""name"");     password = row.getString(""password"");}</code></pre><p>So I guess I had was somehow able to turn the returned Json into and iterable array. Any Ideas how I could achieve this?</p><p>I apologise for my vaguness but I had this working from an example I found on the web and have since been unable to find it.</p>","409826","","86771","","2014-04-02 19:09:29","2014-04-02 19:09:29","JSON Array iteration in Android/Java","<java><android><arrays><json>","6","0","14","",""
"3409106","1","3409183","","2010-08-04 19:29:35","2","674","<p>I'm building an Android application that needs to communicate with a MySQL database. The application isn't meant to be published, and I want the application to be the only thing allowed to interface with the web service I'll create for DB access.</p><p>I've been thinking how I can secure the system, and this is the idea I've come up with. I'd appreciate any feedback or other ideas. Surely there is a method built into Android that I am unaware of.</p><p>My thought is to give the web service a GUID. Each time a call is made to one of it's public methods, the web service matches its GUID with the GUID given to it by the Android application. If the GUIDs do not match, the web service refuses access. In short, my system has a 128-bit password.</p>","301839","","","","","2010-08-04 19:42:49","Android application security when accessing a web service","<android><security><web-services><guid>","1","0","","",""
"3409135","1","","","2010-08-04 19:33:21","1","1361","<p>After much help from the good people here, I finally almost got my little game panel (thats a surfaceview class) up and running with a GestureOverlayView.  Through the use of addView I finally was able to add the GestureOverlayView and get it to work, the trouble is that calling this:</p><pre><code>    /** create the login form */private ViewGroup _createGameStuffs() {  GestureOverlayView gestures = new GestureOverlayView(this);         gestures.setOrientation(gestures.ORIENTATION_VERTICAL);  gestures.setEventsInterceptionEnabled(true);  gestures.setGestureStrokeType(gestures.GESTURE_STROKE_TYPE_MULTIPLE);  gestures.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,          LayoutParams.FILL_PARENT));  //GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures);  gestures.addOnGesturePerformedListener(this);  Panel p = new Panel(this); //my game view  panel.addView(p,0);       //add it to the group  panel.addView(gestures,1); //add the gestureoverlayview i made to the group  return panel;}    public void onCreate(Bundle savedInstanceState) {               super.onCreate(savedInstanceState);               requestWindowFeature(Window.FEATURE_NO_TITLE);               mLibrary = GestureLibraries.fromRawResource(this, R.raw.myspells);                 // create the panel to enclose everything               View mainPanel = _createGameStuffs();              // show the panel on the screen              setContentView(mainPanel);              //setContentView(p); }</code></pre><p>Depending upon which index I give which view takes presedence.  This leads me to believe my game panel has to be added as a child view to the GestureOverlayView, is this correct? If so, how do I get at the children views of the GestureOverlayView?  Or is it the other way around, GestureOverlayView becomes a child of my main view?</p>","327258","","327258","","2010-08-16 03:06:46","2010-08-16 03:06:46","Using ViewGroup.addView() to add a GestureOverlayView to a SurfaceView game panel","<android><surfaceview>","0","0","0","",""
"3409153","1","","","2010-08-04 19:35:04","0","1124","<p>I want to incorporate a full month calendar selector like that of an iOS into my program. The one like this:<img src=""http://t2.gstatic.com/images?q=tbn%3aqEfG1K6Jq85q1M%3a%3a&amp;t=1&amp;usg=__mroNtJkungvkp0ftZes5kbnZiYM="" alt=""alt text""></p><p>However, it seem no one have come up with a control like that. Can i create a custom control like this and if yes, what is the best views to use for each date? a button view or a text view?</p><p>I would really hope someone can help with the general draw calendar algo.</p><p>Thanks alot!</p>","394387","","","","","2011-01-08 18:36:49","Android:How to display a Full Month Calendar Selector control?","<android><algorithm><calendar><fullcalendar>","0","2","","",""
"3409245","1","3409690","","2010-08-04 19:45:38","4","1739","<p>I was trying to set up my options menu so that there would be 2 buttons on the 1st and 2nd row and then 1 button on the 3rd row.  Here is the code I was trying to use but I'm guessing groupID argument isn't what I thought it was.</p><pre><code>  menu.add(1, MENU_NAME, 1, ""by Name"");  menu.add(1, MENU_NUMBER, 2, ""by Number"");  menu.add(2, MENU_POSITION, 1, ""by Position"");  menu.add(2, MENU_COLLEGE, 2, ""by College"");  menu.add(3, MENU_UPDATE, 1, ""Update Roster"");</code></pre><p>Maybe this is solved somehow with the XML Layout but I'm not really good with the layouts ;(  So I managed to not get too far that way either.</p>","394241","","","","","2010-12-09 17:23:29","How can I set my options menu up so that there are only 2 buttons per row?","<android><menu><button><options>","2","0","1","",""
"3409271","1","12376185","","2010-08-04 19:48:47","9","4244","<p>I have a layout that looks something like this:</p><pre><code>[TextView 1] [TextView 2][ TextView 2 spill-over ]</code></pre><p>Essentially, I need the contents of TextView 2 to wrap to the next line, but start where TextView 1 starts. I was thinking that if I knew how much text would fit into TextView 2 before it runs out of space on line one, I could take the rest of the text and put it in another TextView below the first two. So I need to measure how much text will fit into a TextView (which can be tricky because as far as I can tell, Android will try to break the text in a TextView at a good location so that it won't break a word in the middle if it can be avoided) or I need a new idea on how to lay this out.</p><p>Any help would be greatly appreciated.</p><p>Thanks in advance,</p><p>groomsy</p>","349179","","","","","2012-09-11 18:58:46","How do I determine how much text will fit in a TextView in Android?","<android><layout><textview>","2","3","6","",""
"3409356","1","3409538","","2010-08-04 20:02:20","0","806","<p>I am trying to simply load just the contact photo of all my contacts and display them in a gallery.widget...Do I create a query? I was trying simply just to do People.loadcontactphoto but was getting errors....Any easy way to do this?</p>","411224","","","","","2010-08-04 20:25:57","Android Programming...How do I load contact photos so I can use them in an app?","<android><contacts>","1","0","","",""
"3409737","1","3422453","","2010-08-04 20:53:50","1","1848","<p>I have a layout which has one large EditText view at the top + a bunch of buttons at the bottom. The EditText is made to shrink and expand when the ime is activated/deactivated by using adjust_resize. The buttons at the bottom are pushed up above the ime.</p><p>I would like to hide these buttons when the ime displays, to provide enough space for the EditText view.</p><p>I have so far tried the following:</p><ul><li><p>subclassed EditText and provided the activity the option to register a callback on the view's OnSizeChanged.</p></li><li><p>Used this callback to change the visibility of the buttons (actually the layout container) to GONE.</p></li></ul><p>This work OK and does hide the buttons when the ime pops up.However, the EditText does not expand into the new available space.Furthermore, when the ime is disposed off, the EditText field is now bigger than it was originally, pushing (the now showing) buttons outside the screen.</p><p>I should also add that when typing the first letter into the view, and the ime displays the word options, the screen is redrawn and the EditText fills the vacant space.</p><p>Any ideas on how to get this to work?Or even better, is there a simpler solution to my requirement?</p><p>Thanks...</p><p>NB:  In my view, scrolling  is not a good option.</p>","406090","","406090","","2010-08-05 04:51:57","2010-08-06 09:19:53","Android Soft Keyboard: How to manipulate views on keyboard on/off","<android><android-softkeyboard>","2","0","2","",""
"3409797","1","3417842","","2010-08-04 21:02:58","2","1804","<p>I have a listview with a custom arrayadapter that handles about 15 strings. The style of each row alternates (between labels and values for those labels--for example row 1 could be ""email address"" and row 2 would be the actual email address). I'm changing the style of each row to alternate like this in the arrayadapter's getView() method. So if the item at the current position is a label, I'll change the styling from the default row style (which is what the values have applied to them). When the listview first loads, the styling is perfect and just how I want it to be. If I scroll the list slowly up or down, it stays that way. However, if I scroll the list fast up and down, the styling of the value rows starts changing to that of the label ones until all of the rows have the styling of a label row. Does anyone know why this would be happening? I've used custom adapters on other listviews in the app with no problems like this.</p><p>Edit: Found out that it also changes all of the rows to the label styling on portrait->landscape orientation changes. Doesn't do this on landscape->portrait changes. Below is the adapter I'm using. Am I missing something?</p><pre><code>public class DetailsAdapter extends ArrayAdapter&lt;String&gt; {private TextView text = null;private String item = null;public DetailsAdapter(Context context, int resource, int textViewResourceId, String[] objects) {    super(context, resource, textViewResourceId, objects);}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    text = (TextView) super.getView(position, convertView, parent);    item = getItem(position);    if (item.equals(""Name"") || item.equals(""Mobile"") || item.equals(""Home"") || item.equals(""Email"") || item.equals(""Address"")) {        text.setBackgroundColor(0xFF575757);        text.setTextSize(15);        text.setTypeface(null, Typeface.BOLD);        text.setPadding(8, 5, 0, 5);    } else {        text.setPadding(15, 15, 0, 15);    }    return text;}@Overridepublic boolean isEnabled(int position) {    item = getItem(position);    if (item.equals(""Name"") || item.equals(""Mobile"") || item.equals(""Home"") || item.equals(""Email"") || item.equals(""Address"")) {        return false;    } else {        return true;    }}}</code></pre>","378272","","378272","","2010-08-05 16:24:32","2012-02-03 10:41:59","When I scroll a listview with a custom adapter too fast up and down, getView() starts behaving oddly. Why?","<android><listview><scroll><adapter>","2","2","","",""
"3409870","1","","","2010-08-04 21:14:08","0","420","<p>Hey, When I load an application(which I just compiled) in the emulator. I don't see its icon in the icons of the installed application(on the emulator). The command ""adb install ..."" tells me that the application is successfully installed(I can even uninstall it with ""adb uninstall ..."" command). The application is nothing more than a ""Hello World""  type of application, you get when you create a project with ""android create project --target ...."" command. I can compile and run other application perfectly with the same set of tools. </p><p>Give me some pointers, what am I missing? what have I overlooked? Please help me.</p>","410444","","","","","2011-02-09 19:08:06","I can install an application but I don't see its icon in the set of installed applications(on the emulator)","<java><android>","2","0","","",""
"3410016","1","4153572","","2010-08-04 21:32:49","1","1111","<p>Alright, so I have an application that has a tabbed interface. What I would like to know is how I can change the currently active Activity in the tab, and then when I'm done with that Activity, go back the the original Activity, exactly as it was.</p><p>Would I be able to use something like a ViewFlipper for this? Or probably not?</p>","362857","","","","","2010-11-11 10:45:42","Changing Activities within Tab","<android>","3","4","","",""
"3410043","1","","","2010-08-04 21:37:44","1","1329","<p>I'm developing an app that logs into a web site. To do this I use the HttpClient object.</p><p>I noticed I could get all the cookies from the post requests with the HttClient.getCookieStore method, the question is however how I save these cookies so the next time the app is started, the user don't have to log in.</p><p>I should also mention that while the login was post request, rest of the site is mostly get requests, does this effect how the cookies are managed at all?</p><p>Thanks.</p>","242348","","","","","2011-07-01 13:59:42","How to to store http-cookies between sessions","<android><http><cookies>","0","1","","",""
"3410295","1","3410781","","2010-08-04 22:17:03","24","52865","<p>I have 3 activities. Activity A which leads to activity B, which in turn can go back to activity A or start activity C. However, if I press back in activity C the app should close.</p><p>To sum up:</p><ul><li>Activity A starts activity B</li><li>Pressing <strong>Back</strong> on activity B should lead to A</li><li>Activity B starts activity C</li><li>Pressing <strong>Back</strong> on activity C should close the app</li></ul><p>How should I go from activity B to C? This code currently gives me a NullPointerException on the last line:</p><pre><code>Intent intent=new Intent(ActivityB.this, ActivityC.class);startActivity(intent);ActivityB.this.finish();ActivityB.this.getParent().finish();</code></pre><p>If I switch the last two lines I also get a null pointer.</p>","143378","","","","","2013-12-11 09:36:54","Finish parent and current activity in Android","<android><activity>","13","1","10","",""
"3410338","1","","","2010-08-04 22:22:52","1","938","<p>Does anyone know if it is possible to force an app to start automatically when external power is applied - i.e. the following scenario:- app is running (with permanent external power supply; this would not be a 'mobile' app);- external supply fails for some reason;- battery runs low so device turns off;- external supply resumes;- app must start automatically, without pressing the home button or touching the screen, since the device would be unattended.Would this action be different depending on manufacturer's hardware?</p>","411345","","","","","2010-08-04 23:02:09","android wake-up action","<android>","2","0","","",""
"3410417","1","3730990","","2010-08-04 22:36:31","0","1227","<p>I'm trying to create tables with rounded corners. I've quite a bit of XML to do this, but I have a problem.  The table is wrapping itself to the width of its inner text.  I want the entire thing to fill the parent (though I want a border around it so there is some cushion, which I have).  I can't understand why it is not when I have everything to fill_parent.  Could someone point out what is wrong?</p><p>Here's a screenshot of what I mean and a copy of my XML:</p><p><a href=""http://i34.tinypic.com/15cn6kj.png"" rel=""nofollow"">screenshot 1</a></p><p>shape_outer.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;solid android:color=""#0000FF""/&gt;    &lt;corners android:radius=""5px""/&gt;    &lt;padding android:left=""0dp"" android:top=""0dp"" android:right=""0dp"" android:bottom=""0dp"" /&gt; &lt;/shape&gt;</code></pre><p>shape_inner.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;solid android:color=""#FFFFFF""/&gt;    &lt;corners android:radius=""5px""/&gt;    &lt;padding android:left=""0dp"" android:top=""0dp"" android:right=""0dp"" android:bottom=""0dp"" /&gt; &lt;/shape&gt;</code></pre><p>my layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""47px""        style=""?android:attr/windowTitleBackgroundStyle""        android:gravity=""center""&gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:text=""My title""            style=""?android:attr/windowTitleStyle""            android:paddingLeft=""5px"" /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_weight=""1""        android:padding=""10px""        &gt;        &lt;!-- used so we can separate two tables --&gt;        &lt;TableLayout            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:stretchColumns=""1""            &gt;            &lt;!-- first table --&gt;            &lt;TableRow android:paddingBottom=""10px""&gt;                &lt;!-- outer border --&gt;                &lt;TableLayout                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:stretchColumns=""1""                    android:padding=""2px""                    android:background=""@drawable/shape_outer""                    &gt;                    &lt;TableRow&gt;                        &lt;!-- inner whitespace --&gt;                        &lt;TableLayout                            android:layout_width=""fill_parent""                            android:layout_height=""wrap_content""                            android:stretchColumns=""1""                            android:layout_weight=""1""                            android:background=""@drawable/shape_inner""                            android:padding=""10px""                            &gt;                            &lt;TableRow&gt;                                &lt;!-- first row: one --&gt;                                &lt;LinearLayout                                    android:orientation=""horizontal""                                    android:layout_width=""fill_parent""                                    android:layout_height=""wrap_content""                                    android:gravity=""left|center_vertical""                                    &gt;                                    &lt;TextView                                         android:layout_width=""70px""                                        android:layout_height=""wrap_content""                                        android:layout_column=""1""                                        android:text=""One:""                                        android:padding=""6dip""                                        android:textColor=""#000000"" /&gt;                                    &lt;TextView                                         android:id=""@+id/one""                                        android:layout_width=""fill_parent""                                        android:layout_height=""wrap_content""                                        android:layout_column=""1""                                        android:text=""sadflkjaasasdfadsdsf;lkjdsal;asdj""                                        android:padding=""6dip""                                        android:textColor=""#000000""                                        android:maxLines=""1"" /&gt;                                &lt;/LinearLayout&gt;                            &lt;/TableRow&gt;                            &lt;!-- separator --&gt;                            &lt;View                                android:layout_height=""1dip""                                android:background=""#FF909090"" /&gt;                            &lt;TableRow&gt;                                &lt;!-- second row: two --&gt;                                &lt;LinearLayout                                    android:orientation=""horizontal""                                    android:layout_width=""fill_parent""                                    android:layout_height=""wrap_content""                                    android:gravity=""left|center_vertical""                                    &gt;                                    &lt;TextView                                         android:layout_width=""70px""                                        android:layout_height=""wrap_content""                                        android:layout_column=""1""                                        android:text=""Two:""                                        android:padding=""6dip""                                        android:textColor=""#000000"" /&gt;                                    &lt;TextView                                         android:id=""@+id/two""                                        android:layout_width=""fill_parent""                                        android:layout_height=""wrap_content""                                        android:layout_column=""1""                                        android:text=""asdfasdasdfasdfasfasdfasgeargfsgsfd""                                        android:padding=""6dip""                                        android:textColor=""#000000""                                        android:maxLines=""1"" /&gt;                                &lt;/LinearLayout&gt;                            &lt;/TableRow&gt;                        &lt;/TableLayout&gt;                    &lt;/TableRow&gt;                &lt;/TableLayout&gt;            &lt;/TableRow&gt;            &lt;!-- second table --&gt;            &lt;TableRow&gt;                &lt;!-- outer border --&gt;                &lt;TableLayout                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:stretchColumns=""1""                    android:padding=""2px""                    android:background=""@drawable/shape_outer""                    &gt;                    &lt;TableRow&gt;                        &lt;!-- inner white space --&gt;                        &lt;TableLayout                            android:layout_width=""fill_parent""                            android:layout_height=""wrap_content""                            android:layout_weight=""1""                            android:stretchColumns=""1""                            android:background=""@drawable/shape_inner""                            android:padding=""10px""                            &gt;                            &lt;!-- third row: Three --&gt;                            &lt;TableRow&gt;                                &lt;LinearLayout                                    android:orientation=""horizontal""                                    android:layout_width=""fill_parent""                                    android:layout_height=""wrap_content""                                    android:gravity=""left|center_vertical""                                    &gt;                                    &lt;TextView                                         android:layout_width=""70px""                                        android:layout_height=""wrap_content""                                        android:layout_column=""1""                                        android:text=""Three:""                                        android:padding=""6dip""                                        android:textColor=""#000000"" /&gt;                                    &lt;TextView                                         android:id=""@+id/three""                                        android:layout_width=""fill_parent""                                        android:layout_height=""wrap_content""                                        android:layout_column=""1""                                        android:text=""asdfasfasdfasgeargfsgsfd""                                        android:padding=""6dip""                                        android:textColor=""#000000""                                        android:singleLine=""true""                                        android:ellipsize=""end"" /&gt;                                &lt;/LinearLayout&gt;                            &lt;/TableRow&gt;                            &lt;!-- separator --&gt;                            &lt;View                                android:layout_height=""1dip""                                android:background=""#FF909090"" /&gt;                            &lt;!-- second row: four --&gt;                            &lt;TableRow&gt;                                &lt;LinearLayout                                    android:orientation=""horizontal""                                    android:layout_width=""fill_parent""                                    android:layout_height=""wrap_content""                                    android:gravity=""left|center_vertical""                                    &gt;                                    &lt;TextView                                         android:layout_width=""70px""                                        android:layout_height=""wrap_content""                                        android:layout_column=""1""                                        android:text=""Four:""                                        android:padding=""6dip""                                        android:textColor=""#000000"" /&gt;                                    &lt;TextView                                         android:id=""@+id/four""                                        android:layout_width=""fill_parent""                                        android:layout_height=""wrap_content""                                        android:layout_column=""1""                                        android:text=""aasdfasfasdfasgeargfsgsfd""                                        android:padding=""6dip""                                        android:textColor=""#000000""                                        android:singleLine=""true""                                        android:ellipsize=""end"" /&gt;                                &lt;/LinearLayout&gt;                            &lt;/TableRow&gt;                        &lt;/TableLayout&gt;                    &lt;/TableRow&gt;                &lt;/TableLayout&gt;            &lt;/TableRow&gt;        &lt;/TableLayout&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","406790","","","","","2010-09-16 21:31:48","Problem with some advanced UI","<android><tablelayout><android-linearlayout>","2","4","","",""
"3410475","1","3436633","","2010-08-04 22:47:43","19","7455","<p>I am currently developing an android application uses Google map API.</p><p>I am wondering do all android devices support map API, becuase this api is an optinal api and it is an add-on to the platform.</p><p>I am worried that my application won't be able to run on that device.</p><p>What I need to know is programatically detect wether the device support map API, and catch the exception and do something else.</p><p>Because, using map capability is only one of features of my application, I would like to let those devices that don't support map api can still download and run my application with out effecting other features of my app. </p><p>Any comment or suggestions are welcome</p>","399820","","399820","","2013-05-17 23:32:54","2013-05-17 23:32:54","How to detect an android device whether it supports google maps API","<android>","7","0","13","",""
"3410486","1","","","2010-08-04 22:49:47","4","754","<p>Is there an easy way to merge 2 3gp (amr) audio files into a single audio file?</p><p>I need them to be synchronous/over top of each other not one after the other.  I am using android to do this.  I have heard somewhere that for some audio formats you can simply add the bytes (being careful that you dont get a too high or too low result).  Is this true with the 3gp/amr format on android?</p>","411358","","331473","","2011-11-23 05:37:19","2012-04-18 08:36:30","3GP/AMR mix/merge tracks","<android><audio><mixing><3gp><amr>","1","0","","",""
"3410578","1","3410599","","2010-08-04 23:10:53","0","1103","<p>Say that the user has started my App and then switched off to use the Browser (so we have 2 sets of Tasks running). After a while, something happens to my app that requires the user's attention, so it posts a notification to notify the user. Is there a way to bring my App's task (and the Activity on top of the stack) out from the background when user clicks on my notification?</p>","440093","","","","","2010-08-04 23:17:14","Android: How to give focus to a background Activity belonging to a different task?","<android>","2","0","0","",""
"3410722","1","","","2010-08-04 23:44:01","2","1650","<p>I'm trying to figure out how to implement a <em>basic augmented reality application that uses a piece of (real) paper to navigate (simple rotate, zoom) a virtual 3d or pseudo-3d space.</em> </p><p>The example implementation that comes to mind is the <a href=""http://www.harrypotter3d.com/"" rel=""nofollow"">Harry Potter 3D Augmented Reality ad</a>, where you can take a piece of paper, point it at your webcam (at the right angle/distance), and 3d buildings and such would pop up (on your screen). You can then turn the paper around to rotate the building, or even zoom in. </p><p>The example above is done using Shockwave. I'm wondering if there are better web-friendly plugin's, such as Flash (or even HTML5, if webcam integration works?) that might be able to do the same? </p><p>Also, are there ways to optimize grid detection, so that the effect is less ""lossy"" - with the HP example, the buildings often lose their ""bearings"" on the real paper and just freeze onscreen. </p><hr><p>It looks like there's already a class (for flash) - portability for iphone(?)<a href=""http://www.libspark.org/wiki/saqoosha/FLARToolKit/en"" rel=""nofollow"">http://www.libspark.org/wiki/saqoosha/FLARToolKit/en</a></p><p><a href=""http://www.adobe.com/devnet/flash/articles/bow_cards.html"" rel=""nofollow"">http://www.adobe.com/devnet/flash/articles/bow_cards.html</a>http://www.adobe.com/devnet/flash/articles/augmented_reality.html</p><p>It seems to work best with solid-color images though, rather than a complicated map, as in the HP example. </p><p>Is it possible to get the cam on an Android or iPhone to do the augmented reality effect? </p>","357189","","357189","","2010-08-05 00:32:21","2010-09-02 05:02:41","Augmented Reality via (common) Web Cam / iPhone / Android - Grid Detection? - Harry Potter 3D Example","<iphone><android><webcam><augmented-reality><shockwave>","2","0","1","",""
"3410807","1","3412985","","2010-08-05 00:00:12","2","2340","<p>So my app downloads images at the users' request from an online source.  Through a button in the activity, the user can choose to hide or show the images in the gallery.  This is easy enough, I just add or remove a .nomedia file as needed.  However, I want to rescan media every time so that the change is instant, and requires no further user interaction.</p><p>After each image is downloaded, I am using the method at <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg24164.html"" rel=""nofollow"">http://www.mail-archive.com/android-developers@googlegroups.com/msg24164.html</a> to scan the specific image into the library.  That works great for one image, but when the .nomedia file is added, I really need to be able to scan a whole directory.</p><p>I have considered calling the MediaScannerNotifier on each image in the directory, but that just seems clumsy and lazy. </p><p>Advice?</p>","241204","","","","","2013-04-14 11:18:21","On Android: How can I rescan an entire folder to watch for changes in .nomedia","<android><android-sdcard>","3","0","","",""
"3410810","1","8820285","","2010-08-05 00:01:20","7","1690","<p>I am writing a music player that uses a custom Adapter extending BaseAdapter (efficiency adapter) that I want to display in an <code>AlertDialog</code> using <code>setAdapter()</code> where the user can either click on one of the songs to switch to that position in the playlist OR check songs to remove from the playlist. I tried using a custom click listener so that a user could just long click to remove the item from the list but the <code>listview</code> just doesn't work right... it was removing the wrong items (the ones at the end) even though the <code>ArrayList</code> contained the correct playlist items... (when I removed the item from the <code>ArrayList</code>, I passed it to the adapter which called <code>notifyDataSetChanged</code>... but that just didn't work as I mentioned. There is definitely a bug in the <code>AlertDialog ListView</code>... because there is no reason for it to have popped off the results from the end rather than the correct item.</p><p>So... the next method I would like to try is to use the <code>setMultiChoiceItems()</code> method of the <code>AlertDialog</code>... but it appears that it doesn't work with a custom adapter... only simple arrays. Will I have to subclass <code>AlertDialog</code> and <code>Override</code> the <code>setMultiChoiceItems()</code> method or is there a way I can make it work with an <code>ArrayAdapter</code>?</p><p>Basically, I can't figure out how to even iterate the list that the <code>AlertDialog</code> creates or whether it even passes that view somehow. In addition, I don't think I can even listen to clicks on <code>checkboxes</code> if I add those to the row. Any help will be greatly appreciated.</p><p>EDIT: Asking questions here is like magic... I answered my own question... this is how I did it. I added a hint to each <code>checkbox</code> which is the position of the item in the <code>ArrayList</code>. Then I used <code>OnCheckedChangeListener</code> to capture the selections. When you set a hint it adds text to the <code>checkbox</code>... since the background of the <code>AlertDialog</code> is white (even for clicked items?) I just set the hint text color to transparent.</p><pre><code>holder.check.setHintTextColor(Color.TRANSPARENT);holder.check.setHint(String.valueOf(position));holder.check.setOnCheckedChangeListener(new OnCheckedChangeListener() {public void onCheckedChanged(CompoundButton buttonView,            boolean isChecked) {        int position = Integer.parseInt((String) buttonView.getHint());        Log.v(""onCheckedChanged"", ""Checked: ""+isChecked+"" returned: ""+position+"" which should be ""+getItem(position).name);                             }});</code></pre>","386654","","991737","","2012-01-11 12:21:49","2012-01-11 13:43:13","How to use setMultiChoiceItems() with a Custom AlertDialog that uses an efficiency arrayadapter?","<android><alertdialog>","1","1","","",""
"3410912","1","3412784","","2010-08-05 00:32:51","3","915","<p>I've bound data from a SQLite database table to a ListView using a <code>SimpleCursorAdapter</code>. This works well when I use <code>_id INTEGER PRIMARY KEY AUTOINCREMENT</code> as my table's primary key. However, I'm trying to use a composite primary key such as the following:</p><pre><code>CREATE TABLE table (column1,column2,column3,PRIMARY KEY (column1, column2));</code></pre><p>From what I can gather, the <code>SimpleCursorAdapter</code> constructor requires the _id column to work. I cannot find a way to construct the <code>SimpleCursorAdapter</code> with the composite primary key.</p>","382252","","382252","","2010-08-05 01:19:09","2010-08-05 08:00:56","Set ListView Adapter with composite PRIMARY KEY in SQLite table","<java><android><sqlite>","1","0","","",""
"3410924","1","","","2010-08-05 00:35:30","4","434","<p>I'm making an app that can launch other apps.  I've got it launching apps fine using Spinners, however, I would also like to give the user the ability to launch direct dials from it.</p><p>As it is right now I've got ""hot key"" buttons that the user can configure.  Currently, when the user wants to configure one of these ""hot keys"" I use a spinner to let them choose from all the installed applications on their phone.  For starters, I would like it if they are able to view both installed applications and shortcuts in the spinner so that they can map a direct dial to one of these ""hot keys.""  </p><p>So my main questions are, how can I go about looking up all the defined shortcuts available and execute them and how could I create my own direct dials in my app?</p>","368542","","731683","","2011-05-24 23:58:36","2011-06-15 22:00:27","Adding direct dial shortcuts to my app","<android><android-intent><shortcut>","2","0","3","",""
"3411223","1","","","2010-08-05 01:55:28","2","949","<p>I want to do something like andriod home screen effect. when i click the screen and move. the current view will move and next view also can show.</p><p>Now the code only can show the current view. </p><p>Thank you for your help</p><p>The source as follow:</p><pre><code>public class test extends Activity implements OnTouchListener{float downXValue;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Set main.XML as the layout for this Activity    setContentView(R.layout.main);    // Add these two lines    LinearLayout layMain = (LinearLayout) findViewById(R.id.layout_main);    layMain.setOnTouchListener((OnTouchListener) this);     // Add a few countries to the spinner    Spinner spinnerCountries = (Spinner) findViewById(R.id.spinner_country);    ArrayAdapter countryArrayAdapter = new ArrayAdapter(this,android.R.layout.simple_spinner_dropdown_item,new String[] { ""Canada"", ""USA"" });    spinnerCountries.setAdapter(countryArrayAdapter);}public boolean onTouch(View arg0, MotionEvent arg1) {    // Get the action that was done on this touch event    switch (arg1.getAction())    {        case MotionEvent.ACTION_DOWN:        {            // store the X value when the user's finger was pressed down            downXValue = arg1.getX();            break;        }        case MotionEvent.ACTION_UP:        {            // Get the X value when the user released his/her finger            float currentX = arg1.getX();                        // going backwards: pushing stuff to the right            if (downXValue &lt; currentX)            {                // Get a reference to the ViewFlipper                 ViewFlipper vf = (ViewFlipper) findViewById(R.id.details);                 // Set the animation                  vf.setAnimation(AnimationUtils.loadAnimation(this, R.anim.push_left_out));                  // Flip!                  vf.showPrevious();            }            // going forwards: pushing stuff to the left            if (downXValue &gt; currentX)            {                // Get a reference to the ViewFlipper                ViewFlipper vf = (ViewFlipper) findViewById(R.id.details);                 // Set the animation                 vf.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.push_left_in));                  // Flip!                 vf.showNext();            }            break;        }        case MotionEvent.ACTION_MOVE:          ViewFlipper vf = (ViewFlipper) findViewById(R.id.details);            final View currentView = vf.getCurrentView();             currentView.layout((int)(arg1.getX() - downXValue),                    currentView.getTop(), currentView.getRight(),                     currentView.getBottom());             /*may be do something in thest*/        break;    }    // if you return false, these actions will not be recorded    return true;}}</code></pre>","411452","","1043882","","2012-09-30 16:29:41","2012-10-15 13:34:52","Android Home Screen effect","<android><screen><home>","1","0","1","",""
"3411314","1","3420801","","2010-08-05 02:22:03","0","1308","<p>When I stream music using the MediaPlayer, it gives me the wrong song duration.  Has anyone else encountered this?  Work around tips appreciated.</p>","209940","","","","","2010-08-09 19:11:56","Android MediaPlayer - How to get Correct Duration from Streamed File","<android><streaming><music><media-player>","2","0","","",""
"3411413","1","3412775","","2010-08-05 02:47:37","1","481","<p>An activity I have starts an AsyncTask. What is the best way of getting the Activity notified that the AsyncTask is done. I can pass the Activity as a Context in, but I don't want the AsyncTask to know about the type of the Activity.</p><p>In .NET land I would subscribe to an event on the ""AsyncTask"". I didn't find a way to do that in Android.</p>","172861","","","","","2010-08-05 07:59:26","Android AsyncTask Pub Sub to Context?","<android><android-asynctask>","1","0","","",""
"3411421","1","","","2010-08-05 02:49:50","0","1771","<pre><code>                AlertDialog.Builder fpdialog = new AlertDialog.Builder(context);                ListView fpathlist = new ListView(context);                ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(context,android.R.layout.simple_expandable_list_item_1, fpathdata());                OnItemClickListener listener = new OnItemClickListener() {                    public void onItemClick(AdapterView&lt;?&gt; parent, View view,                            final int position, long arg3) {                        // TODO Auto-generated method stub                        for (int i=0;i&lt;=position;i++)                        {                            if (i==position)                            {                                CharSequence[] pathString = {""?????"",""???"",""??"",""??""};                                final AlertDialog.Builder pathlist = new AlertDialog.Builder(context);                                pathlist.setTitle(""????"");                                pathlist.setItems(pathString, new DialogInterface.OnClickListener() {                                    public void onClick(DialogInterface dialog, int which) {     //Here I want to dismiss the fpdialog                                                                      }});                                pathlist.show();                            }                        }                    }                };                fpathlist.setOnItemClickListener(listener);                fpathlist.setAdapter(adapter);                fpdialog.setView(fpathlist);                fpdialog.show();</code></pre>","410220","","","","","2010-08-05 13:32:16","How can I dismiss the dialog?","<android>","2","0","","",""
"3411424","1","3411678","","2010-08-05 02:51:22","0","375","<p>As asked, is it possible? Here's part of my code.I don't know how to change it, please help me! </p><pre><code>Bundle b = New_Entry.this.getIntent().getExtras();</code></pre><p>String s1 = b.getString(""image""); </p><p>try { </p><p>new File(""/sdcard/myImages"").mkdirs();</p><p>InputStream in = getResources().openRawResource(imageSID[position]);</p><p>File f2 = new File(""/sdcard/myimages""+filename[position]); </p><p>OutputStream out = new FileOutputStream(f2);</p><p>byte[] buf = new byte[1024];</p><p>int len;</p><p>while ((len = in.read(buf)) > 0){</p><p>out.write(buf, 0, len);}</p><p>in.close();</p><p>out.close();</p><p>} catch(Exception x) {</p><p>Toast.makeText(getBaseContext(), ""Error!"", Toast.LENGTH_SHORT).show();</p><p>}</p><p>And yes, the error toast came up!</p>","372750","","372750","","2010-08-05 03:18:30","2010-08-05 04:07:33","Able to insert passed image value into sdcard?","<android><sd-card>","1","1","","",""
"3411433","1","","","2010-08-05 02:55:47","0","325","<p>How can I know which childview is shown on the current device screen, in a scrollview?</p><p>I want to make an infinite Ruler App, so I need to dynamically add and remove view when the view is flipping, but how and where can I find out which childview is shown on the current device screen, so I can add or remove the correct view when I get that childview changed notify?</p><p>Or, can anyone who can give me some other idea to realize this function?</p>","411475","","15168","","2010-08-05 03:03:25","2011-06-30 17:11:36","How can I know which childview is shown on the current Device screen in a scrollview?","<android><view><scroll>","2","0","1","",""
"3411480","1","3411558","","2010-08-05 03:12:13","12","6168","<p>I'm trying to download a large file from my Yahoo! web site server which apparently is setup (not by me) to disconnect downloads if they are not completed within 100 seconds.  The file is small enough to usually successfully transfer.  On the occasions when the data rate is slow and the download gets disconnected, is there a way to resume the URLConnection at the file offset where the disconnection occurred?  Here's the code:</p><pre><code>// Setup connection.URL url = new URL(strUrl[0]);URLConnection cx = url.openConnection();cx.connect();// Setup streams and buffers.int lengthFile = cx.getContentLength();InputStream input = new BufferedInputStream(url.openStream());OutputStream output = new FileOutputStream(strUrl[1]);byte data[] = new byte[1024];// Download file.for (total=0; (count=input.read(data, 0, 1024)) != -1; total+=count) {    publishProgress((int)(total*100/lengthFile));    output.write(data, 0, count);    Log.d(""AsyncDownloadFile"", ""bytes: "" + total);}// Close streams.output.flush();output.close();input.close();</code></pre>","411972","","19750","","2010-08-05 03:49:46","2010-08-05 03:49:46","how to resume an interrupted download","<java><android><http>","1","1","19","",""
"3411510","1","","","2010-08-05 03:20:20","0","324","<p>I have a ListView filled with twitter tweets. I made a custom Tweet class so I could store a special type number. So, I have the Tweet class and custom ArrayAdapter:</p><pre><code>class Tweet {    private int typeNumber; // My unique type number which does not come from Twitter    private String message;    // ... other tweet data}class TweetsAdapter extends ArrayAdapter&lt;Tweet&gt; {   private ArrayList&lt;Tweet&gt; tweets;   TweetsAdapter(Context context, int textViewResourceId, ArrayList&lt;Tweet&gt; tweets) {       super(context, textViewResourceId, tweets);       this.tweets = tweets;   }   public View getView(int position, View convertView, ViewGroup parent) {     // Inflate my own view and set my own tweet row information   }}</code></pre><p>There is a nav bar which has 4 Buttons representing the 4 special type numbers.I want to display a filtered tweet ListView when a person clicks on one of the type number buttons without destroying the data in the ArrayAdapter.</p><p>One approach I came up with is to break up my main tweets ArrayList into sub-ArrayLists and set a new ArrayAdapter with the corresponding sub-ArrayList on the ListView every time you click one of the Buttons. That seems inefficient to instantiate a new ArrayAdapter every time.</p><p>Is there a better way to display a filtered ListView while maintaining all the tweet data on the ArrayAdapter(I also tried looking at the filter class and it seems to destroy the data on the adapter to ""filter"")?</p>","411496","","","","","2010-08-05 04:22:45","Android ListView Filtering Without Repeatedly Instantiating ArrayAdapters","<java><android>","1","0","","",""
"3411525","1","3411619","","2010-08-05 03:24:11","3","400","<p>I am currently working on a wallpaper application and I was wondering if there is a way to make the bitmap look less blurry and more crisp once it is set as a wallpaper.Does it just require cropping the picture and resizing it to fit perfectly the size of the screen or there is some other way of solving this issue?</p><p>ps: i read that the application wallpaper set and save is able to deliver very good quality wallpapers once launched !</p><p>Cheers </p><p>-Amine </p>","410019","","","","","2010-08-05 03:51:36","Cropping a wallpaper in order to have a crisp image","<java><android><wallpaper>","1","0","2","",""
"3411577","1","3411720","","2010-08-05 03:38:16","0","445","<p>Here is the example code:</p><pre><code>ImageView carrotsmile =(ImageView) findViewById(R.id.carrotsmile);rocketImage.setBackgroundResource(R.drawable.animation);main = (AnimationDrawable) carrotsmile.getBackground();}}</code></pre><p>What would I replace  rocketAnimation,  carrotsmile, rocketimage, and main with?Like my XML files or something in the xml files, or an image?</p><p>Please explain what they all are.</p>","394842","","","","","2010-08-05 04:20:59","Android - Frame Animation: Which IDs go where?","<android><eclipse><animation><frame>","1","0","","",""
"3411611","1","","","2010-08-05 03:49:20","1","264","<p>Currently, I'm using the following code across all of my activities in my app to store application level variables and carry values between activities..</p><pre><code>prefs = this.getSharedPreferences(""MyPrefs"", Context.MODE_PRIVATE);</code></pre><p>I didn't have a PreferenceActivity prior to this, but now I do and I am looking to store a few user prefs from this new PreferenceActivity in the same sharedPreferences tag, ""MyPrefs"".</p><p>I know I can access the PreferenceActivity SharedPrefs from my activities via</p><pre><code>prefs = PreferenceManager.getDefaultSharedPreferences(this);</code></pre><p>but I would like those values saved to my current sharedPreferences tag, ""MyPrefs"", but I'm not sure how to do this.</p><p>Thanks in advance..</p>","350237","","","","","2012-03-22 07:27:55","Can I use my current SharedPreferences tag to store the values from a PreferenceActivity?","<android>","3","0","0","",""
"3411704","1","3413805","","2010-08-05 04:16:04","3","1427","<p>I""m planning to store my data in a binary format as a resource, read it into an int buffer and basically pass it straight down to a native C++ function, which might cast it to a struct/class and work with it. No pointers, obviously, just ints and floats.</p><p>The question is - what kind of fixing up do I need to do? I suppose that I need to check <code>ByteOrder.nativeOrder()</code>, figure out if it's big endian or little endian, and perform byte-swapping if need be.</p><p>Other than that, floats are presumably guaranteed to be expected in IEEE 754 format? Are there any other caveats I'm completely overlooking here?</p><p>(Also - since I'm compiling using the NDK, I know what architecture it is already (ARMv7-A, in my case), so can I technically skip the endian shenanigans and just take the data the way it is?)</p>","345717","","44390","","2012-06-15 16:46:26","2012-06-15 16:46:26","Is the binary representation of native types guaranteed the same on all targets?","<android><floating-point><android-ndk><arm><endianness>","1","2","1","",""
"3411773","1","","","2010-08-05 04:34:49","5","4956","<p>I am currently developing an app that retrieves some data from the internet .For this purpose i use SAX ,i used it before for parsing simple xml files like google weather api .However the websites that i am interested in take parsing to the next level ,the page is huge and looks messy. I only need to retrieve some specific lines ,the rest is not useful for me.I was wondering if it is possible to skip those useless lines/tags or i have to go step by step ?</p>","410019","","73488","","2010-08-20 06:33:46","2011-04-18 07:08:08","Parsing big XML files using SAX parser (skip some lines/tags)","<java><android><xml><saxparser>","7","1","1","",""
"3411778","1","3415573","","2010-08-05 04:36:24","1","6297","<p>i want to open twitter auth in my webview rather then opening in browser, any good tutorial how to play with webview in dialog and loading it inside dialog?</p>","216431","","","","","2012-07-30 09:23:19","android loading webview in dialog","<android><dialog><webview>","3","0","1","",""
"3411869","1","","","2010-08-05 04:58:58","0","1089","<p>I am new to Android development. I have studied the basics/architecture and the components of android.But now i require few working examples/applications of Android to work on.So please someone can provide me links for few basic examples of Android ?</p><p>Thanks...</p><p>Best Regards</p>","406631","","1228","","2013-08-15 12:34:19","2013-08-15 12:34:19","Require Examples for Android development","<android>","5","0","","2013-08-15 16:19:38",""
"3411890","1","","","2010-08-05 05:05:01","0","486","<p>I am new to android.I have tested the android.view.menu by the following code..It works.</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.Menu;public class menu extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    public boolean onCreateOptionsMenu(Menu menu)    {    menu.add(Menu.NONE, 1, Menu.NONE, ""1 Pixel"");    menu.add(Menu.NONE, 2, Menu.NONE, ""2 Pixels"");    menu.add(Menu.NONE, 3, Menu.NONE, ""8 Pixels"");    menu.add(Menu.NONE, 4, Menu.NONE, ""16 Pixels"");    menu.add(Menu.NONE, 5, Menu.NONE, ""24 Pixels"");    menu.add(Menu.NONE, 6, Menu.NONE, ""32 Pixels"");    menu.add(Menu.NONE, 7, Menu.NONE, ""40 Pixels"");    return(super.onCreateOptionsMenu(menu));    }}</code></pre><p>I just what to know how to add action to each menu.whether we can add intent to each menu buttons.if possible please help me out.Thanks in advance.. </p>","366916","","727811","","2012-11-04 00:54:01","2012-11-04 00:56:12","android -Menu function","<android>","1","1","","",""
"3411995","1","","","2010-08-05 05:33:19","1","1444","<p>I am trying to send an audio file converted to a byte array with SMS using SMSManager.sendDataMessage.</p><p>But, I am unable to send it to other phone. Can any suggest how can I do it?</p>","321234","","","","","2010-08-06 13:47:57","Send Audio data with SMS in android","<android><sms>","1","1","","",""
"3412005","1","","","2010-08-05 05:34:51","1","743","<p>I want to implement conference call. For this i tried listening phone states and as call is received from some number it makes notification to the user we want to involved in conference. Then the person receives notification make the call but i was unable to accept this call without user notification. Please suggest some method to implement this.....</p>","404052","","60261","","2010-08-05 05:35:58","2010-08-05 05:35:58","How to receive call programmatically without user notification in android?","<java><android>","0","2","","",""
"3412012","1","","","2010-08-05 05:36:14","0","369","<p>In an if statement, I have a finish() because I don't want the control to go any further. But, the app exits, but as I see from the logcat, the control goes beyond finish(). </p><p>Maybe that's also the reason why a toast supposed to be displayed and some other GUI actions before finish() are not taking place?</p><p>Please advice.</p>","381699","","","","","2010-08-05 05:38:43","problem with finish() :Android","<android><gui><exit><toast>","1","0","","",""
"3412013","1","3414380","","2010-08-05 05:36:21","4","1618","<p>We have a set of 3-5 android applications that we have developed for an enterprise to integrate with our back-end. How do we create an installer system that upgrades applications automatically. We were thinking of getting version numbers and querying the backend to get current versions and downloading them.</p><p>How do I get the version number of an application in Android?</p><pre><code>ApplicationInfo info = getApplicationInfo();try {    info = getPackageManager().getApplicationInfo(info.packageName, PackageManager.GET_META_DATA);    } catch (NameNotFoundException e) {        e.printStackTrace();    }</code></pre><p>Any pointers will be most useful.</p><p>ThanksSameer</p>","356580","","12534","","2014-02-05 09:31:31","2014-02-05 09:31:31","How do I get the version number of an application in Android?","<android>","1","0","1","",""
"3412129","1","3412141","","2010-08-05 06:01:50","0","153","<p>I am using android build target vendor version 2.2.</p><p>I want to access/read sqlite3 database file of an application A from an application B. Is it possible to do so? because i don't want to import that DB file of apps A in Apps B. </p>","329701","","329701","","2010-08-05 07:33:15","2010-08-05 09:24:20","Is it Possible to access the sqlite3 db of one application from other in Android?","<android><sqlite3>","2","0","","",""
"3412170","1","","","2010-08-05 06:10:47","2","897","<p>Is there anyway in android to loop a recorded audio through microphone. I mean that instead of speaking in microphone, i should be able to send a recorded audio from code into it.  </p>","405521","","12707","","2010-08-05 06:12:29","2010-10-18 19:43:40","Loop an audio through microphone in Android?","<android><microphone>","0","6","1","",""
"3412180","1","3412907","","2010-08-05 06:13:56","8","11469","<p>i need to know, how to recognize, which button is pressed.Like if i have two buttons ,say button 1 and button2,and both of them performing the same method, say method(),how to determine which button pressed ?</p><p>Regards</p>","1497488","","","","","2013-07-11 01:12:21","How to determine which button pressed on android","<android>","3","0","1","",""
"3412200","1","3414228","","2010-08-05 06:17:25","0","1291","<p>Trying to write a game such that most of the screen gets filled with my GameView (custom view, derived from View)</p><p>I then want to have an area at the bottom of the screen for messages etc.  In the following I'm just trying to put a button there to illustrate the issue.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout         xmlns:android=""http://schemas.android.com/apk/res/android""         android:orientation=""vertical""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""&gt;    &lt;my.GameView         android:id=""@+id/gameview""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content"" /&gt;    &lt;Button         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""Action1"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>When this runs the button never shows.  If I move the button before the GameView then it works with the button at the top of the screen.  As it is above GameView is somehow grabbing all the screen.  Tried also giving GameView a layout_weight of 1 with button having 0 (and vice-versa)</p><p>Do I have to implement the onMeasure stuff in GameView (which I couldn't quite get my head round yet) or am I missing something?</p>","199816","","","","","2010-08-05 11:29:51","Android view fills screen using linerlayout","<android><layout><view><android-linearlayout>","2","0","","",""
"3412250","1","3412811","","2010-08-05 06:27:10","1","385","<p>I modeled my game after the Lunar Lander demo that Google provides, and it uses Canvas and onDraw() methods, but I want to get better performance by using Opengl.</p><p>How much work is it to convert it to Opengl? Can I just replace the ondraw methods with opengl's texture methods or something? Or do I have to completely recreate the game?</p><p>Cause I already have surfaceview implemented and I thought I read somewhere that Opengl uses this as well.</p><p>Sorry I'm totally new at Opengl. If anyone could point me into the right direction I would appreciate it!</p><p>I have looked at </p><p><a href=""http://nehe.gamedev.net/"" rel=""nofollow"">http://nehe.gamedev.net/</a> </p><p><a href=""http://blog.jayway.com/author/pererikbergman/"" rel=""nofollow"">http://blog.jayway.com/author/pererikbergman/</a></p><p>But these are all 3d, im looking to implement a way to draw 2d graphics.</p>","394093","","44729","","2011-05-26 15:44:53","2011-05-26 15:44:53","Convert Lunar Lander to use Opengl","<android><opengl-es><canvas><ondraw>","1","0","","",""
"3412291","1","3413168","","2010-08-05 06:36:40","2","289","<pre><code>package one.two;import android.app.Activity;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.SimpleCursorAdapter;import android.widget.Spinner;import android.widget.TextView;import android.widget.AdapterView.OnItemSelectedListener;public class Booking extends Activity{    private DBAdapter db;     private Spinner colourSpinner;    public Cursor c;    public TextView txtArrival;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        db = new DBAdapter(this);        this.setContentView(R.layout.booking);        db.open();        fillData();        db.close();        Spinner colourSpinner = (Spinner) findViewById(R.id.myspinner);    }    private void fillData()    {        Cursor c = db.getSpinnerData();        startManagingCursor(c);        String[] from = new String[]{DBAdapter.KEY_ARRIVAL};        int[] to = new int[]{android.R.id.text1};        SimpleCursorAdapter adapter =        new SimpleCursorAdapter(this,R.layout.booking, c, from, to );        adapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );        Spinner colourSpinner = (Spinner) findViewById(R.id.myspinner);        colourSpinner.setAdapter(adapter);    }    public class MyOnItemSelectedListener implements OnItemSelectedListener    {        public void onItemSelected(AdapterView&lt;?&gt; arg0, View v,int position, long id)        {            if (Booking.this.c.moveToPosition(position)) {                String title=Booking.this.c.getString(1);                Booking.this.txtArrival.setText(title);            }        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; arg0)        {            // TODO Auto-generated method stub        }    };}</code></pre><p>Error log</p><pre><code> 08-06 01:27:34.874: ERROR/AndroidRuntime(721): Uncaught handler: thread main exiting due to uncaught exception08-06 01:27:34.893: ERROR/AndroidRuntime(721): java.lang.NullPointerException08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at one.two.Booking$MyOnItemSelectedListener.onItemSelected(Booking.java:53)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.widget.AdapterView.fireOnSelected(AdapterView.java:856)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.widget.AdapterView.access$200(AdapterView.java:41)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:827)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.os.Handler.handleCallback(Handler.java:587)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.os.Handler.dispatchMessage(Handler.java:92)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.os.Looper.loop(Looper.java:123)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.app.ActivityThread.main(ActivityThread.java:3948)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at java.lang.reflect.Method.invokeNative(Native Method)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at java.lang.reflect.Method.invoke(Method.java:521)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Thank you.</p>","358218","","358218","","2010-08-06 02:53:06","2010-08-06 02:53:06","Anything wrong with my code?","<android><eclipse><sqlite><spinner>","3","6","1","",""
"3412300","1","","","2010-08-05 06:38:21","7","260","<p>I'm exploring using Scala with its <a href=""http://en.wikipedia.org/wiki/Comet_%28programming%29"" rel=""nofollow"">Comet</a> facilities for my next project and was curious if anyone had experience using Comet (not necessarily Scala) with:</p><ul><li>WebOS</li><li>Android</li><li>iOS</li></ul><p>All these phones are WebKit, which should mean that my Chrome tests would work equally well, but I don't know how long-polling connections work over 3G (or whether they eat the battery alive).</p><p>Thoughts?</p>","13257","","318465","","2011-08-17 21:22:02","2011-08-17 21:22:02","Scala Comet and Mobile Applications","<android><ios><mobile><comet><webos>","1","0","3","",""
"3412410","1","3415509","","2010-08-05 06:58:58","0","1323","<p>Does this call block? Or is it in another thread and control can go beyond this statement? </p>","381699","","","","","2010-12-14 14:38:21","sendEmptyMessageDelayed : Android","<android><handler><messages><timedelay>","1","0","","",""
"3412416","1","3412486","","2010-08-05 07:00:26","3","8715","<p>Hi im working on an app  that use gps My testing devices are Nexus One and Htc Mytouch 3g Slide</p><p>So does anyone know how to improve the gps accuracy?</p>","283896","","31161","","2011-08-04 12:07:13","2013-05-08 11:15:32","Improve GPS Accuracy Android","<android><gps><htc>","3","0","6","",""
"3412447","1","3412571","","2010-08-05 07:06:14","0","815","<p>I've been doing the following for the last three days without any success.</p><p>Suppose I have one image. I have set that image invisible in my XML layout. Now I want to make it visible through animation. Suppose translate animation.</p><p>Suppose there is point A and point B. On point B I have already set the image invisible. From point A I want a translate animation effect. And when it completes, the image B becomes visible.</p><p>Please help me.</p>","383597","","1128737","","2012-01-11 22:03:22","2012-01-11 22:03:22","Android image animation","<android>","1","0","","",""
"3412682","1","3413874","","2010-08-05 07:44:57","5","821","<p>I'm completing a project for the iPhone entirely written in Objective-C. I'd like to port this for Android too.</p><p>While the user interface of the iPhone and the Android OS are very different and will need different code, can I some how import the core of my code (ie. the black box that does the thinking) as is to Android as part of some Java code?</p><p>I have no familiarity with bridging between Objective-C and Java even though I have written in both.</p>","283311","","283311","","2012-12-20 23:02:25","2013-06-04 08:37:25","Android and Objective-C","<objective-c><android>","4","0","3","",""
"3412708","1","","","2010-08-05 07:49:41","2","3605","<p>On a Nexus One (for example), the camera application is able to capture H.264 video at 720x480 (the ""High"" quality setting). However, when using the MediaRecorder API, it always seems to capture at a fixed frame size of 320x240.</p><p>I would expect the setVideoSize() method to control the frame size (as in the prepare fragment below), but it appears to have no effect (using Froyo 2.2 Android SDK).</p><pre><code>MediaRecorder recorder = new MediaRecorder();recorder.setAudioSource(MediaRecorder.AudioSource.MIC);recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);recorder.setOutputFile(PATH_TO_FILE);recorder.setVideoSize(720,480);recorder.setPreviewDisplay(holder.getSurface());recorder.prepare();</code></pre><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/a01d2d8b0e4b69e3/0bff4bf9e6653487"" rel=""nofollow"">Discussions on the android developers list</a> seem to indicate this is a long standing issue. Can anyone advise how the frame size can be controlled, or if it is possible at all with the current API?</p>","6329","","","","","2011-12-22 14:14:16","How to control the frame height and width of captured video: setVideoSize() does not work","<android><video><video-capture>","3","0","3","",""
"3412871","1","3412904","","2010-08-05 08:14:33","0","384","<p>I have a singleton in an activity. When I end my application (like pressing back button), and start it again after some time, the singleton is not recreated, but is holding previous state. Singleton is not destroyed if the application is destroyed? Do I have to null its static members in onDestroy() to avoid memory leak?Thanks.</p>","411690","","","","","2010-08-05 08:29:11","live singleton after ending activity","<android><singleton>","1","0","","",""
"3412901","1","","","2010-08-05 08:19:50","0","362","<p>can anybody give example how to implement click event in appwidget in android ?</p><p>Thanks</p>","386430","","3171","","2010-08-05 08:22:29","2011-10-08 07:01:24","android widget question","<android><android-widget>","3","0","","",""
"3412952","1","3415291","","2010-08-05 08:27:59","5","3248","<blockquote>  <p>Looked like my #$#%$%#$ the receiver was not i application element in manifest</p></blockquote><p>Hi</p><p>I just created the helloworld appwidget to see how its works. i followed the dev example on adroid dev site. But for some reason the widget does not want to show in the widget list.</p><p>AndroidManifest.xml</p><pre><code> &lt;receiver android:name=""VoiceRIAWidget"" android:label=""Voice RIA""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;        &lt;/intent-filter&gt;        &lt;meta-data android:name=""android.appwidget.provider""            android:resource=""@xml/appwidget_info"" /&gt;    &lt;/receiver&gt;</code></pre><p>appwidget_info.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;appwidget-provider xmlns:android=""http://schemas.android.com/apk/res/android""    android:label=""Voice RIA"" android:minWidth=""50dp"" android:minHeight=""50dp""    android:updatePeriodMillis=""86400000"" android:initialLayout=""@layout/appwidget""&gt;&lt;/appwidget-provider&gt;</code></pre><p>VoiceRIAWidget</p><pre><code>public class VoiceRIAWidget extends AppWidgetProvider{    @Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager,            int[] appWidgetIds)    {        final int N = appWidgetIds.length;        for (int i = 0; i &lt; N; i++)        {            int appWidgetId = appWidgetIds[i];            CharSequence text = ""Hello"";            RemoteViews views = new RemoteViews(context.getPackageName(),                    R.layout.appwidget);            views.setTextViewText(R.id.appwidget_text, text);            appWidgetManager.updateAppWidget(appWidgetId, views);        }        super.onUpdate(context, appWidgetManager, appWidgetIds);    }}</code></pre><p>appwidget.xml    </p><pre><code>&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/appwidget_text"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:textColor=""#ff000000"" /&gt;</code></pre><p>I cant see what i am missing it runs but nothing in list.</p>","106955","","1236185","","2012-10-10 18:41:44","2012-10-10 18:41:44","Android appwidget not showing","<android><android-appwidget>","3","0","2","",""
"3413157","1","3422200","","2010-08-05 08:59:16","4","9280","<p>Im struggling with the done button on the soft keyboard. I can't get the soft keyboard Done key press to hide the keyboard. From another button, it works perfectly with <code>imm.hideSoftInputFromWindow(editText.getApplicationWindowToken(), 0);</code> but the onKeyListener does not function the way I want. When I hit the editText, the soft keyboard shows up and its content is cleared from characters.</p><p>Thanx for listening!</p><p>The main.xml:</p><pre><code>&lt;EditText     android:id=""@+id/answer""     android:layout_gravity=""center_horizontal"" android:textSize=""36px""    android:inputType=""phone""    android:minWidth=""60dp"" android:maxWidth=""60dp""/&gt;</code></pre><p>The Java file:</p><pre><code>private EditText editText;...editText = (EditText)findViewById(R.id.answer);editText.setOnClickListener(onKeyboard);editText.setOnKeyListener(onSoftKeyboardDonePress);...// method not working:private View.OnKeyListener onSoftKeyboardDonePress=new View.OnKeyListener() {    public boolean onKey(View v, int keyCode, KeyEvent event)     {        if (event.getKeyCode() == KeyEvent.FLAG_EDITOR_ACTION)        {            // code to hide the soft keyboard            imm = (InputMethodManager) getSystemService(                Context.INPUT_METHOD_SERVICE);            imm.hideSoftInputFromWindow(editText.getApplicationWindowToken(), 0);        }        return false;    }};private View.OnClickListener onKeyboard=new View.OnClickListener() {    public void onClick(View v)     {        editText.setText("""");    }};</code></pre><p>The working method using a button (in the same java file):</p><pre><code>private View.OnClickListener onDone=new View.OnClickListener() {    public void onClick(View v)     {        ....        // code to hide the soft keyboard        imm = (InputMethodManager) getSystemService(            Context.INPUT_METHOD_SERVICE);        imm.hideSoftInputFromWindow(editText.getApplicationWindowToken(), 0);    }};</code></pre><p><strong>Edit:</strong> When I press key no ""9"" the keyboard hides. That's odd.</p>","286244","","286244","","2010-08-05 09:26:50","2013-02-04 16:25:12","Hide Soft Keyboard on Done Keypress in Android?","<android><soft-keyboard>","3","0","","",""
"3413194","1","3413311","","2010-08-05 09:03:59","5","2683","<p>I'm currently developing an app for Android which uses google map service. Because users will be able to see thousands of markers I would like to load only those which are currently within the map bounds (i.e. when user look at specific map tile). I know how to do it with javascript/html. However, Android doesn't seem to provide any similar methods such as containsLatLng(latlng) or getBounds (I only found getLatitudeSpan and getLongitudeSpan, but don't know how can I use them in order to achieve the similar effect).</p><p>Can anyone give me some hint on that? I would greatly appreciate any help or at least pointing myself in the right direction.</p>","359656","","881229","","2013-12-30 07:52:03","2013-12-30 07:52:03","How to load markers dynamically for current position in Android google-maps?","<java><android><google-maps>","4","0","6","",""
"3413232","1","3413294","","2010-08-05 09:08:40","0","2481","<p>Im doing a project which similiar like download manager. I have 1 of the function is it allow user to pause the file and they can resume the download later.I have google it, but unlucky i stil haven solve the problem (maybe i'm new in android and stupid to solve it).</p><p>the question is.. if one of the file was haven finish downloaded for internet, how to i get the current stream/size of the file? and how can i continues writting the file?</p><p>i have saw a code in java as below:</p><pre><code>begin = downloaded;file = (FileConnection) Connector.open(""\sdcard\abc.mp3"");OutputStream output = file.openOutputStream(begin);DataOutputStream dos = new DataOutputStream(output);if(read != -1) {dos.write(buffer, 0, read);dos.flush();    downloaded += read;}</code></pre><p>But i'm not really understand how it work in android :(Your reply is very appreciated!!!</p><p>P/S: I'm sorry about my bad english, hope you guys understand what i'm talking about.Thank you.</p><p>Regard</p><p>Wynix</p>","409419","","","","","2010-08-05 09:16:50","android - how to get file stream? (download manager)","<android><file-io>","1","0","","",""
"3413272","1","3415427","","2010-08-05 09:14:40","3","847","<p>I am trying to create an Options menu in an Activity that gets started from a Service and then changes its UI based on messages from the Service passed via a Handler.</p><p>I set up the Options menu as follows:</p><hr><pre><code>     /** Menu creation and setup **/        /* Creates the menu items */        public boolean onCreateOptionsMenu(Menu menu) {            menu.add(0, 1, 0, ""Speaker"");            menu.add(0, 2, 0, ""Mute"");            return true;        }        /* Handles item selections */        public boolean onOptionsItemSelected(MenuItem item) {            switch (item.getItemId()) {            case 1:                //Do something here                return true;            case 2:               //Do something here                return true;            }            return false;        }  </code></pre><hr><p>But it never gets called when my application is run at all.</p><p>I have experienced problems where I need to use a Handler to change Text on the screen as the information is being passed on the wrong thread, could this same issue be the cause of the menu not displaying?</p><p>Is so how can I fix it as I cant override a method in a Handler</p>","243999","","","","","2010-08-05 14:02:05","Android - Options Menu wont work","<android><handler><options-menu>","2","2","","",""
"3413465","1","","","2010-08-05 09:41:40","0","325","<p>I am implementing Gesture in my Activity in Android.Every time I am performing a Gesture, a yellow line is being drawn on the screen.</p><p>How would I set the GestureColor to transparent?</p>","411780","","120243","","2011-05-17 05:30:33","2011-05-17 05:30:33","Need GestureColor as transparent","<android>","2","0","","",""
"3413544","1","3413645","","2010-08-05 09:52:02","4","3972","<pre><code> public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final ThraedDemo objDemo = new ThraedDemo();    Thread objThread = new Thread() {        @Override        public void run() {            objDemo.firstMethod();        }    };    objThread.start();}class ThraedDemo {        private void firstMethod() {            Thread objThread = new Thread() {                @Override                public void run() {                    try {                    ((ImageView)findViewById(R.id.ImageViewnumber)).setImageResource(nums[n]);                        Thread.sleep(10000);                        Log.v(""Thread"",""1111111111111111sleep"");                    } catch (InterruptedException ex) {                        System.out.println(""interuped exception"" + ex.getMessage());                    }                    secondMethod();                }                private void secondMethod() {        Thread objThread = new Thread() {            @Override            public void run() {                try {                ((ImageView)findViewById(R.id.ImageViewResult)).setImageResource(nums[n+1]);                n++;                    Thread.sleep(10000);                   Log.v(""Thread"",""22222222222 sleep"");                } catch (InterruptedException ex) {                    System.out.println(""interuped exception"" + ex.getMessage());                }                firstMethod();            }        };        objThread.start();    }            };            objThread.start();        }    }</code></pre><p>I use the above code but it is not running.it got <code>CalledFromWrongThreadException</code> what is the problem  inb the above code.Please give me some suggestions.Thanks in advance</p>","454808","","948041","","2012-10-10 05:27:16","2012-10-10 05:27:16","CalledFromWrongThreadException","<android>","1","0","1","",""
"3413568","1","3413849","","2010-08-05 09:54:27","2","3892","<p>I'm working at android 2.1 ContactContract, when I had not set account(for example: gmail account) to android emulator then , new a contact , but could not delete this contact at DB.</p><pre><code>ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();    String[] args = new String[] {id};    ops.add(ContentProviderOperation.newDelete(Data.CONTENT_URI)            .withSelection(Data.CONTACT_ID + ""=?"", args)            .build());    ops.add(ContentProviderOperation.newDelete(RawContacts.CONTENT_URI)             .withSelection(RawContacts.CONTACT_ID + ""=?"", args)             .build());    ops.add(ContentProviderOperation.newDelete(Contacts.CONTENT_URI)             .withSelection(Contacts._ID + ""=?"", args)             .build());</code></pre>","408273","","1045074","","2012-10-16 14:02:53","2012-10-16 14:02:53","how to delete a contact in android 2.1","<android><delete><contacts><delete-row>","1","0","2","",""
"3413683","1","3438510","","2010-08-05 10:08:53","15","8876","<p>I would like to disable the context menu that appears after a long tap (touch and hold) on images in my web application. I've seen posts with different ideas how to do it, but none of them seem to work for me.</p><p>Is there a way to do this on Android via HTML/CSS/Javascript?</p>","411807","","114066","","2010-08-09 07:22:41","2013-12-19 21:35:35","Disabling the context menu on long taps on Android","<javascript><android><mobile-webkit>","5","3","8","",""
"3413717","1","","","2010-08-05 10:13:58","0","230","<p>I have a screen where I need to put a <strong>background image</strong>. I need to display only a  <strong>part of the background image</strong>  in each screen . Now when the user swipes towards left , the next screen will be displayed taking <strong>another portion of the background image</strong>. This <strong>transition from the first to second screen should give a 3 Dimension effect of moving the screen</strong>.I am unable to get any help form Android forums.Kindly help with the <strong>code</strong> .</p><p>Warm Regards,Chiranjib</p>","411780","","","","","2010-08-05 10:23:32","Create a 3 dimension view of a background image","<android>","1","2","","",""
"3413980","1","3414098","","2010-08-05 10:54:34","0","4854","<p>I've been reading <a href=""http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html"" rel=""nofollow"">this</a> post on the android developer blog about the twitter client and UI patterns.</p><p>It mentions the source code will become available, does anyone know if this has happened yet and where I can find it? I've drawn a blank.</p><p>Thanks!</p>","119203","","","","","2010-08-05 14:14:40","Android Twitter App Source Code","<android><open-source><twitter>","2","0","1","",""
"3414089","1","3414311","","2010-08-05 11:10:29","5","322","<p>I was working on understanding what the implications of granting a package a particular permission are. To my utter disbelief I could not find any material which would answer the questions satisfactorily.</p><blockquote>  <p>1.) What permissions are reserved to be used by whom?</p>    <p>2.) What level of effect does granting a permission to an application have, in security aspects.</p>    <p>3.) What kind of permission does a user need to beware of and understand completely what the repercussion might be (at install time.)</p>    <p>4.) How to identify when an application is misusing a permission granted to it?</p></blockquote><p>I hope with a series of example programs and bits and pieces of documentation we can organize a clear working model for permission on android. I hope people would paste code for relevant examples in an attempt to understand this and help us develop better applications as well as develop user understanding on how secure they are.</p><p>thanks Shouvik</p><p>EDITED:What I eventually intend to achieve out of this discussion is that when I cluster a group of permissions, I should be able to get a concise picture of what my application will be capable of doing to my data. I then should be able to weigh those risks with the application installed and determine if its worth the risk. Please note, I am not here to suggest that all apps request perms for malicious use! I am here for that 0.1% of apps which might do it with that intent! =)</p><p>Don't take my word for it. Here is a link I came across in the discussion group which puts my idea into a clear perspective. <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/88b69b590c4d1482/d4bfb0e544d8a3a9?lnk=gst&amp;q=permissions#d4bfb0e544d8a3a9"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/88b69b590c4d1482/d4bfb0e544d8a3a9?lnk=gst&amp;q=permissions#d4bfb0e544d8a3a9</a></p>","393459","","1039361","","2012-04-18 09:24:13","2012-04-18 09:24:13","Implications of package permissions (All android developers invited to contribute)","<android><security><permissions>","2","2","2","","2010-08-05 11:10:29"
"3414100","1","","","2010-08-05 11:12:18","4","12646","<p>I am using Android Emulator 2.2 version to develop a small application. I am supposed to list all the image files(jpg) files under a directory. I copied the files to ""/data"" through ADB puash command. </p><p>Example : /data/1.jpg</p><p>Now I create a File object with the directory path as input and call listFiles api.</p><pre><code>File dir = new File(dirPath);File[] filelist = dir.listFiles();</code></pre><p>But the fileList does not contain the image file(1.jpg).</p><p>But strangely, If I create a ImageView with hardcoded path ""/data/1.jpg"", I could see the image getting drawn.</p><p>Can some one help me.... where could be the problem</p><p>Thanks,Kowndinya</p><hr><pre><code>public int PopulateList(final String dirPath){    m_CurrentDirectory = new File(dirPath);    _namelist.clear();    _pathlist.clear();    File[] fileList = m_CurrentDirectory.listFiles(imFilter);    if (fileList != null)    {        for ( int i = 0;i&lt;fileList.length;i++)        {            _namelist.addElement(fileList[i].getName());            _pathlist.addElement(fileList[i].getAbsolutePath());         }    }    notifyDataSetChanged();    return 0;}</code></pre><p>imFilter is an filenamefilter that accepts only files with jpg extension. But if I put break point in the imFilter code, break point does not event hit.</p><pre><code>Output of adb shell ls -l /data:------------------------------------drwxrwx--t system   misc              2010-08-05 15:32 miscdrwxrwx--x shell    shell             2010-08-05 15:32 localdrwxrwx--x system   system            2010-08-05 15:32 app-privatedrwx------ system   system            2010-08-05 15:34 backupdrwx------ root     root              2010-08-05 15:34 propertydrwxrwx--x system   system            2010-08-05 15:35 data-rw-rw-rw- root     root        75752 2010-03-30 12:26 zona_ind_012.jpgdrwxrwx--x system   system            2010-08-05 16:16 appdrwxr-x--- root     log               2010-08-05 15:32 dontpanicdrwxrwx--x system   system            2010-08-05 16:25 dalvik-cachedrwxrwxr-x system   system            2010-08-05 17:16 systemdrwxrwx--- root     root              2010-08-05 15:32 lost+found</code></pre>","341830","","512958","","2013-01-09 10:26:37","2013-09-04 06:02:09","Android File.listFiles does not show all the files inside the directory","<android>","1","0","","",""
"3414253","1","","","2010-08-05 11:33:35","1","586","<p>I am developing an Android program where I need to send message to some people. Here I have the phone numbers of the people in my database.Is there any Android source code to broadcast message to those people.Thanks in Advance!!! </p>","409318","","","","","2011-03-13 17:56:06","Android Program to send messages","<android>","3","0","1","",""
"3414424","1","3417580","","2010-08-05 11:58:35","13","44633","<p>I developed an application. Now I want to deploy it on real device. Can any body please tell me the steps and the requirements to deploy it on a real device.</p><p>ThanksDeepak</p>","406494","","","","","2013-12-23 11:57:05","How to deploy android application to a device?","<android><deployment>","6","0","2","",""
"3414455","1","3416175","","2010-08-05 12:03:25","1","367","<p>When downloading and installing updates from Android Market, you often see an update comment like </p><ul><li>version 1.2.14 Bugfix on...</li><li>version 1.2.15 Added settings menu</li></ul><p>and so on. How is that comment made? I couldn't see a update comment field in the market today.</p><p>Thanx for listening!</p>","286244","","","","","2010-08-05 15:11:15","Android Market Update Comment?","<android><comments><google-play>","2","2","","",""
"3414464","1","","","2010-08-05 12:04:31","0","650","<p>I've read related several questions here and can't find the answer to this: I have an Android 2.1 device (HTC Incredible). My app, however, must be compatible with early (pre SDK 5) devices, so I am using the deprecated format of filter URI:</p><pre><code>Uri contactUri = Uri.withAppendedPath(Contacts.Phones.CONTENT_FILTER_URL, Uri.encode(number));Cursor C = context.getContentResolver().query(contactUri , null, null, null, null));</code></pre><p>The <em>number</em> is of the form 15555551212. This fails to find the Contact, at least on my device. However, changing to the new (SDK 5 and later) ContactsContract format URI</p><pre><code>Uri contactUri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));Cursor C = context.getContentResolver().query(contactUri , null, null, null, null));</code></pre><p>results in success. Originally, the corresponding number in the Contact was in the format +1 555 555 5555, but I changed it to exactly match the input number 15555555555 and the old format URI still fails. In both cases, the new format URI succeeds.</p><p>Does anyone have any thoughts as to why this is the case? I'm stumped!</p>","159508","","","","","2010-08-06 18:50:41","Looking up Contact from phone number - Old vs New URI: Old fails, New Succeeds?","<android><contacts><contactscontract>","1","1","","",""
"3414471","1","3414719","","2010-08-05 12:05:22","0","900","<p>Hi i am displaying the 2 imageViews if one image contain number 1(number1 image) second image show 2(image 2)and again first image displayt the 2 image(number2) then second imageview display the 3 image(number 3 image)second image view is displayed after some time of first image dispalying.for this i am using runOnUiThread concept.Please give me some suggestions to how two threads are write in runOnUiThread method .Give some sample code.Thanks in advance.</p>","454808","","","","","2011-06-10 19:40:29","change the images using runOnUiThread","<android>","1","0","","",""
"3414490","1","3418939","","2010-08-05 12:07:29","8","4789","<p>I have a ListView (with setTextFilterEnabled(true)) and a custom adapter (extends ArrayAdapter) which I update from the main UI thread whenever a new item is added/inserted. Everything works fine at first--new items show up in the list immediately. However this stops the moment I try to filter the list.</p><p>Filtering works, but I do it once and all of my succeeding attempts to modify the contents of the list (add, remove) don't display anymore. I used the Log to see if the adapter's list data gets updated properly, and it does, but it's no longer in sync with the ListView shown.</p><p>Any ideas what's causing this and how best to address the issue?</p>","245642","","","","","2012-12-19 22:56:47","ListView Not Updating After Filtering","<android><listview><filter><filtering><android-arrayadapter>","3","3","4","",""
"3414641","1","3415544","","2010-08-05 12:27:24","0","450","<p>Can anybody please tell me how to get double and int value from a binary file. I have tried alot but its giving me wrong values. Here is my code.</p><pre><code>InputStream iStream = getApplicationContext().getResources().openRawResource(R.raw.map);    DataInputStream input;        input = new DataInputStream(iStream);               try {                   double mapFileFormatVersionNumber, IntendedSoftwareVersion;         int DemoDays;mapFileFormatVersionNumber =input.readDouble();                     IntendedSoftwareVersion = input.readDouble();DemoDays = input.readInt();</code></pre><p>thanks in advance.</p>","397901","","238639","","2010-08-11 07:08:04","2010-08-11 07:08:04","Facing problem from getting double and int value from binary file","<java><android>","2","11","0","",""
"3414666","1","3414739","","2010-08-05 12:31:16","1","500","<p>Actually i m little bit confused in Intent.</p><p>Suppose i have three activities.A,b,c and in activity A i have exit button. When i click on exit button my application finishes. I have one more button in A which is next button. Which take me to new activity.and in activity B i have  two buttons next and back, and in activity C also i have two button out of which first takes me to A and Back button.</p><p>now i'm on C activity and want to go to A. where when i press exit it again takes me back to C instead of finish the application.</p><p>Why is this happening?</p>","383597","","114066","","2010-08-05 16:06:27","2010-08-05 16:06:27","android Intent problem","<android><android-intent>","3","0","","",""
"3414903","1","3415275","","2010-08-05 13:04:43","0","1643","<p>can anybody tell how to run the local webapplication using android webview</p><p>I want to run my own webpages in android using web view</p><p>Thanks</p>","386430","","386430","","2010-08-06 05:26:48","2010-08-06 05:26:48","how to run local web application in android webview","<android><android-webview>","2","2","","",""
"3415074","1","4155296","","2010-08-05 13:25:59","0","766","<p>I'm having problems with adding lines to the map in my android project. Basically, when I want to draw lines from point A to point B android is painting them just fine, but when I want to add another line later (say from point B to point C) android is removing the old line and drawing a new one. I guess it has something to do with collections because I'm using the ItemizedOverlay class to collect all markers and it seems to work, but how to do the same with lines or anything else I would like to draw? How to prevent android from refreshing the map? ItemizedOverlays seems to do the trick, but only with markers/drawables. Can someone please give me some help or at least point me in the right direction with this? I would greatly appreciate it. </p>","359656","","","","","2010-11-11 14:20:25","I can't add more than one line (overlay) to Android google-map?","<java><android><google-maps>","2","0","0","",""
"3415090","1","","","2010-08-05 13:27:06","1","414","<p>i'm using android qsb feature in my app. Qhen user click len button on hes keyboard, i open quick search box with one input box and one button.</p><p>I want to know if i can add another button in qsb.</p><p>I think it is possible, Google has added search by voice button in qsb.</p><p>Thanks.</p>","251434","","","","","2010-08-05 15:12:50","How to put another button in android quick search box?","<android><quick-search>","1","0","1","",""
"3415572","1","","","2010-08-05 14:17:03","0","897","<p>Ok, so I have this application that takes a adress strings (from values/xml) and parses it  your current position) retuning a name, address and distance away.  This is then picked up by an arrayadapter and put up on a listview.  I cannot for the life of me get the list view to accept an onitemclick to start another activity, where I can launch a different view.  I did have it where I was getting the row, name and address to show through to an alert dialog, but in my efforts to get it to launch an activity, I lost that.</p><p>So does anyone have any thoughts?  I am using the following call to make my list and and arrays.  This is stripped down, so assume I have all the imports and proper formatting.  I know I am just missing something simple here...</p><pre><code>public class Wf extends ListActivity {private ArrayList&lt;String&gt; DistanceList;private ArrayAdapter&lt;String&gt; aa; @Override public void onCreate(Bundle icicle) {   super.onCreate(icicle);   // Bind the ListView to an ArrayList of strings.   DistanceList = new ArrayList&lt;String&gt;();ListView lv = (ListView)findViewById(R.id.ListView01);aa = new ArrayAdapter&lt;String&gt;(getApplicationContext(),                                  R.layout.listbox_layout,                                 DistanceList);lv.setAdapter(aa);//Call to get distance... here} public void onListItemClick(ListView parent, View v,int position, long id) {    ListView lv = (ListView)findViewById(R.id.ListView01);    Toast.makeText(this, ""You clicked"", Toast.LENGTH_LONG).show();  }</code></pre>","410428","","60261","","2010-08-05 14:50:27","2010-08-05 14:50:27","Stuck... need help.. Listview w/ Array Adapter","<android><arrays><listview><onclick><adapter>","1","0","","",""
"3415589","1","3416154","","2010-08-05 14:18:14","7","10268","<p>When I'm trying to run the following : </p><pre class=""lang-java prettyprint-override""><code>  ContentValues cv = new ContentValues();  cv.put(table_LocalSettings_Unit, input);  mDb.insert(table_LocalSettings, """", cv);</code></pre><p>I got the following error:</p><blockquote>  <p>Error inserting unit = 0;<br/>  SqliteConstraintException: error code 19 constraint failed.<br/></p></blockquote><p>What should be the problem ?The table sql Code is:</p><pre class=""lang-sql prettyprint-override""><code> ""create table if not exists "" + table_LocalSettings + ""( "" + table_LocalSettings_ID     + "" INTEGER PRIMARY KEY NOT NULL , "" + table_LocalSettings_MapType     + "" INTEGER NOT NULL , "" + table_LocalSettings_Visib + "" BIT NOT NULL , ""     + table_LocalSettings_Unit + "" INTEGER DEFAULT 0 NOT NULL , ""     + table_LocalSettings_SpeedUnit + "" INTEGER NOT NULL , ""     + table_LocalSettings_Alert + "" BIT NOT NULL ,"" + table_LocalSettings_UserID     + "" INTEGER DEFAULT -1 , "" + table_LocalSettings_Username + "" VARCHAR , ""     + table_LocalSettings_PowerSave + "" VARCHAR , "" + table_LocalSettings_PremiumUser     + "" INTEGER NOT NULL DEFAULT 0);"";</code></pre>","393809","","314334","","2013-09-20 07:39:12","2013-09-20 07:39:12","Unable to INSERT in SQLite, Error code:19","<android><sqlite><insert>","4","0","1","",""
"3415666","1","","","2010-08-05 14:25:21","1","6572","<p>How can I open a specific port in android?</p><p>I have a server socket but the connection is rejected because the port is closed.</p><pre><code>try {   ServerSocket server = new ServerSocket(2021);   Socket client = server.accept(); } catch (Exception e) {   // TODO Auto-generated catch block   a = false;   e.printStackTrace(); } </code></pre>","409733","","114066","","2010-08-05 16:02:47","2012-11-12 20:58:45","How to open port in Android?","<android><sockets><connection><port>","3","2","1","",""
"3415702","1","3415837","","2010-08-05 14:28:08","1","14200","<p>Friends,I am working on Sqlite DB and I want to open, view or create databases through the ADB shell command.I've written the following commands in command prompt</p><ol><li><code>cd C:\android-sdk_r04-windows\android-sdk-windows\tools&gt;</code></li><li><code>adb shell</code></li></ol><p>I get a <code>$</code> after step 2. Any idea how I can get <code>sqlite&gt;</code> prompt instead and perform the following task?</p><p>Suppose I want to view the databases. I've written <code>cd/data/data/(mypackage)/databases</code> sqlite3 (database)... after the <code>$</code> but it says 'Database not found.'How can I view the databases executed through my code?</p><p>Thanks in advance.</p>","407506","","1190376","","2013-02-24 08:06:51","2013-02-24 08:06:51","Opening Sqlite Db on command prompt","<android>","1","3","3","",""
"3415789","1","","","2010-08-05 14:36:13","0","1364","<p>How would I use ImageGallery to display images I have saved in a particular location on the sd card?</p>","358438","","","","","2010-08-05 15:09:37","Using ImageGallery to display images from the SD card?","<android>","2","0","","",""
"3415796","1","3415920","","2010-08-05 14:37:00","1","530","<p>In a typical Android project you have the <code>res/drawable</code> directories where you can put images but i have some special custom binary files.</p><p>where do I usually put them and can i access them via the <code>R-class</code> then? </p>","97688","","119895","","2010-08-05 15:34:30","2010-08-05 15:34:30","android: where to put custom data","<android><data>","2","0","","",""
"3415797","1","","","2010-08-05 14:37:00","16","12965","<p>This is a query regarding the usage of adb on android.</p><p>Is there a way to forward the remote port i.e. port on the android device/emulator to the local machine to which the device is connected?</p><p>$ adb forward tcp:port1 tcp:port2 # forwards the local port port1 on the machine to port2 on the device.</p><p>Thanks in advance!</p>","412063","","","","","2011-09-05 20:11:56","adb forward remote port to local machine","<android><port><forwarding><adb>","1","1","1","",""
"3416031","1","","","2010-08-05 14:58:08","2","1115","<p>I have a simple TextView that displays some text that I've scraped of the web.  Despite the fact that the text I want to display is much longer than the width of the screen, it neither wraps nor gives me a scroll bar.  It just stops.</p><p>My layout is configured as follows:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView  xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/displayFighterVerse""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:singleLine=""false""    android:width=""0dip""    android:inputType=""textMultiLine""    android:text=""Welcome to Fighter Verses. Please wait while we download the latest verse.""    /&gt;</code></pre><p>Can anyone help me figure out why this isn't displaying properly?  What really simple thing am I missing?</p>","398293","","","","","2011-09-20 13:12:26","TextView content not wrapping or scrolling","<android>","3","2","","",""
"3416053","1","","","2010-08-05 14:59:49","0","622","<pre><code>image.setBounds((getWidth()/2)-zoomControler, (getHeight()/2)-zoomControler,                (getWidth()/2)+zoomControler, (getHeight()/2)+zoomControler);</code></pre><p>i want to set bounds value for original image size,how can i set the value for display original image size</p>","410757","","271917","","2010-08-05 15:11:52","2012-11-26 00:16:31","Customize setbound value for viewing original image size","<android>","1","0","","",""
"3416087","1","3416242","","2010-08-05 15:03:15","52","83151","<p>I want to add an unknown number of ImageView views to my layout with margin. In xml, I can use layout_margin like this:</p><p><code>&lt;ImageView android:layout_margin=""5dip"" android:src=""@drawable/image"" /&gt;</code></p><p>There is ImageView.setPadding(), but no ImageView.setMargin(). I think it's along the lines of ImageView.setLayoutParams(LayoutParams), but not sure what to feed into that.</p><p>Does anyone know?</p>","409853","","","","","2013-12-29 22:13:51","How to set margin of ImageView using code, not xml","<android><margin><imageview>","4","0","15","",""
"3416400","1","3416503","","2010-08-05 15:35:34","6","10340","<p>I have a <code>ListView</code> on my <code>ListActivity</code> and I'd like the rows of the <code>ListView</code> to be 1 of 3 different layouts.  The first item in my list is always going to use layout A, the second item in my list is always going to use layout B, and all subsequent items are going to use layout C.</p><p>Here is my getView function:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {     // get the View for this list item    View v = convertView;    if (v == null) {        LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);        switch (position) {            case 0:                v = vi.inflate(R.layout.layout_A, parent, false);                break;            case 1:                v = vi.inflate(R.layout.layout_B, parent, false);                break;            default:                v = vi.inflate(R.layout.layout_C, parent, false);                break;        }    }       switch (position) {        case 0:            TextView txtLabel1 = (TextView)findViewById(R.id.label1);            TextView txtLabel2 = (TextView)findViewById(R.id.label2);            if (txtLabel1 != null) {                txtLabel1.setText(""sdfasd"");            }            if (txtLabel2 != null) {                txtLabel2.setText(""dasgfadsasd"");            }            break;        default:            break;    }    // return the created view    return v;}</code></pre><p><code>R.id.label1</code> and <code>R.id.label2</code> are <code>TextViews</code> on <code>R.layout.layout_A</code>.  However, <code>txtLabel1</code> and <code>txtLabel2</code> are null after trying to set them.  Why? </p><p>I stepped through this code in the debugger and it inflated the correct layout (<code>R.layout.layout_A</code>) and fell into the correct case below to set the <code>R.id.label1</code> and <code>R.id.label2</code> text.</p><p>Also, if there is a better way to do this, please let me know.</p>","406790","","119895","","2010-08-05 15:41:40","2012-03-01 00:52:46","ListViews with multiple item layouts","<android><listview><layout>","2","0","2","",""
"3416417","1","","","2010-08-05 15:38:03","1","507","<p>I am putting several markers on a MapView by subclassing an ItemizedOverlay.  The hitch is that the marker I am passing to the ItemizedOverlay is a custom Drawable.  That is to say, I've subclassed ""Drawable"" and I have overwritten the draw() method.  The point of this was to add a color filter to the Drawable, and add custom text:</p><pre><code>public void draw(Canvas canvas) {    String[] colorComps = color.split("","");    baseDrawable.mutate().setColorFilter(Color.rgb(Integer.valueOf(colorComps[0]),                                                   Integer.valueOf(colorComps[1]),                                                   Integer.valueOf(colorComps[2])),                                         PorterDuff.Mode.MULTIPLY);    baseDrawable.draw(canvas);    Paint textPaint = new Paint();    textPaint.setTextAlign(Paint.Align.CENTER);    textPaint.setColor(Color.WHITE);    textPaint.setAntiAlias(true);    textPaint.setTextSize(12);    textPaint.setTypeface(Typeface.DEFAULT);    int textX = getIntrinsicWidth()/2 - 1 + baseDrawable.getBounds().left;    int textY = getIntrinsicHeight()/2 + baseDrawable.getBounds().top;    canvas.drawText(ID, textX, textY, textPaint);}</code></pre><p>The problem is that when I do this, the shadow on the MapView is not the simple grey, translucent overlay that it should be.  Rather, the color filter and text is applied to the shadow as well.  Any suggestions on how to avoid this problem?</p>","404783","","","","","2010-08-05 15:38:03","Weird shadow behavior for android MapView","<android><android-mapview><shadow><itemizedoverlay>","0","1","1","",""
"3416689","1","3416813","","2010-08-05 16:02:33","58","44250","<p>After I start the activity I am unable to scroll down to see other buttons and options in the xml defined below. </p><p>Does anyone know how to make this scrollable?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:background=""#000044"" android:isScrollContainer=""true"" android:orientation=""vertical""&gt; &lt;TextView  android:id=""@+id/title""  android:text=""@string/title""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textColor=""#ffffff""/&gt; &lt;EditText  android:id=""@+id/editTitle""  android:text=""""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""/&gt; &lt;TextView  android:id=""@+id/description""  android:text=""@string/description""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textColor=""#ffffff""/&gt; &lt;EditText  android:id=""@+id/editDescription""  android:text=""""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""/&gt; &lt;TextView  android:id=""@+id/location""  android:text=""@string/location""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textColor=""#ffffff""/&gt; &lt;EditText  android:id=""@+id/editLocation""  android:text=""""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""/&gt; &lt;TextView  android:id=""@+id/startTime""  android:text=""@string/startTime""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textColor=""#ffffff""/&gt; &lt;DatePicker   android:id=""@+id/DatePicker01""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content"" /&gt; &lt;TimePicker   android:id=""@+id/TimePicker01""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""/&gt; &lt;TextView  android:id=""@+id/endTime""  android:text=""@string/endTime""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textColor=""#ffffff""/&gt; &lt;DatePicker   android:id=""@+id/DatePicker02""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content"" /&gt; &lt;TimePicker   android:id=""@+id/TimePicker02""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""/&gt; &lt;Button  android:id=""@+id/buttonCreate""  android:text=""Create""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre><p>My class code is</p><pre><code>package com.example.blah;import android.app.Activity;import android.os.Bundle;public class example extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}</code></pre><p>The output is <a href=""http://img265.imageshack.us/img265/7601/linearlayout.jpg"">http://img265.imageshack.us/img265/7601/linearlayout.jpg</a></p>","402637","","402637","","2010-08-05 16:12:38","2014-03-22 17:44:00","How to make a LinearLayout scrollable","<android>","5","0","4","",""
"3416691","1","","","2010-08-05 16:02:40","3","1224","<p>Is it possible to play a frame animation on a Toast View?</p><p>Lines 3-5 in the code below are what usually works for me if I want to play a frame animation on a View.  Unfortunately when I try to apply that view to a toast object, it is not animating when the toast is shown.  <strong>Does anyone know if it is possible to have a frame animation play on a toast object?  If so, how?</strong>  Thanks</p><pre><code>LayoutInflater inflaterSpin = getLayoutInflater();View layout = inflaterSpin.inflate(R.layout.toast_layout, (ViewGroup)   findViewById(R.id.toast_layout_root));layout.setBackgroundResource(R.anim.anim_toast);AnimationDrawable toastAnim = (AnimationDrawable) layout.getBackground();toastAnim.start();myToast = new Toast(getApplicationContext());             myToast.setView(layoutSpin);myToast.show();</code></pre>","107459","","","","","2011-05-19 03:53:34","Apply a Frame Animation to a Toast View","<android><animation><toast>","1","0","1","",""
"3416829","1","3416843","","2010-08-05 16:17:19","6","9326","<p>I am playing around with this example.<a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList2.html"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList2.html</a></p><p>I cannot figure out how to attach a listener to the children elements so that I can trigger some action when the user taps on the phone number.</p><p>Any code or links would be greatly appreciated.</p>","412164","","","","","2012-08-08 13:12:25","How to create on click event for children in Expandable list","<android><events><listener>","3","0","3","",""
"3416864","1","3416925","","2010-08-05 16:20:58","1","974","<p>I have a textView with some text in it. I want to delete the last 4 characters and then add on some more text. I tried doing this.</p><pre><code>textViewObject.append(""\b\b\b\b new text that I am adding"");</code></pre><p>But instead of the \b doing a backspace, they show up as little squares in the textfield. Can anyone help me out here?</p>","412174","","","","","2010-08-05 16:27:17","How do you do a backspace escape character in Android?","<android><string><escaping><backspace>","1","0","","",""
"3416865","1","","","2010-08-05 16:21:01","1","3107","<p>Is it possible to disable SMS received and send notification in status bar ??What is the procedure to do this ?</p>","404052","","21234","","2010-08-05 16:23:48","2011-02-02 02:56:05","Disable notification of incoming/outgoing SMS in android","<java><android>","2","0","","",""
"3416895","1","4891981","","2010-08-05 16:23:34","1","3165","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1964193/android-how-to-set-the-wallpaper-image"">Android - how to set the wallpaper image</a>  </p></blockquote><p>I hav started doing app in Android. I want to set wallpaer in Android which run in Background(using Service) and the wallpaper will change within 5 minute in background. I keep  the image files in Drawable. Anyone kindly send the coding for setting the wallpaer and retriving it after 5 minutes..</p><p>Thanx in Advance.</p>","412168","","","","","2011-09-02 07:15:41","How to set wallpaper in Android?","<android>","3","0","2","2011-06-08 21:15:09",""
"3416947","1","3417021","","2010-08-05 16:28:49","5","273","<p>There is a description about a product or event that people would like to share among them. This can be a simple text or rich text too.</p><p>They are looking into which format is the best for this purpose. They would like to see compatible with as many phones as possible. We are talking about phones that have Bluetooth.</p><p>Also the text is longer than the length of an SMS, so the SMS format is not suitable</p><p>What would you recommend?<br>And what do you think what would be the best way to share that between phones?</p>","243782","","243782","","2010-08-06 09:07:20","2011-11-17 16:08:56","What's the best common format for an eBook like text to share with most of the mobile phone types","<iphone><android><mobile><symbian><bada>","1","0","1","",""
"3417088","1","3417108","","2010-08-05 16:47:39","1","713","<p>If my X co-ordinates increment every time a frame is drawn, what formula can I employ from the math library in order to have the Y co-ordinate moving around the circumference of a circle frame by frame, creating the illusion of an orbiting object around a continuously moving central point?</p><p>I have seen it may involve sin or cos but am not sure how to adjust the variables accordingly per frame.</p><p>Many thanks for your help</p>","300037","","","","","2010-08-05 16:54:59","Calculating points of a circle dynamically in an Android game","<android><circle><game-physics>","2","0","","",""
"3417122","1","3417157","","2010-08-05 16:52:34","7","24157","<p>I have been a Java programmer/instructor since Java was <code>Oak</code> (which is the development name for Java).  </p><p>Where can one find how to use <code>eclipse</code> to sign an <code>app</code> for release?  I have found several how to <code>docs/web sites</code>, but not detailed enough for a newbie to this <code>android</code> world.  </p><p>I have a screen that comes up that wants the <code>Alias</code>, organizational unit, etc... what are valid values for these entries? </p><p>Thanks in advance for any assistance.</p>","408112","","1139398","","2012-09-10 15:18:37","2013-01-20 07:35:03","How to use Eclipse to create released signed apk?","<android><apk><signing>","1","2","3","2013-11-22 04:01:43",""
"3417161","1","3417198","","2010-08-05 16:57:48","17","6895","<p>I have an application that uses a file on the SD card, the application runs when the phone boots, and it has become apparent that the file cannot be accessed when the program is first run as it starts working before SD card is avaliable. </p><p>Is there an broadcast receiver I can use to tell when the SD card is ready?</p><p><strong>Update</strong></p><p>Just to summarise the answer to register the intent do:</p><pre><code>IntentFilter filter = new IntentFilter (Intent.ACTION_MEDIA_MOUNTED); filter.addDataScheme(""file""); registerReceiver(this.mSDInfoReceiver, new IntentFilter(filter));</code></pre><p>and create a broadcast receiver to react to it:</p><pre><code>private BroadcastReceiver mSDInfoReceiver = new BroadcastReceiver(){    @Override    public void onReceive(Context arg0, Intent intent) {    // Code to react to SD mounted goes here    } }; </code></pre>","315998","","315998","","2010-08-06 11:13:37","2011-06-02 09:14:11","android intent for sdcard ready","<android><android-intent><broadcastreceiver><sd-card>","1","0","5","",""
"3417179","1","3417217","","2010-08-05 17:00:09","1","576","<p>I have a <code>TabActivity</code> with two tabs-activities &mdash; <code>FirstActivity</code> and <code>SecondActivity</code>.</p><p>How can I access to any element (for example, change <code>TextView</code>'s text) on <code>FirstActivity</code> from <code>SecondActivity</code>?</p>","314301","","","","","2010-08-05 17:04:26","Access to element on another activity","<android><activity>","1","0","","",""
"3417293","1","3418081","","2010-08-05 17:13:48","1","258","<p>I just downloaded the most recent camera app on the cupcake branch of the android source tree, mostly in order to find examples to steal from in order to control the camera in my own application. It got the source from <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=shortlog;h=refs/heads/cupcake"" rel=""nofollow"">here</a>. However, when I opened up the extracted folder as a new android project in eclipse, I am getting TONS of compile errors, examples below. I have the Android 1.5 library in the build path. It only has android.jar in it? It is only supposed to have android.jar in it-right? Is there something else that I should be doing? Why can't I compile something straight off of the tree?</p><p>Error examples: </p><p>mScrollX cannot be resolved</p><p>MediaStore.EXTRA_SHOW_ACTION_ICONS cannot be resolved</p><p>The method commitUpdates() is undefined for the type Cursor</p><p>etc.</p><p>Also: an error in the Manifest File: Class com.android.camera.UploadService does not exist</p>","391837","","648313","","2011-07-13 21:00:20","2011-07-13 21:00:20","running android source from git tree","<android><android-source>","1","1","","",""
"3417308","1","","","2010-08-05 17:15:36","8","4796","<p>I'm writing an android application that depends on network activity and the alarm manager sometimes waking the phone up from a sleeping state.</p><p>My question is how can I reliably test this on device? Ideally, how can I force the phone into a full-on sleeping state. Failing that, how can I know for sure when the phone has fully gone to sleep?</p><p>How do you test your Alarm Manager / Wake Lock / Sleep handling code?</p>","412216","","","","","2010-11-20 06:54:43","Force an android phone to sleep, in order to test?","<android>","2","0","3","",""
"3417418","1","","","2010-08-05 17:27:43","17","4577","<p>How do you improve the position of an app in Android Market search results? The apps don't seem to be sorted on downloads. </p><p><strong>Edit</strong>: The scope of this question is limited to working with the Android Market search engine, of which there's little or no information. I changed the title to make it clearer.</p>","143378","","143378","","2012-02-09 19:58:21","2012-02-09 19:58:21","How does the Android Market search engine work?","<android><seo><google-play>","2","7","4","2011-08-06 18:21:37",""
"3417740","1","3417811","","2010-08-05 18:07:46","2","414","<p>When user presses a button from a webview, I open a scrollview activity with some buttons and edittext fields.</p><p>Once the user enters the fields and presses the 'create' button, from scrollview activity, I want the results from the called activity to be accessible.</p><p>How can I do thi?</p>","402637","","","","","2010-08-05 19:23:16","how to get the result from a sub activity","<android>","1","0","","",""
"3417864","1","3417928","","2010-08-05 18:23:17","1","1420","<p>I need a way for my Activity to known that it's going into the background, and not when it's getting killed. I thought about hooking at onStop(), but onStop() is called for both cases. In other words, is there a way to tell if when my Activity is moving into the background and not getting killed?</p>","440093","","","","","2010-08-05 18:30:59","Android: How to detect if an Activity goes into the background?","<android>","2","0","","",""
"3418040","1","3418079","","2010-08-05 18:44:06","5","1614","<p>I have a ListView that I'm trying to add a footer to.  For some reason, it won't show up.  My footer is defined in a separate XML layout called layout_footer.</p><pre><code>View v = getLayoutInflater().inflate(R.layout.layout_footer, getListView(), false);getListView().addFooterView(v);</code></pre><p>Here is the code in my ListActivity's onCreate method.  Please note that it is the last thing I do in onCreate.</p><p>I want this item to scroll with the rest of the list and, according to the resources I've found, I believe this is how you do it.  Unfortunately, the footer does not show :(</p><p>Help would be much appreciated</p>","406790","","","","","2010-08-05 18:47:52","Trouble adding footer to ListView","<android><listview><footer><listactivity>","1","0","1","",""
"3418055","1","3418345","","2010-08-05 18:45:32","4","1633","<p>I have made two versions of my application, a ""large"" version, and a ""mini""/""lite"" version.</p><p>Should I be signing both of these with the same key?  Or should I sign with a unique key for each of them?</p><p>What are the repercussions of signing multiple applications with the same key?</p>","289182","","","","","2010-08-05 19:19:12","Is it okay to sign two different applications with the same key?","<android>","2","0","1","",""
"3418106","1","","","2010-08-05 18:51:26","1","1493","<p>I want to know the length of the file, so I tried <code>getContentLength()</code>. It works fine with network connection (edge/3g) but returns -1 with WiFi?<br>Why? The WiFi is good and the file was found, it can be downloaded but the return of <code>getContentLength()</code> is always ""-1"". I dont understand. <code>file</code> is a google documents file.<br>Is there an other way to get the length?</p><p>My code is:</p><pre><code>URL url = new URL(file);URLConnection conexion = url.openConnection();conexion.connect();int poids = conexion.getContentLength();</code></pre>","412293","","1111767","","2012-06-26 18:51:21","2012-06-26 18:51:21","getContentLength() return -1 only in WiFi?","<java><android><apache>","2","2","","",""
"3418107","1","","","2010-08-05 18:51:27","0","1111","<p>I am new to this platform and already starting to love it. I am work on a UI for a project which uses the tabhost to display two separate activities using a TabActivity class. This works ok. Now i would like to add a viewflipper to the equation. I am trying to add the tabhost widget to the viewflipper using the addView() method. Eg: </p><pre><code>public class Main extends TabActivity {         @Override         public void onCreate(Bundle savedInstanceState) {                 super.onCreate(savedInstanceState);                 TabHost host = getTabHost();                 host.addTab(host.newTabSpec(""one"").setIndicator(""First"").setContent(                                 new Intent(this, First.class)));                 host.addTab(host.newTabSpec(""two"").setIndicator(""Second"")                                 .setContent(new Intent(this, Second.class)));                Button btn1 = new Button(this);                btn1.setText(""Second Screen"");                flipper = new ViewFlipper(this);                flipper.addView(host);                flipper.addView(btn1);                setContentView(flipper);         } } </code></pre><p>The main motive is to an application with two activities all tabbed. The viewflipper will then flip between these two activities. I am thinking an alternative will be to use xml layout to hold the tabhost and just include it in the view. I am avoiding it for now because that would mean me writing the codes for the two classes again. To round all this up, is there a way to include a tabhost in a viewflipper. </p><p>Thanks, </p><p>New Guy</p>","412289","","","","","2011-06-30 14:01:52","Adding a tabhost in viewflipper","<android>","1","0","1","",""
"3418131","1","3422542","","2010-08-05 18:54:40","1","2830","<p>1/I don't want to notify user if this one is already running my app in foreground,<br>is it possible before create nofification to check if my app is not in front ?  </p><p>2/if app is in background, is it possible to bring last state in front ?<br>I know that Os can destroy some Activity, but is it possible to restore last state, don't start a new Intent?<br>because if i start a new Intent and i push back, old Intent appear it's not very beautiful to have 2 identical intent launch.</p><p>Thanks</p><pre><code>NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);Intent notificationIntent = new Intent(this, z_finish.class);PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);Notification notification = new Notification(icon, tickerText, when);notification.flags |= Notification.FLAG_AUTO_CANCEL;notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);final int HELLO_ID = 1;mNotificationManager.notify(HELLO_ID, notification); </code></pre>","144587","","","","","2010-08-27 13:49:13","Android : don't show Notification if app is shown","<android><service><background><notifications><android-service>","2","2","","",""
"3418282","1","3418390","","2010-08-05 19:11:22","0","7351","<p>I have 3-4 activities in the application and all of them have some event listeners that work nicely.However only on one activity i simply can't get the event handling to work.I tried the solution from this thread:http://www.anddev.org/view-layout-resource-problems-f27/ontouch-not-called-t16578.htmlIt doesn't work for me. I tried to manually set OnClickListeners for ImageViews from java code, android:onClick from XML.</p><p>It seems that some other component handles all the events, or my activity doesn't have some permission to handle events.Should I put something in the AndroidMainfest.xml for my activity that enables handling events?</p><p>Hope someone has the idea what should i try, here's the code:</p><p>Activity:</p><pre><code>package com.renegade.begining;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.view.MotionEvent;import android.view.View;import android.widget.ImageView;public class NotesOnStaff extends Activity{   @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.notes_on_staff);   /*     NoteView2 note=(NoteView2)findViewById(R.id.note_red);        Bitmap bm=BitmapFactory.decodeResource(getResources(), R.drawable.note_red);        note.setImage(bm);     */       }    public void onClickEventBtn1(View v) {      // TODO Auto-generated method stub       ImageView keyboard_letter=(ImageView)findViewById(R.id.keyboard_letters);       keyboard_letter.setVisibility(View.INVISIBLE);   }    public void onClickEventBtn2(View v) {      // TODO Auto-generated method stub       ImageView keyboard_letter=(ImageView)findViewById(R.id.keyboard_letters);       keyboard_letter.setVisibility(View.VISIBLE);   }    @Override    public boolean onTouchEvent(MotionEvent event) {       switch (event.getAction()) {      case MotionEvent.ACTION_DOWN:         ImageView keyboard_letter=(ImageView)findViewById(R.id.keyboard_letters);           keyboard_letter.setVisibility(View.VISIBLE);         return true;      case MotionEvent.ACTION_UP:        return false; // something else                default:                        return false;// all others      }    }}</code></pre><p>Layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/notes_on_staff_layout""  android:background=""@drawable/background_ver""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;            &lt;ImageView              android:id=""@+id/notes_keyboard""           android:src=""@drawable/keyboard""           android:layout_height=""wrap_content""           android:layout_width=""wrap_content""           android:layout_alignParentBottom=""true""             android:layout_centerHorizontal=""true""           android:layout_marginBottom=""20dip""            android:clickable=""true"" android:focusable=""true""/&gt;      &lt;ImageView           android:id=""@+id/btn_hide""           android:src=""@drawable/btnhide""           android:layout_alignParentLeft=""true""           android:layout_marginTop=""40dip""           android:layout_marginLeft=""10dip""           android:layout_height=""wrap_content""           android:layout_width=""wrap_content""            android:onClick=""onClickEventBtn1""         android:clickable=""true"" android:focusable=""true""/&gt;      &lt;ImageView          android:id=""@+id/btn_show""          android:layout_alignBottom=""@id/btn_hide""          android:layout_toRightOf=""@id/btn_hide""         android:src=""@drawable/btnshow""          android:layout_height=""wrap_content""          android:layout_width=""wrap_content""         android:onClick=""onClickEventBtn2""          android:clickable=""true"" android:focusable=""true""/&gt;         &lt;ImageView           android:id=""@+id/staff""           android:src=""@drawable/staff""           android:layout_below=""@id/btn_hide""           android:layout_height=""wrap_content""           android:layout_width=""wrap_content""           android:layout_centerHorizontal=""true""           android:layout_marginTop=""0dip""           android:layout_above=""@id/notes_keyboard""         /&gt;         &lt;com.renegade.begining.NoteView2         android:id=""@+id/note_red""      android:layout_width=""wrap_content""       android:layout_height=""wrap_content""           /&gt;            &lt;ImageView          android:id=""@+id/keyboard_letters""          android:layout_alignLeft=""@+id/notes_keyboard""          android:layout_alignBottom=""@+id/notes_keyboard""          android:layout_marginBottom=""10dip""          android:visibility=""invisible""         android:src=""@drawable/keyboard_letters""          android:layout_height=""wrap_content""          android:layout_width=""wrap_content""          android:clickable=""true"" android:focusable=""true""/&gt;   &lt;/RelativeLayout&gt;</code></pre>","240588","","","","","2010-08-05 19:25:39","onClick won't fire on ImageView","<android><onclick><imageview>","1","0","","",""
"3418394","1","","","2010-08-05 19:25:49","3","404","<p>I've been struggling to consume user installed identity CA certs from a p12 file on an SD card.  The certs and keys are installed using the Secure Credential Storage (Location &amp; Security > Install from SD card). </p><p>I haven't found any documentation stating the location if the keys and certificates once imported.  I tried to create an instance of a TrustManagerFactory with no luck, it just contained all the pre-installed SSL certificates.</p><p>Creating an KeyStore with the default parameters doesn't seem to work either.  Any suggestions would be much appreciated!</p>","412312","","","","","2011-06-16 23:12:19","How can I access user-installed keys and certificates from my Android app?","<android><key><x509certificate>","1","0","","",""
"3418402","1","3422790","","2010-08-05 19:26:36","0","1769","<p>I have a database filled with records in the following format: . What I want my application to do is select records from an external database, and display those records on the phone screen using a SurfaceView. </p><p>Currently, I have an Activity, and a Service responsible for the record-gathering portion of the application. The Activity passes an intent to the Service, and the Service responds by returning the records that need to be displayed. The records are stored in my program as instances of the Data class, and merely have the screen-coordinates of where the element should be drawn in the View (I am just drawing a circle for every record in the DB). </p><p>For the sake of brevity, I won't include the service but I will include a skeleton of the Activity class and the Data that I wish to display.</p><pre><code>public class Data{    private int x;    private int y;    private int id;    private int shape;    /*    * Getters and setters for class properties    */}public class Displayer extends Activity {    int ht;    int wt;    dataReceiver dreceiver;     public static Map&lt;String, Data&gt; Info;     private LinearLayout linear;     private static final int RADIUS = 20;    Panel panel;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        panel=new Panel(this);        setContentView(panel);        Intent scv = new Intent(this, DataService.class);        startService(scv);    }    /*    * Various other methods to take care of onDestroy, onPause, etc.    */    public class dataReceiver extends BroadcastReceiver {        //Get new data from intents sent by the Service and store it in Info variable        //Update the Testing Map data-structure in the Panel SurfaceView with new records        panel.setData(Info);    }}</code></pre><p>The problem that I am having pertains to the SurfaceView. I realize that many people are going to suggest that I use just a regular View, but my application involves a lot of elements, so a SurfaceView would be much more suitable for my needs. Below is a skeleton of my SurfaceView class that contains a nested class to manage the threads.</p><pre><code>public class Panel extends SurfaceView implements SurfaceHolder.Callback {    private PanelThread _thread;    private Paint circlepaint;    private Paint textpaint;    private static int CircleColor = Color.YELLOW;    private static int TextColor = Color.RED;    private static Map&lt;String, Data&gt; Testing;    public Panel(Context context, Map&lt;String, Data&gt; entries) {        super(context);        getHolder().addCallback(this);        _thread = new PanelThread(getHolder(), this);        setFocusable(true);        textpaint = new Paint(Paint.ANTI_ALIAS_FLAG);        textpaint.setStyle(Style.FILL_AND_STROKE);        textpaint.setColor(TextColor);        Testing = new HashMap&lt;String, Data&gt;();        // Log.d(""TestingSize"",String.valueOf(Testing.size()));        if (!(Testing.isEmpty())) {            Testing.clear();        }        for (Map.Entry&lt;String, Data&gt; e : entries.entrySet()) {            String keyvalue = e.getKey();            Data v = e.getValue();            Panel.Testing.put(keyvalue, v);        }    }    public Panel(Context context) {        super(context);        getHolder().addCallback(this);        _thread = new PanelThread(getHolder(), this);        setFocusable(true);        textpaint = new Paint(Paint.ANTI_ALIAS_FLAG);        textpaint.setStyle(Style.FILL_AND_STROKE);        textpaint.setColor(TextColor);        Testing = new HashMap&lt;String, Victims&gt;();    }    @Override    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {        // TODO Auto-generated method stub    }    @Override    public void surfaceCreated(SurfaceHolder holder) {        _thread.setRunning(true);        _thread.start();    }    @Override    public void surfaceDestroyed(SurfaceHolder holder) {        /* we have to tell thread to shut down         * &amp; wait for it to finish,         * or else it might touch the Surface         * after we return and explode        */        boolean retry = true;        _thread.setRunning(false);        while (retry) {            try {                _thread.join();                retry = false;            } catch (InterruptedException e) {                // we will try it again and again...            }        }    }       /*If new records are received     * from the service, they can be updated     * using this method    */    public void setData(Map&lt;String,Data&gt;Info){        Testing=Info;    }    /*    * Iterate over all contents of Testing List and display them to the screen    */    @Override    public void onDraw(Canvas canvas) {        super.onDraw(canvas);        if (!(Testing.isEmpty())) {            for (Map.Entry&lt;String, Victims&gt; e : Testing.entrySet()) {                Data d = e.getValue();                      canvas.drawCircle(d.getX(), d.getY(), 10, circlepaint);            }        }        canvas.save();        canvas.restore();    }    /*    * Nested class to manage the threads for the SurfaceView    */    class PanelThread extends Thread {        private SurfaceHolder _surfaceHolder;        private Panel _panel;        private boolean _run = false;        public PanelThread(SurfaceHolder surfaceHolder, Panel panel) {            _surfaceHolder = surfaceHolder;            _panel = panel;        }        public void setRunning(boolean run) {            _run = run;        }        public SurfaceHolder getSurfaceHolder() {            return _surfaceHolder;        }        @Override        public void run() {            Canvas c;            while (_run) {                c = null;                try {                    c = _surfaceHolder.lockCanvas(null);                    synchronized (_surfaceHolder) {                        _panel.onDraw(c);                    }                } finally {                    // do this in a finally so that if an exception is thrown                    // during the above, we don't leave the Surface in an                    // inconsistent state                    if (c != null) {                        _surfaceHolder.unlockCanvasAndPost(c);                    }                }            }        }    }//end of PanelThread}//end of Panel</code></pre><p>The problem that I'm having is that once I make the initial call to the Panel class, I'm going to be getting new records from the service, and consequently, my Info Map data-structure is going to get updated. However, my Panel class just gets stuck in a loop and never receives any new Data objects. All examples of SurfaceViews I've found have involved updating them methods within the SurfaceView class itself (e.g. touching the screen and creating a new image, etc.) Sadly, I'm stumped on this particular problem. Is there a better approach for designing my Activity/SurfaceView interaction? Is an additional View required?</p>","155726","","155726","","2010-08-06 14:46:51","2010-08-06 14:46:51","Update Android SurfaceView on-the-fly with new elements","<java><android><graphics><surfaceview>","1","0","","",""
"3418586","1","","","2010-08-05 19:48:34","1","5821","<p>I've been trying to find one or all of the right filters.  Does anyone have them?  Down at the bottom you can see the logging output of the intents.  Perhaps they aren't public?</p><p>Have tried the following in my code to no avail...</p><pre><code>  &lt;receiver android:name="".ContactsBroadcastReceiver"" android:label=""@string/broadcast_receiver_name"" android:enabled=""true""&gt;       &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.dir/person"" android:host=""contacts"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.dir/contact"" android:host=""com.android.contacts"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.android.contacts.action.LIST_DEFAULT"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.android.contacts.action.LIST_CONTACTS"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.android.contacts.action.LIST_ALL_CONTACTS"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.android.contacts.action.LIST_CONTACTS_WITH_PHONES"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter android:label=""@string/starredList""&gt;            &lt;action android:name=""com.android.contacts.action.LIST_STARRED"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter android:label=""@string/frequentList""&gt;            &lt;action android:name=""com.android.contacts.action.LIST_FREQUENT"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter android:label=""@string/strequentList""&gt;            &lt;action android:name=""com.android.contacts.action.LIST_STREQUENT"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.INSERT_OR_EDIT"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.item/person"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.item/contact"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.item/raw_contact"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.EDIT"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:scheme=""content"" android:host=""com.android.contacts"" android:pathPrefix=""raw_contacts""              android:mimeType=""vnd.android.cursor.dir/contact""/&gt;        &lt;/intent-filter&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.android.contacts.action.SHOW_OR_CREATE_CONTACT"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:scheme=""content"" android:host=""com.android.contacts"" android:path=""contacts""              android:mimeType=""vnd.android.cursor.dir/contact""/&gt;        &lt;/intent-filter&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.android.contacts.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:scheme=""content"" android:host=""com.android.contacts"" android:pathPrefix=""contacts""              android:mimeType=""vnd.android.cursor.dir/contact""/&gt;        &lt;/intent-filter&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.android.contacts.action.INSERT"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:scheme=""content"" android:host=""com.android.contacts"" android:path=""contacts""              android:mimeType=""vnd.android.cursor.dir/contact""/&gt;            &lt;!--            I/ActivityManager( 1212): Starting activity: Intent { act=android.intent.action.VIEW dat=content://com.android.contacts/contacts flg=0x10000000 cmp=com.android.contacts/.DialtactsContactsEntryActivity bnds=[324,598][480,718] }            I/ActivityManager( 1212): Starting activity: Intent { act=android.intent.action.EDIT dat=content://com.android.contacts/raw_contacts/26 cmp=android/com.android.internal.app.ResolverActivity }            I/ActivityManager( 1212): Starting activity: Intent { act=android.intent.action.INSERT dat=content://com.android.contacts/contacts cmp=com.android.contacts/.ui.EditContactActivity }             --&gt;        &lt;/intent-filter&gt;  &lt;/receiver&gt;   </code></pre>","412334","","","","","2014-04-05 14:24:51","Android Intent Filters for VIEW/EDIT/INSERT Contact","<android><filter><view><android-intent><contacts>","2","0","","",""
"3419009","1","","","2010-08-05 20:45:39","1","1291","<p>Using Google Maps on Android does anyone have any ideas on how to load only markers that would be displayed on the current screen?</p><p>I'm thinking about sending a request to a web service that returns the lat/lng for the relevant markers. But what would the parameters be that I could use to calculate if a given lat/lng is within the screen?</p><p>What would be perfect would be something like <a href=""http://gowalla.com/api/explorer#/spots?lat=30.2697&amp;lng=-97.7494&amp;radius=50"" rel=""nofollow"">Gowalla's implementation</a></p><p>Any ideas?</p><p>Mike</p>","412390","","1887603","","2012-12-24 07:11:43","2012-12-24 07:11:43","How to load only markers that's currently visible on the screen (Google maps on Android)","<android><google-maps><google-maps-markers>","1","2","2","",""
"3419032","1","3419213","","2010-08-05 20:48:44","0","595","<p>I'm trying to play around with a RatingBar, but something is really wrong.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    &gt;    &lt;RatingBar        android:id=""@+id/shoppingitem_rating""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:numStars=""5""        android:rating=""0""        style=""?android:attr/ratingBarStyleSmall""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>Here is my layout XML.  This results in a black view with a white rectangle (that is not small, I might add).  What is going on?</p><p>Here is a screenshot:</p><p><a href=""http://i38.tinypic.com/2liio12.png"" rel=""nofollow"">screenshot</a></p>","406790","","","","","2011-08-26 07:27:04","Crazy RatingBar","<android>","2","3","1","",""
"3419187","1","","","2010-08-05 21:11:14","2","980","<p>Looking at the Facebook widget I realized its a 4x2 cell and this isn't one of the standard sizes. I have tried to re-create a widget of this size (either as 320x200 or 294x146 px) however the widget doesn't look good on all devices. The widget layout is : </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;!--  Portrait --&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:id=""@+id/widget""    android:background=""@drawable/widget_bg""    &gt;        &lt;TextView android:id=""@+id/widget_title""            android:layout_width=""fill_parent""             android:layout_height=""60dip""            android:layout_marginTop=""1dip""            android:textSize=""20.0sp""            android:maxLines=""3""            android:textColor=""#000""            android:textStyle=""bold""             android:gravity=""center""            android:layout_marginLeft=""10dip""            android:layout_marginRight=""10dip""            android:layout_centerHorizontal=""true""            android:layout_alignParentTop=""true""            android:ellipsize=""end""             /&gt;            &lt;ImageView android:id=""@+id/widget_thumb""            android:layout_width=""304dip""             android:layout_height=""90dip""            android:layout_alignParentLeft=""true""            android:layout_marginLeft=""7dip""            android:src=""@drawable/thumb_placeholder_large""            android:adjustViewBounds=""true""            android:layout_below=""@+id/widget_title""            android:background=""#000""            /&gt;    &lt;!--  previous button --&gt;    &lt;Button         android:id=""@+id/widget_previous""        android:layout_height=""wrap_content""         android:layout_width=""wrap_content""        android:layout_alignParentLeft=""true""        android:layout_marginLeft=""5dp""        android:layout_marginBottom=""35dp""        android:layout_alignParentBottom=""true""        android:background=""@drawable/left_button""/&gt;    &lt;!--  Next Button --&gt;    &lt;Button        android:id=""@+id/widget_next""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:layout_alignParentRight=""true""        android:layout_marginRight=""5dp""        android:layout_marginBottom=""35dp""        android:layout_alignParentBottom=""true""        android:background=""@drawable/right_button""  /&gt;    &lt;!-- Indicator --&gt;    &lt;LinearLayout         android:id=""@+id/widget_progressbar""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentRight=""true""        android:layout_marginBottom=""33dp""        android:layout_marginRight=""50dp""        android:layout_alignParentBottom=""true""&gt;        &lt;!--  ProgressBar throws exception when it's set invisible from RemoteViews use a layout wrapper instead --&gt;        &lt;ProgressBar            android:layout_width=""15dp""             android:layout_height=""15dp""&gt;        &lt;/ProgressBar&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>On the Motorola Droid this layout fits properly, however on other devices the ImageView sits way below. Any help/suggestions are appreciated.</p><p>The drawable_bg.png is 294x146px.</p><ul><li>Sandeep</li></ul>","412422","","","","","2012-09-19 10:01:48","Android 4x2 widget","<android><android-widget><android-layout>","2","0","","",""
"3419232","1","3437113","","2010-08-05 21:18:19","2","730","<p>I have formatted data with commands embedded with  tags. I use the HTML class to populate the TextView. Is there a way to intercept the click on the link and get what was clicked?</p><pre><code>Html.fromHtml(""&lt;a href='CMD:Bahai'&gt;Some Command Link&lt;/a&gt;"");</code></pre>","172861","","","","","2010-08-09 03:11:34","Android TextView respond to html <a> clicks","<android><textview>","1","0","","",""
"3419239","1","3419301","","2010-08-05 21:19:04","10","6963","<p>I have an app which displays a large amount of text for the user to read.</p><p>I've found that when reading while lying down, I get annoyed that the screen rotates even though my head and the screen are aligned.</p><p>I do not want to set this to be permanently in portrait mode, so I think this would preclude an approach of setting the </p><pre><code> android:screenOrientation=""portrait""</code></pre><p>in the manifest.</p><p>Ideally, I would like to enable/disable automatic orientation changes via a preference page.</p><p>What would be my best approach?</p>","4737","","","","","2010-08-06 11:40:15","Programatically enabling/disabling screen rotations in Android","<android><preferences><screen-orientation>","1","0","4","",""
"3419348","1","3419467","","2010-08-05 21:32:54","1","284","<p>I don't know why this is generating an ArrayOutOfBoundsException! It's likely I've overlooked something because I'm so tired but if someone could tell me what is wrong I'd appreciate it. Thanks.</p><pre><code>// array declarationpublic int CircleLeft[] = new int[mIPAWidth];// this is my loop that generates the error:for(px = 0; px &lt;= mIPAWidth - 1; px++){py =(int) m.sqrt(r^2 - (px-mIPAWidthHalf)^2) + mIPAHeightHalf;Log.w(getClass().getName(), ""mIPAWidth = "" + mIPAWidth + "", index is: "" + px);CircleLeft[px] = py; }</code></pre>","300037","","","","","2010-08-05 21:47:42","I don't know why I'm getting an out of bounds exception?","<android><arrays>","2","0","","",""
"3419437","1","","","2010-08-05 21:42:51","1","1062","<p>I have a wizard application that I want to make Home application. How can I convert regular application into a home application.</p>","410151","","","","","2010-08-06 00:06:00","How can I make my application as home application","<android>","1","2","","",""
"3419451","1","3420266","","2010-08-05 21:45:42","1","515","<p>I'm new to Android development, and I was wondering if there is a way to have an app take a screenshot of the currently active screen, do some processing on the screenshot (which would be internal to the app and temporary; I don't want it in the photo gallery), then communicate with a remote server over the Internet?   </p><p>I am of course looking for more than a yes or no answer.  An example of an api call or library I could use to do this would be a perfect answer.</p><p>The purpose would be to have a program screen scrape another program to recognize some text and use it for updating an online service.</p>","218211","","","","","2010-08-06 00:53:58","Can a backgrounded Android app take screenshots of the currently active screen?","<android><background><screenshot>","1","3","","",""
"3419521","1","3419594","","2010-08-05 21:55:17","4","6012","<p>I'm not referring to textInput, either. I mean that once you have static text in a TextView (populated from a Database call to user inputted data (that may not be Capitalized)), how can I make sure they are capitalized?</p><p>Thanks!</p>","312390","","","","","2014-01-14 01:47:04","How to capitalize a the first letter of text in a TextView in an Android Application","<android><xml>","4","0","","",""
"3419583","1","","","2010-08-05 22:05:47","1","2217","<p>I'm having issues with TextViews and centering the text within the text region.  Specifically, I have a TextView, but when I have text inside that contains letters that straddle down the bottom margin (i.e. p, g, q, y, etc), those letters are getting cut-off.  I'm trying to center the text within the region but haven't had much luck.</p><p>[Updated] I now resolved the letters getting cut-off at the bottom using wrap_content as my height, but found another problem.  It now appears that the text is positioned low in the region, leaving this gap at the top.  I modified my layout to reflect the latest (see below).  Basically, those characters that were getting cutoff before (g, y, j, etc) are touching the region right below which is fine, but it appears to leave a padding at the top.  I tried to change the gravity to center_vertical or center, but don't have much luck:</p><p>Note, I have to work with the specs given the textSizes (i.e. I can't change the values for these)</p><p></p><pre><code>&lt;LinearLayout    android:id=""@+id/header""    android:layout_width=""fill_parent""    android:layout_height=""43.3dip""    android:background=""@drawable/custom_bg""    android:orientation=""horizontal""&gt;    &lt;ImageButton        android:id=""@+id/headshot""        android:layout_width=""43.3dip""        android:layout_height=""43.3dip""        android:src=""@drawable/sample""        android:background=""@drawable/head_btn""        android:layout_gravity=""center"" /&gt;    &lt;RelativeLayout        android:id=""@+id/name_and_email""        android:layout_width=""230.7dip""        android:layout_height=""43.3dip""        android:orientation=""vertical""&gt;    &lt;TextView        android:id=""@+id/name""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:textColor=""@color/custom_color""        android:textSize=""18.6sp""        android:singleLine=""true""        android:ellipsize=""end""        android:layout_alignParentTop=""true""        android:gravity=""center_vertical""        android:background=""#c5ff15""        android:lineSpacingExtra=""0sp""        android:text=""AaBbCcDdGgJjTtYy"" /&gt;    &lt;TextView        android:id=""@+id/email""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:textColor=""@color/custom_color""        android:textSize=""13.3sp""        android:singleLine=""true""        android:ellipsize=""end""        android:layout_centerInParent=""true""        android:layout_below=""@id/name""        android:gravity=""center_vertical""        android:visibility=""gone""        android:text=""qypgj@gmail.com"" /&gt;    &lt;/RelativeLayout&gt;    &lt;ImageButton        android:id=""@+id/headshot2""        android:layout_width=""43.3dip""        android:layout_height=""43.3dip""        android:src=""@drawable/sample""        android:background=""@drawable/head_btn2""        android:layout_gravity=""center"" /&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>Can anyone help?</p><p>MB</p>","412465","","412465","","2010-08-06 20:09:29","2010-08-06 20:09:29","Having issues with centering text in TextView within a region","<android><android-emulator><textview><android-linearlayout><relativelayout>","1","0","","",""
"3419599","1","3420735","","2010-08-05 22:07:44","5","6252","<p>I want to create simple equalizer for android. How can I do it?</p><p>Try to find some methods in MediaPlayer class. But all my attempts failed.</p>","412469","","","","","2012-08-09 11:19:35","How to create equalizer for android","<android><media><equalizer>","3","2","2","",""
"3419697","1","3419864","","2010-08-05 22:25:15","4","19570","<p>Is there any sample? I have my android application and I need to connect to mysql server on my machine, what is the best way?</p><p>I should not use jdbc, explanation here</p><ul><li><a href=""http://stackoverflow.com/questions/2256082/best-way-to-implement-client-server-database-architecture-in-an-android-a"">Best way to implement Client &lt;-&gt; Server &lt;-&gt; Database architecture in an Android application?</a></li></ul><blockquote>  <p>Never never use a database driver across an Internet connection, for any database, for any platform, for any client, anywhere. That goes double for mobile. Database drivers are designed for LAN operations and are not designed for flaky/intermittent connections or high latency.</p></blockquote><p>And should go for:</p><pre><code>DefaultHttpClient httpclient = new DefaultHttpClient(); </code></pre><p>But there is no example in how to open a connection or execute a simple sql statement.anyone could help me? </p>","412449","","92837","","2012-08-18 13:02:29","2014-02-27 01:34:00","How to connect Android to a database server","<android><database-connection>","6","0","1","",""
"3419700","1","3420022","","2010-08-05 22:25:23","1","100","<p>I'm trying to get my feet wet with Android development. I downloaded Eclipse, and setup the ADT. When I create a project from existing source, I choose the demo projects (API Demo) and compile + run. The simulator pops up but I can't seem to find the API Demo application. How can I get this up and running?</p>","19875","","","","","2010-08-05 23:44:54","Android Demo's aren't appearing in simulator","<java><android>","3","0","","",""
"3420139","1","","","2010-08-06 00:15:19","0","489","<p>I made some edits to my preferences.xml file, nothing that generated any syntax flags in Eclipse, and now I'm getting the following weird error when I try to inflate my PreferencesActivity:</p><p>E/AndroidRuntime( 3480): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.shipmate/com.shipmate.PreferencesActivity}: java.lang.IllegalArgumentException: Cannot add a PreferenceCategory directly to a PreferenceCategory</p><p>I always have PreferenceCategory's inside other PreferenceCategory's so I don't think that's the problem. What does it mean that it thinks I'm ""adding"" one PreferenceCategory to another? What does ""add"" mean in XML? And how does an IllegalArgument relate to this addition? Any ideas on how I might isolate this problem?</p>","409849","","","","","2011-03-13 17:06:09","Weird exception from PreferencesActivity","<android>","1","1","","",""
"3420326","1","","","2010-08-06 01:10:25","1","411","<p>I have a hidden view in android that I show in response to a button press. The first time I show it there's a bit of a delay, and it hitches. After that it shows\hides smoothly.</p><p>Is there a way to preload a view so it's ready to be drawn smoothly the first time it's called upon?</p>","92259","","","","","2011-01-13 17:20:45","Preload a view in android?","<android>","1","0","","",""
"3420451","1","","","2010-08-06 01:38:34","1","1831","<p>Is it possible to create a custom button in Android, where the button is idly animating using a frame animation (AnimationDrawable)?</p>","107459","","","","","2010-08-06 05:04:14","How to create a custom button in Android that animates with a frame animation","<android><animation><button>","1","0","","",""
"3420458","1","3420764","","2010-08-06 01:40:25","1","6499","<p>So I'm working with a list view trying to get specific activities to open when a certain item is selected. This is the code that I'm working with right now. I know its wrong but am not sure what I need to change it make it work. I think I need an intent and tried a few ideas but did not come up with much. Thanks.</p><pre><code>package table.periodic;import android.app.ListActivity;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import android.widget.ListView;public class List extends ListActivity{String[] elements={""actinium"", ""aluminum"", ""americium"",         ""antimony"", ""argon"", ""arsenic"", ""astatine"", ""barium"",         ""berkelium"", ""beryllium"", ""bismuth"", ""bohrium"", ""boron"",         ""bromine"", ""cadmium"", ""calcium"", ""californium"", ""carbon"",         ""cerium"", ""cesium"", ""chlorine"", ""chromium"", ""cobalt"",         ""copper"", ""copernicium"", ""curium"", ""darmstadtium"", ""dubnium"",         ""dysprosium"", ""einsteinium"", ""erbium"", ""europium"", ""fermium"",         ""fluorine"", ""francium"", ""gadolinium"", ""gallium"", ""germanium"",         ""gold"", ""hafnium"", ""hassium"", ""helium"", ""holmium"",         ""hydrogen"", ""indium"", ""iodine"", ""iridium"", ""iron"",         ""krypton"", ""lanthanum"", ""lawrencium"", ""lead"", ""lithium"",         ""lutetium"", ""magnesium"", ""manganese"", ""meitnerium"", ""mendelevium"",         ""mercury"", ""molybdenum"", ""neodymium"", ""neon"", ""neptunium"",         ""nickel"", ""niobium"", ""nitrogen"", ""nobelium"", ""osmium"",         ""oxygen"", ""palladium"", ""phosphorus"", ""platinum"", ""plutonium"",         ""polonium"", ""potassium"", ""praseodymium"", ""promethium"", ""protactinium"",         ""radium"", ""radon"", ""rhenium"", ""rhodium"", ""roentgenium"", ""rubidium"",         ""ruthenium"", ""rutherfordium"", ""samarium"", ""scandium"", ""seaborgium"",         ""selenium"", ""silicon"", ""silver"", ""sodium"", ""strontium"", ""sulfur"",         ""tantalum"", ""technetium"", ""tellurium"", ""terbium"", ""thallium"", ""thorium"",         ""thulium"", ""tin"", ""titanium"", ""tungsten"", ""ununhexium"", ""ununoctium"",         ""ununpentium"", ""ununquadium"", ""ununseptium"", ""ununtrium"", ""uranium"",         ""vanadium"", ""xenon"", ""ytterbium"", ""yttrium"", ""zinc"", ""zirconium""}; public void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.list);     setListAdapter(new ArrayAdapter&lt;String&gt;(            this, android.R.layout.simple_list_item_1,             elements)); } public void onListItemClick(ListView parent, View v, int position,         long id){     if (""actinium"".equals(elements[position]))        {startActivity(Actinium.class);}     else if (""aluminum"".equals(elements[position]))        {startActivity(Aluminum.class);} }</code></pre>","288437","","","","","2011-09-01 08:00:09","List View selection to start a new Activity","<android><listview><activity><android-intent>","1","0","4","",""
"3420539","1","3420836","","2010-08-06 02:06:35","2","2153","<p>I have published an app with this AndroidManifest.xml:</p><pre><code>&lt;supports-screensandroid:smallScreens=""true""android:normalScreens=""true""android:largeScreens=""true""android:anyDensity=""false""/&gt;&lt;uses-sdk android:minSdkVersion=""3"" /&gt;</code></pre><p>and with publish options</p><blockquote>  <p>Copy Protection = ON (Helps prevent copying of this application from  the device. Increases the amount of memory on the phone required to  install the application.), <br>Locations = all Locations</p></blockquote><p>but i found that some device can't find it in the market, including Acer liquid, Sony Ericsson x10 mini pro, and even a Samsung Galaxy S  <br/></p><p>Any suggestions?</p>","361010","","414266","","2011-10-30 22:08:29","2011-10-30 22:08:29","Can't find my App in Google Android market","<android><google-play>","1","0","1","",""
"3420728","1","3421664","","2010-08-06 02:54:48","2","1004","<p>My Logcat </p><pre><code>08-06 01:27:34.874: ERROR/AndroidRuntime(721): Uncaught handler: thread main exiting due to uncaught exception08-06 01:27:34.893: ERROR/AndroidRuntime(721): java.lang.NullPointerException08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at one.two.Booking$MyOnItemSelectedListener.onItemSelected(Booking.java:53)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.widget.AdapterView.fireOnSelected(AdapterView.java:856)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.widget.AdapterView.access$200(AdapterView.java:41)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:827)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.os.Handler.handleCallback(Handler.java:587)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.os.Handler.dispatchMessage(Handler.java:92)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.os.Looper.loop(Looper.java:123)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at android.app.ActivityThread.main(ActivityThread.java:3948)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at java.lang.reflect.Method.invokeNative(Native Method)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at java.lang.reflect.Method.invoke(Method.java:521)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)08-06 01:27:34.893: ERROR/AndroidRuntime(721):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Booking.java</p><pre><code>package one.two;import android.app.Activity;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.SimpleCursorAdapter;import android.widget.Spinner;import android.widget.TextView;import android.widget.AdapterView.OnItemSelectedListener;public class Booking extends Activity{    private DBAdapter db;     private Spinner colourSpinner;    public Cursor c;    public TextView txtArrival;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        db = new DBAdapter(this);        this.setContentView(R.layout.booking);        db.open();        fillData();        db.close();        TextView txtArrival = (TextView) findViewById(R.id.txtArrival);        Spinner colourSpinner = (Spinner) findViewById(R.id.myspinner);        colourSpinner.setOnItemSelectedListener(new MyOnItemSelectedListener());    }    private void fillData()    {        c = db.getSpinnerData();        startManagingCursor(c);        String[] from = new String[]{DBAdapter.KEY_ARRIVAL};        int[] to = new int[]{android.R.id.text1};        SimpleCursorAdapter adapter =        new SimpleCursorAdapter(this,R.layout.booking, c, from, to );        adapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );        Spinner colourSpinner = (Spinner) findViewById(R.id.myspinner);        colourSpinner.setAdapter(adapter);    }    public class MyOnItemSelectedListener implements OnItemSelectedListener    {        public void onItemSelected(AdapterView&lt;?&gt; arg0, View v,int position, long id)        {            boolean result = Booking.this.c.moveToPosition(position);            if (result) {                String title=Booking.this.c.getString(1);                Booking.this.txtArrival.setText(title);            }        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; arg0)        {            // TODO Auto-generated method stub        }    };}</code></pre><p>I would like to know how to solve this error.Thank you.</p>","358218","","358218","","2010-08-06 04:10:01","2010-08-06 07:04:37","NullPointerException error","<android><eclipse><sqlite>","4","1","","",""
"3420767","1","3420816","","2010-08-06 03:03:59","6","6369","<p>I am accessing a URL that's redirecting me to a URL with spaces in it. (Using HttpClient 4.x) How do I prevent this from throwing an error (replacing the spaces with %20 not +)</p><pre><code>08-06 02:45:56.486: WARN/System.err(655): org.apache.http.client.ClientProtocolException08-06 02:45:56.493: WARN/System.err(655):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:557)08-06 02:45:56.534: WARN/System.err(655):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:509)08-06 02:45:56.603: WARN/System.err(655):     at com.romcessed.romsearch.searchproviders.DopeRomsConnector$DownloadROMTask.doInBackground(DopeRomsConnector.java:636)08-06 02:45:56.623: WARN/System.err(655):     at com.romcessed.romsearch.searchproviders.DopeRomsConnector$DownloadROMTask.doInBackground(DopeRomsConnector.java:1)08-06 02:45:56.643: WARN/System.err(655):     at android.os.AsyncTask$2.call(AsyncTask.java:185)08-06 02:45:56.663: WARN/System.err(655):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)08-06 02:45:56.683: WARN/System.err(655):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)08-06 02:45:56.693: WARN/System.err(655):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)08-06 02:45:56.713: WARN/System.err(655):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)08-06 02:45:56.713: WARN/System.err(655):     at java.lang.Thread.run(Thread.java:1096)08-06 02:45:56.743: WARN/System.err(655): Caused by: org.apache.http.ProtocolException: Invalid redirect URI: http://somewebsite.com/some file with spaces.zip08-06 02:45:56.787: WARN/System.err(655):     at org.apache.http.impl.client.DefaultRedirectHandler.getLocationURI(DefaultRedirectHandler.java:116)08-06 02:45:56.803: WARN/System.err(655):     at org.apache.http.impl.client.DefaultRequestDirector.handleResponse(DefaultRequestDirector.java:892)08-06 02:45:56.813: WARN/System.err(655):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:457)08-06 02:45:56.843: WARN/System.err(655):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)08-06 02:45:56.843: WARN/System.err(655):     ... 9 more08-06 02:45:56.873: WARN/System.err(655): Caused by: java.net.URISyntaxException: Illegal character in path at index #: http://somewebsite.com/some file with spaces.zip08-06 02:45:56.913: WARN/System.err(655):     at java.net.URI$Helper.validatePath(URI.java:448)08-06 02:45:56.923: WARN/System.err(655):     at java.net.URI$Helper.parseURI(URI.java:398)08-06 02:45:56.953: WARN/System.err(655):     at java.net.URI$Helper.access$100(URI.java:302)08-06 02:45:56.963: WARN/System.err(655):     at java.net.URI.&lt;init&gt;(URI.java:87)08-06 02:45:56.993: WARN/System.err(655):     at org.apache.http.impl.client.DefaultRedirectHandler.getLocationURI(DefaultRedirectHandler.java:114)08-06 02:45:57.013: WARN/System.err(655):     ... 12 more</code></pre>","325081","","","","","2010-08-06 19:40:46","HttpClient redirecting to URL with spaces throwing exception","<java><android><redirect><httpclient><urlencode>","3","0","4","",""
"3421017","1","","","2010-08-06 04:36:47","0","1332","<p>I am trying to get this code to work on my Dell Streak but when I receive an SMS I still dont get a Toast notification... I have added the 'receive' tag in the manifest.xml file... I am a complete noob at this and need a little help getting started :)</p><pre><code>package net.learn2develop.SMSMessaging;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.telephony.SmsMessage;import android.widget.Toast;public class SMSReceiver extends BroadcastReceiver{    @Override    public void onReceive(Context context, Intent intent)    {        //---get the SMS message passed in---        Bundle bundle = intent.getExtras();               SmsMessage[] msgs = null;        String str = """";                   if (bundle != null)        {            //---retrieve the SMS message received---            Object[] pdus = (Object[]) bundle.get(""pdus"");            msgs = new SmsMessage[pdus.length];                       for (int i=0; i&lt;msgs.length; i++){                msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                               str += ""SMS from "" + msgs[i].getOriginatingAddress();                                     str += "" :"";                str += msgs[i].getMessageBody().toString();                str += ""\n"";                   }            //---display the new SMS message---            Toast.makeText(context, str, Toast.LENGTH_SHORT).show();        }                             }}</code></pre>","412653","","244296","","2010-08-06 04:41:41","2010-08-06 05:11:43","Android + SMS Receiver + Toast = FAIL","<android><toast>","1","0","","",""
"3421026","1","3421049","","2010-08-06 04:38:16","1","507","<p>So I was doing this comparative study between the application security model between android and now I need a benchmark for it to compete against. The problem though is I am pretty new to mobile application development and barely know the names and probably used a phone or two in the process with each of the OSes. Now the dilemma I am in is, which OS should I pitt against the Andorid to compete with for a security model study. At most I can pick two because I literally will not have the time to complete developing applications for all the Operating Systems in the market to do a comparative study.</p><p>Which one would be the best choices according to you? (Please elaborate as to why its a worthy competitor).</p>","393459","","393459","","2010-08-06 05:14:45","2010-08-06 06:40:06","Confused in my choice between (webOS, BADA and Iphone) vs Android","<android><security><platform><mobile-application>","2","0","","",""
"3421075","1","3421168","","2010-08-06 04:51:58","0","220","<p>I want to create a directory by using program in android sdk. Is it possible to listen the folder action like open folder and close folder etc.</p><p>Please help me to do this?</p><p>ThanksDeepak</p>","406494","","","","","2010-08-06 05:15:28","Creating a Folder using Program","<android><implementation>","1","0","","",""
"3421116","1","3425265","","2010-08-06 05:02:09","1","665","<p>I am trying to play a file using the MediaPlay.  The first time it is played, it only plays for 1 or 2 seconds then cuts out and never returns.  The second time I play the song, it goes about 3 seconds.  This function is in the onCreate function:</p><pre><code>checkin.setOnCheckedChangeListener(new OnCheckedChangeListener(){   public void onCheckedChanged(CompoundButton buttonView, boolean isChecked){   MediaPlayer mp = MediaPlayer.create(context, R.raw.my_song);   mp.start();   v.vibrate(500);   myLocation.getLocation(context, locationResult);}</code></pre><p>Is another thread clearing overriding the song?  How do I get my whole song to play?</p>","207795","","","","","2010-08-06 15:27:38","MediaPlayer on Android only plays part of my song :(","<android><media-player>","1","0","0","",""
"3421244","1","","","2010-08-06 05:38:22","0","624","<p>I have a problem with my android emulator. it does not shows network bars when i run it, instead it shows a cross over there.</p><p>The problem existed from the day i installed emulator.</p><p>Any suggestions will be welcomed.</p><p>Thanks.</p>","405521","","","","","2011-04-30 19:57:12","ANdroid emulator does not show signal bars","<android><networking><emulator>","2","0","","",""
"3421340","1","3423164","","2010-08-06 06:00:11","4","537","<p>I have a C/S solution, which take Android as its client and PHP as its server.</p><p>I have my own account system.</p><p>I'm wondering whether I could provide my user to login my system with Google Account?</p><p>I saw there are web-solution for this, like this stackoverflow.com could use Google Account to directly login.</p><p>Is there a solution for C/S system?</p>","234939","","","","","2010-08-06 11:06:33","Is it possible for an Android application to use Open-ID service?","<android><openid>","1","0","3","",""
"3421360","1","","","2010-08-06 06:04:25","1","2423","<pre><code>SQLiteDatabase database = SQLiteDatabase.openDatabase(""/data/data/com.android.browser/databases/browser.db"",null, 0);database.setLockingEnabled(true);database.delete(""bookmarks"", ""_id=2"", null);database.close();</code></pre><p>error</p><pre><code>08-06 05:53:45.769: ERROR/tt(958): android.database.sqlite.SQLiteException: error code 14: unable to open database file08-06 05:53:45.769: ERROR/tt(958):     at android.database.sqlite.SQLiteStatement.native_execute(Native Method)08-06 05:53:45.769: ERROR/tt(958):     at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:66)08-06 05:53:45.769: ERROR/tt(958):     at android.database.sqlite.SQLiteDatabase.delete(SQLiteDatabase.java:1362)08-06 05:53:45.769: ERROR/tt(958):     at com.iwidsets.sqlite.manager.SQLiteManager.onCreate(SQLiteManager.java:48)08-06 05:53:45.769: ERROR/tt(958):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)08-06 05:53:45.769: ERROR/tt(958):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)08-06 05:53:45.769: ERROR/tt(958):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)08-06 05:53:45.769: ERROR/tt(958):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)08-06 05:53:45.769: ERROR/tt(958):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)08-06 05:53:45.769: ERROR/tt(958):     at android.os.Handler.dispatchMessage(Handler.java:99)08-06 05:53:45.769: ERROR/tt(958):     at android.os.Looper.loop(Looper.java:123)08-06 05:53:45.769: ERROR/tt(958):     at android.app.ActivityThread.main(ActivityThread.java:3948)08-06 05:53:45.769: ERROR/tt(958):     at java.lang.reflect.Method.invokeNative(Native Method)08-06 05:53:45.769: ERROR/tt(958):     at java.lang.reflect.Method.invoke(Method.java:521)08-06 05:53:45.769: ERROR/tt(958):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)08-06 05:53:45.769: ERROR/tt(958):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)08-06 05:53:45.769: ERROR/tt(958):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","350694","","2541473","","2014-02-25 07:47:47","2014-02-25 07:47:47","Android sqlite exception,how to fix?","<android><sqlite>","1","2","1","",""
"3421410","1","3424140","","2010-08-06 06:15:48","0","326","<p>I want to copy all the video files on my server &amp; save it in the web contents folder of a web service , so that it can be visible to all later on !</p><p>How should i proceeed ?</p>","335429","","2598","","2010-08-18 13:18:51","2010-08-18 13:18:51","Working with web service?","<android><web-services>","1","0","3","",""
"3421431","1","","","2010-08-06 06:19:58","0","98","<p>Suppose i have an application ""MyApp"" which has a button and when clicked it should start another application say""App2"" but this ""App2"" should not be installed on the phone it should dynamically be executed.how do i do this in android.it will be helpful if u can explain with some sample code .</p><p>thank u</p>","410362","","9990","","2010-08-06 06:21:48","2010-09-08 23:27:06","how to load a file during run time","<android>","1","0","","",""
"3421513","1","3421588","","2010-08-06 06:37:18","1","9601","<p>When I uninstall an app using ""adb uninstall , my logcat *:W starts to looks somewhat like this - </p><pre><code>            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f050000            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f020005            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f020004            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f0700e5            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f020031            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f020030            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f050000            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f080000            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f020051            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f020052            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f0a0000            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f02012f            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f020130            W/ResourceType( 1269): Resources don't contain package for resource number 0x7f060001            E/AndroidRuntime( 6887): ERROR: thread attach failed</code></pre><p>What does that error - ""thread attach failed"" mean?</p>","303347","","","","","2011-09-15 23:54:45","Android Runtime Thread Attach Failed","<android>","2","0","","",""
"3421577","1","","","2010-08-06 06:50:16","5","6111","<p>What is the problem with this code? It doesn't catch the exception thrown by <code>insertChild()</code> method.</p><pre><code>childDbOps.open();try {    childDbOps.insertChild(child);} catch (SQLiteException exception) {    Log.i(""error la inserare child"", ""on the next line"");    exception.printStackTrace();} finally {    childDbOps.close();}</code></pre><p>The error is:</p><pre><code>ERROR/Database(320): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed at com.android.dataLayer.DbAdapter.insertChild(DbAdapter.java:169)   at com.android.activities.ChildInsertActivity.onClick(ChildInsertActivity.java:203)   at android.view.View.performClick(View.java:2344) </code></pre><p>It is android sqlite. The line is when the insert method is called.</p>","410726","","375953","","2012-10-01 04:30:42","2012-10-01 04:30:42","SQLiteConstraintException not caught","<java><android><exception-handling><try-catch>","3","5","","",""
"3421599","1","3421719","","2010-08-06 06:54:09","2","733","<p>I have noticed in an application I wrote, in-spite of me not specifying any permission in the manifest file, the application throws up permissions granted, such as</p><blockquote>  <p>android.permission.WRITE_EXTERNAL_STORAGE  android.permission.READ_PHONE_STATE</p></blockquote><p>What is all that about? I was not even aware my application needs to write into external store, and I am pretty sure it doesn't need to. So why are these permission being granted when I never requested for them?</p>","393459","","","","","2010-08-06 07:13:51","Are there default permissions granted for applications on Android?","<android><permissions>","1","0","","",""
"3421631","1","","","2010-08-06 06:59:01","-1","134","<p>Does anyone know how to do google map program in android by inputing two location's name and now one can see the rout between them</p>","397969","","","","","2010-08-06 07:06:53","android program to display rout between two locations","<android>","2","1","","",""
"3421741","1","3422454","","2010-08-06 07:17:04","2","3789","<p>I need to install Tamil font in to my Android device. is it possible to install new Unicode font in to the android device?</p><p>Thanks,Chandnaa</p>","377438","","","","","2010-08-11 12:44:43","Android Device install new font","<android>","2","0","2","",""
"3421812","1","3422895","","2010-08-06 07:29:03","3","9887","<p>I have developed an application which is working fine.</p><p>In that i have used some static variables and also set Application level variables.My problem is that even after setting finish() on each activity, application is showing in Running mode.</p><p>After closing the application, when i start the application after sometime, it will set the last changes.</p><p>How can i destroy my application?</p>","385343","","","","","2011-04-29 15:23:25","Destroy Android application","<android>","5","0","4","",""
"3421864","1","","","2010-08-06 07:41:07","6","2341","<p>I have read the Android UI trick 2 on Android developers, which tells people how to include a layout in another layout file multiple times, and give these included layouts different id. However, the sample here is overwriting the layout id, not the id of the views IN this layout. For example, if the workspace_screen.xml looks like this:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:orientation=""vertical""&gt;&lt;TextView android:id=""@+id/firstText""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""first""/&gt;&lt;TextView android:id=""@+id/secondText""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""second""/&gt;</code></pre><p></p><p>And I include it three times in another layout file. Do I end up with three TextViews with id firstText, and another three with secondText? Isn't there an id collision? And how do I find the secondText TextView in the third included layout with findViewById? What should I input in the findViewById method?</p>","412759","","43222","","2011-01-11 19:36:14","2012-04-16 05:46:05","How do I access the views inside the layout when I reuse it multiple times?","<android><layout><include>","2","0","2","",""
"3421961","1","3421973","","2010-08-06 08:02:58","1","1149","<p>I am currently working on Windows with android 2.2. I am trying to create an SDCard for the Emulator. I have created Sdcard.iso. I am trying to pull songs and videos into it. But I do no how to do it.</p>","366916","","114066","","2010-08-06 08:25:18","2011-11-02 17:08:59","Android- SDCard","<android><sd-card>","3","2","","",""
"3422027","1","","","2010-08-06 08:14:50","0","653","<p>I have an application made up of an ExpandableList, whose children are data collection widgets like CheckBoxes and EditText. Once data is entered, it is immediately lost when the list is scrolled.What may be the problem or solution?Thanks.</p>","357442","","","","","2010-12-10 09:30:12","Android View losing data on scroll","<android><view><expandablelistview>","1","0","","",""
"3422358","1","","","2010-08-06 09:05:57","3","3858","<p>I have a custom button, on which I am capturing its onTouchEvent. </p><pre><code>public class CustomNumber extends ToggleButton {boolean drawGlow = false;float glowX = 0;float glowY = 0;float radius = 30;public CustomNumber(Context context) {    super(context);}public CustomNumber(Context context, AttributeSet attrs) {    super(context, attrs);}public CustomNumber(Context context, AttributeSet attrs, int defStyle) {    super(context, attrs, defStyle);}Paint paint = new Paint();{    paint.setAntiAlias(true);    paint.setColor(Color.WHITE);    paint.setAlpha(70);};@Overridepublic void draw(Canvas canvas){    super.draw(canvas);    if(drawGlow)        canvas.drawCircle(glowX, glowY, radius, paint);}@Override**public boolean onTouchEvent(MotionEvent event)**{    if(event.getAction() == MotionEvent.ACTION_DOWN){        drawGlow = true;    }else if(event.getAction() == MotionEvent.ACTION_UP)        drawGlow = false;    glowX = event.getX();    glowY = event.getY();    this.invalidate();    return true;}</code></pre><p>}</p><p>This custom button is the part of a grid. When I am adding this button to the grid, I have set a OnClickListener to it. But, the code in the OnClickListener is never invoked.</p><p>//Grid Adapter code, where I am adding the button with listener.</p><pre><code>public View getView(final int position, final View convertView, final ViewGroup parent) {    CustomNumber tBtn;    if (convertView == null) {        tBtn = new CustomNumber(context);        tBtn.setTextOff("""");        tBtn.setTextOn("""");        tBtn.setChecked(false);        tBtn.setId(position);        tBtn.setOnClickListener(tBtnListener);        tBtn.setLayoutParams(new GridView.LayoutParams(35, 35));    } else {        tBtn = (CustomNumber) convertView;    }    return tBtn;}</code></pre><p>Please help.</p>","284372","","","","","2012-04-05 12:52:47","Android: Custom button OnClickListener is not getting invoked","<android><gridview><custom-controls><onclick><touch>","4","3","2","",""
"3422388","1","3422405","","2010-08-06 09:10:16","25","50778","<p>I have tried to search on HashMap in Android, but getting problem:</p><p>Consider this example:</p><pre><code>  HashMap&lt;String, String&gt; meMap=new HashMap&lt;String, String&gt;();     meMap.put(""Color1"",""Red"");     meMap.put(""Color2"",""Blue"");     meMap.put(""Color3"",""Green"");     meMap.put(""Color4"",""White"");</code></pre><p>now i want to iterate it and get the value of each colour and want to display in ""Toast"".how do i display it ?</p><p>Any idea.</p>","379693","","379693","","2010-08-06 09:59:20","2014-04-03 08:03:15","Android - Get value from HashMap","<android><android-widget><hashmap>","5","6","15","",""
"3422400","1","","","2010-08-06 09:11:37","5","3420","<p>I would like to get access to the area covered by a finger for each touch event on an Android.</p><p>Every touch event will result in a coordinate pair X and Y independent of how big the finger and consequently the touch area is that triggered the event.</p><p>I was wondering if there is a way to get the area data which triggered the touch event e.g. size or coordinates NOT</p><p>Any help is much appreciated.</p><p>Thanks in advance for you answer or redirects,</p><p>Christian</p>","400022","","","","","2012-04-04 17:09:59","Android: Measure/detect covered area by a finger touch on screen (NOT only touch coordinates)","<android><events><size><touch><area>","2","0","1","",""
"3422403","1","3422548","","2010-08-06 09:12:12","0","112","<p>Here is my issue :<br>I have 2 phones and I don't want to pay twice for an application on the market. Is there a way to share an application I have downloaded and payed for, once, onto the other phone?</p>","263521","","","","","2010-08-06 09:33:14","synchronize/share one application on several android phones","<android><phone><sharing>","1","3","","",""
"3422651","1","","","2010-08-06 09:50:27","2","4073","<p>I have an app that receives qr code from the server. I want to decode it (not with intent and camera) and display the text it contains in my app.  I have alredy done this in Java SE with jars from zxing with this code:</p><pre><code> private class QRCodeDecoder {         public String decode(File imageFile) {         BufferedImage image;         try {         image = ImageIO.read(imageFile);         } catch (IOException e1) {         return ""io outch"";         }         // creating luminance source         LuminanceSource lumSource = new BufferedImageLuminanceSource(image);         BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(lumSource));         // barcode decoding         QRCodeReader reader = new QRCodeReader();         Result result = null;         try {         result = reader.decode(bitmap);         } catch (ReaderException e) {         return ""reader error"";         }         return result.getText();         }        }</code></pre><p>But on Android, BufferedImage is not found. Has anyone decoded qr code on android from image stored on the phone?Tnx.</p>","324417","","","","","2013-12-28 13:31:53","Decoding qr code from image stored on the phone with Zxing (on Android phone)","<java><android><decode><qr-code>","3","3","5","",""
"3422688","1","","","2010-08-06 09:56:16","1","1315","<p>I'm a litte bit desperate to open a file with intent so that android can decide which application should handle this file. My Problem is that i have only the file as an Base64 representation which i decode to an byte Array</p><p>Now i want to send an intent and open that file. I try to do save it in the internal storage and open the file with the uri given by getFilesDir(). Here is my Code</p><pre><code>    FileOutputStream fos = openFileOutput(filename, Context.MODE_WORLD_READABLE );    fos.write((byte[])result);    fos.close();    uri = Uri.fromFile(new File(getFilesDir(), filename));    Intent myIntent = new Intent(Intent.ACTION_VIEW);    myIntent.setData(uri);    startActivity(myIntent);</code></pre><p>Unfortunatly this doesn't work. All i got is an ActivityNotFoundException (even if i try to open a *.jpg)</p><p>Thanks for any input!</p>","412883","","","","","2010-08-06 10:01:05","Android: open file in byte array representation with Intents","<android><file><android-intent>","1","0","1","",""
"3422718","1","3422731","","2010-08-06 10:00:34","0","334","<p>When you use Twitter API and develop your first simple Twitter client, and post a comment to Twitter - it says ""from API"". Using the Twitter web it says ""from the web"". Using Siesmic it says ""from Seesmic"".</p><p>How do you the set the application name/title so it shows up like ""from myApp"" using Android?</p><p>Thanx for listening! Answers will be rewarded.</p>","286244","","","","","2010-08-06 10:04:04","Change title name in Twitter API using Android?","<android><twitter><twitter-api>","1","0","","",""
"3422758","1","3422824","","2010-08-06 10:08:10","25","8200","<p>Can someone tell me how to start new application knowing only its package name? I do not have information about what activity is the main one.</p>","370982","","","","","2013-08-09 11:46:20","start application knowing package name","<android>","2","0","4","",""
"3422801","1","3422841","","2010-08-06 10:13:14","1","278","<p>I have an application which is in portrait mode. However, I want to run a particular activity in landscape mode. I have tried the following with no success.</p><pre><code>1. android:screenOrientation=""landscape"" in AndroidManifest.xml2. this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); in activity requiring landscape mode</code></pre><p>as specified <a href=""http://stackoverflow.com/questions/2150287/force-an-android-activity-to-always-use-landscape-mode"">here</a>. Please help.Thanks</p>","368084","","","","","2010-08-06 13:26:33","Forcing activity to run an activity in landscape in android 1.5","<android>","1","0","","",""
"3422806","1","3423166","","2010-08-06 10:13:46","2","582","<p>I created an object that extends <code>android.view.View</code>, overriding <code>draw()</code> and have it displaying on the screen. To put you in the picture, it is a display of digits to represent a game score. It's displaying correctly horizontally, however, it is taking up the full height of the screen - pushing all other elements off the screen.</p><p>I've put <code>layout_height=""wrap_content""</code> in the xml, but it has no effect.</p><p>Does anyone know what I am doing wrong?</p>","409853","","","","","2010-08-06 11:06:41","Custom view object using up full height of screen even when layout_height is set to wrap_content","<android><view><android-widget>","1","0","1","",""
"3422810","1","","","2010-08-06 10:13:54","0","475","<p>What i m trying to do is, just showing numbers from 1 to 100 in a textview, randomly, and keep on changing until the view is active.</p><p>But i am not able to continuously change random number when view is active.</p><p>it is just like a timer  showing decrement from 10 to 0, but the only difference is i need to show random numbers in between 0 to 100.</p><p>How can show this on my viewthis is how i am trying to do something..may be a better approch will help me out</p><pre><code>if (hasFocus) {   try {        //Give the currentTimeMillis some time for the seed        Thread.sleep(2);     } catch (InterruptedException ex) {        ex.printStackTrace();     }     Random randomizer = new Random(System.currentTimeMillis());     // abcdef  = randomizer.nextInt(max-min+1)+min;   return randomizer.nextInt(max-min+1)+min;  } else { }</code></pre>","1497488","","114066","","2010-08-06 12:07:14","2010-08-06 12:07:40","showing numbers on textview","<android>","1","0","1","",""
"3422905","1","3498315","","2010-08-06 10:29:28","2","1604","<p>I'm new in android and I have few questions to ask.</p><ol><li><p>Is it possible to use the keypad (Left and Right) to move from one TabHost to another?</p></li><li><p>I successfully changed the selector color in listview, then how can I change the textcolor in ListView as well?</p></li><li><p>Is it possible change the TabHost layout by own graphics?</p></li><li><p>I have created a TabHost aligned to the bottom of the screen. How can I move the ""line"" on bottom of TabWidget to above? (see screenshot)</p></li></ol><p><img src=""http://desmond.yfrog.com/Himg251/scaled.php?tn=0&amp;server=251&amp;filename=tabwidget.png&amp;xsize=640&amp;ysize=640"" alt=""alt text""></p><p>Your reply is very appreciated.Thank you.</p><p>P/S: sorry about my bad english, hope you guys understand what I'm talking about.Thanks</p>","409419","","12388","","2010-08-06 10:43:42","2010-08-16 23:50:33","Few questions about android TabHost","<android><android-tabhost><tabwidget>","1","1","2","",""
"3422981","1","","","2010-08-06 10:40:19","11","11381","<p>I am trying to <strong>install an apk file</strong> from command prompt but getting an error ""<strong>Device not found</strong>"".</p>","411780","","64174","","2013-11-29 08:40:21","2013-11-29 08:40:21","Getting the error ""device not found"" when running a apk file from Android emulator","<android><apk>","3","2","3","",""
"3422985","1","","","2010-08-06 10:40:46","0","1267","<p>1 . can we get any event when user tap/touch native application(i.e. messaging,contacts).</p><p>2 . i know that any application launch by intent in android, there is any way to know which application launch with launch of application.</p><p>Thanks</p>","412907","","","","","2013-04-26 05:32:53","Get event on launching the native application","<android>","4","0","0","",""
"3423048","1","","","2010-08-06 10:49:25","1","283","<p>I am currently implementing a webview that uses the default behavior of opening the browser. When the page loads in the browser and I click the download link that is on the page that was loaded, the download starts, and quickly fails. I guess its an unsupported file type. How would I go about setting the WebView so that I may handle when a user downloads a file, and process the file myself? The reason I am going through a webview is that using httpclient, I was unable to spoof the headers after trying unsuccessfully for 30 or so hours. So what I would like to be able to do is handle the saving, and unzipping of the file myself. Can anyone write me some code to get started?</p><p>Thanks a million.</p>","325081","","","","","2010-08-06 10:49:25","Downloading files via a webView","<java><android><download><android-webview>","0","1","3","",""
"3423089","1","","","2010-08-06 10:55:07","0","1107","<p>For some reasons, this ain't working:</p><pre><code>    wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);    if(wifi.isWifiEnabled())    {        tvStatus.setText(""You WiFi is enabled"");    }    else    {        tvStatus.setText(""You WiFi is disabled"");    }</code></pre><p>Why aint this working, am i missing something?And it compiles and everything but when i want to run it on my phone it gives me a force quit error</p>","412932","","","","","2012-11-13 13:33:21","Android SDK WifiManager methods won't work?","<android><android-wifi><wifimanager>","2","1","1","",""
"3423097","1","","","2010-08-06 10:56:26","2","1900","<p>So, I'm new to android unit testing. I'm trying to write a unit test for the Phone application:</p><pre><code>package com.android.phone;import android.content.Intent;import android.net.Uri;import android.test.ApplicationTestCase;import android.test.suitebuilder.annotation.MediumTest;import com.android.phone.PhoneApp;import dalvik.annotation.TestTargetClass;@TestTargetClass(PhoneApp.class)public class TestPhone extends ApplicationTestCase&lt;PhoneApp&gt; {        public TestPhone() {                super(PhoneApp.class);        }        private PhoneApp phone;        @Override        protected void setUp() throws Exception {                super.setUp();                phone = getApplication();        }        @MediumTest        public void testDialerIsUp() {                assertNotNull(""Phone app does not exist"", phone);                // TODO add tests        }}</code></pre><p>Then I start an emulator, wait till it boots up, and run those tests:</p><pre><code>adb shell am instrument -e class com.android.phone.TestPhone -r -w com.android.phone.tests/android.test.InstrumentationTestRunner</code></pre><p>And now I'm getting a <code>junit.framework.AssertionFailedError: PhoneApp does not exist</code>. What is wrong here, why isn't PhoneApp up?</p>","163423","","","","","2013-04-02 18:28:22","Android app unit testing","<android><unit-testing><junit>","4","0","","",""
"3423151","1","","","2010-08-06 11:04:43","0","133","<p>I have an application with two activities, A and B. A is the root activity, which then starts B.</p><p>When the stack looks like this:</p><pre><code>HOME &gt; A &gt; B</code></pre><p>...and I select A from the launcher, I want it to resume the task without clearing the stack, so B is shown. Right now this is mostly working.</p><p><em>However</em>. In certain circumstances this occasionally does not work. What we see in this situation is that invoking A from the launcher will create a new instance of A and add it to our task's stack:</p><pre><code>HOME &gt; A &gt; B &gt; A</code></pre><p>If we go back to home and select A again, we'll get another one:</p><pre><code>HOME &gt; A &gt; B &gt; A &gt; A</code></pre><p>...and so on.</p><p>This happens if, and only if, we uninstall the application completely using the application manager, and then reinstall it, via a file browser. Installing the application with adb does not cause this problem to appear.</p><p>In addition, when this problem manifests, if we then reboot the device, the problem goes away and everything starts behaving correctly!</p><p>This is smelling suspiciously like a launcher bug --- can anyone shed light on this?</p><p>This is using Eclair on real hardware (not the emulator).</p><p><b>Update</b></p><p>I have more information. It seems this is an Android core bug; see <a href=""http://code.google.com/p/android/issues/detail?id=5277"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=5277</a> in the Android bug tracker. Apparently running an application just after it's been installed by pressing the 'Run' button will run the application in a subtly wrong way.</p><p>It's also still extant on Froyo, not just Eclair.</p><p>Does anyone have any suggestions as to any possible workarounds?</p>","404568","","404568","","2010-09-28 16:46:07","2010-10-08 11:49:07","Very odd behaviour with launcher's task stack handling","<android><activity><task>","1","0","","",""
"3423162","1","","","2010-08-06 11:06:10","1","223","<p>I want to connect my Droid via bluetooth to OBDKey . I get Exception : connectionFailed .How can I solve this problem?</p><p>This is my part of code</p><pre><code>private class ConnectThread extends Thread {   private final BluetoothDevice mmDevice;   public ConnectThread(BluetoothDevice device) {      mmDevice = device;      int RFCOMM_CHANEL = 1; //SPP chanel       Method m;      try {          m = mmDevice.getClass().getMethod(""createRfcommSocket"", new Class[] {                int.class });                   mmSocket = (BluetoothSocket) m.invoke(mmDevice, RFCOMM_CHANEL);       } catch (Exception e) {          e.printStackTrace();      }    }  public void run() {     setName(""ConnectThread"");     int countAtemptoConnect=0;     boolean flag=false;     if(IS_READING) {        // cancel discovery because it will slow down a connection        if(mAdapter!=null)           mAdapter.cancelDiscovery();        while(!flag){           countAtemptoConnect++;           // Make a connection to the BluetoothSocket           try {              // This is a blocking call and will only return on a              // successful connection or an exception              mmSocket.connect();           } catch (IOException e) {              Log.e(TAG, ""connectionFailed"", e);              connectionFailed();              // Close the socket             try {               mmSocket.close();             } catch (IOException e2) {}         }         if(countAtemptoConnect==5)             return;       }     }     // Reset the ConnectThread because we're done     synchronized (BluetoothService.this) {     mConnectThread = null;   }    if(IS_READING)       // Start the connected thread       connected(mmSocket, mmDevice);}</code></pre>","369511","","369511","","2010-08-06 11:22:43","2010-08-06 11:22:43","Bluetooth How can I prevent crashed aftet connect()","<android><bluetooth>","0","0","1","",""
"3423177","1","","","2010-08-06 11:08:28","2","1976","<p>friends,</p><p>any one guide me how can i view pdf file in android browser?</p><p>or any other useful way?</p><p>any help would be appreciated.</p>","249991","","","","","2010-08-06 11:08:28","How to view pdf in android browser?","<android>","0","5","","",""
"3423200","1","3423267","","2010-08-06 11:12:29","2","4018","<p>I have a button in an AbsoluteLayout and I want to change the X and Y position on screenprogrammatically.</p><p>How do i it?</p>","404784","","","","","2010-08-06 11:20:53","Change Button position","<android>","1","2","","",""
"3423227","1","3423304","","2010-08-06 11:15:42","0","508","<p>I am not aware of any application on android that is capable of downloading torrents. So in-case I would like to port an unbuntu application like transmission or another similar light weight application would it be that easy. How much of socket programming would I actually require to do in such a case.</p><p>Also if anyone is aware of a project of this nature which is ongoing, I would love to have a look at it. I specifically intend to do this for android 1.6 and 1.5, so I think that makes any new API's which might have been released for this purpose pretty redundant.</p>","393459","","","","","2010-08-06 14:09:06","how do I run torrentz on android?","<android><bittorrent>","3","0","","",""
"3423291","1","","","2010-08-06 11:23:54","1","3252","<p>friend's,   I need to know how to save image loading through url has a original image in sqlite database.how can i convert image url into binary format and to retrieve original image from database.</p><p>Thanks in advance,</p>","407506","","","","","2013-03-13 11:28:50","How to save image loaded through url into sqlite database has a binary format","<android>","1","1","","",""
"3423341","1","3423353","","2010-08-06 11:31:47","0","1032","<p>How i can use broad cast receiver in android,</p><p>Please give me example or a reference to follow.</p><p>Thanks</p>","341443","","379693","","2010-10-30 08:46:39","2010-10-30 08:46:39","How i can use broad cast receiver in android","<android><android-emulator>","1","2","","",""
"3423404","1","3423851","","2010-08-06 11:40:59","1","4228","<p>Can anyone point in the direction of any tutorials that show how to create an options menu with clicakble checks like in the picture below:</p><hr><p><img src=""http://img291.imageshack.us/img291/1221/deviceit.png"" alt=""alt text""></p><hr><p>I have tried as follows:</p><pre><code>/** Menu creation and setup **//* Creates the menu items */public boolean onCreateOptionsMenu(Menu menu) { boolean result = super.onCreateOptionsMenu(menu);    menu.add(0, 1, 0, ""Speaker"").setCheckable(true);    menu.add(0, 2, 0, ""Mute"").setCheckable(true);    return result;}/* Handles item selections */public boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case 1:  if(audioManager.isSpeakerphoneOn()==false){   audioManager.setSpeakerphoneOn(true);   audioManager.setRouting(AudioManager.MODE_IN_CALL,      AudioManager.ROUTE_SPEAKER, AudioManager.ROUTE_ALL);  }else{   audioManager.setSpeakerphoneOn(false);   audioManager.setRouting(AudioManager.MODE_IN_CALL,      AudioManager.ROUTE_EARPIECE, AudioManager.ROUTE_ALL);  }        return true;    case 2:     if(audioManager.isMicrophoneMute())   audioManager.setMicrophoneMute(false);   else   audioManager.setMicrophoneMute(true);        return true;    }    return false;}  </code></pre><hr><p>But this doesn't work it only gives me text on the buttons on the options menu</p><p><strong>EDIT: I have added the following onPrepareOptionsMenu method:</strong></p><pre><code>public boolean onPrepareOptionsMenu(Menu menu){    boolean result = super.onPrepareOptionsMenu(menu);    if(audioManager.isSpeakerphoneOn())     menu.findItem(1).setChecked(true);    else     menu.findItem(1).setChecked(false);    if(audioManager.isMicrophoneMute())     menu.findItem(2).setChecked(true);    else     menu.findItem(2).setChecked(false);    return result;}</code></pre><hr><p>However I get the same outcome just text and no check light as in the picture above</p>","243999","","597607","","2012-02-05 18:29:16","2012-11-18 18:09:35","Android - checkable buttons on options menu","<android><button><options-menu>","2","0","1","",""
"3423579","1","3440232","","2010-08-06 12:08:13","1","3573","<p>I've got a very basic <code>WebView</code> which works until I try to add a custom <code>webViewClient</code> where it stops processing JavaScript.  Am I doing something wrong? Is there another way to get rid of the address bar and menu options in the WebView?  </p><pre><code>    browser = (WebView) findViewById(R.id.webkit);    WebSettings webSettings = browser.getSettings();    webSettings.setJavaScriptEnabled(true);    // uncommenting this line will remove address bar, but also stop JavaScript from loading    //browser.setWebViewClient(new InternalWebViewClient());    // even uncommenting this line will stop JavaScript from loading    //browser.setWebViewClient(new WebViewClient());    browser.setWebChromeClient(new InternalWebChromeClient());    if (savedInstanceState != null) {        browser.restoreState(savedInstanceState);    } else {        browser.loadUrl(""http://site.with.javascript"");    }</code></pre>","264276","","","","","2010-08-09 13:01:50","android: webview not loading javascript with custom WebViewClient","<javascript><android><webview><webviewclient>","2","0","1","",""
"3423701","1","4997191","","2010-08-06 12:23:53","0","240","<p>How can I set dynamically created bitmap as livefolder icon in android?</p><p>LiveFolder takes EXTRA_LIVE_FOLDER_ICON as ShortcutIconResource. Is there a way to reference dynamically created bitmap as shortcuticonresource? In the following code segment instead of using icon as int value I would like to set the file path for the newly created bitmap file.</p><pre><code>intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON,                 Intent.ShortcutIconResource.fromContext(context, icon));</code></pre>","349161","","","","","2011-02-14 20:58:45","How can I set dynamically created bitmap as livefolder icon in android?","<android><icons><shortcut>","1","0","","",""
"3423754","1","","","2010-08-06 12:32:31","127","63694","<p>Is there any API in the Android SDK that allows me to get the API version that the phone is currently running?</p>","402274","","","","","2014-02-11 18:25:38","Retrieving Android API version programmatically","<android>","5","3","23","",""
"3423948","1","3424583","","2010-08-06 12:59:28","0","1227","<p>I've run into some difficulties with implementing a custom progress dialog. Even though an overlay intercepts touch events the user can still operate the trackball and click elements that are supposed to be disabled.</p><p>Is there any way around this?</p><p>Edit: here's a solution</p><pre><code>//=====================================================================================protected void showProgressIndicator(){    progressIndicator_.show();}//=====================================================================================@Overridepublic boolean onTrackballEvent(MotionEvent event){    return progressIndicator_.getVisibility() == View.VISIBLE;}//=====================================================================================protected void hideProgressIndicator(){    progressIndicator_.hide();}</code></pre><p>An then in show method</p><pre><code>//=====================================================================================public void show(){    setVisibility(VISIBLE);    if (animationHandler_ != null)        return;    animationHandler_ = new Handler();    animationHandler_.post(animateTask_);    requestFocus();}</code></pre>","230466","","230466","","2011-02-08 07:26:33","2012-01-12 12:22:43","Disable trackball click in Android","<android><trackball>","3","0","","",""
"3424156","1","3424444","","2010-08-06 13:23:27","6","5865","<p>I am getting an error from <code>Logcat</code> saying that a certain column (in my <code>SQLiteOpenHelper</code> subclass) does not exist. I thought I could upgrade the database by changing the <code>DATABASE_CREATE</code> string. But apparently not, so how can I (step-by-step) upgrade my SQLite Database from version 1 to version 2? </p><p>I apologize if the question seems ""noobish"", but I am still learning about Android.  </p><p>@Pentium10 This is what I do in onUpgrade:</p><pre><code>private static final int DATABASE_VERSION = 1;....switch (upgradeVersion) {case 1:    db.execSQL(""ALTER TABLE task ADD body TEXT"");    upgradeVersion = 2;    break;}...</code></pre>","200477","","1318946","","2014-02-10 06:31:10","2014-02-10 06:31:10","Upgrade SQLite database from one version to another?","<java><android><sqlite><upgrade>","2","0","21","",""
"3424165","1","3424559","","2010-08-06 13:24:49","49","25325","<p>I would like to have an app include a custom font for rendering text, load it, and then use it with standard elements like StaticText. Is this possible?</p>","243782","","","","","2013-04-09 17:14:27","Can I embed a custom font in an Android application?","<android><fonts>","2","0","26","",""
"3424195","1","8009677","","2010-08-06 13:28:12","11","5422","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1101380/determine-if-running-on-a-rooted-device"">Determine if running on a rooted device</a>  </p></blockquote><p>How do you determine (programatically) if an Android device is: rooted Running a cracked copy of your software or rom.</p><p>I have some sensitive information in my database, and I would like to encrypt it when the phone is rooted aka the user has access to the database. How do I detect that?</p>","243782","","","","","2013-07-23 15:32:55","Determining if an Android device is rooted programatically?","<android>","3","0","8","2012-10-16 03:28:32",""
"3424226","1","3424369","","2010-08-06 13:30:57","4","3957","<p>I have a need to render and display charts (bar charts for now, but more types may be needed later) in an Android app I'm working on. I've done some looking around and it doesn't look like there are any really good, mature charting libraries for Android yet.</p><p>Do you know any?</p><p>Edit to add some details of requirements</p><ul><li>Bar Charts</li><li>Horizontal bar charts</li><li>Double stacked bar charts</li><li>Axis labels (including rotated 90 degrees on the y axis)</li><li>Labels above each bar on the chart</li><li>Shaded or custom backgrounds</li></ul>","243782","","","","","2011-10-08 16:28:43","Is there a good charting library for Android?","<android>","2","0","6","",""
"3424254","1","3848918","","2010-08-06 13:33:02","1","882","<p>How to make a text entry fields move up when on screen keyboard is present?</p>","243782","","","","","2010-10-03 07:07:46","How to make a text entry fields move up when on screen keyboard is present","<android>","2","0","","",""
"3424313","1","","","2010-08-06 13:40:26","2","483","<pre><code>&lt;TextView     android:layout_height=""wrap_content""     android:id=""@+id/LineNumberTextView""    android:hint=""Number""     android:textSize=""15sp""     android:layout_width=""wrap_content""    android:paddingRight=""10sp""&gt;&lt;/TextView&gt;</code></pre><p>The above code creates a wrong view: when the text is replaced (in code) to a short (1-3 digits) number, the view width stays about 6 characters - resulting in way too much padding. This problem occurs in some other places in the application too. One option is to set the hint to 1-3 characters - but this seems ugly, and doesn't solve the problem for too-long text (which also suffers from hint width problems). Therefore, I'm looking for a more elegant solution (which does not require recalculating width on each change), if there is one. </p><p>BTW, the input text is set exactly once for each occurrence of this layout, when loading it into some list view (but it's dynamic and unknown when loading the application). Problem is most severe in android 2.1, but appears in some other platforms too. </p>","271362","","","","","2010-08-06 13:40:26","android:textview adjusts itself to wrong layout_width","<java><android><width><textview>","0","2","","",""
"3424459","1","","","2010-08-06 13:57:54","0","682","<p>I have implemented a timer that parses a URL every 15min (the Timer task). An Object that i have created gets that data .I use it afterwards to display the data on the screen   .</p><p>Now , whenever i try to retrieve that Object/a String=Object.toString() out of the runnable I get null pointer exception and fatal errors .</p><p>My question is whether it is possible to do using some other technique to do it , or The Object cease to exist out of the runnable and there is not much we can do about it ;if that is the case can anybody tell me if there is another way of implementing a timer/runnable ?</p><p>Thanks a Lot </p><p>here is most of my code where i have a problem</p><pre><code> @Override    public void onCreate(Bundle icicle) {            super.onCreate(icicle)           final  TextView tv = new TextView(this);            TimerTask scanTask;            final Handler handler = new Handler();            Timer t = new Timer();                                  scanTask = new TimerTask() {                    public void run() {                            handler.post(new Runnable() {                                    public void run() {                                        URL url = null;                                        try {                                            url = new URL(""http://www.eurosport.fr/"");                                        } catch (MalformedURLException e3) {                                            e3.printStackTrace();                                        }                                        /* Get a SAXParser from the SAXPArserFactory. */                                        SAXParserFactory spf = SAXParserFactory.newInstance();                                        SAXParser sp;                                        try {                                            sp = spf.newSAXParser();                                        } catch (ParserConfigurationException e2) {                                            e2.printStackTrace();                                        } catch (SAXException e2) {                                            e2.printStackTrace();                                        }                                        /* Get the XMLReader of the SAXParser we created. */                                        XMLReader xr = null;                                        try {                                            sp = spf.newSAXParser();                                            xr = sp.getXMLReader();                                        } catch (SAXException e1) {                                            e1.printStackTrace();                                        } catch (ParserConfigurationException e) {                                            e.printStackTrace();                                        }                                        /* Create a new ContentHandler and apply it to the XML-Reader*/                                        ExampleHandler myExampleHandler = new ExampleHandler();                                        try {                                            sp = spf.newSAXParser();                                        } catch (ParserConfigurationException e1) {                                            // TODO Auto-generated catch block                                            e1.printStackTrace();                                        } catch (SAXException e1) {                                            // TODO Auto-generated catch block                                            e1.printStackTrace();                                        }                                        xr.setContentHandler(myExampleHandler);                                        /* Parse the xml-data from our URL. */                                        try {                                            xr.parse(new InputSource(url.openStream()));                                        } catch (IOException e) {                                            e.printStackTrace();                                        } catch (SAXException e) {                                            e.printStackTrace();                                        }                                        /* Parsing has finished. */                                        /* Our ExampleHandler now provides the parsed data to us. */                                        ParsedExampleDataSet parsedExampleDataSet =                                                                                        myExampleHandler.getParsedData();                                       System.out.println(parsedExampleDataSet.toString());                                        tv.setText(parsedExampleDataSet.toString());                                     Context context = this.getBaseContext();  // I also dont understand why inside the runnable getBaseContext() does not exist ???    Bitmap mBitmap = BitmapFactory.decodeResource(getResources(),            R.raw.nature1)        context.setWallpaper(mBitmap);                                    }                           });                    }  };                    // I want to retrieve ParsedExampleDataSEt here in order to use it  is it Possible ????                    this.setContentView(tv);                   long temps=1*15*1000;                t.scheduleAtFixedRate(scanTask, 300,temps ); </code></pre>","410019","","410019","","2010-08-08 15:14:11","2010-08-08 15:14:11","Retrieving a String out of a runnable/TimerTask","<java><android><timer><runnable>","1","4","1","",""
"3424770","1","3424786","","2010-08-06 14:34:05","3","1977","<p>friends,   I need help in sqlite query for check whether the data is already exist in table,or to check table is empty or not,let's give queries for it.</p><p>Thanks in advance.</p>","407506","","243782","","2010-08-06 14:40:26","2012-08-08 06:31:08","check whether the data is already exist in table, or to check table is empty","<java><android><sqlite>","4","0","","",""
"3424812","1","7659853","","2010-08-06 14:38:44","3","383","<p>Many times I cannot get my application to install on the emulator.</p><p>I receive the following error from Eclipse:</p><blockquote>  <p>[2010-08-06 09:33:48 - Emulator]  2010-08-06 09:33:48.868  emulator[392:903] Can't open input  server  /Library/InputManagers/MultiClutchInputManager.bundle</p></blockquote><p>The emulator boots, but the application is not installed.</p><p>MultiClutch is a 3rd party preference pane for OS X that allows you to capture gestures and specify what they should do.  I've uninstalled MultiClutch (using AppCleaner), yet I still receive this error.  I'm not quite sure what makes Eclipse decide to ignore it, but after attempting to run enough times, a NEW (read: second) emulator window will open and the application will install.</p><p>Any ideas?</p>","406790","","","","","2011-10-05 10:23:21","Really annoying problem with emulator","<android><android-emulator><emulator>","1","1","1","",""
"3424845","1","3425201","","2010-08-06 14:41:41","2","2828","<p>I'm using a SQLite database to store information on players and their teams using android. I've got it working so that all the players I've created will show up when ever I start my program, so the database is working. So far, so good.</p><p>However, whenever I try to retrieve the rowId of a player from the database, it always gives me 0 back.This surprises me in itself, since I'd think I'd get an error if I wasn't accessing it from the cursor correctly, but instead it gives me 0.</p><p>After debugging for a while, I realized that the Player object (not in database) also wasn't saving the id correctly, although it was finding a value for it. This was corrected when I set the id after creating the object, although it seems I would be able to set it in the creation statement itself. Curiouser and curiouser.</p><p>Even after I do have the id of the row, I can't edit it. The Player object will change, but if I actually retrieve the player from the database again, it hasn't changed at all.</p><p>Weirdest to me is that I don't receive any errors at any point throughout this process.</p><p>Ideas? Thank you in advance for your help! :-)</p><p>Here's my code for the Database Helper:</p><pre><code>    public class VolleyDbAdapter { // Common public static final String KEY_ROWID = ""id""; public static final String KEY_NOTES = ""Notes""; // Player public static final String KEY_NUMBER = ""Number""; public static final String KEY_POSITION = ""Position""; public static final String KEY_FNAME = ""FirstName""; public static final String KEY_LNAME = ""LastName""; public static final String KEY_TEAMID = ""teamId""; private static final String TAG = ""NotesDbAdapter""; private DatabaseHelper mDbHelper; private SQLiteDatabase mDb; /**  * Database creation sql statement  */ private static final String DATABASE_CREATE_PLAYERS = ""CREATE TABLE 'players' (""   + ""  `id` INTEGER AUTO_INCREMENT DEFAULT NULL,""
   + ""  `Number` INTEGER DEFAULT NULL,""
   + ""  `Position` VARCHAR DEFAULT NULL,""
   + ""  `FirstName` MEDIUMTEXT DEFAULT NULL,""
   + ""  `LastName` MEDIUMTEXT DEFAULT NULL,""
   + ""  `teamId` INTEGER DEFAULT NULL,""
   + ""  `Notes` MEDIUMTEXT DEFAULT NULL,""
   + ""  PRIMARY KEY (`id`)""   + "");""; private static final String DATABASE_PLAYERS = ""players""; private static final int DATABASE_VERSION = 5; private final Context mCtx; private static class DatabaseHelper extends SQLiteOpenHelper {  DatabaseHelper(Context context) {   super(context, DATABASE_NAME, null, DATABASE_VERSION);  }  @Override  public void onCreate(SQLiteDatabase db) {   db.execSQL(DATABASE_CREATE_PLAYERS);   db.execSQL(DATABASE_CREATE_GAMES);   db.execSQL(DATABASE_CREATE_STATS);   db.execSQL(DATABASE_CREATE_MATCHES);   db.execSQL(DATABASE_CREATE_LINEUPS);   db.execSQL(DATABASE_CREATE_TEAMS);  }  @Override  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {   Log.w(TAG, ""Upgrading database from version "" + oldVersion + "" to ""     + newVersion + "", which will destroy all old data"");   // Add this later, when actually might update the database   // Don't want to accidentally delete something now!   db.execSQL(""DROP TABLE IF EXISTS players;"");   db.execSQL(""DROP TABLE IF EXISTS teams;"");   db.execSQL(""DROP TABLE IF EXISTS matches;"");   db.execSQL(""DROP TABLE IF EXISTS games;"");   db.execSQL(""DROP TABLE IF EXISTS lineups;"");   db.execSQL(""DROP TABLE IF EXISTS stats;"");   onCreate(db);  } } public VolleyDbAdapter(Context ctx) {  this.mCtx = ctx; } public VolleyDbAdapter open() throws SQLException {  mDbHelper = new DatabaseHelper(mCtx);  mDb = mDbHelper.getWritableDatabase();  return this; } public void close() {  mDbHelper.close(); } public long createPlayer(String fname, String lname, int number,   String position, long teamId) {  ContentValues initialValues = new ContentValues();  initialValues.put(KEY_FNAME, fname);  initialValues.put(KEY_LNAME, lname);  initialValues.put(KEY_NUMBER, number);  initialValues.put(KEY_POSITION, position);  initialValues.put(KEY_TEAMID, teamId);  // Add the teamId?  return mDb.insert(DATABASE_PLAYERS, null, initialValues); } public boolean deletePlayer(long rowId) {  return mDb.delete(DATABASE_PLAYERS, KEY_ROWID + ""="" + rowId, null) &gt; 0; } public boolean deletePlayer(int number) {  return mDb.delete(DATABASE_PLAYERS, KEY_NUMBER + ""="" + number, null) &gt; 0; } public Cursor fetchAllPlayers() {  return mDb.query(DATABASE_PLAYERS, new String[] { KEY_ROWID,    KEY_NUMBER, KEY_POSITION, KEY_FNAME, KEY_LNAME, KEY_TEAMID,    KEY_NOTES }, null, null, null, null, null); } public Cursor fetchPlayer(long rowId) throws SQLException {  Cursor mCursor =  mDb.query(true, DATABASE_PLAYERS, new String[] { KEY_ROWID, KEY_NUMBER,    KEY_POSITION, KEY_FNAME, KEY_LNAME, KEY_TEAMID, KEY_NOTES },    KEY_ROWID + ""="" + rowId, null, null, null, null, null);  if (mCursor != null) {   mCursor.moveToFirst();  }  return mCursor; } public Cursor fetchPlayer(int number) throws SQLException {  Cursor mCursor =  mDb.query(true, DATABASE_PLAYERS, new String[] { KEY_ROWID, KEY_NUMBER,    KEY_POSITION, KEY_FNAME, KEY_LNAME, KEY_TEAMID, KEY_NOTES },    KEY_NUMBER + ""="" + number, null, null, null, null, null);  if (mCursor != null) {   mCursor.moveToFirst();  }  return mCursor; } public boolean updatePlayer(long rowId, String fname, String lname,   int number, String position, long teamId) {  ContentValues args = new ContentValues();  args.put(KEY_FNAME, fname);  args.put(KEY_LNAME, lname);  args.put(KEY_NUMBER, number);  args.put(KEY_POSITION, position);  args.put(KEY_TEAMID, teamId);  return mDb    .update(DATABASE_PLAYERS, args, KEY_ROWID + ""="" + rowId, null) &gt; 0; }</code></pre><p>And for loading the players:</p><pre><code>    public class GlobalApp extends Application { SharedPreferences preferences; VolleyDbAdapter mDbHelper; public long teamId; public long matchId; public long gameId; ArrayList&lt;Player&gt; playerList; ArrayList&lt;Player&gt; court; ArrayList&lt;Player&gt; play; public int selectedPlayer; public int selectedPosition; //More vars not shown public void onCreate() {  super.onCreate();  preferences = PreferenceManager.getDefaultSharedPreferences(this);  initializeVars();  importOldData(); } public void importOldData() {  mDbHelper = new VolleyDbAdapter(this);  mDbHelper.open();  getPlayersFromDatabase();  mDbHelper.close(); }    public void getPlayersFromDatabase() {      Cursor c = mDbHelper.fetchPlayersFromTeam(getTeamId());      c.moveToFirst();      while (c.isAfterLast() == false) {       long myId = c.getInt(c.getColumnIndex(VolleyDbAdapter.KEY_ROWID));       String fname = c.getString(c         .getColumnIndex(VolleyDbAdapter.KEY_FNAME));       String lname = c.getString(c         .getColumnIndex(VolleyDbAdapter.KEY_LNAME));       String pos = c.getString(c         .getColumnIndex(VolleyDbAdapter.KEY_POSITION));       String num = c.getString(c         .getColumnIndex(VolleyDbAdapter.KEY_NUMBER));       long ti = c.getLong(c.getColumnIndex(VolleyDbAdapter.KEY_TEAMID));       Player p = new Player(myId, fname, lname, num, pos, ti);       addPlayer(p);       c.moveToNext();      }      c.close();     }</code></pre><p>The code to create a new player (MenuManager is an activity that has the menu added to it):</p><pre><code>public class EditPlayer extends MenuManager implements OnClickListener { GlobalApp global; VolleyDbAdapter mDbHelper; EditText s1, s2, s3; Button b1; Spinner choosePos; int editPosition; // Player selectedPlayer; ArrayAdapter&lt;CharSequence&gt; adapter; public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.edit_player);  global = ((GlobalApp) getApplicationContext());  mDbHelper = new VolleyDbAdapter(this);  mDbHelper.open();  s1 = (EditText) this.findViewById(R.id.player_input_fname);  s2 = (EditText) this.findViewById(R.id.player_input_lname);  s3 = (EditText) this.findViewById(R.id.player_input_number);  choosePos = (Spinner) findViewById(R.id.choosePos);  adapter = ArrayAdapter.createFromResource(this, R.array.positions,    android.R.layout.simple_spinner_item);  adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);  choosePos.setAdapter(adapter);  b1 = (Button) this.findViewById(R.id.player_submit);  b1.setOnClickListener(this);  if (global.getSelectedPlayer() != null) {   fillFields();  } } public void fillFields() {  s1.setText(global.getSelectedPlayer().getFName());  s2.setText(global.getSelectedPlayer().getLName());  s3.setText(global.getSelectedPlayer().getNumber());  choosePos.setSelection(adapter.getPosition(global.getSelectedPlayer()    .getPosition())); } @Override public void onClick(View v) {  switch (v.getId()) {  case R.id.player_submit:   if (global.getSelectedPlayer() == null) {    long myId = mDbHelper.createPlayer(s1.getText().toString(), s2      .getText().toString(), Integer.parseInt(s3.getText()      .toString()), choosePos.getSelectedItem().toString(),      global.teamId);    Player myP = new Player(myId, s1.getText().toString(), s2      .getText().toString(), s3.getText().toString(),      choosePos.getSelectedItem().toString(), global        .getTeamId());    myP.setId(myId);    global.addPlayer(myP);    global.sortPlayers(global.NUMBER);    Intent intent = new Intent();    setResult(RESULT_OK, intent);    finish();   } else {    Player p = global.getSelectedPlayer();    p.setFName(s1.getText().toString());    p.setLName(s2.getText().toString());    p.setNumber(s3.getText().toString());    p.setPosition(choosePos.getSelectedItem().toString());    mDbHelper.updatePlayer(p.getId(), p.getFName(), p.getLName(),      p.getIntNumber(), p.getPosition(), p.getTeamId());    global.sortPlayers(global.NUMBER);    Intent intent = new Intent();    setResult(RESULT_OK, intent);    finish();   }   // this.finish();   // setResult(0);   break;  } }}</code></pre><p>And finally, the player itself:</p><pre><code>public class Player{ String number; String fname; String lname; String position; long id; long teamId; public Player(String fn, String ln, String nu, String p, long t) {  fname = fn;  lname = ln;  number = nu;  position = p;  teamId = t; } public Player(long i, String fn, String ln, String nu, String p, long t) {  id = i;  fname = fn;  lname = ln;  number = nu;  position = p;  teamId = t; } public void setId(long i) { id = i; } public long getId() { return id; } public long getTeamId() {return teamId; } //You should never need to set the teamId outside of the constructor public String getFName() { return fname; } public String getLName() { return lname; } public String getFullName() { return fname + "" "" + lname; } public String getNumber() { return number; } public int getIntNumber() { return Integer.valueOf(getNumber()); }  public String getPosition() { return position; } public int getHits() { return hits; } public int getSets() { return sets; } public int getSetsKills() { return setsKills; } public int getPasses() { return passes; } public int getPassesKills() { return passesKills; } public int getHitsKills() { return hitsKills; } public int getHitsMisses() { return hitsMisses; } public int getBlocks() { return blocks; } public void setFName(String s) { fname = s; } public void setLName(String s) { lname = s; } public void setNumber(String s) { number = s; } public void setPosition(String s) { position = s; } public String toString() { return getNumber(); } public String showMyStats() {  /*TableLayout tb = new TableLayout(c);   tb.addView(getStatRow(""Number: "", getNumber(), c));   tb.addView(getStatRow(""Name: "", getName(), c));   tb.addView(getStatRow(""Position: "", getPosition(), c));   tb.addView(getStatRow("""", """", c));   tb.addView(getStatRow(""Hit Attempts: "", getHits(), c));   tb.addView(getStatRow(""Kills"", getHitsKills(), c));   tb.addView(getStatRow("""", """", c));   tb.addView(getStatRow("""", """", c));*/  String stats = """";  stats += ""Number: "" + getNumber() + ""\n"";  stats += ""Name: "" + getFullName() + ""\n"";  stats += ""Position: "" + getPosition() + ""\n"";  stats += ""\n"";  stats += ""Hit Attempts: "" + getHits() + ""\n"";  stats += ""Kills: "" + getHitsKills() + ""\n"";  stats += ""Misses: "" + getHitsMisses() + ""\n"";  stats += ""Hitting Percentage: "" + getHittingPercentage() + ""\n"";  stats += ""\n"";  stats += ""Sets: "" + getSets() + ""\n"";  stats += ""Set Kills: "" + getSetsKills() + ""\n"";  stats += ""Setting Percentage: "" + getSettingPercentage() + ""\n"";  stats += ""\n"";  stats += ""Passes: "" + getPasses() + ""\n"";  stats += ""Passes Kills: "" + getPassesKills() + ""\n"";  stats += ""Passing Percentage: "" + getPassingPercentage() + ""\n"";  //TextView popup = new TextView(c);  //popup.setLayout(new TableLayout());  //popup.setText(stats);  return stats; } public TableRow getStatRow(String s1, String s2, Context c) {  TableRow tr = new TableRow(c);  TextView t = new TextView(c);  t.setText(s1);  tr.addView(t);  t.setText(s2);  tr.addView(t);  return tr; } public TableRow getStatRow(String s1, int s2, Context c) {  return getStatRow(s1, Integer.toString(s2), c); } public double getHittingPercentage() {  if(getHits() &gt; 0) {   return (getHitsKills()-getHitsMisses()) / getHits();   } else { return 0; } } public double getSettingPercentage() {  if(getSets() &gt; 0) {   return (getSetsKills()) / getSets();   } else { return 0; } } public double getPassingPercentage() {  if(getPasses() &gt; 0) {   return (getPassesKills()) / getPasses();   } else { return 0; } }}</code></pre>","413161","","","","","2010-08-06 15:21:44","Attempting to retrieve rowid of android database always returns 0","<android><sqlite3>","1","0","0","",""
"3424904","1","3425101","","2010-08-06 14:50:12","10","13832","<p>Wanna to split a screen for my app with two LinearLayouts. What parameters should I use to make exact splitting in two equal parts - first LinearLayout on the top and the second one is just under it.</p>","397991","","","","","2013-07-05 02:11:42","How to split the screen with two equal LinearLayouts?","<android><android-linearlayout>","2","2","1","",""
"3424974","1","","","2010-08-06 14:57:18","0","178","<p>i'm making a program that disables your wifi when you lock your screenbut i can't find an object the holds that kind of information (wether it's locked or not)</p>","412932","","","","","2010-08-06 15:20:25","I want to the information about my screen (if it's locked or not), Android","<android><screen><locking>","1","0","","",""
"3425080","1","3425146","","2010-08-06 15:08:48","11","742","<p>I want to start making cellphone apps with Android as first choice but not the only one. I have 10 years of experience with Java, C#, C++ in commercial applications and I know that many things and practices for this applications are not valid for cellphones. Where do I start reading? How do I adapt my way of thinking to this new environment as quickly as posible? I plan to make some money with it sometime in the future as an extra income or a career change maybe, who know. Any resource or advice you could recommend will be very welcome. Thanks in advance.</p>","354063","","","","","2010-08-06 16:53:33","What should a developer know before building cellphone apps?","<java><c><android><cellphone>","6","2","6","",""
"3425088","1","","","2010-08-06 15:09:20","16","10065","<p>I need to test Android (Android Browser) and iPhone/iPad (Safari for iOS) with Selenium or a similar Ruby-aware automated testing tool. How can I do that?</p>","413160","","617450","","2013-07-05 05:25:03","2013-07-05 05:25:03","Can Selenium test mobile webapps?","<android><selenium><ios-simulator><mobile-safari>","2","1","6","",""
"3425238","1","3426185","","2010-08-06 15:25:02","0","438","<p><a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design.html#tabstructure"" rel=""nofollow"">http://developer.android.com/guide/practices/ui_guidelines/icon_design.html#tabstructure</a></p><p>Are we sure this page was written correctly?  It states that <strong>UNSELECTED</strong> icons must be ""<strong>WHITE</strong>""; and <strong>SELECTED</strong> icons must be ""<strong>GRAY</strong>"".  This seems backwards and looks quite odd in my application.</p>","406790","","","","","2010-08-06 17:26:27","Tab icon guidelines","<android><icons><tabactivity>","2","2","","",""
"3425650","1","","","2010-08-06 16:13:30","1","942","<p>I've ran into a strange thing while making a list of custom views. I had two ListViews displaying the same data using the same adapter. One of them was inflated from XML and the other was created programmatically in another Activity as it showed/hid according to touch event. They worked in both cases. Later on I replaced the ListViews with GridViews (using search/replace), but only the inflated one worked from that point on. The one created programmatically throws a NullPointerException in GridView.layoutChildren() and my Adapter.getView() never gets called, despite the Adapter is populated as expected. I cannot get over that exception, any ideas?</p><p>Inflated GridView works well (Activity.onCreate()):</p><pre><code>mListColours = (GridView) findViewById(R.id.listColours);mAdapter = new ColourViewAdapter(this, R.layout.colour, Palette.getColours());mListColours.setAdapter(mAdapter);</code></pre><p>The other GridView inside ViewGroup's constructor:</p><pre><code>mColourList = new GridView(context);mAdapter = new ColourViewAdapter(context, R.layout.colour,Palette.getColours());mColourList.setAdapter(mAdapter);(...)addView(mColourList);</code></pre><p>The exception is thrown here (in the ViewGroup):</p><pre><code>@Overrideprotected void onLayout(boolean changed, int l, int t, int r, int b){  (...)  gv = (GridView) child;  gv.layout(0, 0, r, getMeasuredHeight()); // NullPointerException  (...)}</code></pre><p></p>","176210","","1817269","","2012-11-29 04:50:09","2012-11-29 04:50:09","GridView: Adapter.getView() Never Called","<android><xml><gridview><layout>","0","2","","",""
"3425668","1","","","2010-08-06 16:15:46","1","924","<p>I learned all basic java classes and how to use them. I like to learn Android App Programming. But one of my colleague suggested me to learn EJB. What is the best to learn?</p>","401738","","","","","2010-08-06 16:24:45","What to learn now? EJB or Android Programming","<java><android><ejb>","5","0","1","",""
"3425906","1","6485850","","2010-08-06 16:47:58","56","26396","<p>What's the best way to create a temporary file in Android? </p><p>Can <a href=""http://developer.android.com/reference/java/io/File.html#createTempFile%28java.lang.String,%20java.lang.String%29"">File.createTempFile</a> be used? The documentation is very vague about it.</p><p>In particular, it's not clear when temporary files created with <code>File.createTempFile</code> are deleted, if ever.</p>","143378","","143378","","2011-06-26 18:13:47","2014-03-19 18:35:17","Creating temporary files in Android","<android><file-io><temporary-files>","4","2","11","",""
"3425932","1","3473105","","2010-08-06 16:50:29","21","14288","<p>I have an EditText widget in my view.  When the user selects the EditText widget, I display some instructions and the soft keyboard appears.</p><p>I use an OnEditorActionListener to detect when the user has completed text entry and I dismiss the keyboard, hide the instructions and perform some action.</p><p>My problem is when the user dismisses the keyboard by pressing the BACK key.  The OS dismisses the keyboard, but my instructions (which I need to hide) are still visible.</p><p>I've tried overriding OnKeyDown, but that doesn't seem to get called when the BACK button is used to dismiss the keyboard.</p><p>I've tried setting an OnKeyListener on the EditText widget, but that doesn't seem to get called either.</p><p>How can I detect when the soft keyboard is being dismissed?</p>","346166","","","","","2013-07-11 15:36:52","Detecting when user has dismissed the soft keyboard","<android>","4","0","10","",""
"3426011","1","3426040","","2010-08-06 17:02:07","10","23358","<p>I downloaded a sample project from a website. when i import this project to eclipse work space. Im getting this error</p><p><strong>Project has no default.properties file! Edit the project properties to set one.</strong></p><p>How i can get rid of this problem. Please let me know</p><p>Thanks</p>","341443","","","","","2012-01-24 07:47:56","Project has no default.properties file!","<android>","5","2","7","2013-02-15 11:27:23",""
"3426025","1","3426194","","2010-08-06 17:03:50","0","2105","<p>I am trying to draw rectangle on top of image and I am having trouble placing the art on the image. Only part of Rectangle shows up somewhere in bottom of screen. Here is what I am doing: </p><p>sinewave is the image from res>drawable folder </p><pre><code>public void onDraw(Canvas canvas) {     Bitmap myBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.sinewave);     canvas.drawBitmap(myBitmap, 0, 0, null);     Paint myPaint = new Paint();     myPaint.setColor(Color.GREEN);     myPaint.setStyle(Paint.Style.STROKE);     myPaint.setStrokeWidth(3);     canvas.drawRect(0, 35 ,80 , 20, myPaint);}</code></pre><p>I am not able to go beyond 35, I want to place the rectangle right in the middle of sinewave's image. Can some one help me with their ideas. </p>","357349","","851273","","2012-06-15 23:02:26","2012-06-15 23:02:26","resize the bitmap canvas","<android><android-emulator><android-widget><android-manifest>","1","0","","",""
"3426099","1","","","2010-08-06 17:16:01","6","680","<p>I'm looking into learning more about the Android framework and I would also like to understand what issues small development teams (&lt; 10 people) for Android based phones are likely to run into (i.e. porting to other platforms, inadequate security testing, or just anything across the software development lifecycle that poses difficulties).</p><p>Any feedback or links to external resources considering this topic would be much appreciated. </p><p>Thanks</p>","413303","","238639","","2010-08-08 01:23:36","2010-08-08 01:23:36","What are common issues that small Android development teams experience?","<java><android>","4","2","1","",""
"3426335","1","3441731","","2010-08-06 17:47:14","1","268","<p>How do I specify the destination of sendMessage() as logTextBox() in the example below?</p><pre><code>public class Controller extends Activity {    public Handler hLogTextBox = new Handler();    ...    public void listener() {        String s = ""my string"";        android.os.Message osMessage = hLogTextBox.obtainMessage();        Bundle b = new Bundle();        b.putString(null, s);        osMessage.setData(b);        hLogTextBox.sendMessage(osMessage);    }    ...    public void logTextBox(String s) {        ...    }    ...}</code></pre>","398460","","398460","","2010-08-09 10:14:21","2010-08-09 15:47:14","How do I specify the destination of android.os.Message?","<java><android><message><handler>","1","0","","",""
"3426349","1","3430029","","2010-08-06 17:48:39","2","1079","<p>Much like the music app does i want to access the name of the song (not the name of the file) or the artist or album.  For example, i want to populate a listview with the names of all the songs on the phone.</p>","357032","","","","","2010-08-07 10:13:01","How do you access the name, artist, album name off the music stored on the phone in android?","<android><listview><music>","1","0","1","",""
"3426549","1","3426584","","2010-08-06 18:14:16","1","546","<p>I changed some code on an android application that was working perfectly fine at least 3 days ago (note, this was not three days of coding, I have not done THAT many changes). Now, instead of running along on its merry way, it is ambushed and killed as soon as it gets out of the door. At least, I think that I am interpreting the output correctly: </p><pre><code>[2010-08-06 14:07:04 - chart] Android Launch![2010-08-06 14:07:04 - chart] adb is running normally.[2010-08-06 14:07:04 - chart] Performing org.achartengine.chartdemo.demo.ChartDemo activity launch[2010-08-06 14:07:04 - chart] Automatic Target Mode: using device 'HT03LHF01264'[2010-08-06 14:07:04 - chart] WARNING: Application does not specify an API level requirement![2010-08-06 14:07:04 - chart] Device API version is 3 (Android 1.5)[2010-08-06 14:07:04 - chart] Uploading chart.apk onto device 'HT03LHF01264'[2010-08-06 14:07:04 - chart] Installing chart.apk...[2010-08-06 14:07:08 - chart] Success![2010-08-06 14:07:08 - chart] Starting activity org.achartengine.chartdemo.demo.ChartDemo on device [2010-08-06 14:07:11 - chart] ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined[2010-08-06 14:07:11 - chart] ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined[2010-08-06 14:07:12 - chart] ActivityManager: Starting: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} comp={org.achartengine.chartdemo.demo/org.achartengine.chartdemo.demo.ChartDemo} }[2010-08-06 14:07:12 - chart] ActivityManager: [1]   Killed                  am start -n org....</code></pre><p>Anyway, does anybody have ideas as to what might be causing the immediate killing of a program?</p><p>Problem identified by Aidanc. The manifest file that was giving me trouble was</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt; - &lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android"" package=""org.achartengine.chartdemo.demo"" android:versionCode=""1"" android:versionName=""1.0.0""&gt;- &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:permission=""android.permission.CAMERA""&gt;- &lt;activity android:name="".ChartDemo"" android:label=""AChartEngine demo""&gt;- &lt;intent-filter&gt;  &lt;action android:name=""android.intent.action.MAIN"" /&gt;   &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;   &lt;/intent-filter&gt;  &lt;/activity&gt;  &lt;activity android:name=""org.achartengine.chartdemo.demo.chart.XYChartBuilder"" /&gt;   &lt;activity android:name=""org.achartengine.GraphicalActivity"" /&gt;   &lt;activity android:name="".GeneratedChartDemo"" /&gt;   &lt;activity android:name=""DisplayImage"" /&gt;   &lt;/application&gt;  &lt;uses-permission android:name=""android.permission.CAMERA"" /&gt;   &lt;uses-feature android:name=""android.hardware.camera"" /&gt;   &lt;uses-feature android:name=""android.hardware.camera.autofocus"" /&gt;   &lt;uses-sdk android:minSdkVersion=""3"" /&gt;   &lt;/manifest&gt;</code></pre>","391837","","391837","","2010-08-06 18:45:24","2010-08-06 18:55:07","android application killed right after launch","<android>","3","0","1","",""
"3426614","1","4250558","","2010-08-06 18:24:16","2","4045","<p>How can I convert from NV21 to JPEG. Currently, NV21 is the only <code>previewFormat</code> that is supported by the camera on a Nexus One (running Android 2.2). </p><p>Thanks. </p>","306346","","","","","2010-11-22 21:52:19","Android Converting from NV21 Preview Format on Nexus one to JPEG","<android><image><camera><jpeg>","2","1","","",""
"3426662","1","","","2010-08-06 18:32:23","0","493","<p>I want to connect my Droid to OBDKey I use BluetoothChat as example to connect via bluetooth  I connect to OBDKey succesfully but after send message to OBDKey connection lost</p><p>How can I prevent this? </p>","369511","","234976","","2011-11-15 08:32:07","2011-11-15 08:32:07","Bluetooth connection lost after send message (BluetoothChat)","<android><bluetooth>","1","0","","",""
"3426851","1","3426964","","2010-08-06 18:59:58","2","1040","<p>a million error per day using eclipse with the Android plug-in i tried everything uninstall plug-in ,eclipse,JDK,JRE and install them again and using different ver. also changes Workspaces , i thought the problem with the new Java and Eclipse but i solved it and still . what the alternative is there a way so it could be more stable is other IDE with Android Plugin is mature enough to use them instead of all the problem and headache that eclipse give me in my life . </p><p>Edit: i use Eclipse 3.5 and im running Win7 in 4 Gig of ram ,i read the info about the known bug with Eclipse and JDK 6 update 21 and try what they suggest but i think thats not the problem. </p><p>some of the problem that i had ,XML editor for Android also sometime the disable of the Auto-complete (i made new Workspaces now i have 10's of them ) and when i open the DDMS nothing appears even when i try to add the LogCat also alot of error msgs that prompt to me and close the IDE and sometime it just close by-itself  .</p><p>Edit 2 : New Error it display to me ""permGen space"" ?! </p>","302707","","302707","","2010-08-08 20:23:20","2010-08-08 21:42:50","So much problems with Eclipse developing for Android?","<java><android><eclipse><ide>","4","3","0","",""
"3426856","1","3427392","","2010-08-06 19:00:29","0","1674","<p>Ok, I've tried two examples of AlarmManager- one from the commonsware website, and one from the manning website.The code I am currently working with is from the manning website : [http://unlocking-android.googlecode.com/svn/chapter8/trunk/SimpleAlarm/][1]</p><p>There are two classes, AlarmReceiver and GenerateAlarm. Anyone have any idea why the toast will not display in the emulator? I was thinking that it was because I am located in the Eastern Time Zone and it uses UTC, but I have fiddled with different things and none of them seem to work. </p><pre><code>public class GenerateAlarm extends Activity {Toast mToast;@Overrideprotected void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    Button button = (Button) findViewById(R.id.set_alarm_button);    button.setOnClickListener(this.mOneShotListener);}private OnClickListener mOneShotListener = new OnClickListener() {    public void onClick(View v) {        Intent intent = new Intent(GenerateAlarm.this, AlarmReceiver.class);        PendingIntent appIntent = PendingIntent.getBroadcast(GenerateAlarm.this, 0, intent, 0);        Calendar calendar = Calendar.getInstance();        calendar.setTimeInMillis(System.currentTimeMillis());       // calendar.add(Calendar.MINUTE, 1);        calendar.add(Calendar.SECOND, 10);        AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);        am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), appIntent);        if (GenerateAlarm.this.mToast != null) {            GenerateAlarm.this.mToast.cancel();        }        GenerateAlarm.this.mToast = Toast.makeText(GenerateAlarm.this, R.string.alarm_message, Toast.LENGTH_LONG);        //GenerateAlarm.this.mToast.show();    }};}public class AlarmReceiver extends BroadcastReceiver {public void onReceiveIntent(Context context, Intent intent) {    Toast.makeText(context, R.string.app_name, Toast.LENGTH_SHORT).show();}@Overridepublic void onReceive(Context context, Intent intent) {}}</code></pre>","413394","","844923","","2013-04-06 20:34:59","2013-04-06 20:34:59","Android AlarmManager","<android><alarmmanager>","1","0","2","",""
"3426890","1","3427106","","2010-08-06 19:04:22","0","2142","<p>I'm starting to dip my toes into LocationManager.  I've created a service which tracks GPS location (interval is more than 60000ms) and updates my application with user location so they can find stuff nearby.</p><p>As I understand it, users can go into their preferences and disable GPS for a particular application.</p><p>I would essentially like to offer my users two modes.  1) GPS.  2) If <strong>GPS can not pull, device does not have a GPS chip, or GPS is turned off for my app</strong>, I would like to allow them to type in their zip code (or maybe switch to cell tower lookup).</p><p>The bolded text is what I'm interested in.  How can I tell if the device does not have GPS?  How can I tell if the user has disabled GPS for my application?</p><p>Side question:  My service gets launched from my 2nd Activity.  I call stopService in the onDestroy method of this Activity.  If I back up to my 1st Activity and the 2nd Activity is destroyed, I still notice the GPS icon on my phone running.  Is stopping the service sufficient?  Or do I need to stop the LocationManager in the onDestroy of the service?</p>","406790","","844923","","2013-04-06 20:31:34","2013-04-06 20:31:34","GPS lookup and user preference","<android><gps><locationmanager>","2","0","","",""
"3426917","1","3426966","","2010-08-06 19:07:14","40","77598","<p>I am trying to use an alert dialog to prompt for a username and a password in android. I have found this code <a href=""http://www.androidsnippets.org/snippets/20/"">here:</a></p><pre><code>  if (token.equals(""Not Found""))    {        LayoutInflater factory = LayoutInflater.from(this);                    final View textEntryView = factory.inflate(R.layout.userpasslayout, null);        AlertDialog.Builder alert = new AlertDialog.Builder(this);         alert.setTitle(""Please Login to Fogbugz"");         alert.setMessage(""Enter your email and password"");         // Set an EditText view to get user input          alert.setView(textEntryView);         AlertDialog loginPrompt = alert.create();        final EditText input1 = (EditText) loginPrompt.findViewById(R.id.username);        final EditText input2 = (EditText) loginPrompt.findViewById(R.id.password);        alert.setPositiveButton(""Login"", new DialogInterface.OnClickListener() {         public void onClick(DialogInterface dialog, int whichButton) {             input1.getText().toString(); **THIS CRASHES THE APPLICATION**        }         });         alert.setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {           public void onClick(DialogInterface dialog, int whichButton) {             // Canceled.           }         });         alert.show();     }</code></pre><p>EDIT: I was able to set up the proper layout, but receive an error when I try to access the text field. What is the problem here?</p>","381508","","381508","","2010-08-06 21:15:58","2013-09-05 20:07:53","How to add two edit text fields in an alert dialog","<android><login><dialog>","6","0","11","",""
"3427072","1","3428832","","2010-08-06 19:26:52","2","1524","<p>I have a free android app that I want to now distribute as free (with ads) and paid (without ads), so the only difference would be in a few of the layout files, where I just remove the ads in the paid version.</p><p>I tried moving all of my code from my existing free app to a new project which I set up as a library project, and I'm referencing the library project from the app project. In the manifest file. </p><p>What I want to do is completely contain the free app within this library project, and create two new app projects that reference the library, and change the layout file for the paid app, removing the ads.</p><p>I'm working on the paid app version and can't figure out how to reference the drawable for the app icon in the manifest file.</p><p>Am I going about this all wrong? Help is much appreciated.</p>","413414","","","","","2010-08-07 01:43:51","Android: How to reference library drawable in app manifest","<android><resources><manifest><drawable>","1","0","","",""
"3427099","1","9001476","","2010-08-06 19:30:57","2","985","<p>Is it possible to lookup native browser cookies in a custom Android App? I am not talking about WebView cookies. In my app I want to check if a user visited a website using the normal browser. Are browser cookies stored in a pubic directory somewhere on the device? </p>","257036","","","","","2012-01-25 10:52:32","Access Browser Cookies from Android App?","<android><browser><cookies>","1","0","3","",""
"3427146","1","","","2010-08-06 19:37:27","0","53","<p>I am trying to have the main screen displayed from within activity using  setContentView(R.layout.main); and then have an image displayed as follows:</p><p>public class TryGraph extends Activity {</p><pre><code>/** Called when the activity is first created. */public LinearLayout mLinearLayout;protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // Create a LinearLayout in which to add the ImageView    mLinearLayout = new LinearLayout(this);    // Instantiate an ImageView and define its properties    ImageView i = new ImageView(this);    i.setImageResource(R.drawable.face3);    i.setAdjustViewBounds(true); // set the ImageView bounds to match the Drawable's dimensions    mLinearLayout.addView(i);    setContentView(mLinearLayout);}}</code></pre><p>The main.xml is like this               </p><pre><code>           &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:orientation=""vertical""            android:layout_width=""fill_parent""             android:layout_height=""fill_parent""             &gt;            &lt;TextView               android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:text=""@string/hello""                 /&gt;         &lt;Button android:text=""button"" android:id=""@+id/Button01""           android:layout_width=""wrap_content""                      android:layout_height=""wrap_content""&gt;&lt;/Button&gt;</code></pre><p></p><p>The button is hidden by the pic as it is drawn over top of button. How to place the pic on the fly at different place so that both the button and pic are displayed. note: I don't want to display pic from xml, I want to display it from LinearLayout. </p>","357349","","357349","","2010-08-06 20:04:33","2010-08-06 20:04:33","Android View Help","<android><android-emulator><android-manifest>","1","0","","",""
"3427202","1","5494155","","2010-08-06 19:44:37","1","1453","<p>I'm building a C library we have using the Android NDK build chain.  Things are working in general, but the following section is causing problems:</p><pre><code>#include &lt;netdb.h&gt;...    struct addrinfo* addr_result;    struct addrinfo hints;    memset(&amp;hints, 0, sizeof(hints));    hints.ai_family = AF_INET;    hints.ai_socktype = SOCK_STREAM;    hints.ai_protocol = IPPROTO_TCP;    LOGD(""host name: %s"", name);    result = getaddrinfo(name, GCSL_NULL, &amp;hints, &amp;addr_result);    LOGD(""result: %d"", result);</code></pre><p>getaddrinfo is returning an error code of 7, which translates to ""EAI_NODATA"".</p><p>I tried forcing ""name"" to easy urls like ""www.google.com"" and ""http://www.google.com"" but nothing works.</p><p>I'm debugging using the emulator, which in general is able to connect to the Internet from other applications.</p>","10505","","10505","","2012-09-18 00:26:03","2012-09-18 00:26:03","getaddrinfo() failing in Android?","<android><sockets><android-ndk>","2","0","","",""
"3427233","1","3470567","","2010-08-06 19:48:35","3","3487","<p>So I have an android application that needs to connect to a socket server. That's simple enough if the socket server was running on my development machine. However the socket server is running on a server not only not on my own machine, but on a different subnet. How would I connect my emulator to the socket server? I understand how the port forwarding works to connect to the local machine, but I'm sort of confused on how I can redirect it across a subnet from my dev machine.</p>","375874","","","","","2010-08-12 17:56:18","Android emulator networking across network","<android><sockets><networking><emulator>","1","1","","",""
"3427402","1","3430349","","2010-08-06 20:11:11","1","675","<p>I am trying to have an image be at the left, to the right of that, a vertical list (title, address, and date), and to the right of all the url.  I can't seem to get the url to display anywhere but on top of the title.  Can anyone point me in the right direction?</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""?android:attr/listPreferredItemHeight""android:padding=""6dip""&gt;&lt;ImageView    android:id=""@+id/icon""    android:layout_width=""wrap_content""    android:layout_height=""fill_parent""    android:layout_alignParentTop=""true""    android:layout_alignParentBottom=""true""    android:layout_marginRight=""6dip""/&gt;&lt;TextView    android:id=""@+id/title""    android:layout_width=""fill_parent""    android:layout_height=""20dip""     android:layout_toRightOf=""@id/icon""    android:layout_alignParentTop=""true""    android:layout_alignParentRight=""true""    android:textStyle=""bold""    android:singleLine=""true""    android:ellipsize=""marquee""/&gt;&lt;TextView    android:id=""@+id/address""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:textSize=""12dip""    android:layout_toRightOf=""@id/icon""    android:layout_alignParentRight=""true""    android:layout_below=""@id/title""/&gt;&lt;TextView    android:id=""@+id/date""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_toRightOf=""@id/icon""    android:layout_below=""@id/address""    android:layout_alignParentRight=""true""    android:textSize=""12dip""    android:singleLine=""true""    android:ellipsize=""end"" /&gt;&lt;TextView    android:id=""@+id/url""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_toRightOf=""@id/date""     /&gt;</code></pre><p></p><p>With this current XML attempt with the url to the right of the @id/date...it doesn't appear at all.  If I place it toRightOf=""@id/icon"" it appears literally on top of, not above, the title.</p><p>Thanks for any help!</p>","2186261","","","","","2010-08-07 12:09:30","Problems with Relative layout","<android>","3","0","","",""
"3427458","1","","","2010-08-06 20:20:24","3","9840","<p>I would like to use a custom skin for my Datepickers and Timepickers. Changing the background in XML doesn't do the trick (it changes the background to the set, not each of its buttons). The API is painfully short and has nothing about appearance ( <a href=""http://developer.android.com/reference/android/widget/DatePicker.html"" rel=""nofollow"">http://developer.android.com/reference/android/widget/DatePicker.html</a> ). Is it possible to use a custom skin for the buttons of Datepickers and Timepickers?</p>","402682","","","","","2013-06-14 14:00:07","How do you use custom Datepicker and Timepicker skins?","<android><gui><datepicker><timepicker>","5","0","2","",""
"3427516","1","3432777","","2010-08-06 20:25:44","14","5253","<p>I try to increase the value of an integer key in a row in my table. However, nothing really seems to happen. </p><pre><code>db.rawQuery(""UPDATE table SET key = key + 1 WHERE name=?"", new String[] {name});</code></pre><p>However, this code works fine (just sets the key to a hard-coded value):</p><pre><code>    ContentValues values = new ContentValues();    values.put(""key"", 2);    db.update(""table"", values, ""name=?"", new String[] {name});</code></pre><p>Also tried '?' instead of just ?, but it resulted just in a run-time error.</p>","404691","","42346","","2010-08-06 20:36:00","2010-08-08 01:48:44","Increase the value of a record in android/sqlite database","<android><sqlite>","1","5","3","",""
"3427571","1","3427615","","2010-08-06 20:32:18","2","4715","<p>I'm playing around with reading the signal strengths in a small Android App, and was wondering if anyone has tested this (or just knows) of the documented values (0-31, 99) which value is better.</p><p>By asking which is better, I mean, does 0 represent no signal, or perfect signal.  </p><p>I'm running an HTC Incredible on Verizon, so I can confirm the 99 is no GSM antenna, but I could not find any other items on GSM</p>","335705","","844923","","2013-04-06 20:45:19","2013-04-06 20:45:19","Which Values (High or Low) are better in Android's getGsmSignalStrength()","<android><gsm><signal-strength>","1","0","1","",""
"3427660","1","","","2010-08-06 20:43:50","26","1581","<p>I am interested in integrating Scala (or some other non-Java JVM-language) into the android platform. I am not referring to writing an android application with Scala, that I did early early on, but actually hooking into the build process that builds the android platform source tree. I imagine this will be a matter of hooking into the makefiles and such. Does anyone have insight into this?</p><p><strong>What I have so far:</strong>The platform source treefrom git://android.git.kernel.org/platform/manifest.git built in its virgin form, guided by ""[Download and build the Google Android][1]""</p><ul><li>build/core/combo/scalac.mk # Configures scala compiler related variables, included by config.mk</li><li>Added definitions in build/core/definitions.mk for an all-subdir-scala-files and an all-scala-files-under</li><li>Added definition in definitions.mk to build scala files such that they are included in the package</li></ul><p><strong>What's left:</strong> </p><ul><li>Include scala-library.jar</li><li>Ensure changes to -bootclasspath has not broken anything</li><li>Figure out how to handle case where scala classes depend on java classes and visa versa</li><li>Major cleanup of code</li><li>Testing!</li><li>Figure out what to do (other than just posting them here) with the changes I've made</li></ul><p>Looks like I'm <strong>almost there!!!</strong></p><p><strong>Some notes from the past</strong></p><p>Latest: I have found where the Java source files are compiled! In definitions.mk, see 'define transform-java-to-classes.jar'. The latest idea is to write a transform-scala-to-classes definition and then have it store those classes in the directly that gets packaged. I will call transform-scala-to-class right before this step in transform-java-to-classes.jar. Support for eclipse and cygwin will for now be dropped as it clutters up the code with workarounds and therefore increases my chances of failure.</p><p>The build process starts out by the root Makefile running build/core/main.mkbuild/core/main.mk includes build/core/config.mk which includes build/core/combo/javac.mk which sets HOST_JAVAC, TARGET_JAVAC, and COMMON_JAVAC. COMMON_JAVAC is the ""Java compiler command with common arguments,"" by the look of it the other two variables get these values by default, unless in a special environment (openjdk or eclipse). COMMON_JAVAC is not used outside this file. The other two are only used in build/core/definitions.mk.</p><p>build/core/java_library.mk (included by config.mk) seems to only be concerned with building jars. This is out of the scope of us caring. Any interaction with jars presupposes class files which presuppose that we were already successful in building our scala files.</p><p>There are checks in main.mk regarding the version of java. We will ignore these and assume that our version of scala is compatible. Right now (in combo/scalac.mk) I am using the same --target arg used in javac.mk. This should perhaps be stored in a variable.</p><p>main.mk also includes build/core/definitions.mk which in turns defines some useful functions. The one we care about here is all-java-files-under and all-subdir-java-files. The latter is used in Android.mk files to find java files. The former is used in the implementation of the latter. I will write Scala equivalents of them.</p><p>To figure out how the build process works, I am now running make with -n and others. I got this idea from the stackoverflow article ""[Tool for debugging makefiles][2]"". I am also investigating debugging with remake.</p><p>build/core/{config.mk, definitions.mk} gives us light as to which make files/commands are used to do what.</p><p>As a possible way of hacking in support on a per project bases, additional code could most likely be added to the project's Android.mk file. From platform/build/core/build-system.html we read ""Android.mk is the standard name for the makefile fragments that control the building of a given module. Only the top directory should have a file named ""Makefile""."" You could create a new target like ""scala-build"" and run that (make PackageName scala-build) before the final make. One could perhaps also hide it sneakily in a variable assignment, mitigating the need for a target to be called explicitly.</p><p>Another way (far far more hackish) is to hijack the command being used for javac. This is set in build/core/combo/javac.mk. Your project's Android.mk will have to include *.scala files in LOCAL_SRC_FILES along with the *.java files.</p>","189491","","189491","","2010-08-11 21:01:49","2010-09-16 00:05:48","How to integrate Scala into core Android platform?","<android><scala><dalvik><jvm-languages>","1","1","9","","2010-08-10 18:35:57"
"3427731","1","","","2010-08-06 20:52:26","1","1121","<p>I was wondering if there are ways to run Android on XWindows (Xorg) without any emulation and using X11 (or a window) to render graphics... I've read that Android uses the FB device (and I don't know how does this fit with OpenGl). </p><p>Does anyone have some information about this? Are there projects or other?</p>","138606","","","","","2011-01-15 18:49:51","Are there ways to run Android on XWindows?","<android><x11><xorg>","1","2","","","2010-08-06 20:52:26"
"3427751","1","3516961","","2010-08-06 20:55:14","0","1530","<p>When I trying run Android Emulation, i Have error message: </p><pre><code>$ tools/emulator -avd Default -verbose -debug-allemulator: found SDK root at /opt/android-sdk-linux_86emulator: /home/jupeter/.android/avd/Default.ini: parsing as .ini fileemulator:    1: KEY='target' VALUE='android-8'emulator:    2: KEY='path' VALUE='/home/jupeter/.android/avd/Default.avd'emulator: /home/jupeter/.android/avd/Default.ini: parsing finishedemulator: root virtual device file at /home/jupeter/.android/avd/Default.iniemulator: virtual device content at /home/jupeter/.android/avd/Default.avdemulator: /home/jupeter/.android/avd/Default.avd/config.ini: parsing as .ini fileemulator:    1: KEY='hw.lcd.density' VALUE='160'emulator:    2: KEY='sdcard.size' VALUE='200M'emulator:    3: KEY='skin.name' VALUE='HVGA'emulator:    4: KEY='skin.path' VALUE='platforms/android-8/skins/HVGA'emulator:    5: KEY='image.sysdir.1' VALUE='platforms/android-8/images/'emulator: /home/jupeter/.android/avd/Default.avd/config.ini: parsing finishedemulator: virtual device config file: /home/jupeter/.android/avd/Default.avd/config.iniemulator:     found image search path: platforms/android-8/images/emulator: found a total of 1 search paths for this AVDemulator:     no kernel-qemu in content directoryemulator: found kernel-qemu in search dir: /opt/android-sdk-linux_86/platforms/android-8/images/emulator:     no ramdisk.img in content directoryemulator: found ramdisk.img in search dir: /opt/android-sdk-linux_86/platforms/android-8/images/emulator:     no system.img in content directoryemulator: found system.img in search dir: /opt/android-sdk-linux_86/platforms/android-8/images/emulator: found userdata-qemu.img in content directoryemulator:     locking user data image at /home/jupeter/.android/avd/Default.avd/userdata-qemu.imgemulator: found cache.img in content directoryemulator:     locking cache image at /home/jupeter/.android/avd/Default.avd/cache.imgemulator: found sdcard.img in content directoryemulator:     locking SD Card image at /home/jupeter/.android/avd/Default.avd/sdcard.imgemulator: found skin 'HVGA' in directory: platforms/android-8/skinsemulator: autoconfig: -skin HVGAemulator: autoconfig: -skindir platforms/android-8/skinsemulator: adding binding BUTTON_CALL to F3emulator: adding binding BUTTON_HANGUP to F4emulator: adding binding BUTTON_HOME to HOMEemulator: adding binding BUTTON_BACK to ESCAPEemulator: adding binding BUTTON_MENU to F2emulator: adding binding BUTTON_MENU to PAGEUPemulator: adding binding BUTTON_STAR to Shift-F2emulator: adding binding BUTTON_STAR to PAGEDOWNemulator: adding binding BUTTON_POWER to F7emulator: adding binding BUTTON_SEARCH to F5emulator: adding binding BUTTON_CAMERA to Ctrl-KEYPAD_5emulator: adding binding BUTTON_CAMERA to Ctrl-F3emulator: adding binding BUTTON_VOLUME_UP to KEYPAD_PLUSemulator: adding binding BUTTON_VOLUME_UP to Ctrl-F5emulator: adding binding BUTTON_VOLUME_DOWN to KEYPAD_MINUSemulator: adding binding BUTTON_VOLUME_DOWN to Ctrl-F6emulator: adding binding TOGGLE_NETWORK to F8emulator: adding binding TOGGLE_TRACING to F9emulator: adding binding TOGGLE_FULLSCREEN to Alt-ENTERemulator: adding binding BUTTON_DPAD_CENTER to KEYPAD_5emulator: adding binding BUTTON_DPAD_UP to KEYPAD_8emulator: adding binding BUTTON_DPAD_LEFT to KEYPAD_4emulator: adding binding BUTTON_DPAD_RIGHT to KEYPAD_6emulator: adding binding BUTTON_DPAD_DOWN to KEYPAD_2emulator: adding binding TOGGLE_TRACKBALL to F6emulator: adding binding SHOW_TRACKBALL to DELETEemulator: adding binding CHANGE_LAYOUT_PREV to KEYPAD_7emulator: adding binding CHANGE_LAYOUT_PREV to Ctrl-F11emulator: adding binding CHANGE_LAYOUT_NEXT to KEYPAD_9emulator: adding binding CHANGE_LAYOUT_NEXT to Ctrl-F12emulator: adding binding ONION_ALPHA_UP to KEYPAD_MULTIPLYemulator: adding binding ONION_ALPHA_DOWN to KEYPAD_DIVIDEemulator: keyset loaded from: /home/jupeter/.android/default.keysetemulator: trying to load skin file 'platforms/android-8/skins/HVGA/layout'emulator: skin network speed: 'full'emulator: skin network delay: 'none'emulator: IP address of your DNS(s): 192.168.1.1emulator: registered 'boot-properties' qemud serviceemulator: registered 'boot-properties' qemud serviceemulator: Adding boot property: 'qemu.sf.lcd_density' = '160'emulator: Adding boot property: 'dalvik.vm.heapsize' = '16m'emulator: argv[00] = ""tools/emulator""emulator: argv[01] = ""-kernel""emulator: argv[02] = ""/opt/android-sdk-linux_86/platforms/android-8/images//kernel-qemu""emulator: argv[03] = ""-initrd""emulator: argv[04] = ""/opt/android-sdk-linux_86/platforms/android-8/images//ramdisk.img""emulator: argv[05] = ""-nand""emulator: argv[06] = ""system,size=0x4e00000,initfile=/opt/android-sdk-linux_86/platforms/android-8/images//system.img""emulator: argv[07] = ""-nand""emulator: argv[08] = ""userdata,size=0x4200000,file=/home/jupeter/.android/avd/Default.avd/userdata-qemu.img""emulator: argv[09] = ""-nand""emulator: argv[10] = ""cache,size=0x4200000,file=/home/jupeter/.android/avd/Default.avd/cache.img""emulator: argv[11] = ""-hda""emulator: argv[12] = ""/home/jupeter/.android/avd/Default.avd/sdcard.img""emulator: argv[13] = ""-serial""emulator: argv[14] = ""android-kmsg""emulator: argv[15] = ""-serial""emulator: argv[16] = ""android-qemud""emulator: argv[17] = ""-append""emulator: argv[18] = ""qemu=1 console=ttyS0 android.checkjni=1 android.qemud=ttyS1 android.ndns=1""emulator: argv[19] = ""-m""emulator: argv[20] = ""96""emulator: argv[21] = ""-clock""emulator: argv[22] = ""unix""emulator: mapping 'system' NAND image to /tmp/android/emulator-0Waqxcemulator: rounding devsize up to a full eraseunit, now 4e1e000emulator: qesd_audio_init: enteringemulator: could not find libesd on this systemaudio: Could not init `esd' audio driveremulator: using 'alsa' audio input backendemulator: qesd_audio_init: enteringemulator: could not find libesd on this systemaudio: Could not init `esd' audio driveremulator: using 'alsa' audio output backendInconsistency detected by ld.so: dl-version.c: 230: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed!</code></pre><p>The problem is on last line:</p><pre><code>Inconsistency detected by ld.so: dl-version.c: 230: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed!</code></pre><p>Any idea how to fix it?</p>","413477","","","","","2010-08-18 21:42:02","Cannot load Android Emulator on Ubuntu 10.04","<android>","1","3","","",""
"3427774","1","3427954","","2010-08-06 21:00:34","2","1417","<p>I would like to install an APK from within an Android application. Can anyone give me an example of how to do this?</p><p>EDIT:</p><p>Also how do I open the install applications from unknown resources preference page so that users can change it?</p><p>EDIT:</p><p>I actually meant open the screen using code, so I can immediately open the preference page for the user to simply check the box, and press back. Is it possible to check to see if they allow non-market apps? </p><p>Can an application request permission enough to do this?</p>","325081","","325081","","2010-08-10 15:57:22","2010-08-10 15:57:22","Install APK from assets or RAW folder","<java><android><download><apk>","1","0","1","",""
"3427831","1","3427952","","2010-08-06 21:11:43","6","1272","<p>I am creating a multiple stop watch application for which there will be multiple timers running parallel, and each notification binded to each timer. </p><p>I am able to create multiple timers with the following code.  </p><pre><code>private void updateNotification(int notificationId, int clockStatusID, CharSequence text) {   // notificationManager.cancel(notificationId);    // throws up an ongoing notification that the timer is running    Log.i(""TIMERCOUNT"", ""Notification id: "" + notificationId);    Notification not = new Notification(clockStatusID, // the        // icon        // for        // the        // status        // bar        text, // the text to display in the ticker        System.currentTimeMillis() // the timestamp for the        // notification to appear    );    Intent intent = new Intent();    intent.setClassName(""com.intuit.time_catcher.android.activities"",    ""com.intuit.time_catcher.android.activities.Tabs"");    not.setLatestEventInfo(self,        getText(R.string.timer_notification_title),        getText(R.string.timer_on_notification_text), PendingIntent        .getActivity(this, 0, intent,            PendingIntent.FLAG_UPDATE_CURRENT));    not.flags += Notification.FLAG_ONGOING_EVENT;    not.flags += Notification.FLAG_NO_CLEAR;    notificationManager.notify(notificationId, not);}</code></pre><p>The following is the problem that im facing.Consider there are 3 timer running and 3 notifications in the status bar. When i update timer 2, notification 3(which is at the rightmost end) gets updated, but what i really want to do is to update the second notification(middle one). When i print the notification id's, im seeing the right values. I cant comprehend why am i getting this weird behavior?</p>","374499","","","","","2010-08-07 04:18:37","Android: Managing multiple notifications in status bar","<java><android>","2","0","1","",""
"3427887","1","3445907","","2010-08-06 21:20:35","3","2198","<p>Following the ""<a href=""http://developer.android.com/resources/tutorials/hello-world.html"" rel=""nofollow"">Hello, World</a>"" and ""<a href=""http://developer.android.com/resources/tutorials/testing/helloandroid_test.html"" rel=""nofollow"">Hello, Testing</a>"" tutorials I created an android application created with Eclipse, along with a corresponding Android Test Project. </p><p>The tests run fine... once. After that, in order for me to run the tests again, I have to close the emulator. </p><p>If I don't close the emulator, the Eclipse console get stuck on ""Installing instrumentation  android.test.InstrumentationTestRunner on device emulator-5554""... Nothing happens after that.</p><p>Here's the output from my program on the second run:</p><pre><code>[HelloTest] ------------------------------[HelloTest] Android Launch![HelloTest] adb is running normally.[HelloTest] Performing android.test.InstrumentationTestRunner JUnit launch[HelloTest] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'FakePhone'[HelloTest] Uploading HelloTest.apk onto device 'emulator-5554'[HelloTest] Installing HelloTest.apk...[HelloTest] Success![HelloTest] Project dependency found, installing: Hello[Hello] Application already deployed. No need to reinstall. [HelloTest] Launching instrumentation android.test.InstrumentationTestRunner on device emulator-5554</code></pre><p>As you can see it stops at ""Launching Instrumentation""... I've also run ""adb logcat"" and not seen anything interesting. </p><p>I've been told to exit out of the application under test in the emulator in order to run the test again. Unfortunately the emulator doesn't have the app pulled up (it's in the normal ""locked"" position and when unlocked brings up the home screen) and even if I do pull it up then exit, it doesn't seem to let me run my tests again.</p><p>All the example videos and tutorials all stop at the first run of a test. I have yet to see anyone anywhere run a test a second time! </p>","145499","","145499","","2010-08-10 00:26:22","2011-07-20 18:46:06","How do I run android unit tests/functional tests?","<android><unit-testing>","2","2","2","",""
"3428090","1","","","2010-08-06 21:56:53","2","1663","<p>Is there a way to know all the threads that are currently running in background inside of an Android application??</p><p>Thanks!!</p>","373542","","","","","2011-09-08 14:22:46","How to get the running threads in Android process?","<android><multithreading><background>","2","0","1","",""
"3428102","1","3428963","","2010-08-06 21:58:26","13","7243","<p>This is a continuation of <a href=""http://stackoverflow.com/questions/3411480/how-to-resume-an-interrupted-download/3411558#3411558"">my previous question</a> which I posted when I wasn't a registered user.  As a refresher, I'm trying to resume the downloading of a large file from my Yahoo! web site server when the download gets interrupted.  I previously thought the interruption was due to a 100 second timeout limit (because Yahoo! enforces that time limit on user written scripts).  However, when I measured the timing of the download interrupts, I saw that the interrupt timing varies a lot (sometimes the download runs uninterrupted for less than 100 seconds and sometimes up to seven minutes).  So I don't know the reason for the timeouts and I'm just trying to work around them.</p><p>I tried the suggestion by <a href=""http://stackoverflow.com/users/306602/naikus"">naikus</a> (thank you) and, according to the dump of http header fields, it appears that my Yahoo! web site server does recognize the ""range"" property that should allow the download to resume at the offset of the interruption.  Unfortunately, although the byte range appears correct in the http header in the resumed connections, the transferred content always restarts at the beginning of the file.  (My test file is an array of 50,000 4-byte integers that increments starting at 0.  My downloaded file always starts recounting at 0 at every offset at which a download interrupt occurred.)</p><p><b>Is there some other http connection property request I should be making to get the Yahoo! server to actually skip to the file offset specified in the header's byte range?</b>  Here's the code and what it dumps:</p><pre><code>         // Setup connection.         URL url = new URL(strUrl[0]);         URLConnection connection = url.openConnection();         downloaded = Integer.parseInt(strUrl[3]);         if (downloaded &gt; 0) {             connection.setRequestProperty(""Range"", ""bytes=""+downloaded+""-"");             connection.connect();             fileLength = mDownloadFileLength;             Log.d(""AsyncDownloadFile"",                  ""new download seek: "" + downloaded +                 ""; lengthFile: "" + fileLength);         }         else {             connection.connect();             downloaded = 0;             fileLength = connection.getContentLength();             mDownloadFileLength = fileLength;         }         Map&lt;String, List&lt;String&gt;&gt; map = connection.getHeaderFields();         Log.d(""AsyncDownloadFile"", ""header fields: "" + map.toString());         // Setup streams and buffers.         input = new BufferedInputStream(url.openStream(), 8192);         outFile = new RandomAccessFile(strUrl[1], ""rw"");         if (downloaded &gt; 0)               outFile.seek(downloaded);         byte data[] = new byte[1024];         // Download file.         for (int count=0, i=0; (count=input.read(data, 0, 1024)) != -1; i++) {              outFile.write(data, 0, count);             downloaded += count;              if (downloaded &gt;= fileLength)                 break;             // Display progress.             Log.d(""AsyncDownloadFile"", ""bytes: "" + downloaded);             if ((i%10) == 0)                 publishProgress((int)(downloaded*100/fileLength));             if (mFlagDisableAsyncTask) {                 downloaded = 0;                 break;             }         }         // Close streams.         outFile.close();         input.close();</code></pre><hr><p>dump:  </p><pre><code>@ 4:08:24  D/AsyncDownloadFile( 2372): header fields: {p3p=[policyref=""http://info.yahoo.com/w3c/p3p.xml"", CP=""CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV""], content-type=[application/zip], connection=[close], last-modified=[Fri, 06 Aug 2010 14:47:50 GMT], content-length=[2000000], age=[0], server=[YTS/1.17.13], accept-ranges=[bytes], date=[Fri, 06 Aug 2010 20:08:33 GMT]}  D/AsyncDownloadFile( 2372): bytes: 1024  D/AsyncDownloadFile( 2372): bytes: 1033  D/AsyncDownloadFile( 2372): bytes: 2057  D/AsyncDownloadFile( 2372): bytes: 2493  D/AsyncDownloadFile( 2372): bytes: 3517  D/AsyncDownloadFile( 2372): bytes: 3953  ...@ 4:13:25  D/AsyncDownloadFile( 2372): bytes: 386473  D/AsyncDownloadFile( 2372): bytes: 387497  D/AsyncDownloadFile( 2372): bytes: 387933  D/AsyncDownloadFile( 2372): new download seek: 387933; lengthFile: 2000000  D/AsyncDownloadFile( 2372): header fields: {p3p=[policyref=""http://info.yahoo.com/w3c/p3p.xml"", CP=""CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV""], content-type=[application/zip], connection=[close], last-modified=[Fri, 06 Aug 2010 14:47:50 GMT], content-length=[1612067], age=[0], server=[YTS/1.17.13], accept-ranges=[bytes], date=[Fri, 06 Aug 2010 20:13:29 GMT], content-range=[bytes 387933-1999999/2000000]}  D/AsyncDownloadFile( 2372): bytes: 388957  D/AsyncDownloadFile( 2372): bytes: 389981  D/AsyncDownloadFile( 2372): bytes: 390409  D/AsyncDownloadFile( 2372): bytes: 391433  D/AsyncDownloadFile( 2372): bytes: 391869  D/AsyncDownloadFile( 2372): bytes: 392893  ...@ 4:18:45  D/AsyncDownloadFile( 2372): bytes: 775413  D/AsyncDownloadFile( 2372): bytes: 775849  D/AsyncDownloadFile( 2372): bytes: 776873  D/AsyncDownloadFile( 2372): bytes: 777309  D/AsyncDownloadFile( 2372): new download seek: 777309; lengthFile: 2000000  D/AsyncDownloadFile( 2372): header fields: {p3p=[policyref=""http://info.yahoo.com/w3c/p3p.xml"", CP=""CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV""], content-type=[application/zip], connection=[close], last-modified=[Fri, 06 Aug 2010 14:47:50 GMT], content-length=[1222691], age=[0], server=[YTS/1.17.13], accept-ranges=[bytes], date=[Fri, 06 Aug 2010 20:18:54 GMT], content-range=[bytes 777309-1999999/2000000]}  D/dalvikvm( 2372): GC_FOR_MALLOC freed 11019 objects / 470560 bytes in 155ms  D/AsyncDownloadFile( 2372): bytes: 778333  D/AsyncDownloadFile( 2372): bytes: 779357  D/AsyncDownloadFile( 2372): bytes: 779790  D/AsyncDownloadFile( 2372): bytes: 780814  D/AsyncDownloadFile( 2372): bytes: 781250  D/AsyncDownloadFile( 2372): bytes: 782274  ...@ 4:23:45  D/AsyncDownloadFile( 2372): bytes: 1163334  D/AsyncDownloadFile( 2372): bytes: 1163770  D/AsyncDownloadFile( 2372): bytes: 1164794  D/AsyncDownloadFile( 2372): bytes: 1165230  D/AsyncDownloadFile( 2372): new download seek: 1165230; lengthFile: 2000000  D/AsyncDownloadFile( 2372): header fields: {p3p=[policyref=""http://info.yahoo.com/w3c/p3p.xml"", CP=""CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV""], content-type=[application/zip], connection=[close], last-modified=[Fri, 06 Aug 2010 14:47:50 GMT], content-length=[834770], age=[0], server=[YTS/1.17.13], accept-ranges=[bytes], date=[Fri, 06 Aug 2010 20:23:47 GMT], content-range=[bytes 1165230-1999999/2000000]}  D/AsyncDownloadFile( 2372): bytes: 1166246  D/AsyncDownloadFile( 2372): bytes: 1167270  D/AsyncDownloadFile( 2372): bytes: 1167706  D/AsyncDownloadFile( 2372): bytes: 1168730  D/AsyncDownloadFile( 2372): bytes: 1169754  D/AsyncDownloadFile( 2372): bytes: 1170778  ...@ 4:30:25  D/AsyncDownloadFile( 2372): bytes: 1551255  D/AsyncDownloadFile( 2372): bytes: 1551691  D/AsyncDownloadFile( 2372): bytes: 1552715  D/AsyncDownloadFile( 2372): bytes: 1553151  D/AsyncDownloadFile( 2372): new download seek: 1553151; lengthFile: 2000000  D/AsyncDownloadFile( 2372): header fields: {p3p=[policyref=""http://info.yahoo.com/w3c/p3p.xml"", CP=""CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV""], content-type=[application/zip], connection=[close], last-modified=[Fri, 06 Aug 2010 14:47:50 GMT], content-length=[446849], age=[0], server=[YTS/1.17.13], accept-ranges=[bytes], date=[Fri, 06 Aug 2010 20:30:44 GMT], content-range=[bytes 1553151-1999999/2000000]}  D/AsyncDownloadFile( 2372): bytes: 1554167  D/AsyncDownloadFile( 2372): bytes: 1554184  D/AsyncDownloadFile( 2372): bytes: 1555208  D/AsyncDownloadFile( 2372): bytes: 1555644  D/AsyncDownloadFile( 2372): bytes: 1556668  D/AsyncDownloadFile( 2372): bytes: 1557104  ...@ 4:37:10  D/AsyncDownloadFile( 2372): bytes: 1939188  D/AsyncDownloadFile( 2372): bytes: 1939624  D/AsyncDownloadFile( 2372): bytes: 1940648  D/AsyncDownloadFile( 2372): bytes: 1941084  D/AsyncDownloadFile( 2372): new download seek: 1941084; lengthFile: 2000000  D/dalvikvm( 2372): GC_FOR_MALLOC freed 13701 objects / 604600 bytes in 128msD/AsyncDownloadFile( 2372): header fields: {p3p=[policyref=""http://info.yahoo.com/w3c/p3p.xml"", CP=""CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV""], content-type=[application/zip], connection=[close], last-modified=[Fri, 06 Aug 2010 14:47:50 GMT], content-length=[58916], age=[0], server=[YTS/1.17.13], accept-ranges=[bytes], date=[Fri, 06 Aug 2010 20:37:16 GMT], content-range=[bytes 1941084-1999999/2000000]}  D/AsyncDownloadFile( 2372): bytes: 1942108  D/AsyncDownloadFile( 2372): bytes: 1942117  D/AsyncDownloadFile( 2372): bytes: 1943141  D/AsyncDownloadFile( 2372): bytes: 1943577  D/AsyncDownloadFile( 2372): bytes: 1944601  D/AsyncDownloadFile( 2372): bytes: 1945037  ...@ 4:38:30  D/AsyncDownloadFile( 2372): bytes: 1993217  D/AsyncDownloadFile( 2372): bytes: 1994241  D/AsyncDownloadFile( 2372): bytes: 1994677  D/AsyncDownloadFile( 2372): bytes: 1995701  D/AsyncDownloadFile( 2372): bytes: 1996137  D/AsyncDownloadFile( 2372): bytes: 1997161  D/AsyncDownloadFile( 2372): bytes: 1997597  D/AsyncDownloadFile( 2372): bytes: 1998621  D/AsyncDownloadFile( 2372): bytes: 1999057  D/onPostExecute( 2372): download: unsuccessful  - - -  </code></pre><p>After the tip from BalusC (thanks), I modified the connection setup but the Yahoo! server continues to reset to the start of the file at each interrupt.  Here's the changed code and the resulting dumps:</p><pre><code>            // Setup connection.            URL url = new URL(strUrl[0]);            URLConnection connection = url.openConnection();            downloaded = Integer.parseInt(strUrl[3]);            if (downloaded == 0) {                connection.connect();                strLastModified = connection.getHeaderField(""Last-Modified"");                fileLength = connection.getContentLength();                mDownloadFileLength = fileLength;            }            else {                connection.setRequestProperty(""Range"", ""bytes="" + downloaded + ""-"");                connection.setRequestProperty(""If-Range"", strLastModified);                connection.connect();                fileLength = mDownloadFileLength;                Log.d(""AsyncDownloadFile"",                         ""new download seek: "" + downloaded +                        ""; lengthFile: "" + fileLength);            }            map = connection.getHeaderFields();            Log.d(""AsyncDownloadFile"", ""header fields: "" + map.toString());</code></pre><hr><p>dump:  </p><pre><code>@12:36:40 started  D/AsyncDownloadFile(  413): header fields: {p3p=[policyref=""http://info.yahoo.cm/w3c/p3p.xml"", CP=""CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTP OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA PL HEA PRE LOC GOV""], content-type=[application/zip], connection=[close], last-mdified=[Fri, 06 Aug 2010 14:47:50 GMT], content-length=[2000000], age=[0], servr=[YTS/1.17.13], accept-ranges=[bytes], date=[Sat, 07 Aug 2010 04:36:56 GMT]}  D/AsyncDownloadFile(  413): bytes: 1024  D/AsyncDownloadFile(  413): bytes: 2048  D/AsyncDownloadFile(  413): bytes: 2476  D/AsyncDownloadFile(  413): bytes: 3500  D/AsyncDownloadFile(  413): bytes: 3936  ...@12:39:20 interrupted  D/AsyncDownloadFile(  413): bytes: 388068  D/AsyncDownloadFile(  413): bytes: 389092  D/AsyncDownloadFile(  413): bytes: 389376  D/AsyncDownloadFile(  413): new download seek: 389376; lengthFile: 2000000  D/AsyncDownloadFile(  413): header fields: {p3p=[policyref=""http://info.yahoo.com/w3c/p3p.xml"", CP=""CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV""], content-type=[application/zip], connection=[close], last-modified=[Fri, 06 Aug 2010 14:47:50 GMT], content-length=[1610624], age=[0], server=[YTS/1.17.13], accept-ranges=[bytes], date=[Sat, 07 Aug 2010 04:39:21 GMT], content-range=[bytes 389376-1999999/2000000]}  D/AsyncDownloadFile(  413): bytes: 390400  D/AsyncDownloadFile(  413): bytes: 390409  D/AsyncDownloadFile(  413): bytes: 391433  D/AsyncDownloadFile(  413): bytes: 391869  ...@12:44:10 interrupted  D/AsyncDownloadFile(  413): bytes: 775413  D/AsyncDownloadFile(  413): bytes: 775849  D/AsyncDownloadFile(  413): bytes: 776873  D/AsyncDownloadFile(  413): bytes: 777309  D/AsyncDownloadFile(  413): new download seek: 777309; lengthFile: 2000000  D/AsyncDownloadFile(  413): header fields: {p3p=[policyref=""http://info.yahoo.com/w3c/p3p.xml"", CP=""CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV""], content-type=[application/zip], connection=[close], last-modified=[Fri, 06 Aug 2010 14:47:50 GMT], content-length=[1222691], age=[0], server=[YTS/1.17.13], accept-ranges=[bytes], date=[Sat, 07 Aug 2010 04:44:20 GMT], content-range=[bytes 777309-1999999/2000000]}  D/dalvikvm(  413): GC_FOR_MALLOC freed 10869 objects / 465664 bytes in 122ms  D/AsyncDownloadFile(  413): bytes: 778333  D/AsyncDownloadFile(  413): bytes: 778342  D/AsyncDownloadFile(  413): bytes: 779366  D/AsyncDownloadFile(  413): bytes: 779802  ...@12:49:30 interrupted  D/AsyncDownloadFile(  413): bytes: 1163782  D/AsyncDownloadFile(  413): bytes: 1164806  D/AsyncDownloadFile(  413): bytes: 1165242  D/AsyncDownloadFile(  413): new download seek: 1165242; lengthFile: 2000000  D/AsyncDownloadFile(  413): header fields: {p3p=[policyref=""http://info.yahoo.com/w3c/p3p.xml"", CP=""CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV""], content-type=[application/zip], connection=[close], last-modified=[Fri, 06 Aug 2010 14:47:50 GMT], content-length=[834758], age=[0], server=[YTS/1.17.13], accept-ranges=[bytes], date=[Sat, 07 Aug 2010 04:49:43 GMT], content-range=[bytes 1165242-1999999/2000000]}  D/AsyncDownloadFile(  413): bytes: 1166266  D/AsyncDownloadFile(  413): bytes: 1167290  D/AsyncDownloadFile(  413): bytes: 1167718  D/AsyncDownloadFile(  413): bytes: 1168742  ...@12:55:30 interrupted  D/AsyncDownloadFile(  413): bytes: 1552722  D/AsyncDownloadFile(  413): bytes: 1553158  D/AsyncDownloadFile(  413): bytes: 1554182  D/AsyncDownloadFile(  413): bytes: 1554618  D/AsyncDownloadFile(  413): new download seek: 1554618; lengthFile: 2000000  D/AsyncDownloadFile(  413): header fields: {p3p=[policyref=""http://info.yahoo.com/w3c/p3p.xml"", CP=""CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV""], content-type=[application/zip], connection=[close], last-modified=[Fri, 06 Aug 2010 14:47:50 GMT], content-length=[445382], age=[0], server=[YTS/1.17.13], accept-ranges=[bytes], date=[Sat, 07 Aug 2010 04:55:39 GMT], content-range=[bytes 1554618-1999999/2000000]}  D/AsyncDownloadFile(  413): bytes: 1555642  D/AsyncDownloadFile(  413): bytes: 1556666  D/AsyncDownloadFile(  413): bytes: 1557094  D/AsyncDownloadFile(  413): bytes: 1558118  ...@12:57:20 interrupted  D/AsyncDownloadFile(  413): bytes: 1941834  D/AsyncDownloadFile(  413): bytes: 1942858  D/AsyncDownloadFile(  413): bytes: 1943882  D/AsyncDownloadFile(  413): bytes: 1943994  D/AsyncDownloadFile(  413): new download seek: 1943994; lengthFile: 2000000  D/AsyncDownloadFile(  413): header fields: {p3p=[policyref=""http://info.yahoo.com/w3c/p3p.xml"", CP=""CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV""], content-type=[application/zip], connection=[close], last-modified=[Fri, 06 Aug 2010 14:47:50 GMT], content-length=[56006], age=[0], server=[YTS/1.17.13], accept-ranges=[bytes], date=[Sat, 07 Aug 2010 04:57:15 GMT], content-range=[bytes 1943994-1999999/2000000]}  D/dalvikvm(  413): GC_FOR_MALLOC freed 13617 objects / 602200 bytes in 165ms  D/AsyncDownloadFile(  413): bytes: 1945018  D/AsyncDownloadFile(  413): bytes: 1946042  D/AsyncDownloadFile(  413): bytes: 1946470  D/AsyncDownloadFile(  413): bytes: 1947494  ...@12:58:10 finished  D/AsyncDownloadFile(  413): bytes: 1996103  D/AsyncDownloadFile(  413): bytes: 1997127  D/AsyncDownloadFile(  413): bytes: 1997563  D/AsyncDownloadFile(  413): bytes: 1998587  D/AsyncDownloadFile(  413): bytes: 1999023  D/onPostExecute(  413): downloaded: unsuccessful  </code></pre>","411972","","944657","","2012-11-19 01:51:45","2012-11-19 01:51:45","how to resume an interrupted download - part 2","<java><android><http><file-download>","2","0","21","",""
"3428109","1","3432845","","2010-08-06 21:59:34","0","324","<p>I'm trying to build a project in Android 1.5 that references another Android (library) project compiled against Android 1.5 and I keep seeing this error in the Console in Eclipse:</p><p>Target 'Android 1.5' does not support building project with libraries.</p><p>I'm running Eclipse 3.5, and version 0.9.7 of the ADT.</p><p>I followed the instructions here:</p><p><a href=""http://developer.android.com/guide/developing/eclipse-adt.html"" rel=""nofollow"">http://developer.android.com/guide/developing/eclipse-adt.html</a></p><p>What gives?</p>","413414","","","","","2010-08-08 02:27:54","Target 'Android 1.5' does not support building project with libraries","<android><build><reference><project>","1","2","","",""
"3428162","1","3429320","","2010-08-06 22:10:00","1","1293","<p>Hi i download Android 2.2 SDK and install nbandroid plugin on netbeans.when i run project i get this message on netbeans out put and emulator did not start !!! </p><blockquote>  <p>init:  deps-jar:  Compiling 1 source file to C:\Users\mahdi\Documents\NetBeansProjects\Hello Android\build\classes  compile:  =C:\Users\mahdi\Documents\NetBeansProjects\Hello was unexpected at this time.  C:\Users\mahdi\Documents\NetBeansProjects\Hello Android\nbproject\build-impl.xml:411: exec returned: 255  BUILD FAILED (total time: 2 seconds)</p></blockquote><p>and this is my code :</p><pre><code>package org.me.helloandroid;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class MainActivity extends Activity {@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    TextView tv = new TextView(this);    tv.setText(""Hello World"");    setContentView(tv);}}</code></pre><p>can any body help me thanks</p>","377983","","","","","2013-01-15 18:00:04","probleam in start first android hello world on netbeans","<android><hello-world>","1","0","","",""
"3428187","1","3428194","","2010-08-06 22:15:01","0","1295","<p>I need to test, with Selenium or a similar automated testing tool, how my webapp behaves on iPhone's Mobile Safari and on Android browser. How can I do that?</p><p>I usually test my app by hand setting Safari 5 with User Agent = ""Mobile Safari"", I used iPhoney as well but it's too buggy IMO.</p>","199660","","","","","2010-08-06 22:15:52","Can Selenium test my app for Mobile Safari and Android browser?","<ruby-on-rails><android><selenium><ios-simulator><mobile-safari>","0","0","0","",""
"3428188","1","3430129","","2010-08-06 22:15:07","5","2443","<p>I am about to build an app in Android that will act as a clock-in card for employees on the road.</p><p>At the start of a job the user will click a button that will record the GPS location and current time (thus verifying that he is where he should be at a given time) and again at the end of the job he records the time and GPS location.</p><p>SO I reckon this will be easy enough, except that I can't find a way of pulling current location data. The nearest I can find is <code>onLocationChanged</code> which implies that I cannot get a stationary GPS read. I know it has to be possible to do this but cannot find a working example of how it would be achieved.</p>","409826","","496830","","2011-11-08 13:04:04","2012-11-12 20:47:09","How can I obtain the current GPS location?","<java><android><gps>","3","0","2","",""
"3428291","1","3429048","","2010-08-06 22:38:21","0","283","<p>I am unable to display both the setContentView(R.layout.main) and View together. I think I am not getting the concept right. Could anyone explain me where I am going wrong. Thank you. //please read the comment in code</p><p>I am trying to display a image on main.xml using BitmapFactory.</p><pre><code>   public class TryGraph extends Activity  {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);//I think this is where I need your help    setContentView(new myView(this));//I want this to be displayed in main.xml}private class myView extends View{    public myView(Context context) {        super(context);        // TODO Auto-generated constructor stub    }    @Override    protected void onDraw(Canvas canvas) {        // TODO Auto-generated method stub        Bitmap myBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.sinewave);        Bitmap resizedBitmap = Bitmap.createBitmap(myBitmap, 0, 0,                300, 143);        canvas.drawBitmap(resizedBitmap, 60, 50, null);        Paint myPaint = new Paint();        myPaint.setColor(Color.RED);        myPaint.setStyle(Paint.Style.STROKE);        myPaint.setStrokeWidth(5);        canvas.drawRect(250,255,260,250, myPaint);    }}</code></pre><p>}</p><p>THE XML FILE IS</p><p>                         </p>","357349","","","","","2010-08-07 03:38:57","main.xml hiding the view help","<android><android-emulator><android-ndk><android-manifest>","1","0","","",""
"3428469","1","3428482","","2010-08-06 23:23:54","2","1814","<p>I created a sqlite database to store playlists for a media player I am developing because of extended feature (rather than using the Content Provider). It works perfectly on the 1.6 emulator but FCs on anything higher than 2.0... what has changed that I need to know about as far as opening databases in SDK 2.0+? Here is the logcat.</p><blockquote>  <p>08-06 19:05:46.365: INFO/SQLiteDatabaseAdapter(4692): DB (playlists.db) copied!  08-06 19:05:46.373: INFO/SQLiteDatabaseAdapter(4692): Try to create instance of database (playlists.db)  08-06 19:05:46.373: INFO/SQLiteDatabaseAdapter(4692): Create or Open database : playlists.db  08-06 19:05:46.389: INFO/SQLiteDatabaseAdapter(4692): instance of database (playlists.db) created !  08-06 19:05:46.389: INFO/Database(4692): sqlite returned: error code = 1, msg = no such table: playlist  08-06 19:05:46.397: DEBUG/AndroidRuntime(4692): Shutting down VM  08-06 19:05:46.397: WARN/dalvikvm(4692): threadid=1: thread exiting with uncaught exception (group=0x4001d7e0)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692): FATAL EXCEPTION: main  08-06 19:05:46.514: ERROR/AndroidRuntime(4692): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androidworkz.andamp/com.androidworkz.andamp.andAMP}: android.database.sqlite.SQLiteException: no such table: playlist: , while compiling: SELECT playlist.* FROM playlist ORDER BY id ASC;  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.os.Handler.dispatchMessage(Handler.java:99)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.os.Looper.loop(Looper.java:123)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.app.ActivityThread.main(ActivityThread.java:4627)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at java.lang.reflect.Method.invokeNative(Native Method)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at java.lang.reflect.Method.invoke(Method.java:521)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at dalvik.system.NativeStart.main(Native Method)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692): Caused by: android.database.sqlite.SQLiteException: no such table: playlist: , while compiling: SELECT playlist.* FROM playlist ORDER BY id ASC;  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.database.sqlite.SQLiteCompiledSql.(SQLiteCompiledSql.java:64)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:80)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:46)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1315)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at com.androidworkz.andamp.objects.Playlist.getPlaylists(Playlist.java:75)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at com.androidworkz.andamp.andAMP.onCreate(andAMP.java:353)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)  08-06 19:05:46.514: ERROR/AndroidRuntime(4692):     ... 11 more</p></blockquote><p>Here is the dbhelper class</p><pre><code>package com.androidworkz.andamp;import android.content.Context;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteException;import android.database.sqlite.SQLiteOpenHelper;public class DBHelper extends SQLiteOpenHelper {// Android's default system path for your application's database.private static String DB_PATH = ""/data/data/com.androidworkz.andamp/databases/"";private static String DB_NAME = ""playlists.db"";public DBHelper(Context context) {    super(context, DB_NAME, null, 1);    if (!checkDataBaseExistence()) {        createDatabase();    }}public void onCreate(SQLiteDatabase db) {    // Leave this method empty}public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {    // fill in your code here}public void createDatabase() {    SQLiteDatabase db = null;    String dbPath = DB_PATH + DB_NAME;    db = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.CREATE_IF_NECESSARY);    db.close();    db = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.OPEN_READWRITE);    db.execSQL(""CREATE TABLE [playlist] (""+            ""[id] INTEGER  PRIMARY KEY AUTOINCREMENT NOT NULL,""+            ""[name] VARCHAR(255)  NULL);)"");    db.execSQL(""CREATE TABLE [songs] (""+            ""[id] INTEGER  PRIMARY KEY AUTOINCREMENT NOT NULL,""+            ""[playlistId] INTEGER  NULL,""+            ""[songId] INTEGER  NULL,""+            ""[name] VARCHAR(255)  NULL,""+            ""[key] VARCHAR(255)  NULL,""+            ""[duration] INTEGER  NULL,""+            ""[path] VARCHAR(255)  NULL,""+            ""[artistName] VARCHAR(255)  NULL,""+            ""[artistKey] VARCHAR(255)  NULL,""+            ""[albumId] INTEGER  NULL,""+            ""[albumName] VARCHAR(255)  NULL,""+            ""[albumKey] VARCHAR(255)  NULL);"");    db.close();}private boolean checkDataBaseExistence() {    // database to be verified    SQLiteDatabase dbToBeVerified = null;    try {        // get database path        String dbPath = DB_PATH + DB_NAME;        // try to open the database        dbToBeVerified = SQLiteDatabase.openDatabase(dbPath, null,                SQLiteDatabase.OPEN_READONLY);    } catch (SQLiteException e) {        // do nothing since the database does not exist    }    // in case it exists, close it    if (dbToBeVerified != null) {        // close DB        dbToBeVerified.close();    }    // in case there is a DB entity, the DB exists    return dbToBeVerified != null ? true : false;}}</code></pre><p>god I hate this stupid ""enter code here""... why can't stackoverflow just use tags like a normal syntax highlighter.</p>","386654","","12707","","2010-08-07 16:32:35","2010-08-10 01:25:20","SQLite problem - works perfect in the 1.6 emulator - won't work on the phone (2.2) or 2.0+ emulator","<android><sqlite>","2","0","","",""
"3428731","1","3429027","","2010-08-07 01:05:27","2","308","<p>In Android, what functionality do ListActivity and ListView provide beyond a regular Activity and View?</p>","65663","","65663","","2010-08-08 15:11:23","2010-08-08 15:11:23","What do ListActivity and ListView provide beyond a regular Activity and View?","<android>","2","0","1","",""
"3428773","1","3428943","","2010-08-07 01:22:07","2","1555","<p>When my notification goes off I want to restore the activity that was put into the background, not start a new activity. I've seen some answers about using FLAGS but I don't know how to implement it</p><pre><code>contentIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | INTENT.FLAG_ACTIVITY_SINGLE_TOP);</code></pre><p>Where do I put this in my code? I tried but it didn't work. Please help!</p><pre><code>        ns = Context.NOTIFICATION_SERVICE;        mNotificationManager = (NotificationManager) getSystemService(ns);        icon = R.drawable.icon;        tickerText = ""Short Msg"";        when = System.currentTimeMillis();        notification = new Notification(icon, tickerText, when);        context = getApplicationContext();        contentTitle = ""MyApp"";        contentText = ""Reopen App"";        notification.defaults |= Notification.DEFAULT_SOUND;        notification.defaults |= Notification.DEFAULT_VIBRATE;        notificationIntent = new Intent(this, StartTimer.class);        contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);        notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);</code></pre>","394093","","1292730","","2012-05-01 11:37:13","2013-03-22 16:35:24","How to restore previous activity by clicking on notification","<android><activity><notifications><restore><android-notification-bar>","2","0","","",""
"3428784","1","5754470","","2010-08-07 01:24:39","4","421","<p>I have a custom view I created that resides in a library I'm referencing in my app. In the library I declared a styleable, which the view uses. In my app, I'm using the custom view from the library as such:</p><pre><code>&lt;nefarious.library.myappname.views.DragDropList   xmlns:ddl=""http://schemas.android.com/apk/res/nefarious.library.myappname""android:id=""@id/android:list""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""   android:choiceMode=""singleChoice""   android:clickable=""true""    android:longClickable=""true""   android:focusable=""true""   android:hapticFeedbackEnabled=""true""    android:cacheColorHint=""#00000000""   ddl:normalHeight=""@dimen/list_item_height""   ddl:doubleHeight=""@dimen/list_item_height_doubled""   ddl:grabber=""@id/grabber""   ddl:grabberPadding=""30dip""   ddl:dragndropBackground=""@color/moola_light"" /&gt;</code></pre><p>Eclipse seems to be having a problem finding the stylable. Eclipse is telling me it couldn't find the resource identifier for every one of my stylable attributes.</p><p>How can I get my app to see the stylable from the library?</p><p>My question is exactly this one:</p><p><a href=""http://stackoverflow.com/questions/573581/specifying-android-project-dependencies-in-eclipse"">http://stackoverflow.com/questions/573581/specifying-android-project-dependencies-in-eclipse</a></p><p>Which appears to not have been answered.</p>","413414","","413414","","2010-08-07 01:44:41","2011-04-22 10:21:20","Android: How do I reference a stylable that resides in a library that my app references?","<android><reference>","1","0","","",""
"3428824","1","3429014","","2010-08-07 01:39:58","0","2449","<p>I am trying to make the images clickable so that when they are pressed it will send the user to another page or link.</p><p>How can I achive this? Currently each row in the <code>GridView</code> has 2 <code>Buttons</code>. How will it know which item in the <code>GridView</code> is clicked so that it performs a certain action, specific to the item that was clicked. </p><p>Thanks for any help!</p><p>This is in my image adapter class:</p><pre><code>// create a new ImageView for each item referenced by the Adapterpublic View getView(int position, View convertView, ViewGroup parent) {    ImageView imageView;    if (convertView == null) {  // if it's not recycled, initialize some attributes        imageView = new ImageView(mContext);        imageView.setAdjustViewBounds(true);       // imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);        imageView.setPadding(4, 8, 4, 8);    } else {        imageView = (ImageView) convertView;    }    imageView.setImageResource(mThumbIds[position]);    return imageView;}// references to our imagesprivate Integer[] mThumbIds = {        R.drawable.menu_about,R.drawable.menu_episodes  }; }</code></pre>","411224","","704374","","2012-08-21 06:09:30","2012-09-27 04:50:03","Android: In Gridview how do I make the images clickable","<android><image><gridview><android-image>","3","0","","",""
"3428842","1","3433173","","2010-08-07 01:48:20","1","1488","<p>Ive been trying to implement a limit to prevent the user from scaling the image too much in my multitouch zoom app. Problem is, when i set the max zoom level by dumping the matrix, the image starts to translate downward once the overall scale of the image hits my limit. I believe it is doing this because the matrix is still being affected by postScale(theScaleFactorX,theScaleFactorY,myMidpointX,myMidpointY) where theScaleFactorX/Y is the amount to multiply the overall scale of the image (so if the theScaleFatorX/Y is recorded as 1.12, and the image is at .60 of its origional size, the overall zoom is now .67). It seems like some sort of math is going on thats creating this translation, and was wondering if anyone knew what it was so i can prevent it from translating, and only allow the user to zoom back out.</p>","385051","","","","","2010-08-08 05:16:17","matrix help: how does postScale affect the translation part of a matrix?","<android><math><matrix>","1","0","0","",""
"3428865","1","","","2010-08-07 01:55:44","0","806","<p>I am trying to create intents that will be set using alarmmanager. Currently, I can do this with one intent, add extra data to it (strings, but i send them as one string with a seperator), and everything works fine and goes off at the correct time. However, when I try to send multiple intents like this, they are overwritten and only one goes off at the correct time. How can i structure my intents so that they appear different to the alarmmanager (i think they are getting deleted when filterIntent() is run).</p><p>long story short- putExtra() makes all the intents look the same still... how can i make them look different so they wont get deleted (and keep track of them in case i want to delete a specific one)</p>","413394","","","","","2010-08-07 12:12:38","android intents alarmmanager","<android><android-intent><alarmmanager>","2","0","","",""
"3428880","1","3428983","","2010-08-07 02:04:19","0","1348","<p>I'm trying to design an Android layout that would look like the following:</p><pre><code>Entity1option1 for Entity1option2...optionNEntity2option1 for Entity2...optionNEntity3...</code></pre><p>With the requirement that for each entity, one and only one option is allowed.</p><p>And I decided to use radio button with the intention of using RadioGroup to enforce that. I designed as follows to achieve the above: </p><pre><code>&lt;table layout&gt;    &lt;TextView, content = ""Entity1""/&gt;    &lt;TextView, content = ""option1 for Entity1""/&gt; &lt;RadioButton/&gt;    &lt;TextView, content = ""option2""&gt; &lt;RadioButton/&gt;   ...&lt;/table layout&gt;</code></pre><p>And the pseudo-code would be:</p><pre><code> RadioGroup raGroup = createEmptyRaGroup()    ...    row = new TableRow();     row.add(TextView-entity1);      row.add(TextView-op1ForEntity1);     RadioButtton raBtn = createRadioButton();     raGroup.addView(raBtn);     row.addView(raBtn);      ...</code></pre><p>And the problem I'm having is that I can't group the radio buttons under one RadioGroup so that only one option is selected. At run-time, Android complains that the radio button must be a direct child of the row. If I add the radio button to the row first, then adding the radio button to the radio group first would then throw a similar run-time error. </p><p>Can anyone advise me how to achieve the RadioGroup effect using the above design or otherwise? </p><p>Thanks guys. </p>","397455","","","","","2010-08-07 03:06:10","Android: How to design to achive the ""RadioGroup"" effect?","<android><radio-button><tablelayout>","1","0","","",""
"3428883","1","3429066","","2010-08-07 02:04:48","0","1425","<p>I want to send down a webpage from a server to WebView components on Android handsets.I've already learned how to enable the webpage to talk to the JavaScript handler, so the native application can interact with the webpage.I am, however, stuck on images.</p><p>I want the webpage that comes from a server to somehow tell the app which image (stored in either res or in assets) to load.  This way I don't have to send the image over the wire as well.  Is this doable?  It will make the process of loading WebView pages so much faster for my purposes.</p><p>Thanks!</p>","449670","","","","","2010-08-07 03:55:59","Loading images from res or assets when web page in webview loads from server","<android><image><webview>","1","0","1","",""
"3429225","1","","","2010-08-07 05:21:44","1","762","<p>we have a android application that works fine up to android 2.1, but when we try to  release it for android 2.2 we get a nullpointerexception. This happens when we're parsing a xml, on the following line of code:</p><pre><code>((node) getText.item(0).getNodeValue();</code></pre><p>help appreciated!</p>","314369","","877472","","2014-02-19 02:41:45","2014-02-19 02:41:45","Why nullpointerexception when parsing xml in android application?","<java><android><nullpointerexception>","2","0","1","",""
"3429248","1","","","2010-08-07 05:33:55","3","1820","<p>we got a requirement to record video from front and rear cameras simultaniously..In the Android 2.1 SDK we only have the MediaRecorder.VideoSource.CAMERA and DEFAULT, but not FRONT_CAMERA and REAR_CAMERA. So, is there any other way to record from Front camera.. like any third party API's.. thank you..</p>","365184","","243782","","2010-08-07 06:56:37","2010-08-17 07:17:23","How to record video from Front Facing Camera?","<android><video-capture>","1","0","","",""
"3429330","1","3429610","","2010-08-07 06:01:47","0","361","<p>Whilst trying to update through the Android AVD Manager, I receive the message:</p><p><em>""No suitable XML Schema Validator could be found in your Java environment""</em></p><p>It therefore can't parse the repository.xml and I can't download any updates.</p><p>How can I get rid of this error? I am guessing it might be caused by GIJ being the default Java implementation on my platform (Debian), however I have also installed the Sun JRE/JDK now.</p>","95481","","83664","","2010-08-07 06:20:44","2010-11-11 02:31:16","""No suitable XML Schema Validator could be found""","<java><android><linux>","3","0","","",""
"3429437","1","","","2010-08-07 06:41:32","2","3900","<p>I have to use  <code>java.awt.image</code> package for <code>BufferedImage</code> class in my android app, but I am not able to do this and does anyone knows that how to do this in Android or what's the equivalent class of <code>java.awt.Image</code> in Android?</p>","286919","","1627730","","2013-01-09 14:33:47","2013-01-09 14:33:47","How to use java.awt.image package in android app","<android><image>","1","0","1","",""
"3429512","1","","","2010-08-07 07:08:48","1","454","<p>Im using Android 2.1 Api</p><p>Hi all,</p><p>I need to add a String MIME type into existing contacts for storing a userdefined data apart from Phone numbers,email etc.Please help me how to add that Custom Field from my application.</p><p>I request with an example because I am a week old on Android please help me.</p>","413692","","","","","2010-12-30 12:22:25","Please help me in Contacts App on Android","<android>","1","0","1","",""
"3429533","1","3429570","","2010-08-07 07:17:21","0","1827","<p>I am attempting to get my app to open a settings menu screen and return. The problem I am having is when in the settings page, upon pressing the back button, the app closes. I am VERY new to programming in general after fighting this for about 8 hours I am ready to ask for help! </p><p>Here is the code I have written</p><p>`package com.bowersoftware.connecttozcu;</p><p>import android.app.Activity;import android.os.Bundle;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.widget.ArrayAdapter;import android.widget.Spinner;import android.widget.Toast;</p><p>public class ConnecttoZCU extends Activity {</p><pre><code>private Spinner mEngineSpinner;private Spinner mUnitsSpinner;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mEngineSpinner = (Spinner) findViewById(R.id.engineSpinner);    ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(            this, R.array.engine, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    mEngineSpinner.setAdapter(adapter);}private void ConnectSettings() {    setContentView(R.layout.settings);    mUnitsSpinner = (Spinner) findViewById(R.id.unitsSpinner);    ArrayAdapter&lt;CharSequence&gt; settingsadapter = ArrayAdapter.createFromResource(            this, R.array.units, android.R.layout.simple_spinner_item);    settingsadapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    mUnitsSpinner.setAdapter(settingsadapter);}@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.option_menu, menu);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    // Handle item selection    switch (item.getItemId()) {    case R.id.scan:        Toast.makeText(this, ""Scan"", Toast.LENGTH_LONG).show();        return true;    case R.id.settings:        Toast.makeText(this, ""Settings"", Toast.LENGTH_LONG).show();        ConnectSettings();        return true;    default:        return super.onOptionsItemSelected(item);    }}</code></pre><p>}`</p><p>I am sure it is something silly I am missing but just can't figure it out. </p><p>Thanks, Jason</p>","413695","","","","","2010-08-07 07:30:28","How to open options menu, change setting, and return - Android?","<android>","1","0","","",""
"3429546","1","3429643","","2010-08-07 07:22:51","16","13164","<p>I have a TextView and I want to add a bullet symbol in my text through XML. Is it possible?</p>","284372","","304151","","2014-03-09 11:36:10","2014-03-09 11:36:10","How do I add a bullet symbol in TextView?","<android><android-layout><special-characters><android-textview>","4","0","5","",""
"3429647","1","","","2010-08-07 07:57:24","1","101","<p>hi i am kid application  i am using uihandler display images using gallery and image view in gallery scrolling  one method running automatically apply handler another one onitem selection clicked event this two events are developing code my problem is at a time one event are fire how to implement </p><p>this on item selection event</p><p>g.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView parent, View v, final int position, long id)             {                // mRedrawHandler.handleMessage(new Message());<br>                isUpdateUI = false;                new Timer().schedule(new TimerTask()                 {                @Override                    public void run()                    {</p><pre><code>            try {                imageid=position;                ((ImageView)findViewById(R.id.ImageViewlarge)).setImageResource(mImageIds[position]);                ((TextView)findViewById(R.id.TextViewImageName)).setText(imgNames[position]);                    } catch (Exception e) {                            // TODO Auto-generated catch block                            e.printStackTrace();                        }                }                    },  2);             isUpdateUI = true;              mRedrawHandler.handleMessage(new Message());              }</code></pre><p>this code for update handler</p><pre><code>protected void onStart() {super.onStart();    imageid=getSharedPreferences(""ResultInfo"", 0).getInt(""Result"", 0);    Log.v(""Gallary"",""Imageid""+imageid);    isUpdateUI = true;    mRedrawHandler.handleMessage(new Message());} protected void onPause(){    super.onPause();    isUpdateUI = false;} class RefreshHandler extends Handler {    @Override    public void handleMessage(Message msg) {                    KidsSpell.this.updateUI();    }    public void sleep(long delayMillis) {        this.removeMessages(0);                 if(isUpdateUI)            sendMessageDelayed(obtainMessage(0), delayMillis);    }</code></pre><p>}public void updateUI(){    try    {           getImages();//rotation method        mRedrawHandler.sleep(2000);</p><pre><code>}catch (Exception e) {    e.printStackTrace();}</code></pre><p>gallery automatically scrolling every 2sec using handler its working fine problem is gallery items scrolling then stop handler then activity finish after continue the handler how can implemented  please some solution i am new in android its urgent</p>","254790","","","","","2010-08-07 07:57:24","how to implement uihandlers running one after one in android","<android>","0","1","1","",""
"3429775","1","","","2010-08-07 08:44:38","1","771","<p>I want to delete a particular SMS before going into inbox. Is it possible ??</p><p>I tried it using ..</p><pre><code>context.getContentResolver().delete(    Uri.parse(""content://sms//""),""address=? and body=?"", new String[{        currentMessage.getOriginatingAddress(), ""RECORD""    });</code></pre><p>it delete the SMS but not the current one rather the one which is coming from same address and having content = ""RECORD"".</p>","404052","","133203","","2010-08-07 09:13:02","2011-06-27 21:22:46","how to delete sms before going into Inbox in android?","<java><android>","0","1","1","",""
"3429785","1","3432680","","2010-08-07 08:49:33","1","927","<p>please excuse the crude photoshop job. but this image should show pretty succinctly what I'm trying to do:</p><p><img src=""http://www.efalk.org/buttons3.png"" alt=""buttons""></p><p>In a nutshell, I want the buttons evenly spaced along the height of my screen, and I'd like them to be all the same size.  Is there a reasonable way to do this?</p>","338479","","","","","2010-08-09 14:27:11","How can I create evenly-spaced buttons?","<android>","2","0","","",""
"3429829","1","3429922","","2010-08-07 09:03:31","0","901","<p>Hi guys suddenly I have no experience with java and html parsing and I really need it...(possibly from <a href=""http://www.uefa.com/teamsandplayers/teams/club=52280/domestic/index.html"" rel=""nofollow"">http://www.uefa.com/teamsandplayers/teams/club=52280/domestic/index.html</a>)</p><p>I want a simple way to convert an html website to xml document(fetch,convert,parse) or an easy alternative way to do it...</p><p>ps:if you know any alternative FREE resource of football(soccer) data tell it...</p>","413726","","","","","2010-08-07 09:36:20","android html data parsing","<html><android><xml><parsing><dom>","1","1","0","",""
"3429880","1","","","2010-08-07 09:21:43","2","2572","<p>I have implemented the search functionality using the android search dialog.to search multiple  columns of a table using LIKE query.But search became slow as I have written a query in such a way that every time the text of each field(like the sample fields title,description category etc.)  will be searched. title LIKE ""---""OR description LIKE ''---""OR.....category LIKE ""---""OR location LIKE""---""to.So is there any other way to speed up the functionality..</p><p>Regards,</p><p>vani</p>","342873","","","","","2010-12-07 05:28:04","Search functionality to search database tables in android","<android>","1","1","","",""
"3429887","1","3430003","","2010-08-07 09:23:49","4","682","<p>I use Eclipse for programming in PHP (PDT), Python and sometimes Android. Each of this programming languages requires to run many things after Eclipse start.</p><p>Of course I do not use all of them at one moment, I have different workspace for each of those. Is there any way, or recommendation, how to make Eclipse to run only neccessary tools when opening defined workspace?</p><p>e.g.:</p><blockquote>  <p>I choose <strong>/workspace/www/</strong>, so then only PDT tools will run</p>    <p>I choose <strong>/workspace/android/</strong>, so then only Android tools and buttons in toolbars will appears</p></blockquote><p>Do I have to manually remove all unneccessary things from each of the workspace? Or it is either possible to remove all?</p>","335717","","","","","2011-06-10 18:24:49","How to organize Eclipse - Workspace VS Programming languages","<python><android><eclipse><workspace><pdt>","2","2","2","",""
"3429898","1","3479948","","2010-08-07 09:27:20","4","1457","<p>I do some mobile browser testing in the Android web browser through the Android SDK in Linux and I have a couple of questions:</p><ol><li>Can I run an Android Virtual Device without the entire Android SDK?</li><li>Can I autostart the web browser when starting an Android Virtual Device/emulator?</li></ol>","114168","","","","","2010-08-17 21:18:21","Android SDK web browser","<linux><browser><android><android-emulator>","2","2","","",""
"3429927","1","","","2010-08-07 09:37:20","0","156","<p>i have implement gallery widget,i just wanted to provide an option to user, that he can download images from gallery.What to do in order to implement downloading options?And i do have imageID and imageName, which user selects.</p><p>Suggestions needed</p><p>regards</p>","1497488","","","","","2011-01-26 11:58:22","Gallery with option of saving image, android","<android>","1","0","","",""
"3429959","1","3470439","","2010-08-07 09:45:17","66","59800","<p>I am using the Android plugin for Eclipse, and when I try to run my program using a real device through the <em>Android Device Chooser</em>, my phone is not listed as a device. I have updated Eclipse, all of the Android packages, and the USB driver, but it still isn't showing up. My phone is running Android 2.1, which is also the target version listed in the Eclipse project.</p><p>Also it happens that the device shows up as an unknown target and the serial number as question marks as shown in the screenshot.</p><p><img src=""http://i.stack.imgur.com/9Zl6F.jpg"" alt=""Android Device Chooser""></p>","412168","","356895","","2012-12-02 13:22:36","2014-04-12 15:11:21","Why is Eclipse's Android Device Chooser not showing my Android device?","<android><eclipse><adb>","16","3","33","",""
"3430146","1","","","2010-08-07 10:56:57","1","364","<p>I'm pretty sure I saw a specific command for this, but I can't remember what it's called, which means I can't Google it!</p><p>If I have an image resource, e.g. R.drawable.myimage , which gets used in a Linearview more than once and I want to change the alpha on just a single occurrence of that image, (normally, changing the alpha changes all the occurrences of that image), what command do I use to 'unlink' the changes of that image.</p>","330770","","","","","2012-01-08 15:25:00","Android - using an image resource multiple times but changing alpha on only 1 instance","<android><image><bitmap><alpha>","2","0","","",""
"3430211","1","","","2010-08-07 11:20:48","1","986","<p>I have follow the step mentioned in <a href=""http://code.google.com/p/fbconnect-android/wiki/Setup"" rel=""nofollow"">http://code.google.com/p/fbconnect-android/wiki/Setup</a></p><p>But it is giving error on project build </p><pre><code>UNEXPECTED TOP-LEVEL EXCEPTION:java.lang.IllegalArgumentException: already added: Lcom/codecarpet/fbconnect/FBLoginDialog$FBRequestDelegateImpl;[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.dx.dex.file.DexFile.add(DexFile.java:143)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.dx.command.dexer.Main.processClass(Main.java:299)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.dx.command.dexer.Main.access$100(Main.java:56)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.dx.command.dexer.Main.processOne(Main.java:245)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.dx.command.dexer.Main.run(Main.java:139)[2010-08-07 16:46:13 - fbconnect-sample]    at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)[2010-08-07 16:46:13 - fbconnect-sample]    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[2010-08-07 16:46:13 - fbconnect-sample]    at java.lang.reflect.Method.invoke(Method.java:616)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.ide.eclipse.adt.internal.sdk.DexWrapper.run(Unknown Source)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.ide.eclipse.adt.internal.build.ApkBuilder.executeDx(Unknown Source)[2010-08-07 16:46:13 - fbconnect-sample]    at com.android.ide.eclipse.adt.internal.build.ApkBuilder.build(Unknown Source)[2010-08-07 16:46:13 - fbconnect-sample]    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)[2010-08-07 16:46:13 - fbconnect-sample]    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)[2010-08-07 16:46:13 - fbconnect-sample]    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)[2010-08-07 16:46:13 - fbconnect-sample]    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)[2010-08-07 16:46:13 - fbconnect-sample]    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)[2010-08-07 16:46:13 - fbconnect-sample]    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)[2010-08-07 16:46:13 - fbconnect-sample]    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)[2010-08-07 16:46:13 - fbconnect-sample]    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)[2010-08-07 16:46:13 - fbconnect-sample]    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)[2010-08-07 16:46:13 - fbconnect-sample]    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)[2010-08-07 16:46:13 - fbconnect-sample]    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)[2010-08-07 16:46:13 - fbconnect-sample]    at     org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)[2010-08-07 16:46:13 - fbconnect-sample] 40 errors; aborting[2010-08-07 16:46:13 - fbconnect-sample] Conversion to Dalvik format failed with error 1</code></pre>","413788","","243709","","2011-02-15 08:02:06","2011-09-13 05:45:01","FBconnect is not working in android :(","<android><facebook><fbconnect>","1","5","","",""
"3430255","1","","","2010-08-07 11:32:24","2","290","<p>I want to create app on which user can not open sms when he is driving car(mean by checking accelerometer on particular  speed of android device).Is it possible in android and if yes then how we can do that.Thanks..Nishant Jain</p>","413791","","","","","2010-08-08 11:52:53","How to disable sms on particular speed(acclerometer) in android","<android>","1","3","","",""
"3430368","1","","","2010-08-07 12:15:57","3","1715","<p>As the title says I wonder how I can make my images to perspective view. Here's an image showing how they manage to do this in photoshop:</p><p><a href=""http://netlumination.com/blog/creating-perspective-and-a-mirror-image-in-photoshop"" rel=""nofollow"">http://netlumination.com/blog/creating-perspective-and-a-mirror-image-in-photoshop</a></p><p>Is it possible to do something like this in android?</p>","413818","","396458","","2010-08-07 12:52:52","2012-03-27 19:18:58","Make an Image In Perspective","<java><android>","2","0","1","",""
"3430392","1","","","2010-08-07 12:23:52","1","649","<p>I would like to know if it's possible to update a third party application without user action.</p><p>By 3rd party, I mean an application not located on the Android Market but rather on a specific website.</p><p>Thx</p><p>John</p>","413822","","413822","","2010-08-07 12:29:12","2011-02-21 08:34:49","How to update 3rd party Android application without user action?","<android>","1","1","","",""
"3430472","1","","","2010-08-07 12:42:46","1","6023","<p>I did upload a text file from C drive to server using java code..I included the same code in android and executed. But i am unable to upload the file.</p><p>I am getting these warnings in catlog:</p><pre><code>&gt;08-07 17:39:12.360: WARN/System.err(32030): java.io.IOException: Unable to connect to server: Unable to retrieve file: 550&gt;08-07 17:39:12.391: WARN/System.err(32030):     at org.apache.harmony.luni.internal.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:203)&gt;08-07 17:39:12.401: WARN/System.err(32030):     at org.apache.harmony.luni.internal.net.www.protocol.ftp.FtpURLConnection.getOutputStream(FtpURLConnection.java:344)&gt;08-07 17:39:12.411: WARN/System.err(32030):     at f.t.p.Upload.upload_file(Upload.java:26)&gt;08-07 17:39:12.431: WARN/System.err(32030):     at f.t.p.FTP.onCreate(FTP.java:24)&gt;08-07 17:39:12.445: WARN/System.err(32030):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)&gt;08-07 17:39:12.450: WARN/System.err(32030):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)&gt;08-07 17:39:12.460: WARN/System.err(32030):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)&gt;08-07 17:39:12.460: WARN/System.err(32030):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)&gt;08-07 17:39:12.510: WARN/System.err(32030):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)&gt;08-07 17:39:12.520: WARN/System.err(32030):     at android.os.Handler.dispatchMessage(Handler.java:99)&gt;08-07 17:39:12.530: WARN/System.err(32030):     at android.os.Looper.loop(Looper.java:123)&gt;08-07 17:39:12.530: WARN/System.err(32030):     at android.app.ActivityThread.main(ActivityThread.java:4363)&gt;08-07 17:39:12.530: WARN/System.err(32030):     at java.lang.reflect.Method.invokeNative(Native Method)&gt;08-07 17:39:12.540: WARN/System.err(32030):     at java.lang.reflect.Method.invoke(Method.java:521)&gt;08-07 17:39:12.551: WARN/System.err(32030):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)&gt;08-07 17:39:12.571: WARN/System.err(32030):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)&gt;08-07 17:39:12.580: WARN/System.err(32030):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I changed the FileInputStream to /sdcard/test.txt and given .INTERNET, .WRITE_EXTERNAL_STORAGE permissions in AndroidManifest.xml</p><blockquote>  <p>used: <a href=""ftp://user:pass@www.site.com/test.txt;type=i"" rel=""nofollow"">ftp://user:pass@www.site.com/test.txt;type=i</a>"" as a url to connect.</p></blockquote><p>I do not understand why the code does not work in android while it worked in Java. Do I need to add any extra code for android?</p><p>Please help me... Thank you... :)</p><p>Here is the code..</p><pre><code>public class Upload {    public static void upload_file() throws MalformedURLException, IOException{         BufferedInputStream bis = null;         BufferedOutputStream  bos = null;         try         {            URL url = new URL(""ftp://user:pass@www.site.com/test.txt;type=i"");            URLConnection urlc = url.openConnection();            System.out.println(""COnnection established:"");                bos = (BufferedOutputStream) urlc.getOutputStream();                 bis = new BufferedInputStream(new FileInputStream(""/sdcard/test.txt""));                  byte[] readData = new byte[1024];                  int length;                  while((length=bis.read(readData))&gt;0) {                    bos.write(readData);                  }                  bis.close();                  bos.flush();                  bos.close();         }catch(IllegalStateException ise){  System.out.println(""Illegal state exception for setUseCaches..""); }         finally         {            if (bis != null)               try{                  bis.close();                  System.out.println(""closed bis"");               }               catch (IOException ioe){}            if (bos != null)               try{                  bos.close();                  System.out.println(""closed bos"");               }catch (IOException ioe){                                       System.out.println(""Exception, not finally.."");               }         }      }}</code></pre>","365184","","365184","","2010-08-09 13:40:58","2012-12-08 09:25:48","Uploading files to server in Android","<android><file-upload>","3","1","","",""
"3430675","1","3481695","","2010-08-07 13:55:53","1","1410","<p>Is there a way to use a custom row for the ListPreference in the Android preference screen?</p><p>Currently I populate the ListPreference like this, but I need more info (description) shown in the List </p><pre><code>int count = items.size();CharSequence[] entries = new CharSequence[count];CharSequence[] entryValues = new CharSequence[count];for (int i = 0; i &lt; count; i++) {    entries[i] = items.get(i).toString();    entryValues[i] = String.valueOf(i);}langPref.setEntries(entries);langPref.setEntryValues(entryValues);</code></pre>","172861","","","","","2012-09-05 06:46:31","Android Customize Row in ListPreference","<android><listpreference>","2","0","1","",""
"3430710","1","3430726","","2010-08-07 14:08:28","15","6213","<p>I've been programming Android in Eclipse for about a year now and I have always launched my app by right clicking on my project name in the project explorer, followed by ""run as"", then ""Android Application"". There has to be a better way... </p><p>Is there a way to change this (three mouse clicks): </p><p><code>""Right click on project"" -&gt; ""run as"" -&gt; ""Android Application""</code></p><p>To this (one hotkey press): </p><p><code>&lt;My favorite hotkey&gt;</code></p><p>So I can just press one button to launch my app? </p><p>Thanks!</p>","268803","","","","","2014-01-23 15:10:53","Add application launch shortcut in Eclipse?","<android><eclipse><hotkeys>","7","0","3","",""
"3430764","1","","","2010-08-07 14:21:10","0","655","<p>I designed a widget and successful using ""setOnClickPendingIntent"" to active the click event, but I want to start other application witch is install in my Android phone (such as Google Map), how can I using in this following command?</p><p>if (intent.getAction().equals(ACTION_WIDGET_CLICK)) {   ....}</p><p>Beside that, My widget is a clock widget, I want to click a button to start the ""system clock page"" and click the date to the system Calendar. How can I make it? many thanks!</p>","413865","","33624","","2010-08-07 14:26:42","2010-08-08 06:18:53","How to start others application in Widgets click event?","<android><widget>","1","0","","",""
"3430797","1","","","2010-08-07 14:31:43","1","257","<p>doing some tests with my ADP1 (version 1.6) I noticed that the maximum ping that I can send when it's connected with wifi (ad.hoc or with a router) is of 57740 bytes, shouldn't be 64K? I think it's related with the receiving buffer, do somebody know how to modify it or how to get information about it?</p>","356921","","356921","","2010-08-07 14:38:39","2011-07-06 12:22:10","Android max ping size less than 64K","<android><networking><size><buffer><android-wifi>","1","0","","",""
"3430824","1","3431012","","2010-08-07 14:45:00","0","2520","<p>I am very new to android development and have been trying to draw a square comprised of multiple smaller rectangles of different colours... Like a Mosaic essentially. </p><p>Basically at the moment I am reading values from a file which assigns the colour to the smaller Rects. I am using a pair of nested for loops to try to draw the small Rects sequentially, line by line. However when the program finishes there is only one small Rect drawn which is the last one to be drawn and its colour corresponds to the first value read from the file.</p><p>Here is some of my code to show you what I mean:</p><pre><code>public SnapshotDraw(Context context) {    super(context);    for(int a = 0; a &lt; 63; a++){        for(int b = 0; b &lt; 63; b++){            fileName = PREFIX + ""2"" + EXTENSION;            try {                bf = new BufferedReader(new FileReader(fileName));                tokens = new StringTokenizer(bf.readLine(), "" \n"");                weight = Byte.parseByte(tokens.nextToken());                x_scalar = b*MAG;                y_scalar = a*MAG;                   mDrawable = new ShapeDrawable(new RectShape());                mDrawable.getPaint().setColor(colour.getColour(weight));                mDrawable.setBounds((X_OFFSET + x_scalar), (Y_OFFSET + y_scalar), ((MAG + X_OFFSET) + x_scalar), ((MAG + Y_OFFSET) + y_scalar));            } catch (FileNotFoundException ex) {                Logger.getLogger(NetworkUtilities.class.getName()).log(Level.SEVERE, null, ex);            } catch (IOException ex) {                Logger.getLogger(NetworkUtilities.class.getName()).log(Level.SEVERE, null, ex);            }        }    }}protected void onDraw(Canvas canvas) {    mDrawable.draw(canvas);}</code></pre><p>This except is from a class which extends View and is called inside an <code>onCreate()</code> method in an Activity.</p><p>I would appreciate any guidance in this and thanks in advance!!</p><p>Cheers.</p>","413872","","309308","","2010-08-07 15:44:42","2011-04-29 05:05:34","Draw multiple shapes using loop - Android Canvas","<java><android><graphics>","2","1","","",""
"3430852","1","","","2010-08-07 14:55:36","3","1736","<p>i recently customized the UI of my tabs by setting a backgroundResource on each tab, then switch between selected / unselected depending on which tab is currently in focus. I got one problem though, there seems to be a white border that comes with the tabwidget by default that stretches over to the other (unselected) tabs at the bottom. I wanna change the color or possibly remove it. Is there anyway of doing that ?</p><p>//thx in advance for replies</p>","413808","","","","","2011-01-25 10:57:22","change or possibly remove the tab border on tabwidget","<android><android-sdk-2.1>","0","7","","",""
"3430901","1","","","2010-08-07 15:14:57","1","794","<p>i overlapped opengl view and camera preview, and it shows everything at fresh start.</p><p>but after backed from child activity (after onResume()) opengl objects not appeared anymore.</p><p>i found some discussion about this weird problem, but i can't use following solution, because i should call child - map activity.</p><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/fe7c0755c2c05a5c"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/fe7c0755c2c05a5c</a></p>","308748","","44729","","2010-08-08 01:19:11","2010-08-08 01:19:11","android opengl view (with camera preview) is not visible after activity resumed","<android><opengl-es><activity><camera><overlap>","0","1","1","",""
"3430987","1","3431028","","2010-08-07 15:38:13","0","3785","<p>I am reading a few thousand items out of a database in my Android app and want to show a loading dialog,  start a thread and read the database then close the dialog and then populate a listview with the data. I cant seem to figure this out. </p><p>I have the dialog pop up and disappear but I don't know how to populate the listview after the thread is done. </p><p>Any ideas?</p>","282475","","","","","2010-08-07 15:52:32","Android Show a dialog until a thread is done and then continue with the program","<android><multithreading><listview>","1","0","","",""
"3430990","1","3431147","","2010-08-07 15:39:01","1","965","<p>When using this class I get this strange exception. It is used to print out a nice timer display for my game, and is created when my main GameView class is created. The error gets thrown at line 26: super(s*1000,1000);</p><pre><code>package tommedley.android.game;import android.content.Context;import android.graphics.Canvas;import android.graphics.drawable.Drawable;import android.os.CountDownTimer;public class Timer extends CountDownTimer{    public static int MODE_COUNTING = 0;    public static int MODE_PAUSED = 1;    public static int MODE_FINISHED = 2;    private Canvas canvas;    private Context context;    private float xPos;    private float yPos;    private static int DIGIT_WIDTH = 50;    private static int DIGIT_HEIGHT = 70;    private int numDigits = 3;    private int seconds;    Drawable[] digitImgs;    private int mode;    public Timer(Canvas c, Context con, float x, float y, int digits, int s){        super(s*1000, 1000);        mode = MODE_COUNTING;        canvas = c;        context = con;        xPos = x;        yPos = y;        seconds = s;        numDigits = digits;        digitImgs = new Drawable[numDigits];        this.start();    }    public void draw(){        String reprNum = String.format(""%0""+numDigits+""d"", seconds);        for(int i = 0;i&lt;numDigits;i++){            switch(reprNum.charAt(i)){            case '0':                digitImgs[i] = context.getResources().getDrawable(R.drawable.digit_0);                break;            case '1':                digitImgs[i] = context.getResources().getDrawable(R.drawable.digit_1);                break;            case '2':                digitImgs[i] = context.getResources().getDrawable(R.drawable.digit_2);                break;            case '3':                digitImgs[i] = context.getResources().getDrawable(R.drawable.digit_3);                break;            case '4':                digitImgs[i] = context.getResources().getDrawable(R.drawable.digit_4);                break;            case '5':                digitImgs[i] = context.getResources().getDrawable(R.drawable.digit_5);                break;            case '6':                digitImgs[i] = context.getResources().getDrawable(R.drawable.digit_6);                break;            case '7':                digitImgs[i] = context.getResources().getDrawable(R.drawable.digit_7);                break;            case '8':                digitImgs[i] = context.getResources().getDrawable(R.drawable.digit_8);                break;            case '9':                digitImgs[i] = context.getResources().getDrawable(R.drawable.digit_9);                break;            }            digitImgs[i].setBounds((int)xPos+DIGIT_WIDTH*i, (int)yPos, (int)xPos+DIGIT_WIDTH*(i+1), (int)yPos+DIGIT_HEIGHT);            digitImgs[i].draw(canvas);        }    }    @Override    public void onFinish() {        seconds = 0;        mode = MODE_FINISHED;    }    @Override    public void onTick(long millsLeft) {        seconds = (int)millsLeft / 1000;    }    public int getMode(){        return mode;    }}</code></pre>","319618","","","","","2010-08-07 16:23:10","Why do I get a ""Can't create handler inside a thread that has not called Looper.prepare()"" with android.os.CountDownTimer?","<java><android>","1","0","","",""
"3431105","1","","","2010-08-07 16:13:32","2","1144","<p>Has anybody used jodatime with android? I'm getting a force close with no trace. </p><pre><code>package test.journal.help;import java.util.Date;import org.joda.time.DateTime;import org.joda.time.Days;import android.app.Activity;import android.os.Bundle;public class journaltester extends Activity {    /** Called when the activity is first created. */    private Date today = new Date();    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);      Days days = Days.daysBetween(new DateTime(today), new DateTime(today));        setContentView(R.layout.main);    }}</code></pre><p>Value of today : ""Sat Aug 07 00:00:00 America/New_York 2010""</p><p>alright making some progress... getting a stackoverflow error at org.joda.time.DateTimeZone.getDefault() according to kiwidoc this is caused if zone is null.</p><pre><code> public static DateTimeZone getDefault() {    DateTimeZone zone = cDefault;    if (zone == null) {        synchronized(DateTimeZone.class) {            zone = cDefault;            if (zone == null) {                DateTimeZone temp = null;                try {                    try {                        temp = forID(System.getProperty(""user.timezone""));                    } catch (RuntimeException ex) {                        // ignored                    }                    if (temp == null) {                        temp = forTimeZone(TimeZone.getDefault());                    }                } catch (IllegalArgumentException ex) {                    // ignored                }                if (temp == null) {                    temp = UTC;                }                cDefault = zone = temp;            }        } //LINE 147    }    return zone;}</code></pre><p>Heres the stack:</p><pre><code>Thread [&lt;3&gt; main] (Suspended (exception StackOverflowError))    DateTimeZone.getDefault() line: 147 ISOChronology.getInstance() line: 86    DateTimeUtils.getChronology(Chronology) line: 231   DateConverter(AbstractConverter).getChronology(Object, Chronology) line: 82 DateTime(BaseDateTime).&lt;init&gt;(Object, Chronology) line: 170 DateTime.&lt;init&gt;(Object) line: 168   PlantsCursorAdapter.newView(Context, Cursor, ViewGroup) line: 71    PlantsCursorAdapter(CursorAdapter).getView(int, View, ViewGroup) line: 182  </code></pre>","393328","","393328","","2010-08-10 00:26:59","2010-09-07 09:36:40","Android force close with JodaTime","<java><android><jodatime>","1","2","1","",""
"3431145","1","3433364","","2010-08-07 16:23:04","2","1053","<p>I have some text encoded in ISO-8859-1 which I then extract some data from using Regex.</p><p>The problem is that the strings I get from the matcher object is in the wrong format, scrambling chars like ""ÅÄÖ"".</p><p>How do I stop the regex library from scrambling my chars?</p><p>Edit: Here's some code:</p><pre><code>private HttpResponse sendGetRequest(String url) throws ClientProtocolException, IOException{    HttpGet get = new HttpGet(url);    return hclient.execute(get);}private static String getResponseBody(HttpResponse response) throws IllegalStateException, IOException{    InputStream input = response.getEntity().getContent();    StringBuilder builder = new StringBuilder();    int read;    byte[] tmp = new byte[1024];    while ((read = input.read(tmp))!=-1)    {        builder.append(new String(tmp), 0,read-1);    }    return builder.toString();}HttpResponse response = sendGetRequest(url);String html = getResponseBody(response);Matcher matcher = forum_pattern.matcher(html);while(matcher.find()) // do stuff</code></pre>","242348","","242348","","2010-08-08 01:10:19","2010-08-08 06:46:04","Regex and ISO-8859-1 charset in java","<java><android><regex><character-encoding>","2","6","1","",""
"3431302","1","","","2010-08-07 17:08:30","2","13595","<p>Alright, so I've got this OpenGL tutorial I'm basing from, my current code is equivalent to Part II of it, which is here:<a href=""http://blog.jayway.com/2009/12/04/opengl-es-tutorial-for-android-%E2%80%93-part-ii-building-a-polygon/"" rel=""nofollow"">http://blog.jayway.com/2009/12/04/opengl-es-tutorial-for-android-%E2%80%93-part-ii-building-a-polygon/</a></p><p>The code for that can be downloaded near the bottom of the page.  It leaves you with a white square, and I want to apply a texture to it, which this tutorial series doesn't cover.  I can't figure out how to texture my white square, in Android.</p>","369990","","369990","","2010-08-08 06:31:58","2013-05-28 19:03:56","Texturing a square in OpenGL ES on Android","<android><opengl-es><textures>","3","0","2","",""
"3431321","1","3431612","","2010-08-07 17:13:04","1","1522","<p>I am trying to mimic buttons (Apps, Games, Downloads) as seen in Android Market application</p><p><img src=""http://i33.tinypic.com/2vumyb9.png"" alt=""alt text""></p><p>Checking the configuration of TabWidget, I think it's not possible to create this simple design with it. I decided to use simple buttons and try to create custom design following <a href=""http://stackoverflow.com/questions/1521640/standard-android-button-with-a-different-color"">answer to similar question</a>. But still I cannot clone the design (gradient, divider, bottom line etc). </p><p>Are there any provided details how Google Android applications are built?</p>","73010","","","","","2010-08-07 20:27:41","Creating Android Market tab buttons","<android>","2","3","2","",""
"3431351","1","3431836","","2010-08-07 17:22:58","19","8656","<p>I am experimenting with using a WebView to display Flash content inside my activity. Everything is working pretty well, but when the user hits the home key to put the activity into the background, the Flash content keeps running (sound keeps playing, etc)</p><p>I have noticed that both the stock Android browser and Dolphin Browser seem to avoid this problem, and properly pause the Flash content when the browsing activity is put into the background.</p><p>Ideally I would like a solution that kills the WebView completely if the activity is finishing, but pauses it otherwise (basically copying the default behavior of the browser)</p><p>Here is a simple test I put together that loads a game on Kongregate which has some background music:</p><pre><code>    public class BrowserTest extends Activity {    private WebView mWebView;        @Override        protected void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            mWebView = new WebView(this);            mWebView.getSettings().setJavaScriptEnabled(true);            mWebView.getSettings().setPluginsEnabled(true);            mWebView.loadUrl(""http://m.kongregate.com/games/Jiggmin/the-game-of-disorientation-mobile"");            setContentView(mWebView);        }        @Override        protected void onPause(){            super.onPause();            mWebView.pauseTimers();            if(isFinishing()){                mWebView.loadUrl(""about:blank"");                setContentView(new FrameLayout(this));            }        }        @Override        protected void onResume(){            super.onResume();            mWebView.resumeTimers();        }    }</code></pre><p>I took a look at the latest source for the stock browser, and it seems to be doing something similar (calling pauseTimers/resumeTimers), although I fear the code I have been looking at is out of date, because it is calling functions that don't seem to exist anymore.</p><p>I did verify that the call to pauseTimers is working by testing with a simple JavaScript setInterval which updates a counter. Is there something else obvious that I should be trying in regard to Window or View management?</p><p>The documentation for the mobile Flash player says:</p><blockquote>  <p>Flash Player will also automatically pause SWF playback it is not in view or the foreground application, for example when a call is received or alarm goes off, to reduce CPU utilization, battery usage and memory usage.</p></blockquote><p>This seems to be working perfectly in both the stock browser and Dolphin Browser, but not in my app. Any ideas/solutions would be greatly appreciated!</p><p><strong>Update:</strong> Here is the function we ended up adding to our activity to get this to work. We call it with ""onPause"" in the activity's onPause function and ""onResume"" in the activity's onResume function:</p><pre><code>private void callHiddenWebViewMethod(String name){    if( mWebView != null ){        try {            Method method = WebView.class.getMethod(name);            method.invoke(mWebView);        } catch (NoSuchMethodException e) {            Log.error(""No such method: "" + name, e);        } catch (IllegalAccessException e) {            Log.error(""Illegal Access: "" + name, e);        } catch (InvocationTargetException e) {            Log.error(""Invocation Target Exception: "" + name, e);        }    }}</code></pre>","413903","","413903","","2010-10-15 23:06:32","2012-01-10 17:11:19","How do I pause Flash content in an Android WebView when my activity isn't visible?","<android><android-webview><android-sdk-2.2>","2","2","9","",""
"3431352","1","3431662","","2010-08-07 17:23:07","6","1630","<p>What concepts in desktop application development (e.g. Java, WPF, Cocoa) are closest to Android's fundamental concepts like Activity, ActivityGroup, and Intent? (And what are the nuances to how they differ?)</p>","65663","","","","","2010-08-07 19:00:33","Understanding Android concepts through desktop development perspective","<android>","3","0","4","",""
"3431456","1","","","2010-08-07 17:56:39","0","841","<p>I have just started with Android development, and facing one issue in the android application.</p><p>When application tries to read the data from file (raw resources), it throws IOException on readLine() function. code is as below:</p><pre><code>final Resources resources = m_ApplicationContext.getResources();InputStream inputStream = resources.openRawResource(R.raw.datafile);BufferedReader reader = new BufferedReader(new InputStreamReader(   inputStream));try { String line; while ((line = reader.readLine()) != null) {</code></pre><p>the reader.readLine() function is throwing the exception. Do I need to mention any kind of additional permission for reading the file ?</p><p>Thanks in advance.</p>","413966","","150771","","2010-08-07 17:58:35","2010-11-06 11:36:28","IOException in Android application","<android><inputstream><readline><bufferedreader>","1","6","","",""
"3431532","1","3432016","","2010-08-07 18:22:13","1","391","<p>Is it possible to programatically push a file into the SD card of an Android device over the network? How can this be done?</p>","143378","","143378","","2010-08-07 20:35:54","2012-02-23 02:31:34","Push file into Android device","<android><file-download><push>","2","3","","",""
"3431568","1","","","2010-08-07 18:33:15","2","573","<p>In AirplaneModEnabler.java present in ..\packages\apps\Settings\src\com\android\settings, the handler looks for EVENT_SERVICE_STATE_CHANGED to toggle the state of the checkbox and to display the summary.</p><p>When and from where is EVENT_SERVICE_STATE_CHANGED triggered? Currently the airplane mode functionality is very weird. I need to debug from the point where this event is triggered.</p><p>Any help is greatly appreciated. Thanks in advance.</p><p>-Webgenius</p>","308131","","","","","2010-08-07 18:33:15","Airplane mode in Android","<android>","0","0","1","",""
"3431684","1","","","2010-08-07 19:06:08","0","29","<p>Friends,  I need to fetch data from SQlite Db and set it on List View,it fetches data has well but the view showing on screen being empty,anybody help me to get the content to visible.</p>","407506","","","","","2010-09-09 17:54:48","Need help on setting value fetched from db to list","<android>","1","0","","",""
"3431907","1","3628687","","2010-08-07 20:22:50","0","600","<p>I've read several example programs and tutorials to try and solve my problem but they all seem to go the same way.  I've used a couple Activities and xml documents to create a menu that loads when my game starts.  When the user clicks the ""Start The Game"" button, it loads a new Activity that sets the view with my game thread and all of the game properties.  I know this activity works because I've run it alone as its own project, but every way I've tried to start it after the Menu, I get a nullPointerException and it force closes.  I read the SurfaceViewOverlay tutorial and attempted to use that implementation, but I'm using a SurfaceView, not a GLSurfaceView.  I'm debating rewriting my entire program to use OpenGL but I figured I would see if anyone else knows what I'm doing wrong here.  If you need the code snippets I can paste some here, but it's not really the specific code that's wrong, I think it's the way I'm using(abusing) the language...</p><p>Thanks for any help,Aaron</p>","394991","","","","","2010-09-02 15:33:47","Possible to start a SurfaceView with a Game Thread anytime other than at startup of the program?","<android><surfaceview>","1","0","","",""
"3431910","1","3433005","","2010-08-07 20:23:29","5","1743","<p>I understand, at least on paper, the basic difference between the Content Provider and just directly accessing the SQLiteDatabase.  I have a functioning prototype for my application, and currently it is just directly hitting the database.  I don't really have any experience using the Content Provider pattern, but I have found out that I will need to share some data with another application.</p><p>I will only be sharing about 2 out of a dozen or so tables, so I was wondering if I should be just completely redoing the data layer to follow the Content Provider pattern, or just expose only those tables via a Content Provider for the sake of the other application and still directly access the database in the primary application.</p><p>One of the issues I ran into with my prototype was that I have some fairly complex transactions, and the code I wrote to get that working is not designed particularly well and isn't reusable at all.  As I add more functionality to this app, I'm going to need a better designed data access layer, before I set off writing my own, does anyone know of any good resources with design patterns for this type of thing already?  Also, if I need to go the Content Provider route, am I going to have solid control over the database transactions?</p>","382437","","","","","2010-08-08 03:55:22","Content Provider vs Direct Database Access (Transaction Management)","<android>","2","0","2","",""
"3432018","1","3432277","","2010-08-07 20:59:44","0","422","<p>I'm parsing large XML document using pull parser (<code>org.xmlpull.v1.XmlPullParser</code>). When I reach specific node I want to grab it and all its children as chunk of text (or just children is OK too) and save as String. What would be efficient way of achieving this? Anything better than (in essence) <code>buffer.append('&lt;').append(xpp.getName()).append('&gt;')</code>?</p><p>Here's an example</p><pre><code>&lt;root id=""root""&gt;    &lt;node&gt;      &lt;grab-all-inside&gt;          &lt;!-- bunch of nodes, attributes etc. that needs to be saved as text --&gt;      &lt;/grab-all-inside&gt;    &lt;/node&gt;    &lt;node&gt;      &lt;grab-all-inside&gt;          &lt;!-- bunch of nodes, attributes etc. that needs to be saved as text --&gt;      &lt;/grab-all-inside&gt;    &lt;/node&gt;    &lt;node&gt;      &lt;grab-all-inside&gt;          &lt;!-- bunch of nodes, attributes etc. that needs to be saved as text --&gt;      &lt;/grab-all-inside&gt;    &lt;/node&gt;&lt;/root&gt;</code></pre><p>P.S. If you think I'm better off using some other parser or technique I'm open for suggestions. Just as a side note - these text chunks will be serialized to db with premise that at some point these will be extracted and parsed  </p>","135946","","135946","","2010-08-08 03:52:41","2010-08-08 03:52:41","Android XML - saving text chunks during pull parsing","<android><xml><xmlpullparser>","1","0","","",""
"3432057","1","3435870","","2010-08-07 21:11:40","0","219","<p>I've read several example programs and tutorials to try and solve my problem but they all seem to go the same way.  I've used a couple Activities and xml documents to create a menu that loads when my game starts.  When the user clicks the ""Start The Game"" button, it loads a new Activity that sets the view with my game thread and all of the game properties.  I know this activity works because I've run it alone as its own project, but every way I've tried to start it after the Menu, I get a nullPointerException and it force closes.  I read the SurfaceViewOverlay tutorial and attempted to use that implementation, but I'm using a SurfaceView, not a GLSurfaceView.  I'm debating rewriting my entire program to use OpenGL but I figured I would see if anyone else knows what I'm doing wrong here.  If you need the code snippets I can paste some here, but it's not really the specific code that's wrong, I think it's the way I'm using(abusing) the language...</p><p>Thanks for any help,Aaron</p>","394991","","","","","2010-08-08 20:03:14","Possible to start a SurfaceView with a Game Thread anytime other than at startup of the program?","<android><surfaceview>","1","0","","",""
"3432078","1","","","2010-08-07 21:19:50","0","2304","<p>When trying to build the ""Hello World"" in Eclipse i keep getting this error:</p><p>ddms]Failed to initialize Monitor Thread: Unable to establish loopback connection</p><p>The emulator pops up some time after the error but without the ""hello world""-program.</p><p>I've tried the adb kill-server stuff, turned off all firewalls, yet i still keep getting the same error.</p><p>Running Win 7 64, Eclipse 3.5.</p><p>Any suggestions?</p>","414049","","","","","2011-08-30 19:06:14","Problem running Android ""Hello World"", Eclipse 3.5, Win 7","<android><eclipse><windows-7>","0","2","","",""
"3432153","1","","","2010-08-07 21:44:17","0","282","<p>I'm developing an Android game using Windows 7 64 bit. My Android device is a Samsung Vibrant running version 2.1.</p><p>I installed the USB driver software on my machine using SDK Setup. The phone has USB debugging turned on.</p><p>When I plug in the phone, Windows automatically searches and fails to locate the driver.</p><p>I go to device manager and find the phone > update drivers and navigate to the usb driver folder in the sdk directory. Windows does not find the driver.</p><p>Solutions please?</p>","414057","","","","","2010-08-07 23:00:34","How do I develop on a Samsung Vibrant using Windows 7 64 bit","<android>","1","0","","",""
"3432156","1","3432395","","2010-08-07 21:44:53","0","124","<p>I'm creating an Android app, where the user starts out seeing a list of questions. When the user clicks a question, I would like to show him a new clickable list, containing that question and its answer alternatives.</p><p>My questions reside in rows in the database. The questions live in the first column, while the answer alternatives live in the following columns.</p><p>I've managed to display any single element from the row when I click a question in the list, but how to display more than one completely eludes me.</p><p>This is the relevant source code in the intent entered when the user clicks a question:</p><pre><code>private void fillData() {    Bundle extras = getIntent().getExtras();    Long id = extras != null ? extras.getLong(QuestionsDbAdapter.KEY_ROWID) : null;    Cursor questionsCursor = mDbHelper.fetchQuestion(id);    startManagingCursor(questionsCursor);    String[] from = new String[]{mDbHelper.KEY_QUESTION,        mDbHelper.KEY_ALT1,mDbHelper.KEY_ALT2};    int[] to = new int[]{R.id.text1};    SimpleCursorAdapter questions =         new SimpleCursorAdapter(this, R.layout.questions_one_row,        questionsCursor, from,to);    setListAdapter(questions);}</code></pre><p>This displays only the question. If I put one of the answer alternatives first in the 'String[] from ...' statement, that gets displayed instead.</p>","8522","","","","","2010-09-19 00:49:54","How to show the contents of a row as a list, in Android?","<android><list><row><listadapter>","1","0","","",""
"3432286","1","","","2010-08-07 22:28:38","4","3426","<p>I'm working on an app for a client that requires streaming of an AAC audio stream.  Unfortunately, there's nothing I can do about the stream format on the server.  I'm working on Android and have discovered that Android's media player does not support raw AAC streams (which is what I'm getting).  I found a project on <a href=""http://code.google.com/p/aacplayer-android/"" rel=""nofollow"">Google Code</a> that supports it (I tested it with the stream) but it's GPL'ed and that doesn't work for my client.  I don't have much experience with this sort of thing so forgive me if my ideas aren't great.  I know Android <em>can</em> play AAC encoded content if it is in an MP4 wrapper so I had thought about creating an MP4 wrapper on the fly on the client-side or perhaps even just doing some conversion to another format on the fly.  Are these reasonable options?  Does anybody have better suggestions?</p><p>Thanks in advance! </p><p><strong>Edit</strong>  To rephrase, is it possible to put a raw AAC stream from a web server in an MP4 container in real time?  If so, does anybody know of resources to help me with the process?</p>","150771","","150771","","2010-08-08 03:52:18","2012-05-22 11:16:33","Stream AAC on Android","<android><audio><streaming><aac>","1","0","1","",""
"3432377","1","3432411","","2010-08-07 23:00:02","9","5370","<p>In Android: is it possible to insert a timestamp into a SQLite database using <code>ContentValues</code>?</p><p>When I try to add it using something like </p><pre><code>ContentValues args = new ContentValues();       args.put(MY_DATE, my_date);</code></pre><p>I get an error telling me that <code>my_date</code> needs to be  a string</p>","409826","","2390083","","2013-11-04 16:04:53","2013-11-04 16:04:53","Insert timestamp into SQLite via ContentValues","<java><android><timestamp><android-sqlite>","1","0","1","",""
"3432523","1","","","2010-08-07 23:53:45","1","453","<p>I've been following this tutorial:<a href=""http://www.droidnova.com/playing-with-graphics-in-android-part-iii,176.html"" rel=""nofollow"">http://www.droidnova.com/playing-with-graphics-in-android-part-iii,176.html</a></p><p>To get comfortable with Android. It's been very, very helpful.In it though, he uses one thread to handle input, and another for drawing to the canvas.This is my first time using threads, and I am wondering if it is wise to put the entire onDraw() method into a synchronized block. Will this cause performance problems, especially in a game handling a lot of bitmaps?</p>","414057","","","","","2010-09-12 09:43:55","Threads and performance with Android games","<java><android>","1","0","","",""
"3432601","1","3432645","","2010-08-08 00:25:51","1","3934","<p>I'm trying to create an application that can use the android as a fax machine, IE Send a picture as a fax or receive a fax and save as a picture. So far I'm starting from the ground up and making sure I can intercept a call at the users discretion. I have an Receiver registered in the Manifest of my program with a filter of Phone_State which flags when the state has changed(IE incoming call).</p><p>So on my BroadcastReceiver I'm trying to have an AlertDialog popup prompting the user to either accept as fax or call but the AlertDialog seems to throw a android.view.WindowManager$BadTokenException Error when it has an incoming call. My code is just simple an onReceive(context arg0, intent arg1) and I pass the arg0 to the AlertDialog...</p><p>The full error message is below</p><pre><code>08-08 00:16:14.315: ERROR/AndroidRuntime(275): java.lang.RuntimeException: Unable to start receiver com.android.fax.IncomingFax: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application08-08 00:16:14.315: ERROR/AndroidRuntime(275):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2550)08-08 00:16:14.315: ERROR/AndroidRuntime(275):     at android.app.ActivityThread.access$3000(ActivityThread.java:116)08-08 00:16:14.315: ERROR/AndroidRuntime(275):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1843)</code></pre><p>From what I have seen in the AlertDialog code, it passes the context as well as a Window and WindowManager, which I believe is why it's crashing, is there a better way or something else I should be using which might overlay the call screen?</p>","256108","","","","","2011-05-05 08:40:26","AlertDialog in BroadcastReceiver","<android><broadcastreceiver><alertdialog>","1","0","0","",""
"3432649","1","3433064","","2010-08-08 00:45:25","7","3990","<p>I followed the instructions here on how to create an Android library project, and use it in an Android application:</p><p><a href=""http://developer.android.com/guide/developing/eclipse-adt.html"">http://developer.android.com/guide/developing/eclipse-adt.html</a></p><p>but it is not working. I can see the library project is added to my application but I cannot reference anything in it because it won't build. The R.java file from the lib is NOT being added to my application project, so the lib project contains tons of errors, everywhere it tries to reference it's own R.java file.</p><p>I don't know if this has anything to do with it, but in the console there are messages stating that the there is ""No resource identifier found for attribute 'X' in package 'Lib Package'. My library package has a a few styleable attributes defined for a custom view I made, all of which are being complained about in this console message. The library builds just fine, and I don't get those messages in the console until I hook the library to my application, so I don't know what's up with this.</p><p>I really would like to get this working. I've spent two entire days on it, to no avail. Please offer any ideas you might have to help!</p>","413414","","413414","","2010-08-08 03:11:33","2012-07-19 07:57:34","R.java file from Android library project not importing into application project","<android><reference>","2","1","4","",""
"3432651","1","3432930","","2010-08-08 00:46:37","1","344","<p>I have a very simple question about menu control in Android. I'm writing a program that performs some simple numeric calculations and outputs an answer. My question is how do make the program move to second screen when a button is pressed, and how can I let the user move back to the original screen. Here's a quick example</p><p>Screen 1              </p><pre><code>""Add Numbers""Input 1st # ____       Input 2nd # ____      (Add) </code></pre><p>Screen 2</p><pre><code>The answer is ""____""</code></pre><p>The user inputs two integers. presses add, and then the program moves to the second screen which displays the answer. If they user wants they can return to the first screen and start over.</p><p>I know this has been covered but with so many resources I don't know what to look for. Answers or links to resources would be most helpful. Thank you!</p>","414104","","414104","","2010-08-08 01:14:35","2010-08-08 03:13:56","Extremely Simple Menu Question for Android","<android><gui>","4","2","1","",""
"3432768","1","3432780","","2010-08-08 01:42:45","4","2855","<p>I'm working on a site that's supposed to scale fluently down to low resolutions, so that it would work just as well on a phone.  This works well in Firefox and Chrome when I just make the window small, but when I try it out on an actual Android phone (Nexus One running Android 2.2), it renders it super-huge!  (Using JS's window.innerWidth and window.innerHeight properties, it seems the viewport resolution it reports is 800x1271!)</p><p>Is there a way to render the page at actual-size in the browser window so I can have my full design show up on the phone?  User-agent sniffing is allowed, JS is allowed but discouraged.</p>","100835","","","","","2012-07-11 19:52:11","How can I make the Android browser render my document at the screen's size?","<android><mobile-safari><android-browser>","2","0","2","",""
"3432818","1","","","2010-08-08 02:11:45","1","328","<p>I am interested in making an application that does various things, but I am having trouble getting a static image, such as an avatar off of a web page.</p><p>Any ideas?</p>","414122","","414122","","2010-08-08 03:47:07","2010-08-08 04:50:40","How would I make a web image viewer with a static image?","<android>","1","2","","",""
"3432922","1","3514923","","2010-08-08 03:10:36","0","1419","<p>I have an API Object that I made, and I would like to share it between a running Service and various Activities in my app, almost like if I was to make the class static.  How could I go about sharing the created object between the two?</p>","362857","","","","","2010-08-18 17:39:54","How can I share an Object between a running Service and Activity","<android>","2","0","","",""
"3432945","1","3433831","","2010-08-08 03:23:57","1","809","<p>Is there any easy way to stamp bitmaps along a line in Android? I've found the PathDashPathEffect class but that only allows Paths to be stamped, rather than bitmaps. It seems like it should be possible, but I'm not sure where to start.</p><p>I could obviously just draw bitmaps along the line, but it seems to me like that would be a bit more resource intensive, especially because I would not be doing it in native code.</p><p>Any help or suggestions?</p>","118241","","","","","2010-08-08 09:47:17","Stamp Bitmap on Path - Android","<java><android><bitmap>","1","3","","",""
"3432960","1","","","2010-08-08 03:35:18","1","1968","<p>Hey guys,   I have the Uncertain number of GeoPoint, i want to display them all on the google maps. I don't know how to do it.   thank you!</p>","313897","","","","","2011-05-09 09:29:24","How to make the whole list of GeoPoint display on the google maps?","<android><maps>","2","0","","",""
"3433124","1","","","2010-08-08 04:50:52","1","2761","<p>This is probably related to <a href=""http://stackoverflow.com/questions/2078475/eclipse-classcastexception-when-trying-to-expand-xml-layout-for-android"">this question</a>. I want to know if anyone else gets the same error as me and if there is a way to get around this.</p><p>I did the following:</p><ul><li>Followed the instructions from <a href=""http://developer.android.com/sdk/index.html"" rel=""nofollow"">this page</a>. </li><li>From the top, go to File -> Create a new project -> Android Project -> Create project from existing sample. </li><li>Checked Android 2.2. </li><li>From the drop-down menu picked SkeletonApp. </li><li>Clicked finish. </li><li>From the package explorer, went to SkeletonActivity -> res -> layout -> skeleton_activity.xml. </li><li>In the tabs at the bottom of the editor area (editor area is the center of the screen) clicked on Layout. </li></ul><p>Then I got the error ""ClassCastException: android.widget.EditText cannot be cast to andoid.text.ViewGroup"". The full text of the error message is given below.</p><pre><code>java.lang.ClassCastException: android.widget.EditText cannot be cast to android.view.ViewGroupat android.view.LayoutInflater.rInflate(LayoutInflater.java:619)at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)at android.view.LayoutInflater.inflate(LayoutInflater.java:407)at android.view.LayoutInflater.inflate(LayoutInflater.java:296)at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:397)at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.computeLayout(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.recomputeLayout(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.onConfigurationChange(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.onTargetChange(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.onDescriptorsChanged(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.initUiRootNode(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor$1.updateEditor(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor$1.onTargetLoaded(Unknown Source)at com.android.ide.eclipse.adt.AdtPlugin$16.run(Unknown Source)at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)at org.eclipse.equinox.launcher.Main.run(Main.java:1407)</code></pre>","414154","","414154","","2010-08-13 03:16:41","2010-10-11 14:07:03","ClassCastException from layout editor in Eclipse's ADT Plugin","<android><eclipse-plugin><android-manifest>","1","1","","",""
"3433164","1","3471376","","2010-08-08 05:13:30","0","822","<p>How could i inflate my custom view using the main.xml file? I thought it carried the format of</p><pre><code>&lt;com.blah.project.MainClass.innerClass /&gt; </code></pre><p>but I cant seem to get the fully qualified name of my inner class right. My customView is inside of my Main.java file, anyone know how I could properly reference it? Thank you.</p>","385051","","12707","","2010-08-08 05:16:33","2010-08-12 19:40:45","how to inflate a view class in main.xml","<android><xml><view><custom-view>","2","0","","",""
"3433253","1","3433544","","2010-08-08 05:54:42","2","181","<p>Hey,Have had this happen alot, I forget to select the .java file before running an android app from Eclipse.</p><p>I have a .xml selected, press Run and the projectfile breaks.</p><p>How do I fix it?</p>","414170","","","","","2010-08-08 08:02:38","Eclipse Android Project broken from accidental Run of XML","<android><xml><eclipse>","1","2","","",""
"3433315","1","","","2010-08-08 06:23:35","12","15643","<p>I'm an Android newbie trying to learn how to port one of my apps to the Android platform. I've been following this tutorial:</p><p><a href=""http://www.vogella.de/articles/Android/article.html#overview"">http://www.vogella.de/articles/Android/article.html#overview</a></p><p>I'm stuck unable to boot up the emulator  :(  When I tell it to start, it would just stick at the ""Android"" boot animation for hours on end.  I searched online and found some pages talking about disabling the boot animation.  I did so and tried again.  There's no boot animation (just the word ""Android"" flashing), but it's still hours with no sign of booting.  'top' shows  an app called 'emulator' using a lot of CPU.  </p><p>Am I doing something wrong?  My system is an AMD Athlon X2 dual-core QL-60, 1900 MHz with 3GB ram.</p><p>Thanks for any help you can offer.</p>","414182","","203220","","2011-12-03 20:04:41","2012-05-01 05:06:14","Android emulator refuses to boot","<android><eclipse><android-emulator><boot-animation>","5","2","3","",""
"3433329","1","","","2010-08-08 06:32:27","0","63","<p>I am creating a project in which i need to take in some numbers, makes some calculations and then on a new screen create show the answers.  I am using an <code>Intent</code> object to go to the new screen:</p><pre><code>   final Button button = (Button) findViewById(R.id.save);   button.setOnClickListener(new OnClickListener()    {       public void onClick(View v)       {           Intent myIntent = new Intent();           myIntent.setClass(HelloAndroid.this, screen2.class);           myIntent.putExtra(""eFiber"", Double.toString(E_fiber));           startActivity(myIntent);        }   });</code></pre><p>but when i do this it crashes when i click the button.  If i use the same xml file as i do in the first screen then it works just fine, its when i use a different xml file that i have the problems.  </p>","414186","","12707","","2010-08-08 06:40:13","2010-08-08 06:41:23","Problems creating a new screen","<android><gui>","1","4","","",""
"3433545","1","","","2010-08-08 08:02:37","0","113","<p>My application listens for user input from the touchscreen and the buttons, but I would like to listen for interaction with specific items in the homescreen view.  So, for example, I need to listen for the user to tap the menu button, and then to produce output.  Is there a paramater I can pass through the onClick() class?  Or do I need to take another route? </p>","414225","","19679","","2011-01-28 17:17:00","2011-01-28 17:17:00","How do I listen for specific button presses, and home view user interactions?","<java><android>","0","2","1","",""
"3433685","1","3436404","","2010-08-08 08:52:54","0","1165","<p>While using network provider for location updates, I found that it is the same time that I set on my device. Can it not be that provided by network as it goes when it is GPS. Or if network provider cannot provide time , then atleast location.getTime() should return 0 instead of device time. Is there any way to avoid device time, as I want to distinguish it.</p>","315619","","","","","2010-08-08 22:55:17","Why using network provider for location updates in Android GPS gives device time?","<android><gps>","1","0","","",""
"3433778","1","3433828","","2010-08-08 09:25:38","12","31298","<p>I am getting this exception while I am trying to call an activity from another one.  The complete exception is </p><blockquote>  <p>android.content.ActivityNotFoundException:Unable to find explicit activity class {com.x.y/com.x.y.class};</p></blockquote><p>I am doing an <code>intent.setClass(""com.x.y"",""com.x.y.className"")</code> where <code>className</code> is the name of my activity class and <code>com.x.y</code> is the package it resides in.</p><p>My AndroidManifest.xml has the following content:</p><pre><code>&lt;activity android:name=""com.x.y.className"" android:label=""@string/app_name""&gt;</code></pre><p>Am I missing anything?</p>","381417","","579718","","2011-11-25 09:55:53","2014-04-08 12:54:04","android.content.ActivityNotFoundException:","<android><activity><android-manifest>","19","0","2","",""
"3433792","1","","","2010-08-08 09:30:30","2","9503","<p>I can't call setContentView to show XML layouts - I can only get a RelativeLayout which I can programmatically modify. Now, what I need to do is add a simple TextView, aligned at the bottom of that RelativeLayout. With XML it would be as simple as:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""horizontal""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextView    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""     android:maxLines=""5""    android:scrollbars=""vertical""    android:text=""some text""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>I've been trying various ways of doing this with code, but I can't get it working right. I've tried textView.setGravity(Gravity.BOTTOM) and relativeLayout.setVerticalGravity(RelativeLayout.ALIGN_PARENT_BOTTOM), but those didn't work. I am able to push it down by giving it padding, but I don't want it to fill the whole screen.</p>","414251","","414251","","2010-08-08 10:18:44","2011-11-14 23:48:18","Programmatically align a Text view in a RelativeLayout","<android><textview><relativelayout>","0","0","","2013-03-17 02:15:19",""
"3433796","1","","","2010-08-08 09:30:55","1","1366","<p>I am trying to write a method that determines if a contact has at least one phone number, at the moment I have this:</p><pre><code>public boolean hasPhone() { Cursor phones = this.map.getContentResolver().query(  ContactsContract.Contacts.CONTENT_URI,  null,  ContactsContract.Contacts._ID + ""="" + this.contactId,  null,  null ); boolean has = false; if(phones.moveToFirst()) {  do {            if(Integer.parseInt(phones.getString(phones.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0) {      has = true;      break;    }  } while(phones.moveToNext()); } return has;}</code></pre><p>the method always returns false, even though I know the contact in question has a phone number.  Also I know the contactId is correct as I also use it to get the postal address, etc.</p><p>Any help would be greatly appreciated, as I am about to tear my hair out :p</p><p>Thanks.</p>","414256","","47773","","2010-08-08 09:32:48","2011-05-22 01:54:02","Android HAS_PHONE_NUMBER","<java><android><contacts><contactscontract>","1","5","","",""
"3433842","1","3434042","","2010-08-08 09:52:25","1","447","<p>I have a TextView inside the same RelativeLayout as a chunk of ImageView derived custom classes. I'd like to be able to write to the TextView from inside these other Views. How do I do this since I am unable to use findViewById due to it not being a child?</p>","414266","","414266","","2010-08-08 10:46:26","2011-02-18 23:02:26","How do I find a non child View in Android?","<android><view>","2","0","","",""
"3433875","1","4479729","","2010-08-08 10:00:47","4","4838","<p>I want speed factor in my GPS application in android. I want to use both network provider and gps provider both to get location updates. But network provider hardly gives speed. While GPS provider provides fix many a times.</p><ol><li><p>But is it so that once a fix is found without speed, device will not request for new update until the interval or distance set in requestLocationUpdates changes ? If so, how can I enforce to continue it until I have speed. I found Criteria class, but we can use it only while choosing a provider. I want to use it while obtaining fix. Can I ?</p></li><li><p>Another thing I noticed is sometimes I get speed to be 127 m/s at start, even I am steady then it normalizes to actual speed. Is this a problem of device (tested in G1), or is in general depending on satallite or location ?</p></li><li><p>Does using Criteria while choosing provider, will not provide me location points that do not fit it ? Like if I set criteriaObj.setSpeedRequired(true) , then will I not get points if there is not such availble. As I require position update in any case. </p></li></ol><p>Any suggestions ?</p>","315619","","","","","2010-12-18 19:29:21","How to force GPS provider to get speed in android?","<android><gps>","2","0","","",""
"3433883","1","3437498","","2010-08-08 10:03:01","6","5336","<p>I've been trying to figure out the best way to handle local database access in my android applications. I had been creating a database connection object in each activity but this seems like a really inefficient way to do things. Doing some research I stumbled onto <a href=""http://groups.google.com/group/android-beginners/browse_thread/thread/47eefb1978b9d144/b345463a5e943e9b?show_docid=b345463a5e943e9b"">this discussion</a>. Using a Service seems like a great way to do things, but I am having trouble getting it working. Here is what I have:</p><p>SERVICE:</p><pre><code>public class DBservice extends Service {    private final static String TAG = ""net.iamcorbin.frolfcard"";    public DBconn db;    private DBbinder mDatabaseBinder = new DBbinder();    @Override    public void onCreate() {        super.onCreate();        Log.d(TAG,""DBservice : onCreate"");        mDatabaseBinder.mDatabaseService = this;        this.db = new DBconn(getApplicationContext());        this.db.open();    }    @Override    public IBinder onBind(Intent intent) {        Log.d(TAG,""DBservice : onBind"");        return mDatabaseBinder;    }    @Override    public int onStartCommand(Intent intent, int flags, int startID) {        Log.d(TAG,""DBservice : onStartCommand"");        return Service.START_STICKY;    }    @Override    public void onDestroy() {        super.onDestroy();        Log.d(TAG,""DBservice : onDestroy"");        mDatabaseBinder.mDatabaseService = null;        this.db.close();    }}</code></pre><p>BINDER:</p><pre><code>public class DBbinder extends Binder {    public DBservice mDatabaseService;    public DBconn getDB() {        return mDatabaseService.db;    }}</code></pre><p>SERVICE CONNECTION:</p><pre><code>public class DBserviceConn implements ServiceConnection {    private final static String TAG = ""net.iamcorbin.frolfcard"";    DBbinder mBinder;    public DBserviceConn(DBbinder binder) {        Log.d(TAG,""DBseviceConn : Constructor"");        this.mBinder = binder;    }    public void onServiceConnected(ComponentName className, IBinder binder) {        Log.d(TAG,""DBseviceConn : OnServiceConnected"");        this.mBinder = (DBbinder) binder;    }    public void onServiceDisconnected(ComponentName arg0) {        Log.d(TAG,""DBseviceConn : OnServiceDisconnected"");    }</code></pre><p>}</p><p>ACCESSING:</p><pre><code>private DBbinder dbBinder;private DBserviceConn dbServiceConn;//In onCreate() for Activity that wants to access database//Setup DB Service Connection and Binderthis.dbServiceConn = new DBserviceConn(this.dbBinder);final Intent i_DBservice = new Intent(PickGame.this, DBservice.class);//bind DB Servicethis.bindService(i_DBservice, this.dbServiceConn, BIND_AUTO_CREATE);</code></pre><p>This executes without throwing any errors but when I try and use the database with:</p><pre><code>this.dbServiceConn.mBinder.mDatabaseService.db.queryPlayers();</code></pre><p>it throws a NullPointerException. From reading the discussion(linked above) I'm assuming that this is because the database just isn't open yet because I'm doing the query in onCreate immediately after bindService. I need to use the database to populate a ListView though.</p><p>So the question is<br>1. Am I creating the service, binder, and service connection properly?<br>2. If so, how do I go about creating the callback to populate the ListView once the Service is started, bound, and the database opened?</p>","414260","","414260","","2010-08-09 04:31:18","2011-06-22 16:13:26","Creating a Service to share database connection between all activities in Android app?","<android>","1","3","1","",""
"3433923","1","","","2010-08-08 10:13:27","0","226","<p>I have an application that queries a server (not under my control).The server returns a serialized object. I have the model for the class - however the problem is that the class is in ""default package""... something not recognizable by Android ClassLoader.</p><p>How can I resolve this issue?</p>","332210","","","","","2010-08-09 07:32:45","Deserializing into Object when class is in default package on android","<java><android><serialization>","1","1","","",""
"3433991","1","","","2010-08-08 10:41:30","2","1255","<p>I am an android application developer. I am currently developing an application which requires of me to display an image stored in an sqlite database, Could anyone guide me on how to retrieve an image from a sqlite database and display it...Thanks..</p>","414289","","","","","2010-08-08 22:46:45","displaying images from sqlite in android","<android><sqlite>","1","1","","",""
"3434107","1","3434331","","2010-08-08 11:16:53","2","5737","<p>We have made a device which can act as an USB host or slave and processes the data it receives. I want to use the Android phones to send the data to it via USB.</p><p>My research leads me to conclude that we cannot use Android devices in USB Host mode without modifying the hardware or OS. Doing so is not an option as this is going to be a commercially deployed device. </p><p>However, I couldn't find any information on using the Android phone as a slave. This is already technically possible because it can connect to the PC in a similar configuration. Can we do the same via an application? If so, any information on how to achieve this will be greatly appreciated. I have full access to our device's embedded system, so custom code there should not be a problem.</p>","414290","","","","","2011-11-17 21:45:00","Android: Communicating with a USB device which acts as host","<android><usb>","1","1","2","",""
"3434133","1","","","2010-08-08 11:24:32","1","168","<p>I am trying a small program on the emulator</p><pre><code>  int frequency=8000;       int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO;    int audioEncoding = AudioFormat.ENCODING_PCM_8BIT;    bufferSize = AudioRecord.getMinBufferSize(frequency,                        channelConfiguration, audioEncoding);I keep getting bufferSize -2.</code></pre><p>hwaudioInput:yes is set for the emulator.</p><p>For what values should this work? Or do you have any other ideas why this is not working?Is there way to check why getMinBufferSize fails? What is the exact error message?</p><p>Thank you.</p>","135807","","135807","","2010-08-08 11:36:10","2012-07-27 06:42:48","What audio encodings are supported on Android Emulator?","<android>","1","1","2","",""
"3434263","1","3434306","","2010-08-08 12:17:55","0","644","<p>Is it a good practice to define the alphabetic shortcuts (<code>alphabeticShortcut</code>) of the menu items?</p><p>I ask because I've never used them in any of the Android devices that I have owned, even those that have a physical keyboard. Is there any reason to define them? Maybe an accessibility use-case than I'm not seeing?</p>","143378","","143378","","2010-08-08 12:24:45","2010-08-08 12:31:20","Alphabetic shortcuts for menu in Android","<android><menu><accessibility>","1","0","","",""
"3434325","1","","","2010-08-08 12:39:18","3","253","<p>I'm working on my first android app.  So far I have an activity that reacts to clicks on the hardware volume controls.  That's was easy to do, but I'm wondering if there is a way to make it so the app responds to these events from the hardware buttons even while the phone is locked?</p><p>I'm really looking for a confirmation of whether or not this can be done.  If someone could confirm and give me the general idea of how to do it that would be awesome.</p>","190055","","","","","2012-07-25 18:25:55","Is there a way to make an android app respond to hardware buttons while phone locked?","<android>","1","3","1","",""
"3434411","1","","","2010-08-08 13:11:39","4","2918","<p>I have a grid view of buttons that is generated by a CursorAdapter. When the CursorAdapter is passed to the Gridview the view renders correctly however the first item in the grid does not fire the OnClickListener event.</p><p>If I select another button in the grid, the event fires correctly however if I selected the first button then another button, it loads the first button action then the section button action.</p><p>When testing this, it only seems to be an issue in Android 2.2 on my emulator, my 1.5 phone works as expected. I've wiped the emulator but that doesn't seem to have made a difference.</p><pre><code>public class AdapterMedia extends CursorAdapter {    Context context;    Cursor cursor;    public AdapterMedia(Context context, Cursor dataset)    {        super(context, dataset);        this.context = context;        this.cursor  = dataset;    }    @Override    public View newView(Context context, Cursor cursor, ViewGroup arg2)    {        Button imageView;        imageView = new Button(context);        imageView.setLayoutParams(new GridView.LayoutParams(85, 85));        imageView.setPadding(8, 8, 8, 8);        imageView.setId(cursor.getInt(0));        imageView.setText(cursor.getString(1));        imageView.setOnClickListener(buttonClickListener);        return imageView;    }    @Override    public void bindView(View arg0, Context arg1, Cursor arg2)    {        Button imageView = (Button) arg0;        imageView.setLayoutParams(new GridView.LayoutParams(85, 85));        imageView.setPadding(8, 8, 8, 8);        imageView.setId(cursor.getInt(0));        imageView.setText(cursor.getString(1));        imageView.setOnClickListener(buttonClickListener);    }    public OnClickListener buttonClickListener = new OnClickListener()    {        public void onClick(View view)        {            Bundle dataset = new Bundle();            dataset.putInt(""media_id"", view.getId());            Intent showMedia = new Intent(context.getApplicationContext(), MediaActivity.class);            showMedia.putExtras(dataset);            context.startActivity(showMedia);        }    };}</code></pre>","414344","","1839241","","2012-11-29 08:03:45","2012-11-29 08:03:45","Android OnClickListener not firing in GridView (2.2 only)","<android><gridview><cursor><onclick>","1","0","1","",""
"3434502","1","3435807","","2010-08-08 13:38:45","1","1639","<p>Using this tutorial at this section 4.5 : <a href=""http://www.vogella.de/articles/Android/article.html#first_uiproperties"" rel=""nofollow"">http://www.vogella.de/articles/Android/article.html#first_uiproperties</a> as aguide, I attempt to ""Select the complete widget and use the Properties view toset the property ""background"" to the color attribute ""myColor"".""</p><p>I can select the widget, highlight the 'Background' property, and when i pressthe [...] button in the value column the Reference Chooser Window never appearsand the Value [...] button disapears.</p><p>Reproducible: Always</p><p>Steps to Reproduce:<br>1.Highlight the Widget in the Layout View<br>2.Highlight the Background Property<br>3.Press [...] button under Value</p>","414360","","414360","","2010-08-08 18:48:10","2011-04-05 18:57:31","Cannot bring up ""Reference Chooser"" window from Properties in Eclipse Android SDK","<android>","1","1","","",""
"3434525","1","","","2010-08-08 13:46:23","10","11217","<p>I've been through different tutorials and this website, but couldn't find a proper solution. On the other hand, I've seen apps logging into websites and requesting further information, so I'm sure there's a way to get this working, but maybe my approach is all wrong.</p><p>Here's what I'm trying to do: I want to log into a website that needs user authentication and then read and parse websites that are only accessible if the user is logged in.The problem: after POSTing the credentials to the website, I receive a cookie which doesn't seem to be preserved in my HttpClient, even though the docs suggest that exactly that should happen.</p><p>Here's some of my code:</p><pre><code>DefaultHttpClient httpclient = new DefaultHttpClient();HttpPost httpost = new HttpPost(LOGIN_URL);List&lt;NameValuePair&gt; nvps = new ArrayList&lt;NameValuePair&gt;();nvps.add(new BasicNameValuePair(USER_FIELD, login));nvps.add(new BasicNameValuePair(PASS_FIELD, pw));nvps.add(new BasicNameValuePair(REMEMBERME, ""on""));httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));HttpResponse response = httpclient.execute(httpost);HttpEntity entity = response.getEntity();if (entity != null) {  entity.consumeContent();}List&lt;Cookie&gt; cookies = httpclient.getCookieStore().getCookies();</code></pre><p>When I output the contents of ""cookies"", everything seems fine (I receive a session):</p><p><code>- [version: 0][name: ASP.NET_SessionId][value: xxx][domain: xxx][path: /][expiry: null]</code></p><p>As I understood, the cookie/session will be preserved and used in my HttpClient as long as I don't close it.</p><p>When reading the next page (which is restricted), using this code:</p><pre><code>HttpGet httpget2 = new HttpGet(RESTRICTED_URL);response = httpclient.execute(httpget2);entity = response.getEntity();InputStream data = entity.getContent();// data will be parsed hereif (entity != null) {    entity.consumeContent();}// connection will be closed afterwards</code></pre><p>If I output the response of the GET-request (using <code>response.getStatusLine()</code>) I get a ""200 OK"" message, but parsing the site that is returned shows, that the login is lost (I only retrieve a login form).</p><p>Any help is appreciated.</p>","255905","","","","","2012-10-01 18:03:54","Android: log into website and preserve session/cookie using DefaultHttpClient","<android><session><cookies><login><httpclient>","4","0","3","",""
"3434557","1","3434685","","2010-08-08 13:56:07","-1","176","<p>I am building Android apps and have an HTC Desire with running 2.1 of Android.</p><p>How do I upgrade, or even downgrade, OS on the phone to test the app on real devices as well.</p>","172861","","","","","2010-08-09 10:16:10","Android update OS","<android>","3","0","","2013-01-22 07:13:39",""
"3434624","1","3434694","","2010-08-08 14:13:26","2","1374","<p>In an Android app, I am looking for the functionality of the .NET string function [Trim('aaa')] which will trim off the text ""aaa"" off a string. I don't think this is natively available in Java and I haven't seen that functionality in Android Java textutil library.</p><p>Is there an easy way to have a Java app trim a set of characters from the string?</p>","172861","","172861","","2010-08-08 16:04:31","2010-08-08 16:04:31","Android .NET Trim function in Java?","<java><.net><android><trim>","2","2","0","",""
"3434807","1","3434836","","2010-08-08 15:16:16","0","1221","<p>I'm trying create a scaling layout for an Android application. The whole screen should contain two areas. The top 3/4 of the screen should be a MapView showing a certain area. The remaining quarter of the screen should contain some textual information to certain places shown on the map. </p><p>So now I'm wondering what is the best practice to archive this layout the 3:1 ratio of the screen partition? Is there a way to set this ratio in the layout xml file or do I have to calculate and set it manually by code in the corresponding activity? </p>","19601","","","","","2010-08-08 15:22:17","Who to create a proportional Android layout?","<android><gui>","2","0","0","",""
"3434877","1","3434921","","2010-08-08 15:31:47","1","1165","<p>I have an application published in the Android Market. Its target is 1.6 and its <code>minSdkVersion</code> is 1.5. The only persmission it uses is <code>INTERNET</code>. My Manifest file looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""XXX""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application        android:label=""@string/app_name""        android:icon=""@drawable/icon""&gt;        &lt;meta-data android:name=""android.app.default_searchable""            android:value=""XXX"" /&gt;        &lt;activity android:name=""XXX""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name=""XXX""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.SEARCH""&gt;&lt;/action&gt;                &lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;            &lt;/intent-filter&gt;            &lt;meta-data android:name=""android.app.searchable""                android:resource=""@xml/searchable"" /&gt;        &lt;/activity&gt;        &lt;activity android:name=""XXX""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""XXX"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity            android:name=""XXX""            android:theme=""@android:style/Theme.Black.NoTitleBar.Fullscreen""            android:screenOrientation=""landscape""        /&gt;        &lt;activity android:name="".Favorites"" /&gt;        &lt;provider            android:name=""SearchSuggestions""            android:authorities=""XXX""        /&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt;</code></pre><p>(I <code>XXX</code>ed stuff I can't show)</p><p>I recently got an email from a user saying the application doesn't show up in the Market on an HTC Wildfire. I looked it up and the Wildfire is a QVGA (LDPI, 240x320) device running Android 2.1. The app does appear for MDPI and HDPI devices. Also, I can start up a QVGA 2.1 emulator and install the application without any problems.</p><p>What is causing this?</p>","180784","","","","","2010-08-08 18:36:06","Application not appearing in the Market for some devices","<android><google-play>","3","0","","",""
"3434930","1","3438631","","2010-08-08 15:46:50","0","561","<p>I'm having some trouble accessing attributes like DURATION and DATE_MODIFIED of video and image. My app access these attributes for both type of data but if I take a picture or shoot a video the related attributes are not immediately available through content provider e.g. for DURATION for that specific video it returns 0.</p><p>If I restart the phone the attribute for the newly shoot video or picture taken becomes available.</p><p>The other way to make the attributes available is to plug in and out your phone to a computer through usb cable. Once that is done the attributes are available.</p><p>Any comments on why this is happening ?</p>","394675","","","","","2011-02-01 15:34:51","in android when video duration or date_modified attribute available through content provider","<android><image><video><media><duration>","1","1","","",""
"3434978","1","3439660","","2010-08-08 16:00:33","5","10380","<p>I have successfully implemented my AutoCompleteTextView which is based off an sqlite query and placed in an array adapter. Thats all working beautifully, however I cant et my onclickevent working. I just want to create an intent to pass the selected value to a new activity. I know how to create an onclicklistener I am just unsure about how to apply it to the dropdown box of the AutoCompleteTextView. </p>","397085","","73488","","2011-11-17 08:18:28","2011-11-17 08:18:28","Android AutoCompleteTextView click event?","<android><sqlite><autocomplete><onclick>","2","0","1","",""
"3435177","1","4314296","","2010-08-08 16:51:07","0","257","<p>I'm not sure about older versions of Android, but in Android 2.1 and 2.2, the system clock application doesn't have its own background. Instead, it uses the system's background. Does anyone know how to accomplish this?</p>","301839","","","","","2011-05-27 04:21:04","How can my Android app use the system's background image as its image?","<android>","1","0","","",""
"3435239","1","3435819","","2010-08-08 17:07:05","4","3228","<p>I have a widget that displays the picture of some of my contacts and I would like to display the QuickContact card when the user taps on one of the pictures. I know I should be using the method ContactsContract.QuickContact.showQuickContact(), but it requires a View or a Rect as one of the input parameters. My problem is that Widgets only have RemoteViews, so I'm no sure what to pass as the View or Rect parameter. Any ideas would be appreciated.</p>","318525","","","","","2011-02-04 23:20:37","How to display QuickContact card from widget","<android><android-widget><contacts>","4","1","3","",""
"3435248","1","3435482","","2010-08-08 17:10:30","0","1479","<p>i am using the following method in a new application i'm developing.</p><p>there is a main activity, which instantiates different classes that extends RelativeLayout, and i'm using setContentView to switch between the different modules of the application.</p><p>i wonder if this is a good approach or necesarily i have to use different activities to the several screens the app haves.</p>","369372","","","","","2010-08-08 18:16:28","call a method in the main Activity. From a Custom View class","<android>","1","0","","",""
"3435271","1","","","2010-08-08 17:19:23","1","945","<p>Lets say I have a database with tables called box, item, and box_contents and I want to get any item that is contained in the box_content table (all items, but discard the ones that arent in the box_contents table). What would be the correct sqllite syntax for this?</p>","282475","","244296","","2010-08-08 17:22:00","2010-08-08 17:27:55","Android Sqlite Statement Question","<sql><android><sqlite3>","2","4","1","",""
"3435316","1","3466839","","2010-08-08 17:30:55","9","1855","<p>Please bear with me for a moment.  I'm working on a master's thesis and want to demonstrate how bad a malicious application can be.  I'm looking for a pre-installed application on the application on the android emulator or an application that has ""brick"" permission on the device. Rather than bricking my device, I would much prefer bricking the emulator instead!</p><p>PS: My device is a samsung galaxy i7500 just in case.</p><p>EDIT: Please do care to leave a comment as to why this question might annoy you (I promise not to serial downvote you)!  I understand the topic may seem ""very suspicious"", but then I would not be linking myself publically to something that may be malicious in nature and I intend to pull off! Thanks for your consideration.</p>","393459","","12950","","2010-08-12 12:26:15","2010-08-12 12:26:15","How can I brick the Android emulator?","<android><permissions>","1","6","4","",""
"3435587","1","","","2010-08-08 18:48:25","0","499","<p>How to display current location with out using onLocationChanged method </p>","414523","","","","","2011-11-30 17:03:05","Displaying current location in android","<android>","2","0","","",""
"3435624","1","","","2010-08-08 18:58:15","1","413","<p>After you attach an inputstream to am MMS message on a WAP server, does anyone have a suggestible Java api to parse the message?</p><p>Someone may recommend the WMA of JavaMe, but JavaME is not the Java implementation on Android. I have tried using various .jar apis from sourceforge but none of them compile properly when added to the build path.</p><p>I find myself very stuck attempting to process an MMS message in an Android app? Any suggestions?</p>","371532","","","","","2010-08-08 18:58:15","Parse MMS Parts Using InputStream from WAP Server","<android><inputstream><mms>","0","1","","",""
"3435751","1","","","2010-08-08 19:29:54","4","13004","<p>The problem is probably quite simple for some of you:I have a 7zip archive which contains some hundred files separated into different directories. The target is to download it from a FTP server and then extract it on the phone. My problem is that the 7zip SDK contains not really a lot. I am looking for examples, tutorials and snippets regarding the decompression of 7z files.</p><p>(Decompression via <code>Intent</code> is only a secondary option)</p>","408659","","168175","","2012-12-24 09:20:42","2013-10-28 17:04:20","How to unzip a 7zip archive in Android?","<java><android><archive><7zip>","1","4","","",""
"3435775","1","3436258","","2010-08-08 19:34:52","2","129","<p>I'm considering developing apps for Android and Windows Phone 7 that allow the user to read content from an online producer (newspaper/magazine/blogs etc). This provider has a REST API that should allow for straightforward access to the content. A few questions I have:</p><ul><li><p>I saw an OData demo, where getting data from a feed was super easy, with no parsing of any sort required. Is it worth building an OData provider on top of the publication's existing API, just to make it easier for the mobile apps to get data?</p></li><li><p>I have heard that C++ can be used on wp7 and Android. Is there any reason to develop an app core in C++, then interact with the device APIs in C#/Java? Or is the core logic layer of the app so thin that it's not worth the hassle? It seems like there's really not that much to developing a publication reader app - basically just a GUI on top of an API that provides all the data.</p></li><li><p>Or, would it make more sense to just develop a mobile version of this publication's web site? Then there could be one service for all mobile platforms. What are the pros and cons of an app that runs on the device as opposed to a website specially built for mobile devices? (Like the Gmail, Google Docs, and GTalk ""apps"" for the iPhone.)</p></li></ul><p>Thanks.</p>","147601","","918414","","2013-03-16 03:10:05","2013-03-16 03:10:05","Advice for a mobile app for reading a publication","<android><iphone><windows-phone-7><mobile><odata>","2","0","","",""
"3435857","1","","","2010-08-08 19:59:24","4","3602","<p>The layout xml is as below. I have a RelativeLayout, which contains a TextView. The OnClick listener is set on RelativeLayout. The RelativeLayout has a selector background. What I want is, when user clicks on the RelativeLayout, the background of the RelativeLayout should change, and the color of the text of the TextView should change too. Even though I set color selector for the TextView, only the selector on RelativeLayout works. The color selector on TextView doesn't work. How can I implement change of both RelativeLayout background and text color of TextView when user clicks the layout? Thanks.</p><pre><code>&lt;RelativeLayout android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""@drawable/background_selector""        android:id=""@+id/mylayout""&gt;    &lt;TextView android:id=""@+id/mytextview""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:typeface=""sans""        android:textSize=""18sp""        android:textStyle=""bold""        android:singleLine=""true""        android:ellipsize=""end""        android:textColor=""@drawable/color_blue_selector""         /&gt;&lt;/RelativeLayout&gt;</code></pre>","256239","","","","","2011-09-19 11:15:11","How to implement color selector of TextView when the OnClick listener is set on its parent Layout?","<android>","3","1","2","",""
"3435978","1","3452003","","2010-08-08 20:37:47","0","2147","<p>I have an activity that implements LocationListener in my application and my onLocationChanged method has been working perfectly up until recently.  For some reason the Location object being passed into the method is null.  My question is, why is it null?  Does it pass in a null object if it cannot acquire a location?</p><p>My GPS is on and I have it set to pull a location from the GPS, and I know my GPS can get a fix on me as I used Maps and had it locate me.</p><p>Also, I have the permission for my app set as:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.CAMERA"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_GPS"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;</code></pre><p>I don't believe permissions is the issue though, as my activity was working beforehand and I have not altered the permissions since then.</p><p>Here is the code that determines the provider of the location object:</p><pre><code>String locationProvider = this.mLocationManager.getBestProvider(mLocationCriteria, true);this.onLocationChanged(this.mLocationManager.getLastKnownLocation(locationProvider));</code></pre><p>Here is the LogCat output of the error:</p><pre><code>08-08 18:25:26.310: ERROR/MapActivity(6447): Couldn't get connection factory client08-08 18:26:18.771: ERROR/AndroidRuntime(6447): Uncaught handler: thread main exiting due to uncaught exception08-08 18:26:18.880: ERROR/AndroidRuntime(6447): java.lang.IllegalStateException: Could not execute method of the activity08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.View$1.onClick(View.java:2031)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.View.performClick(View.java:2364)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.View.onTouchEvent(View.java:4179)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.View.dispatchTouchEvent(View.java:3709)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.os.Handler.dispatchMessage(Handler.java:99)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.os.Looper.loop(Looper.java:123)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.app.ActivityThread.main(ActivityThread.java:4363)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at java.lang.reflect.Method.invokeNative(Native Method)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at java.lang.reflect.Method.invoke(Method.java:521)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at dalvik.system.NativeStart.main(Native Method)08-08 18:26:18.880: ERROR/AndroidRuntime(6447): Caused by: java.lang.reflect.InvocationTargetException08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.proto.screens.MyMapActivity.onLocateUserClick(MyMapActivity.java:147)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at java.lang.reflect.Method.invokeNative(Native Method)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at java.lang.reflect.Method.invoke(Method.java:521)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at android.view.View$1.onClick(View.java:2026)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     ... 21 more08-08 18:26:18.880: ERROR/AndroidRuntime(6447): Caused by: java.lang.NullPointerException08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     at com.proto.screens.MyMapActivity.onLocationChanged(MyMapActivity.java:135)08-08 18:26:18.880: ERROR/AndroidRuntime(6447):     ... 25 more</code></pre><p><code>[UPDATE]</code> I have tested the same code on another device (an HTC MyTouch 3G to be precise) and it works flawlessly with the GPS, however on my Motorola Droid it crashes.</p>","384386","","384386","","2010-08-09 19:32:38","2012-10-27 05:31:16","Location object passed into onLocationChanged is null?","<android><google-maps><geolocation><gps>","3","4","","",""
"3436021","1","","","2010-08-08 20:54:43","4","6407","<p>I've included the relevant portion in my manifest:</p><pre><code>&lt;meta-data android:value=""123456789"" android:name=""ADMOB_PUBLISHER_ID"" /&gt;            &lt;!-- Track Market installs from AdMob ads --&gt;                         &lt;receiver android:name=""com.admob.android.ads.analytics.InstallReceiver"" android:exported=""true""&gt;                    &lt;intent-filter&gt;                            &lt;action android:name=""com.android.vending.INSTALL_REFERRER"" /&gt;                    &lt;/intent-filter&gt;            &lt;/receiver&gt;            &lt;meta-data android:value=""true"" android:name=""ADMOB_ALLOW_LOCATION_FOR_ADS"" /&gt;'</code></pre><p>and</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""/&gt;'</code></pre><p>attrs copied right from the example:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;resources&gt;            &lt;declare-styleable name=""com.admob.android.ads.AdView""&gt;                    &lt;attr name=""backgroundColor"" format=""color"" /&gt;                    &lt;attr name=""primaryTextColor"" format=""color"" /&gt;                    &lt;attr name=""secondaryTextColor"" format=""color"" /&gt;                    &lt;attr name=""keywords"" format=""string"" /&gt;                    &lt;attr name=""refreshInterval"" format=""integer"" /&gt;            &lt;/declare-styleable&gt;    &lt;/resources&gt;</code></pre><p>My layout (Which is a tabs view btw) is a table with it on its own row:</p><pre><code>xmlns:app=""http://schemas.android.com/apk/res/com.icukansas.lenscalculator""</code></pre><p>and</p><pre><code>&lt;TableRow&gt;     &lt;!-- Place an AdMob ad at the bottom of the screen. --&gt;    &lt;!-- It has white text on a black background. --&gt;    &lt;com.admob.android.ads.AdView      android:layout_span=""4""      android:id=""@+id/ad""       app:backgroundColor=""#000000""      app:primaryTextColor=""#FFFFFF""      app:secondaryTextColor=""#CCCCCC""      app:keywords=""security""    /&gt;    &lt;/TableRow&gt;</code></pre><p>I then call:</p><pre><code>public class myClass extends Activity implements AdListener{</code></pre><p>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);</p><pre><code>    setContentView(R.layout.tab_thistab);    AdView ad = (AdView) findViewById(R.id.ad);    ad.setAdListener(this);</code></pre><p>Every time I get onFailedToReceiveAd error in the log.</p><p>I'm sure its something easy I'm missing :)</p>","409330","","","","","2012-01-27 05:19:24","Trouble getting ads to display on android with adMob","<android><admob>","6","1","3","",""
"3436166","1","3436179","","2010-08-08 21:38:50","0","689","<p>I am developing a simple android application using eclipse.  I wrote a JUnit TestCase for a class I wrote.  One particular test compares two 2d arrays so see if they are equal.  If they are not equal the test fails.  When the test fails I would like to print out the contents of the offending array to see what went wrong. I have tried System.out.print and it doesn't show up in the console or JUnit results.  What am I doing wrong?  Is it even possible?</p>","414576","","","","","2010-08-08 21:50:47","How to output additional debugging information using Eclipse and Android JUnit","<android><eclipse><junit>","1","0","1","",""
"3436174","1","3436821","","2010-08-08 21:41:08","0","2083","<p>I have a custom spinner (customized for formatting).  It works fine and shows the result of the selected array item.  The string array with my data is called mydata[].</p><p>I want to do something with that result - I've tried hours of changes but, it seems I don't know what the container is for the selected result - it just displays automatically.  The mNumber refers to a case select in a class (it's result is based on what's passed into-it).</p><p>My question(s) - refer to the <strong>* WHAT DO I USE HERE *</strong> shown in the code's last line:<br>1.  What is the container for the result?<br>2.  How to access and syntax it?  </p><p>Here's the code:<br><strong>Thank you!</strong></p><pre><code>**[declared in onCreate]**      Spinner spinner = (Spinner) findViewById(R.id.Spinner01);        MySpinnerAdapter adapter = new MySpinnerAdapter(this, R.layout.mspinner, R.id.text,mydata);       spinner.setAdapter(adapter);  **[declared outside of onCreate]**      @SuppressWarnings(""unchecked"")      private class MySpinnerAdapter extends ArrayAdapter{      public MySpinnerAdapter(Context context, int resource, int textViewResourceId, String[] objects) {      super(context, resource, textViewResourceId, objects);      final TextView woof =(TextView)findViewById(R.id.TextView07);      woof.setText(String.valueOf(dogday.mNumber(*** WHAT DO I USE HERE ? ***)));      }      }  </code></pre><p><strong>EDITED - FOR MY RESPONSE TO COMMONSWARE</strong> (too many characters for a comment box).</p><p>Thanks.  You know the result that gets displayed in a spinner (by default) when something's selected - <strong>that's the piece of data I need.</strong>  I want to use it as an argument for a call.</p><p>The user selects something in the spinner - The selected item will be used to make some choices in the class method (dogDay), which takes a data argument for mNumber(<em>data</em>) and returns a result (just like a function).</p><p>I want to do some math calcs with the result.  First, I want to display what's coming back (for now) so, I'm using the dogDay.mNumber(<em>data</em>) as an argument for woof.text.</p><p><strong>My question is this</strong>, How to get the piece of <em>data</em> (<em>the thing the user selected in the Spinner</em>)?  How did the spinner know what to display for my selection - that's what I want?  I tried using something like getSelectedItem (or whatever the it was - I can't remember just now) but, it crashes.</p><p><strong>Is their an easier way to custom format a spinner?</strong> (and get the <em>data</em>)  I searched hi and low for info and found only one applicable to android 1.5/later (I want a spinner with all black background and red text - I can do it via the way shown in my code using a the custom layout).</p><p>Thanks - I got a bit long winded!</p><p><strong>EDITED - with full code</strong>Here's a full code with the custom spinner and the call you suggested.  As I mentioned, I already tried it - it only shows the first item in the list - never the selected one.  I use the result of getSelectedItem as an argument for the string... I tried it from both within and outside the adapter...</p><pre><code>package com.bt.junk;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.Spinner;import android.widget.TextView;public class MyMaincode extends Activity {private static String mydata[] = {""one"", ""two"", ""three""};int poop;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);// DECLARATIONS ------------------------------------------------           Spinner spinner = (Spinner) findViewById(R.id.Spinner01);    MySpinnerAdapter adapter = new MySpinnerAdapter(        this,R.layout.custom_spinner_row,R.id.text, mydata );    spinner.setAdapter( adapter );    poop = spinner.getSelectedItemPosition();}//end onCreate ********************************************// METHODS, CLASSES, etc ---------------------------------------@SuppressWarnings(""unchecked"") //&lt;-- I added thatprivate class MySpinnerAdapter extends ArrayAdapter{    public MySpinnerAdapter(Context context, int resource,                   int textViewResourceId, String[] objects) {        super(context, resource, textViewResourceId, objects);                          final TextView sayWhat = (TextView) findViewById(                                            R.id.TextView01);        sayWhat.setText(String.valueOf(mydata[poop]));    }//end MySpinnerAdapter}//end class MySpinnerAdapter}//end activity</code></pre>","382200","","382200","","2010-08-09 17:05:04","2010-08-09 17:05:04","Android Custom Spinner - What is the useable result?","<android><spinner>","1","0","","",""
"3436246","1","","","2010-08-08 22:03:26","1","661","<p>I have a similar question going because I had the same problem with the <code>listview</code> in an <code>AlertDialog</code>. so now I suspect something else is wrong. All I am doing is removing a single item from the <code>arraylist</code> and calling <code>notifyDataSetChanged()</code> in my efficiency adapter. The <code>ListView</code> completely disappears but I can still get a valid count via <code>getCount()</code> and even pull items from the dang list! So... the <code>ListView</code> is still active but it's not visible in my view... what the hell? This code is the exact same efficiency adapter I am using in my main activity and I call <code>notifyDataSetChanged()</code> exactly the same way in that activity with no issues. This is driving me nuts for 2 days now. Has anyone ever seen anything like this?</p><p>EDIT: I was able to fix the issue with a large amount of unnecessary and elaborate hacks... :P</p>","386654","","1232277","","2013-01-05 03:02:02","2013-01-05 03:02:02","ListView with Efficiency adapter notifyDataSetChanged() causes listview to dissapear?","<android>","0","3","","",""
"3436280","1","","","2010-08-08 22:12:22","5","4012","<p>How can I start or stop the built-in tethering in Android 2.2 from my application?</p>","764272","","","","","2013-09-20 10:05:42","Start / stop built-in Wi-Fi / USB tethering from code?","<android><wifi><android-2.2-froyo>","4","1","4","",""
"3436322","1","3436343","","2010-08-08 22:23:16","2","1303","<p>Note that my activity is NOT extending ListActivity; just Activity.</p><p>I have a list view with a custom layout as follows:</p><p>(res/layout/list_item.xml)</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:orientation=""horizontal""&gt;&lt;ImageView android:id=""@+id/icon"" android:layout_width=""30dip"" android:paddingTop=""15dip"" android:layout_height=""wrap_content"" android:src=""@drawable/icon_default""/&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/text1""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:textAppearance=""?android:attr/textAppearanceMedium""    android:gravity=""center_vertical""    android:paddingLeft=""6dip""    android:minHeight=""?android:attr/listPreferredItemHeight""    android:textColor=""#ffffff""/&gt;    &lt;/LinearLayout&gt;</code></pre><p>I'm then setting the adapter for the ListView to an ArrayAdapter using an ArrayList, here called 'machines'.</p><pre><code>ListView rooms = (ListView)findViewById(R.id.machines);ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(getApplicationContext(), R.layout.list_item, android.R.id.text1, machines);rooms.setAdapter(aa);</code></pre><p>How would I go about doing a similar thing for the ImageView field?</p>","320837","","","","","2013-02-01 06:32:31","Multiple icons in Android ListView","<java><android><listview>","2","0","1","",""
"3436434","1","3436869","","2010-08-08 23:06:29","7","6594","<p>As the database in my app grows, it is going to require more and more of the internal phone space. There isn't any sensitive/private data in the DB, so I'm interested in moving it to the SD card.</p><p>I'm using SQLiteOpenHelper to assist with the database work. It's my understanding that you can't use this for DB-access on the SD card as you can't define the DB path. However, there are some (very poor) examples on the Internet that suggest you can  override this limitation. However I've never gotten one of those code samples to compile.</p><p>Is it possible? And if so--HOW! Please note that Froyo's ""apps on SD card"" feature won't work as it doesn't move internal files.</p>","213345","","396458","","2010-08-08 23:08:54","2012-04-04 10:37:39","Is it possible to move the internal DB to the SDCard?","<android><sqlite3><sd-card>","3","0","5","",""
"3436440","1","3436590","","2010-08-08 23:10:13","0","1439","<p>I am going through the android hello world tutorial, and have been stuck when trying to create an XML UI.  For some reason, even on a new program, in which I have made no changes to the default build, it gives the error java.lang.NullPointerException after every character I type.  I can't figure out why it is doing this, as I am just trying to edit the text between the Text  I want to set it to say something other than what is set by default.  However, even with a fresh build, no changes, and I just try to change the text within the xml tags, it still gives the error.  What do I need to do to allow it to let me type? I am using the eclips IDE and the android sdk.  I was able to do the first part of the tutorial that doesn't involve XML.</p>","414596","","","","","2010-08-16 03:26:32","Android string.xml error for every character I type","<java><android><xml><eclipse><ide>","3","1","","",""
"3436523","1","3436552","","2010-08-08 23:42:27","0","1258","<p>Is there a way for the sender of a <code>Notification</code> to know when that <code>Notification</code> is delivered to the receiver? i.e. Some method that can check if a the user has clicked on a given <code>Notification</code>.</p><p>What I'm trying to accomplish is this: Have my <code>Service</code> send a notification with a <code>PendingIntent</code> to start ActivityA. But if the user starts ActivityA without clicking on the Notification, I would like the service to cancel the <code>Notification</code> and send a direct Intent to ActivityA</p>","204317","","","","","2010-08-08 23:52:31","Android: How to check if a pending Notification was delivered?","<android>","1","0","","",""
"3436609","1","","","2010-08-09 00:12:03","0","609","<p>I got following problem, I need to use a Content Provider to read aDatabase of an other App.first I want all rows, and after analyzing the data only e.g. the rowsfrom _id = 1, 3 and 5.</p><p>how can I call a Content provider and select only these rows?</p><p>or is it possible to create a subset Cursor form an given Cursor?</p><p>Thanks in advance.</p>","389859","","","","","2011-04-10 19:55:15","Content Provider filtering query, filtering Cursor","<android><cursor><android-contentprovider>","1","0","","",""
"3436639","1","3437117","","2010-08-09 00:24:08","1","951","<p>I have HTML with standard links which correspond to commands I'd like to handle.</p><pre><code>This is &lt;a href=""CMD:nice""&gt;a command&lt;/a&gt;.</code></pre><p>I populate a TextView with Html.fromHtml()</p><p>How can I use the Android Linkify system to convert the  links to Linkify'ed ones?</p>","172861","","238639","","2010-08-09 01:42:20","2010-08-09 03:12:38","Android Linkify from HTML in TextView","<android><linkify>","1","0","","",""
"3436674","1","","","2010-08-09 00:35:26","0","4489","<p>I currently have this in my AndroidManifest.xml</p><p><strong>uses-library android:name=""com.google.android.maps"" android:required = ""false""</strong></p><p>The specified requirement of google map api is not compulsory. (This enables me to install my application on an none-google-api emulator)</p><p>However, this only works for API level 7, Platform 2.1 <strong>It doesn't work for API level 4, Platform 1.6</strong></p><p>I am getting an error message when I am compiling - "" <strong>No resource identifier found for attribute 'required"" in package 'android'</strong></p><p>But, when I looked at the documentation here:<a href=""http://developer.android.com/guide/topics/manifest/uses-feature-element.html"" rel=""nofollow"">http://developer.android.com/guide/topics/manifest/uses-feature-element.html</a></p><p>The attribute 'required' is introduced since level 4.</p><p>Could somebody help me out!</p><hr><p>Thanks Aillyn</p><p>I think it impossible to include required attribute in uses-library tag.</p><p>Is there a way to include uses-library in the java code rather than in the AndroidManifest.xml??</p>","399820","","194753","","2011-10-11 14:57:34","2011-10-21 06:28:37","uses-library in AndroidManifest.xml","<android>","2","0","","",""
"3436682","1","","","2010-08-09 00:36:42","2","875","<p>Say I have 3 active Activities that can display and add data to a ContentProvider. What's the best way of synchronizing state among the Activities? For example, if ActivityA adds a new record to the ContentProvider, I would like ActivityB and ActivityC to receive notification so they  may update their view.</p>","204317","","","","","2012-07-11 09:09:28","Android: How to receive callback from Content Provider when Data Changes?","<android>","1","0","1","",""
"3436717","1","3437619","","2010-08-09 00:46:03","1","270","<p>I'm trying to develop a very specific app for my Dell Streak. I want the entire app to run landscape. The Streak has a tilt function that switches the whole OS to a landscape 800x480.</p><p>So I want to make an ADT to test in that uses an 800x480 display, but whenever I set the size I get no buttons. The Streak has a Home, Menu and Back button aswell as volume/mute and power, and I need to use some of them for my application.</p><p>P.S. I'm not worried about the tilting messing up my application. Not yet, anyway. Just need the test environment the right size and with buttons.</p>","414632","","","","","2010-08-09 05:51:23","How do I create an ADT virtual machine of a specific size that still has the hardware control buttons?","<java><android><virtual-machine><adt>","1","0","","",""
"3436733","1","3436757","","2010-08-09 00:52:55","1","1101","<p>I'm a novice Android programmer, and to help me understand how Intents really work, I wanted to put together a small Activity which would let the user call startActivity() with any action and data they want.  I tried many different combinations, including ""android.intent.action.VIEW"" and ""http://www.google.com"".  No matter what combinations I use, I always get an ActivityNotFoundException.  Any ideas as to why?</p><p>The code in my only Activity is below:</p><pre><code>public class TestingIntents extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button goButton = (Button) findViewById(R.id.button);        goButton.setOnClickListener(new ClickListener());    }    private class ClickListener implements OnClickListener    {        @Override        public void onClick(View arg0)         {            String id = ((EditText) findViewById(R.id.intent)).getText().toString();            String data = ((EditText) findViewById(R.id.data)).getText().toString();            Builder builder = new Builder();            builder = builder.path(data);            Uri path = builder.build();            Intent i = new Intent(id, path);            startActivity(i);        }    }}</code></pre><p>The results of adb shell logcat from the time of starting the app to just after touching 'Force close' are below.</p><pre><code>I/ActivityManager( 1086): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=tk.h2g2guy.testingIntents/.TestingIntents }I/ActivityManager( 1086): Start proc tk.h2g2guy.testingIntents for activity tk.h2g2guy.testingIntents/.TestingIntents: pid=4037 uid=10054 gids={}D/dalvikvm( 1006): GC_EXPLICIT freed 289 objects / 10960 bytes in 98msD/dalvikvm( 1006): GC_EXPLICIT freed 47 objects / 2088 bytes in 121msD/dalvikvm( 1006): GC_EXPLICIT freed 2 objects / 48 bytes in 109msI/ActivityManager( 1086): Displayed activity tk.h2g2guy.testingIntents/.TestingIntents: 462 ms (total 462 ms)D/dalvikvm( 2300): GC_EXPLICIT freed 1226 objects / 61640 bytes in 69msI/ActivityManager( 1086): Starting activity: Intent { act=android.intent.action.VIEW dat=http%3A//www.google.com }D/AndroidRuntime( 4037): Shutting down VMW/dalvikvm( 4037): threadid=1: thread exiting with uncaught exception (group=0x4001d7e0)E/AndroidRuntime( 4037): FATAL EXCEPTION: mainE/AndroidRuntime( 4037): android.content.ActivityNotFoundException: No Activityfound to handle Intent { act=android.intent.action.VIEW dat=http%3A//www.google.com }E/AndroidRuntime( 4037):        at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)E/AndroidRuntime( 4037):        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)E/AndroidRuntime( 4037):        at android.app.Activity.startActivityForResult(Activity.java:2817)E/AndroidRuntime( 4037):        at android.app.Activity.startActivity(Activity.java:2923)E/AndroidRuntime( 4037):        at tk.h2g2guy.testingIntents.TestingIntents$ClickListener.onClick(TestingIntents.java:41)E/AndroidRuntime( 4037):        at android.view.View.performClick(View.java:2408)E/AndroidRuntime( 4037):        at android.view.View$PerformClick.run(View.java:8816)E/AndroidRuntime( 4037):        at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime( 4037):        at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime( 4037):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 4037):        at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime( 4037):        at java.lang.reflect.Method.invokeNative(NativeMethod)E/AndroidRuntime( 4037):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 4037):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime( 4037):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime( 4037):        at dalvik.system.NativeStart.main(Native Method)W/ActivityManager( 1086):   Force finishing activity tk.h2g2guy.testingIntents/.TestingIntentsW/ActivityManager( 1086): Activity pause timeout for HistoryRecord{449d4518 tk.h2g2guy.testingIntents/.TestingIntents}I/Process ( 4037): Sending signal. PID: 4037 SIG: 9I/ActivityManager( 1086): Process tk.h2g2guy.testingIntents (pid 4037) has died.I/WindowManager( 1086): WIN DEATH: Window{44bd4120 tk.h2g2guy.testingIntents/tk.h2g2guy.testingIntents.TestingIntents paused=false}</code></pre>","414069","","414069","","2010-08-09 13:18:50","2010-08-09 13:18:50","Why do I constantly get ActivityNotFound exceptions?","<android><exception><activity>","2","0","","",""
"3436751","1","3436765","","2010-08-09 01:04:05","1","1474","<p>I have the following import in my android class Clock - </p><pre><code>import android.pim.DateUtils;</code></pre><p>But the compiler is giving me the error - </p><p>The import android.pim cannot be resolved.</p><p>I am using the Android 2.1-update1 jar. </p><p>Please help.    </p>","303347","","","","","2010-11-25 15:33:05","The import android.pim cannot be resolved","<android>","1","0","","",""
"3436801","1","3436809","","2010-08-09 01:20:40","3","1856","<p>I am trying to remove 6 rows from the database using the following statement but i get the error shown below</p><p>getWritableDatabase().execSQL(""DELETE FROM tblname ORDER BY _id ASC LIMIT 6;"");</p><p>Error:<strong>Caused by: android.database.sqlite.SQLiteException: near ""ORDER"": syntax error: DELETE FROM tblname</strong> </p><p>I tried reformatting the SQL in different ways but i couldn't get it to work. What am i missing? Thanks a lot for your help</p>","50510","","","","","2011-10-11 22:08:33","Deleting specified number of rows from SQLite database","<android><sqlite>","2","0","1","",""
"3436832","1","3597481","","2010-08-09 01:30:21","1","844","<p>I have four buttons arranged in a 2x2 TableLayout.  These buttons each have an image on the left and some text.  The buttons display fine in the emulator for 1.5, and for 2.2, but when testing with 1.6 the two buttons in the righthand column are cropped so that they are missing their righthand edge (the padding to the right of the text is missing and the button ends abruptly with squared off corners rather than rounded ones).  There is plenty of room for the TableLayout to expand to accommodate the full width of the buttons.  This happens for all screen sizes.</p><p>The layout looks like this and itself appears within a RelativeLayout:</p><pre><code>&lt;TableLayout android:id=""@+id/buttons""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:layout_centerHorizontal=""true""             android:layout_alignParentTop=""true""             android:paddingTop=""10dp""&gt;  &lt;TableRow&gt;    &lt;Button android:id=""@+id/button1""            style=""@style/LaunchButton""            android:drawableLeft=""@drawable/button1""            android:text=""@string/button1""/&gt;    &lt;Button android:id=""@+id/button2""            style=""@style/LaunchButton""            android:drawableLeft=""@drawable/button2""            android:text=""@string/button2""/&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;    &lt;Button android:id=""@+id/button3""            style=""@style/LaunchButton""            android:drawableLeft=""@drawable/button3""            android:text=""@string/button3""/&gt;    &lt;Button android:id=""@+id/button4""            style=""@style/LaunchButton""            android:drawableLeft=""@drawable/button4""            android:text=""@string/button4""/&gt;  &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>The buttons are styled as follows:</p><pre><code>&lt;style name=""LaunchButton""&gt;  &lt;item name=""android:layout_width""&gt;wrap_content&lt;/item&gt;  &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;  &lt;item name=""android:gravity""&gt;fill_horizontal&lt;/item&gt;  &lt;item name=""android:textSize""&gt;24dp&lt;/item&gt;  &lt;item name=""android:textStyle""&gt;bold&lt;/item&gt;&lt;/style&gt;</code></pre><p>I'm assuming this is a 1.6-specific bug.  Has anybody else come across this problem?  Any suggestions for work-arounds?</p><p><strong>EDIT:</strong> I've had the opportunity to try it with Android 2.1 (both on the emulator and a device), and the problem happens there too.  So 1.5 good, 1.6 bad, 2.1 bad, 2.2 good.</p>","5171","","5171","","2010-08-09 14:02:14","2010-09-03 02:23:35","Buttons in TableLayout cropped on Android 1.6 and 2.1 (but not on 1.5 or 2.2)","<android><tablelayout>","1","1","1","",""
"3436843","1","3443144","","2010-08-09 01:33:38","0","377","<p>I know this has been asked before, but nothing is working.</p><p>I have signed my app.  </p><p>I sent the signed apk as an email attachment.</p><p>I click on the email attachment to install it and I get a parsing error.</p><p>What am I doing wrong?</p><p>Thanks DeanO</p><p>screen shot link  <a href=""http://picasaweb.google.com/lh/photo/EAdwMYNAPXSoY9BU8VJRhw?feat=directlink"" rel=""nofollow"">http://picasaweb.google.com/lh/photo/EAdwMYNAPXSoY9BU8VJRhw?feat=directlink</a></p>","408112","","408112","","2010-08-09 19:40:35","2011-02-09 07:05:01","parsing error with android app","<android>","1","2","","",""
"3436917","1","3437058","","2010-08-09 01:59:45","1","807","<p>To enable Linkify behavior, I do this in code:</p><p>textView.setMovementMethod(LinkMovementMethod.getInstance());</p><p>Is there a way to set this in the layout xml for the textview?</p>","172861","","","","","2011-06-04 22:21:56","Android LinkMovementMethod in XML?","<android><linkify>","2","0","","",""
"3436938","1","3548806","","2010-08-09 02:07:38","10","3747","<p>I'm looking for some way in Android to play in-memory audio in a manner analogous to the <code>waveOutOpen</code> family of methods in Windows programming.</p><p>The <code>waveOut...</code> methods essentially let an application create arrays of sample values (like in-memory WAV files without the headers) and dump them into a queue for sequential playback.  Windows transitions seamlessly from one array to the next, so as long as the application keeps dumping arrays into the queue ahead of playback, the program can create and play continuous audio of any arbitrary length.  The Windows API also incorporates a callback mechanism that the application can use to indicate progress and load additional buffers.</p><p>As far as I can tell, the Android audio API lets an application play a file from local storage or a URL, or from a memory stream.  Is there any way to get Android to ""queue up"" <code>MediaPlayer.start()</code> calls so that one player transitions (without glitches) into the next upon play completion?  It appears that <code>Jet</code> does something like this, but only with its own internal synthesis engine.</p><p>Is there any other way of accessing Android audio in a <code>waveOutOpen</code> way?</p>","14606","","","","","2010-08-23 15:02:37","Low-level audio API for Android","<android><audio>","1","0","1","",""
"3436970","1","","","2010-08-09 02:21:07","0","375","<p>I am implementing a simple app. I need to start an activity based on the state of the Activity. Lets take i am using a button to start the activity.     1. If the activity is not started, I need to start XYZ activity.     2. If the XYZ activity is on focus, then i need to close the activity on the button press.     3. If the XYZ activity is not in focus (like onPause) state then, I need to change the button state.</p><p>Can you please help me in the flags that i need to use for starting the intent. Is it possible to get the state of activity before I start that activity?</p>","291364","","","","","2011-04-09 14:26:19","Launching activity through intents","<android><activity><android-intent>","3","0","","",""
"3437109","1","3437185","","2010-08-09 03:10:42","3","801","<p>I understand how to create a custom Android control, and I believe I understand how to pull attributes for it from the Xml layout. I don't know, however, how to get any children elements from it.</p><p>Here's a visual example of what I'm trying to accomplish:</p><pre><code>public class Menu extends LinearLayout{    // Custom Code}public class MenuItem extends Button{    // Custom Code}&lt;!-- Layout --&gt;&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;Menu&gt;    &lt;MenuItem/&gt;    &lt;MenuItem/&gt;&lt;/Menu&gt;</code></pre><p>When my Menu is created, how do I get references to the two MenuItems?</p>","301839","","","","","2010-08-09 15:37:15","How do I design a custom Android control and use it in Xml?","<android><xml><android-layout><android-custom-view>","2","1","","",""
"3437259","1","3515992","","2010-08-09 04:00:24","3","638","<p>It is a Java issue in general, though in this particular case I am using Vertex Arrays in Android for OpenGL. To use this basic GL system, you must use Java's Buffer system in native allocation mode. This is very slow on Java. And roughly 40-50% of my entire application's time is spent inside of buffer.put().</p><p>Is there any way to speed this up while staying in Java (ie, don't use the native sdk)?</p>","255605","","","","","2010-08-19 08:14:52","How to get around the performance issues with Buffer.put() and Android OpenGL","<android><performance><opengl-es><buffer>","3","2","3","",""
"3437388","1","","","2010-08-09 04:43:47","0","144","<p>Is there any source code to send same messages to multiple recipients.Here I need to send some message to multiple recipients. I should be able to select phone numbers and send that message.Can any one please add any sample code with a apt user interface...</p>","371960","","","","","2011-06-28 18:41:53","Android Message Sending","<android>","1","0","","",""
"3437414","1","4919457","","2010-08-09 04:52:56","3","18132","<p>I have a tabview in my android app with 3 tabs. The tabs are all working fine.</p><p>Now I want to perform some additional logic when the tab (on the top) of the currently active tab is clicked. </p><p>Here is an example:</p><p>In one of my tabs, I provide an option for the user to sort things in different order. When the press the tab of the currently active tab, I want to reset all these sorting.</p><p>Is it possible to capture the tab click event in tabview and perform some additional logic?</p><p>Edit: Edited for clarity.</p>","24949","","24949","","2010-08-09 06:56:49","2012-08-17 23:55:46","Capturing the tab click event in Android Tabview","<android><tabs>","4","2","1","",""
"3437456","1","","","2010-08-09 05:02:54","-1","2397","<p>please guide me how to implement the push notification in android. according to my application when server hits any information at any time i want to display that info at that time. what i need to implement this in my android plateform.</p>","403007","","21234","","2012-03-04 00:23:47","2012-07-13 09:27:58","push notification in android","<android><push-notification>","2","0","0","",""
"3437527","1","","","2010-08-09 05:27:11","1","1254","<p>I have been attempting to add sound on boot to run with the boot animation on a droid running Froyo 2.2 ROM.</p><p>This is what I have tried this far:</p><p>Added to init.rc</p><pre><code>###Bootsound - Safe to Delete: Start ###service bootsound /system/bin/bootsound        user media        group audio        disabled        oneshoton property:init.svc.bootanim=running   # to correct timing        start bootsoundon property:dev.bootcomplete=1        stop bootsound### Bootsound - Safe to Delete: End ###</code></pre><p>Created bootsound in /system/bin</p><pre><code>#!/system/bin/sh#bootsound - plays a sound at bootbprop=/system/build.propgrepprop() { x=`grep ""^$1="" $bprop | head -n 1`; echo $x | cut -d = -f 2; }play=`grepprop ""ro.config.play.bootsound""`if [ ""$play"" = ""1"" ]; then        stagefright -a -o /system/media/android_audio.mp3fiexit 0</code></pre><p>Added to build.prop</p><pre><code>### Safe to Delete: Start ###ro.config.play.bootsound=1### Safe to Delete: End ###</code></pre><p>And of course added the android_audio.mp3 file to /system/media</p><p>No luck, can anyone spot what I may have missed?</p><p>Thanks </p>","414728","","995926","","2012-05-05 13:41:37","2012-05-05 13:41:37","Adding boot sound to Froyo 2.2 Droid","<android><audio><boot><android-2.2-froyo>","1","1","","",""
"3437532","1","3437709","","2010-08-09 05:28:17","5","1961","<p>I would like to know what would be the top ten most deadly permissions that can be requested by an android. I know it might be a matter of opinion, but supposing that I had the 10 permission listed in by an application, I would definitely know my application did not generate a whole lot of confidence among users. What would be the permissions I would most likely like to avoid asking the user for.</p><p>I am aware of permissions like BRICK and SHUTDOWN but since they don't apply to third party devs I would like to know only of permission which can be requested by a third party developer.</p><p>PS: need not necessarily be 10. Any number of permissions you believe might lead to the user being weary of application would be nice.</p>","393459","","69742","","2010-08-10 21:14:55","2010-08-10 21:14:55","Whats are the ten most deadly permissions?","<android><permissions>","5","0","4","","2010-08-09 05:28:17"
"3437568","1","","","2010-08-09 05:36:04","0","1078","<p>I want to know that is it possible to implement the push notification in Android 1.6. If it possible then how can I solve this? </p>","403007","","3978","","2010-08-09 06:33:40","2011-07-30 05:27:20","push notification in Android 1.6","<android><push-notification>","1","3","0","",""
"3437653","1","","","2010-08-09 06:01:27","0","1627","<p>I can get a cookie with firefox, but not with android.</p><p>This is the code:</p><pre><code>HttpParams httpparams = new BasicHttpParams();                          httpparams.setParameter(ClientPNames.COOKIE_POLICY,CookiePolicy.BROWSER_COMPATIBILITY);HttpGet httpget = new HttpGet(sURL);httpget.setParams(httpparams);httpget.setHeader(""User-Agent"",""Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2"");httpget.setHeader(""Accept"", ""text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"");httpget.setHeader(""Accept-Language"", ""es-mx,es;q=0.8,en-us;q=0.5,en;q=0.3"");httpget.setHeader(""Accept-Encoding"", ""gzip,deflate"");httpget.setHeader(""Accept-Charset"", ""ISO-8859-1,utf-8;q=0.7,*;q=0.7"");httpget.setHeader(""Keep-Alive"", ""115"");BasicHttpResponse response = (BasicHttpResponse) httpclient.execute(httpget);</code></pre><p>Using wireshrack I saw:</p><pre><code>GET /login.php HTTP/1.1User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: es-mx,es;q=0.8,en-us;q=0.5,en;q=0.3Accept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive: 115Host: www.conquerclub.comConnection: Keep-Alive</code></pre><p>and the response is using my code:</p><pre><code>HTTP/1.1 200 OKDate: Mon, 09 Aug 2010 05:41:38 GMTServer: Apache/2.0.52 (Red Hat)X-Powered-By: PHP/5.2.13Set-Cookie: referer=%5Bdirect%5D; path=/Set-Cookie: referer60=%5Bdirect%5D; expires=Wed, 08-Sep-2010 05:41:38 GMT; path=/Connection: closeTransfer-Encoding: chunkedContent-Type: text/html</code></pre><p>but whith Firefox the response is</p><pre><code>HTTP/1.1 200 OKDate: Mon, 09 Aug 2010 05:11:13 GMTServer: Apache/2.0.52 (Red Hat)X-Powered-By: PHP/5.2.13Set-Cookie: referer=%5Bdirect%5D; path=/Set-Cookie: referer60=%5Bdirect%5D; expires=Wed, 08-Sep-2010 05:11:13 GMT; path=/Set-Cookie: PHPSESSID=sv8f6ro571t9rv999mu6jtkbu3; path=/; HttpOnlyExpires: Thu, 19 Nov 1981 08:52:00 GMTCache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0Pragma: no-cacheContent-Encoding: gzipVary: Accept-EncodingContent-Length: 4324Connection: closeContent-Type: text/html</code></pre><p>again using wireshark to see firefox I got this:</p><pre><code>GET / HTTP/1.1Host: www.conquerclub.comUser-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: es-mx,es;q=0.8,en-us;q=0.5,en;q=0.3Accept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive: 115Connection: keep-alive</code></pre><p>It is the same, but the server don't respond this line</p><pre><code>Set-Cookie: PHPSESSID=sv8f6ro571t9rv999mu6jtkbu3; path=/; HttpOnly</code></pre><p>why? any idea would be very well receive.</p>","383343","","383343","","2010-08-09 06:25:20","2010-08-11 02:58:03","How can I get a missing cookie with android ? In Firefox yes appear","<android><cookies>","2","2","","",""
"3437686","1","","","2010-08-09 06:09:53","8","17533","<p>I am trying to send touch events to a device using AndroidDebugBridge, so that I can do some basic automation for UI tests. I have followed the discussion in <a href=""http://groups.google.com/group/android-beginners/browse_thread/thread/8a5d8fa9229114d2/ce6e604f52b5318f?pli=1"">LINK</a>. I am able to use sendevent to simulate touch on emulators, but unable to do the same on a device. </p><p>Like in above link the emulator seems to send out 6 events for each touch ( xcoord, ycoord, 2 for press,2 for release) and it was easy to use this information to sendevents, but a getevent for the touchscreen for a device seems to generate far too many events.</p><p>Has somebody managed to send touch from ADB to a device? Could you please share the solution.</p>","414752","","1609201","","2013-06-16 10:25:27","2013-10-10 06:24:44","How to use ADB to send touch events to device using sendevent command?","<android><automation><adb><touchscreen>","4","1","0","",""
"3437694","1","4173396","","2010-08-09 06:11:54","6","13516","<p>I am building an application reading the signal strength of each available Wifi access point. </p><p>I've written code like:</p><pre><code>    wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);    // Get WiFi status    WifiInfo info = wifi.getConnectionInfo();    textStatus.append(""\n\nWiFi Status: "" + info.toString());    // List available networks    List&lt;WifiConfiguration&gt; configs = wifi.getConfiguredNetworks();</code></pre><p>However, I have two problems:</p><ol><li><p>In debugging, <code>configs</code> only contains one connection. However, I can see that there are several APs available in the system's wifi setting. I.e. <code>configs</code> is an incomplete list.</p></li><li><p>I don't know how to get the signal strength in <code>WifiConfiguration</code>.</p></li></ol><p>btw, I am using HTC Hero and Android 1.5. </p>","183828","","","","","2014-01-03 09:40:00","How to get the connection strength of Wifi access points?","<android><wifi>","4","0","6","",""
"3437702","1","","","2010-08-09 06:14:00","1","2328","<p>I want my application to display a ZoomButtonsController on a GLSurfaceView whenever the user touches the GLSurfaceView. My activity constructor looks like this:</p><pre><code>_zoomButtonsController = new ZoomButtonsController(_surface);_zoomButtonsController.setAutoDismissed(true);            _zoomButtonsController.setOnZoomListener(_zoomListener);  // Set listener</code></pre><p>Then I override <code>onTouchEvent()</code> to make the ZoomButtonsController visible when the user generates an <code>ACTION_MOVE</code> event:</p><pre><code>/** Called when user generates touch event */@Overridepublic boolean onTouchEvent(MotionEvent event) {    switch (event.getAction()) {    case MotionEvent.ACTION_MOVE:        // Does this somehow register an IntentListener???         if (_zoomButtonsController != null) {            _zoomButtonsController.setVisible(true);        }</code></pre><p>The application appears to work until I exit, at which time I get:</p><pre><code>D/Solaris (22616): onDestroy() E/WindowManager(22616): Activity com.tomoreilly.solarisalpha.SolarisAlpha has leaked window android.widget.ZoomButtonsController$Container@4495c640 that was originally added here</code></pre><p>and the stack trace refers to the line in <code>onTouchEvent</code> where <code>_zoomButtonsController.setVisible(true)</code> was called.</p><p>Why is this? Why does setting the zoom button controller visible also register it as an intent listener? And how the heck do I unregister it?  Am I actually using the proper approach - i.e. should I call <code>ZoomButtonsController.setVisible(true)</code> from within <code>Activity.onTouchEvent()</code>?</p><p>Thanks,Tom</p>","414755","","135138","","2010-09-23 17:19:31","2010-09-23 17:19:31","leaked IntentReceiver android.widget.ZoomButtonsController?","<android>","1","0","","",""
"3437713","1","","","2010-08-09 06:15:49","4","879","<p>I am developing a program drawing text on screen using android NDK in C native code. Could you please tell me how do I render the text? Thank you.</p><p>Best regards    Michael</p>","414756","","414756","","2010-08-09 06:27:55","2010-08-09 10:19:43","How to render text in C (android)?","<c><android><fonts><native>","4","0","","",""
"3437727","1","3438577","","2010-08-09 06:17:37","2","940","<p>I notice that some of the base applications in Android are using this little control (View in Android terms I guess) that shows the contact picture. When you click on the picture it shows all the ways of contacting the person (phone, sms, talk, facebook). I see this little View used in the contact app, sms app, twitter for android, facebook for android etc.</p><p>Is there a library or a way of getting this working on my own application or do I need to write this from scratch?</p>","397900","","","","","2010-08-09 08:58:56","Where to find the Contact View in Android?","<android>","1","0","1","",""
"3437921","1","","","2010-08-09 07:02:26","1","1994","<p>I am using Android API 2.1.</p><p>Whether API's are available for adding new Custom field of Specific MIME type from an application.I have done through normal insertion of new contacts by this MIME type ""vnd.android.cursor.item/asterix"" and inserted on Data.Data1 .. Contact got inserted but not displaying any details please sort me out from this requirement.</p>","412719","","199048","","2014-03-24 21:15:55","2014-03-24 21:15:55","Adding new Custom Field of specific MIME type in Contacts App","<android>","1","0","0","",""
"3437949","1","","","2010-08-09 07:06:10","5","1758","<p>How to set transparent toast frame in android ? I want to it more transparent.</p>","397849","","","","","2010-08-09 09:11:48","Transparent toast frame","<android><transparent>","1","0","1","",""
"3437988","1","","","2010-08-09 07:13:30","2","509","<p>My xml code is:</p><pre><code>    &lt;GridView android:id=""@+id/gridView_calendar""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:layout_weight=""1"" android:numColumns=""5""/&gt;</code></pre><p>But there appear to the right of the gridView a blank. Its size seems for scroll bar. I don't know how it comes. Can anybody help me? Thanks!</p>","414787","","375209","","2010-12-27 07:53:37","2013-11-28 14:24:47","Unknown space to the right of the grid view","<android><gridview><scroll><android-layout><space>","2","0","1","",""
"3438233","1","3448189","","2010-08-09 07:53:20","6","4905","<p>I'm searching for a way to password protect my android application on launch, i.e. when launching/resuming an activity belonging to my apk-package a password dialog will be shown.</p><p>I've tried some approaches to this (extending <a href=""http://developer.android.com/reference/android/app/Application.html"">application class</a> and so on) but none seems to work. Either they don't run on the UI thread or the dialog isn't shown on every launch/resume occasion.</p><p>// m</p>","414817","","","","","2012-02-27 17:09:46","Password protect launch of android application","<android>","2","1","10","",""
"3438276","1","3438352","","2010-08-09 08:04:24","73","88945","<p>How do I change the text of the title bar? as of now it just displays the title of the program and im wanting it to display something of my choosing and be different for each page/activity in my app i.e. my home page could say page1 in the title bar while another activity that the app switches to could have page2 in that page's title bar.</p>","407775","","56285","","2014-01-14 14:12:06","2014-01-16 06:11:46","Change title bar text in Android","<android><android-actionbar><android-titlebar><custom-titlebar>","6","0","44","",""
"3438408","1","3438563","","2010-08-09 08:30:02","2","2236","<p>I was asked to refactor the <code>getView()</code> code presented below.</p><p>I have got ListView with custom Adapter. Every row contains clickable buttons and texts.</p><p>At the moment onClickListeners are set in the body of <code>getView()</code>, this is quite insane idea, because this method is called very frequently. Inside of every onClick function I need access to the  private data to call new activity with bundle.</p><p>How can i move onClick definition outside getView() routine?</p><p>When onClick will be called I need info about position of list element (to access private data) and which View was clicked (to start correct Activity) .</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {    if(convertview == null) {        convertView = ((Activity) getContext()).getLayoutInflater().inflate(R.layout.photo_tweet_row, null);    }    TextView userTweet = (TextView) v.findViewById(R.id.feed_user_tweet_body);    RepliesButton repliesBtn = (RepliesButton) v.findViewById(R.id.feed_replies_button);    Status twitterDataItem = getItem(position);    if (twitterDataItem != null) {        if (userTweet != null) {            userTweet.setText(twitterDataItem.getText());        }        if (repliesBtn != null) {            repliesBtn.setText("" replies"");        }        userTweet.setOnClickListener(new View.OnClickListener() {                       @Override            public void onClick(View v) {                                  Intent intent = new Intent(getContext(), ProfileActivity.class);               intent.putExtra(getContext().getString(R.string.serializable_user), twitterDataItem.getUser());              getContext().startActivity(intent);            }        });        repliesBtn.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                if (!twitterDataItem.getComments().contentEquals(""0"")) {                    Intent myIntent = new Intent(getContext(), RepliesToFeedActivity.class);                    myIntent.putExtra(""photoTweet"", twitterDataItem);                    getContext().startActivity(myIntent);                }            }        });    }    return convertView;}</code></pre>","361832","","361832","","2010-08-09 18:31:35","2011-02-09 16:03:51","How to avoid setting inline onClickListner in getView()","<android><listview><onclick><listener>","2","1","1","",""
"3438565","1","3469350","","2010-08-09 08:55:53","5","7580","<p>I initialize some arrays in an onUpdate() method and after that, using an intent and a button, I try to call onReceive() function which runs fine but cannot access arrays set in onUpdate() method. Why is that? Those array's are object variables and are declared public.Am I missing something?</p><pre><code>package net.aerosoftware.widgettest;import java.util.HashMap;import android.app.PendingIntent;import android.appwidget.AppWidgetManager;import android.appwidget.AppWidgetProvider;import android.content.Context;import android.content.Intent;import android.util.Log;import android.widget.RemoteViews;public class WidgetTest extends AppWidgetProvider {    public static String ACTION_WIDGET_RECEIVER = ""ActionReceiverWidget"";    public HashMap&lt;Integer, String&gt; channelsImages;    @Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)     {        Log.e(""UPDATE"", ""Start"");           RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.main);        channelsImages = new HashMap&lt;Integer, String&gt;();        channelsImages.put(0, ""one"");        channelsImages.put(1, ""two"");        Intent active = new Intent(context, WidgetTest.class);        active.setAction(ACTION_WIDGET_RECEIVER);               PendingIntent actionPendingIntent = PendingIntent.getBroadcast(context, 0, active, 0);        remoteViews.setOnClickPendingIntent(R.id.buttonclick, actionPendingIntent);        super.onUpdate(context, appWidgetManager, appWidgetIds);        appWidgetManager.updateAppWidget(appWidgetIds, remoteViews);        Log.e(""UPDATE"", ""End"");    }    @Override    public void onReceive(Context context, Intent intent)     {        Log.e(""RECEIVE"", ""Start 2"");        if (intent.getAction().equals(ACTION_WIDGET_RECEIVER))         {            try            {                Log.e(""SIZE"", ""Size Of channel array: ""+channelsImages.size());            }            catch(Exception e)            {                Log.e(""ON_RECIEVE_ERROR"", "" ""+e.getMessage());            }        }        super.onReceive(context, intent);        Log.e(""RECEIVE"", ""End"");    }}</code></pre>","180344","","180344","","2010-08-09 11:19:11","2010-08-12 15:31:16","Widget onUpdate, onReceive","<android><android-widget>","2","4","1","",""
"3438575","1","","","2010-08-09 08:58:43","0","586","<p>In my tableview i need to add the scroll view for the particular rows . Is there any way to create like this in android?  </p>","398981","","","","","2011-02-22 14:39:21","Add scroll view for particular row in runtime in android?","<android>","1","0","","",""
"3438591","1","","","2010-08-09 09:02:40","1","7136","<p>Hi would someone post an example of how to stream audio/video files using rtsp in android........</p>","414884","","140592","","2010-11-24 11:08:29","2013-02-23 05:23:54","example for rtsp streaming in android","<android><rtsp>","1","2","1","",""
"3438615","1","9074649","","2010-08-09 09:05:56","1","620","<p>hi  i am implementing gallery application  in this gallery circular order draging left to right and right to left scrolling  i am using one handler on gallery rotation  another activity is gallery item clicking  handler automatically running  display the gallery image another action is click the gallery image display the clicked image   my problem gallery image clicking  and scorring  stop handler  and not scrolling clicking next continue to handler this functionality how can implemented please some suggestion its urgent some solution </p><p>clicking activity</p><pre><code> g.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id)             {                try {                    imageid=position;                    ((ImageView)findViewById(R.id.ImageViewlarge)).setImageResource(mImageIds[position]);                    ((TextView)findViewById(R.id.TextViewImageName)).setText(imgNames[position]);                     mp = MediaPlayer.create(SeaSpell.this,audioTrack[position]);                        } catch (Exception e) {                                // TODO Auto-generated catch block                                e.printStackTrace();                            }                }            });</code></pre><p>handler gallery rotation</p><pre><code> class RefreshHandler extends Handler {        @Override        public void handleMessage(Message msg) {                        SeaSpell.this.updateUI();        }        public void sleep(long delayMillis) {            this.removeMessages(0);                     if(isUpdateUI)                sendMessageDelayed(obtainMessage(0), delayMillis);        }}public void updateUI(){    try    {     getImages();// this method is gallery  rotation in circular manner        mRedrawHandler.sleep(3000);    }</code></pre><p>how can solve this problem please send some solution  its urgent </p>","254790","","","","","2012-01-31 05:01:11","how to implement handler pause on another activity running this activity finish next continue handler","<android>","1","2","1","",""
"3438637","1","3499350","","2010-08-09 09:10:18","21","8724","<p>I've accepted for a while now that it's impossible to silently install an application on Android - that is, to have a program install an application bundled as an APK without providing the standard OS installation prompt and going through the app installer activity. But now I've picked up a copy of the Appbrain fast web installer, and it does exactly this.</p><p>How on earth is this possible? :D</p>","39368","","","","","2011-12-19 06:51:20","Silent installation on Android devices","<android><install><apk>","3","13","10","",""
"3438656","1","3440228","","2010-08-09 09:12:48","1","3274","<p>I want to implement an activity where the only thing you see is a big image, which can be scrolled horizontally and vertically.On Top of that image I want to display buttons, that can be clicked and trigger certain actions (like creating an intent to start a new activity).</p><p>First I was thinking about a ScrollView, that has a FrameLayout as a child. The FrameLayout could have the image as a background and can have the buttons as childs. Because I know the position of my buttons exactly I could place them with absolute coordinates. Here is my first code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;FrameLayout        android:layout_width=""1298px""        android:layout_height=""945px""        android:background=""@drawable/myimage""&gt;        &lt;Button              android:id=""@+id/mybutton""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:layout_x=""115px""            android:layout_y=""128px""/&gt;    &lt;/FrameLayout&gt;&lt;/ScrollView&gt;</code></pre><p>The Problem is, that you can only scroll a ScrollView vertically. HorizontalScrollView doesn't solve the Problem, cause it only scrolls in one direction either. Can I mix them somehow? Is there another solution? </p><p>I found some similar threads on stackoverflow, where people put the image into a WebView and get horizonzal/vertical scrolling for free (<a href=""http://stackoverflow.com/questions/2278625/android-imageview-scrolling-to-display-full-high-quality-image"">here</a>). Or someone put the image in an imageview and gave the imageview an onTouchListener to handle scrolling (<a href=""http://stackoverflow.com/questions/3058164/android-scrolling-an-imageview)"">here</a>). The Problem with both ways is, that I either way I dont think you can put Buttons on top of the image, which is what I need to do.</p><p>I would very appreciate if someone help me out.</p>","351723","","","","","2010-08-09 13:07:03","Android: Scrollable (horizontal and vertical) ImageView with Buttons overlayed","<android><image><button><scrolling>","1","0","","",""
"3438704","1","4199453","","2010-08-09 09:20:50","2","4414","<p>After performing a Menubar> Project> Clean...I get the following error in the errorlog:</p><blockquote>  <p>Java Model Exception: Java Model Status [gen [in MyApp] does not exist]      at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:502)      at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246)      at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:515)      at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:252)      at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:238)      at org.eclipse.jdt.internal.core.PackageFragmentRoot.getKind(PackageFragmentRoot.java:477)      at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:645)      at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(PackageExplorerContentProvider.java:791)      at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:734)      at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(PackageExplorerContentProvider.java:791)      at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:734)      at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.elementChanged(PackageExplorerContentProvider.java:124)      at org.eclipse.jdt.internal.core.DeltaProcessor$3.run(DeltaProcessor.java:1557)      at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)      at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1547)      at org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:1381)      at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1357)      at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:1958)      at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:470)      at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291)      at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)      at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)      at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)      at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:313)      at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1022)      at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:45)      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)</p></blockquote><p>Any ideas if this is a problem and what is causing it?It occurs whether I Clean just my project or all projects </p><ul><li>Frink</li></ul><p>My Development Environment is:Eclipse 3.5.2 with ADT 0.9.7 (2.1) and Java SDK 6 Update 2132bit Windows XP VirtualBox VM on 64bit Windows 7AMD Phenom II X4 955 Processor @3.20GHz with 4GB RAM</p>","131209","","","","","2014-01-22 05:06:17","Java Model Exception: Java Model Status [gen [in MyApp] does not exist] after Eclipse Android project Clean","<android><android-sdk-2.1>","7","1","2","",""
"3438743","1","3438840","","2010-08-09 09:28:13","3","959","<p>I am writing an activity, that loads data from a server and displays it as a list using ArrayAdapter. For that I'm showing a progress dialog i.e loading, while it loads all data from the server. Then i dismiss the dialog in a handler. My problem is that when ever i change the orientation, the progress dialog is again shown, which is not needed, because all the data is displayed already?</p>","414777","","114066","","2010-08-09 10:52:04","2010-08-09 10:52:04","How to handle Activity when Orientation changes?","<android><progressdialog><activity-lifecycle>","1","0","","",""
"3438791","1","3439295","","2010-08-09 09:37:35","0","1026","<p>I was wondering if anyone knows of a tutorial explaining how to capture the video from the camera on an Android device and then display the video in real time on the screen?</p><p>I have looked up MediaRecorder, MediaPlayer, Videoview but they all seem concerned with recording audio/video to a file or playing audio/video from a file or a URL.</p><p>I simply want to be able to take the data from what the camera is seeing and display it on the screen.</p>","243999","","","","","2010-08-09 10:52:53","Android - How do I capture and loop video to the screen?","<android><video-capture><video-camera><audiovideoplayback>","1","0","","",""
"3438792","1","","","2010-08-09 09:37:40","0","256","<p>Friends,   I am inserting the xml parsed data into database table,i have the following fields,name,price,image,</p><ol><li>Static insert of nameaddevent(""name"",price,image);it's getting inserted well,where i given name field has static.</li></ol><p>2.Dynamic insert of names.But when insert the field data from xml parsed value (name) - String ,it's being inserted has null value in the table or it's blank value.</p><p>table field data types,  name  TEXT, price TEXT,image TEXT.Help me fix this problem.</p><p>Thank's in advance</p>","407506","","263521","","2010-08-09 11:41:17","2010-08-09 12:12:28","Reason for inserting column value in SQLite database","<android><database><sqlite><insert>","1","0","","",""
"3438809","1","3441133","","2010-08-09 09:41:21","2","13318","<p>I have a list of albums which I got using this:</p><pre><code>private List&lt;Album&gt; getAlbums() {Cursor cur = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, null, null, null);  List&lt;Album&gt; albums = new ArrayList&lt;Album&gt;();  if (cur.moveToFirst()) {   do {    int albumIdIndex = cur.getColumnIndex(MediaStore.Audio.Media.ALBUM_ID);    int albumIndex = cur.getColumnIndex(MediaStore.Audio.Media.ALBUM);    int artistIndex = cur.getColumnIndex(MediaStore.Audio.Media.ARTIST);    int albumId = cur.getInt(albumIdIndex);    String name = cur.getString(albumIndex);    String artist = cur.getString(artistIndex);    LogUtil.i(TAG, ""albumid= "" + albumId + "", album= "" + name + "", artist="" + artist);    Album album = new Album(albumId, name, artist);    if (!albums.contains(album)) {     albums.add(album);    }       } while (cur.moveToNext());  }  return albums; }</code></pre><p>I use this list of albums in a ListActivity, but I also want to get the thumbnails of the Albums. </p><p>I know I can use the following code to get the actual artwork, but I need the thumbnails because I get Out Of Memory if I use the full images in a List Activity:</p><pre><code>Uri sArtworkUri = Uri.parse(""content://media/external/audio/albumart"");Uri uri = ContentUris.withAppendedId(sArtworkUri, album_id);</code></pre><p>I saw this post:<a href=""http://stackoverflow.com/questions/2902232/android-media-thumbnails-serious-issues"">http://stackoverflow.com/questions/2902232/android-media-thumbnails-serious-issues</a>But I do not have the imageId, only the albumid, so I don't think it helps.</p>","396106","","","","","2010-08-12 06:18:50","How do I get Album Thumbnails in Android?","<android><thumbnails><albumart>","1","1","4","",""
"3438857","1","3438992","","2010-08-09 09:48:49","5","11786","<p>I am adding three text views in a activity. I need scrollview for every textview. If i add scroll view the third one is only have the scroll view. How to set scroll view for all text views in a single screen(Activity)</p>","389404","","","","","2013-12-30 06:44:50","Scroll view for textview in android","<android>","2","0","3","",""
"3438926","1","3439256","","2010-08-09 09:59:23","4","6767","<p>Hi Folks,</p><p>I have different layout files for different screens size like</p><p>Folder Structure:</p><p>layout layout-large layout-small</p><p>For emulators like HVGA and QVGA there is no problem, the respective layout.xml file being refereed. But the layout-large folder is ignored when I run the emulator of WVGA(480x854) , here it is referring the ""layout"" folder of the application. Please point me to the right direction which is right way to handle this situation.</p><p>I tried using</p><blockquote>  <p>layout-large-hdpi  layout-large-mdpi layout-large-ldpi   layout-normal-hdpi layout-normal-mdpi  layout-normal-ldpi</p></blockquote><p>And in the AndroidManifest.xml I specified</p><pre><code>   &lt;supports-screens   android:largeScreens=""true""   android:normalScreens=""true""   android:smallScreens=""true""   android:anyDensity=""true"" /&gt;</code></pre><p>but no success</p><p>Best Regards, Vinayak</p>","28557","","1104926","","2011-12-19 13:24:58","2011-12-19 13:24:58","Android - layout-large folder is been ignored","<android><android-manifest>","2","2","","",""
"3439052","1","","","2010-08-09 10:18:45","0","201","<p>I am new to android.I have created sdcard.iso file.Then i have opened the adb shell and i gave ls -l..</p><p>I found that the sdcard system file is d--------- instead of dwrxwrxwrx ..</p><p>I have tried to push image file into sdcard using DDMS-->File Explorer.I tried to push the file I cant.</p><p>I shows cannot push the file:Its is read only file system..</p><p>I set the Target also as -sdcard </p><p>Please help me out..</p>","366916","","","","","2010-08-09 11:46:50","Android-Sd card","<android>","1","1","","",""
"3439056","1","","","2010-08-09 10:19:13","0","3314","<p>In my case i would be retrieving values from sqlite database and have to display it in a list view...So how should i pass the images out from the database into the list view.. I am able to save and retrieve images individually and display it on the screen.But how do i pass a bitmap and display it in a list view.can you help me with some sample codes please...</p>","414945","","135152","","2011-07-05 17:54:28","2011-07-05 17:54:28","How to display list of images in listview from database using android?","<android><sqlite><android-listview>","1","0","","",""
"3439080","1","3439869","","2010-08-09 10:23:07","0","1458","<p>I am having a really difficult time trying to work with android's ListView multipleChoice mode. Here is what I am trying to do:</p><p>I have a ""players"" button in a game setup screen. When this is clicked it opens another activity with a multipleChoice ListView of all the players in the database in CheckedTextViews. I have this working properly and when you click on a player they will be added or removed from the game via a query to the game_players table. </p><p>The problem I am having is in setting up the ListView so that the players that have already been added to the game get checked initially when the activity opens. </p><p>I have tried to do this by iterating over the entire list in the ListView activity but this doesn't work because the Views that are not currently visible can't be accessed to check. </p><p>So now I'm trying to do this in my extended SimpleCursorAdapter in bindView but I can't even get this simple code to work:</p><pre><code>@Overridepublic void bindView(View _view, Context _context, Cursor _cursor) {    String name = c.getString(c.getColumnIndexOrThrow(from[0]));    this.player = (CheckedTextView)_view.findViewById(to[0]);    this.player.setText(name);    this.player.setChecked(true);}</code></pre><p>It correctly sets the player's name with setText(), but I can't get any of the boxes to check in bindView. Is there somewhere else I should be doing this or am I just doing it incorrectly?</p>","414260","","","","","2013-08-03 01:54:01","Setting Initially checked CheckedTextViews in ListView for choiceMode=""multipleChoice""","<android>","2","0","","",""
"3439356","1","3439838","","2010-08-09 11:02:46","53","57125","<p>I have a service class. I have exported this class to jar and I have embed the jar in my client app.</p><p>When needed, I call the service class. When I try to do this, I get the following error:</p><p>Unable to start service Intent {comp={com.sample.service/com.sample.service.serviceClass}} : not found</p><p>I have other class apart from the service class, which I am able to access (create object of that class) which are inside the same jar.</p><p>I feel I have missed out some thing in my configuration or manifest or so.</p><p>Please help me identifying the same. My code is below:</p><pre><code>public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);        Intent intent = new Intent () ;        intent.setClassName(""com.sample.service"" ,""com.sample.service.serviceClass"") ;        this.startService(intent) ; // when I call this line I get the message...        // binding other process continue  here   }</code></pre><p>Client manifest.xml</p><pre><code>&lt;service android:name=""com.sample.service.serviceClass""              android:exported=""true"" android:label=""@string/app_name""             android:process="":remote""&gt;   &lt;intent-filter&gt;&lt;action android:name=""com.sample.service.serviceClass""&gt;&lt;/action&gt;   &lt;/intent-filter&gt;&lt;/service&gt;</code></pre><p>Thanks in advance,<br>Vinay</p>","362416","","379693","","2010-08-09 12:32:56","2014-02-18 23:10:24","Unable to start Service Intent","<android><service><android-intent><intentfilter>","5","2","10","",""
"3439387","1","","","2010-08-09 11:08:31","0","955","<p>I want to make progress bar visible on button click.It is happening properly but when progress bar start it hides the text of edit box.After the completion of process(also progress bar's visibility is gone) ,if user want to enter any data in edittext box it can done but it'll not be visible to the user.Can any one tell me solution.here is my code:-`public class Login extends Activity implements OnClickListener {    /** Called when the activity is first created. */    EditText user_name;    EditText user_pass;    Button login_btn;    ProgressBar bar;    String response_get;</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,            WindowManager.LayoutParams.FLAG_FULLSCREEN);    setContentView(R.layout.login);    user_name = (EditText) findViewById(R.id.user_id_edit);    user_pass = (EditText) findViewById(R.id.user_pass_edit);    login_btn = (Button) findViewById(R.id.login);    bar = (ProgressBar) findViewById(R.id.splash_progressbar);    login_btn.setOnClickListener(this);    login_btn.setBackgroundDrawable(getResources().getDrawable(            R.drawable.login_selector));}public void onClick(View v) {    // TODO Auto-generated method stub    if (v.getId() == R.id.login) {        response_get = null;        if (user_name.getText().length() == 0                || user_pass.getText().length() == 0) {            Toast.makeText(this, ""Required field must not be blank "",                    Toast.LENGTH_LONG).show();        } else {            bar.setVisibility(0);            if (Internet.checkConnection(HIVPharmacy.this)) {                new Thread() {                    public void run() {                        response_get = ImageUploader.getCLient(user_name                                .getText().toString(), user_pass.getText()                                .toString());                        WebServices.abc(user_name.getText().toString(),                                user_pass.getText().toString());                        // Log.e(""Ye Response mila hai ting tong"",                        // response_get);                        handler.sendEmptyMessage(0);                        handlerFinishProgressbar.sendEmptyMessage(0);                    }                }.start();            } else {                new AlertDialog.Builder(Login.this)                        .setTitle(""Alert!"").setMessage(                                ""Please check internet connetion."")                        .setNeutralButton(""OK"",                                new DialogInterface.OnClickListener() {                                    public void onClick(                                            DialogInterface dialog,                                            int whichButton) {                                        finish();                                        android.os.Process                                                .killProcess(android.os.Process                                                        .myPid());                                    }                                }).setCancelable(false).create().show();            }        }    }}private Handler handlerFinishProgressbar = new Handler() {    @Override    public void handleMessage(Message msg) {        bar.setVisibility(8);    }};private Handler handler = new Handler() {    @Override    public void handleMessage(Message msg) {        if (response_get.trim().contains(""user"")                &amp;&amp; response_get.trim().contains(""admin"")) {            new AlertDialog.Builder(Login.this)                    .setTitle(""Admin!"")                    .setMessage(                            ""Do you want to add new user or want to administer tests."")                    .setPositiveButton(""Add user"",                            new DialogInterface.OnClickListener() {                                public void onClick(DialogInterface dialog,                                        int whichButton) {                                    startActivity(new Intent(                                            Login.this, Admin.class));                                }                            }).setNeutralButton(""Administer test"",                            new DialogInterface.OnClickListener() {                                public void onClick(DialogInterface dialog,                                        int whichButton) {                                    startActivity(new Intent(                                            Login.this,                                            ClientVerification.class));                                }                            })                    .setCancelable(false).create().show();            user_name.setText("""");            user_pass.setText("""");            // bar.setVisibility(8);            Toast.makeText(getApplicationContext(), ""Admin"",                    Toast.LENGTH_LONG).show();        } else if (response_get.trim().contains(""user"")) {            Toast.makeText(getApplicationContext(), ""User"",                    Toast.LENGTH_LONG).show();            startActivity(new Intent(Login.this,                    ClientVerification.class));            user_name.setText("""");            user_pass.setText("""");            // finish();            // bar.setVisibility(8);        } else {            Toast.makeText(getApplicationContext(),                    ""Invalid user name or password"", Toast.LENGTH_LONG)                    .show();            // bar.setVisibility(8);        }    }};</code></pre><p>}`      </p><p>Here is XML file:- </p><p>'</p><pre><code>&lt;RelativeLayout android:id=""@+id/bar""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:layout_alignParentTop=""true"" android:background=""@drawable/bg2""    android:gravity=""center""&gt;    &lt;TextView android:id=""@+id/topbar_txt"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_centerInParent=""true""        android:gravity=""center"" android:text=""User Login"" android:textSize=""20dip""        android:layout_marginBottom=""10dip"" /&gt;&lt;/RelativeLayout&gt;&lt;TableLayout android:id=""@+id/table_layout_login_id_and_password""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:background=""@drawable/hiv_login_bg""    android:layout_centerVertical=""true"" android:layout_weight=""1""&gt;    &lt;TableRow android:layout_marginTop=""15dip""        android:layout_marginLeft=""15dip""&gt;        &lt;TextView android:id=""@+id/user_id_txt""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_column=""1"" android:gravity=""center_vertical|right""            android:text=""@string/nurseId"" android:layout_marginRight=""5dip"" /&gt;        &lt;EditText android:id=""@+id/user_id_edit""            android:layout_width=""160dip"" android:layout_height=""wrap_content""            android:singleLine=""true"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:layout_marginLeft=""15dip""&gt;        &lt;TextView android:id=""@+id/user_pass_txt""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_column=""1"" android:layout_marginRight=""5dip""            android:text=""@string/nursePass"" android:gravity=""center_vertical|right"" /&gt;        &lt;EditText android:id=""@+id/user_pass_edit""            android:layout_width=""160dip"" android:layout_height=""wrap_content""            android:singleLine=""true"" android:password=""true"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;RelativeLayout android:id=""@+id/relative_radio_group_register""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:layout_below=""@id/table_layout_login_id_and_password""&gt;    &lt;Button android:id=""@+id/login"" android:layout_height=""wrap_content""        android:layout_width=""wrap_content"" android:layout_below=""@+id/edit_pass_login""        android:layout_centerHorizontal=""true"" android:layout_marginTop=""15dip""        android:gravity=""center"" android:background=""@drawable/login_btn"" /&gt;&lt;/RelativeLayout&gt;&lt;ProgressBar android:id=""@+id/splash_progressbar""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""    android:layout_centerInParent=""true"" android:visibility=""gone""    android:indeterminateDrawable=""@drawable/progressbar"" /&gt;</code></pre><p>'</p><p>This code is working properly with ""Nexus One"" but creating problem with G1.</p>","414954","","414954","","2010-08-10 04:39:10","2010-08-10 04:39:10","Progress bar overrides edit text's information how to resolve it","<android><android-progressbar>","0","2","","",""
"3439465","1","3439917","","2010-08-09 11:20:30","0","1765","<p>Hi i'm programming an app that reads sensors values, and I need that it continue saving data while the phone goes standby (the screen go black after 1 minute). Any idea?</p><p>Tnk's<br />Valerio From Italy</p>","314554","","","","","2010-08-09 12:20:49","How to keep running my android app when phone goes standby?","<android><running>","2","0","1","",""
"3439517","1","3439576","","2010-08-09 11:29:35","13","9737","<p>How can I set the degree symbol to a <code>TextView</code> in Android? </p>","393809","","1507439","","2013-05-07 13:27:26","2013-05-07 13:27:26","Android set degree symbol to Textview","<java><android><android-textview><symbols>","1","0","2","2013-11-08 05:57:15",""
"3439537","1","3439680","","2010-08-09 11:31:20","0","725","<p>In my Android app, I try to connect to a port on a local server to get some packets. I've encased to code in some try &amp; catch's but with the following code:</p><pre><code>address = ""192.168.175.82"";public void run() {    try {  smtpSocket = new Socket(address, 60001);        os = new DataOutputStream(smtpSocket.getOutputStream());        is = new DataInputStream(smtpSocket.getInputStream());    } catch (UnknownHostException e) {        System.err.println(""Don't know about host: "" + address);        run();    } catch (IOException e) {        System.err.println(""Couldn't get I/O for the connection to: "" + address);        run();    } catch (Exception e) {     System.out.println(""retry"");     run();    }</code></pre><p>if ther server is not on, I obviously get the IOException a few times (e.g. a few hundred times) before I get a stack overflow error and the app crashes.</p><pre><code>01-20 22:21:32.526: ERROR/AndroidRuntime(5678): java.lang.StackOverflowError01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at java.util.Hashtable.get(Hashtable.java:282)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at java.util.Properties.getProperty(Properties.java:177)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at java.lang.System.getProperty(System.java:440)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at java.lang.System.getProperty(System.java:412)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at java.lang.Boolean.getBoolean(Boolean.java:174)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at org.apache.harmony.luni.net.NetUtil$Action.run(NetUtil.java:89)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at org.apache.harmony.luni.net.NetUtil$Action.run(NetUtil.java:80)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at java.security.AccessController.doPrivilegedImpl(AccessController.java:264)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at java.security.AccessController.doPrivileged(AccessController.java:84)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at org.apache.harmony.luni.net.NetUtil.preferIPv6Addresses(NetUtil.java:51)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at org.apache.harmony.luni.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at java.net.Socket.startupSocket(Socket.java:777)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at java.net.Socket.tryAllAddresses(Socket.java:192)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at java.net.Socket.&lt;init&gt;(Socket.java:256)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at java.net.Socket.&lt;init&gt;(Socket.java:220)01-20 22:21:32.526: ERROR/AndroidRuntime(5678):     at com.example.sockets.ReadSocket.run(ReadSocket.java:83)</code></pre><p>Could anyone please point me in the right direction of how to get this to work? Perhaps I should test the connection first somehow (if so, please say how?)Thanks</p><p>Chris</p>","410921","","","","","2010-08-09 11:50:19","Android Network Programming: IOExceptions and StackOverflowError","<android><networking><ioexception><stackoverflowerror>","2","0","","",""
"3439587","1","3443671","","2010-08-09 11:39:00","1","428","<p>I want to make an Tab Activity.which consists of 3 tabs.but when i create an project with Android 2.2 and API 8 then in Main.XML its showing an null pointer exception.but when i change it to API 4 or 5 den it is showing the layout of tabs.</p><p>and one more thing i want to clarify is when we create an project we need to specify Build target and AVD on which we want to run application. i want to ask that both the API will be same or can be different??</p><p>Thanks in Advance</p>","383597","","379693","","2010-08-09 13:07:59","2010-08-09 19:56:08","Android TabHost","<android><android-widget><android-tabhost>","1","1","","",""
"3439590","1","","","2010-08-09 11:39:13","1","3924","<p>I have to create tab bar in my application in which i have to navigate between activities under single tag. So that i tried many ways one of which is to clear all tabs from tabhost and create new tabs and add on tabhost but it gives me unexpectedly close error.can you help me...                                                                   Thank You In Advance.                                                                        Vikram Kadam</p>","395627","","","","","2010-09-06 23:01:21","How to clear old tabs and add new tab on tabhost","<android>","2","1","","",""
"3439769","1","","","2010-08-09 12:01:24","1","957","<p>I need to use Bing map API on android .As i am not able to get any proper tutorial , Has any body tried it .</p>","95877","","73488","","2010-09-21 02:47:46","2014-01-08 08:56:05","Bing maps on android","<java><android><bing-maps>","2","2","1","2014-01-08 09:37:21",""
"3439794","1","3440212","","2010-08-09 12:04:20","1","1101","<p>How would I edit this tutorial so that it will grab images from the SD card?</p><p><a href=""http://developer.android.com/guide/tutorials/views/hello-gallery.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/views/hello-gallery.html</a></p><pre><code>          private Integer[] mImageIds = {        R.drawable.lol.marker,        R.drawable.sample_2,        R.drawable.sample_3,        R.drawable.sample_4,        R.drawable.sample_5,        R.drawable.sample_6,        R.drawable.sample_7        };</code></pre><p>Alternatively is it possible to make subfolders within R.drawable? </p>","358438","","","","","2010-08-09 17:29:12","Change this tutorial to access images from the sd card?","<android><image>","1","1","2","",""
"3439811","1","3479004","","2010-08-09 12:06:31","5","1357","<p>i am programming for google android and i wonder if the scans for wireless 802.11 networks are done passively or actively? i mean: does the device <strong>actually emit</strong> a beacon request signal on <code>WifiManager.startScan()</code> or does it just listen for beacons sent periodically by the access points?</p>","370969","","","","","2010-08-13 16:47:58","Do Android devices scan *actively* for WiFi networks?","<android><wifi><scanning>","1","1","4","",""
"3440000","1","3601931","","2010-08-09 12:33:44","1","7565","<p>I have followed the steps to create my media player object but I cant understand why it is not playing the music track. I used the following code:</p><pre><code>mp = new MediaPlayer();    mp.create(this, R.raw.testmed);     mp.setVolume(100, 100);    mp.start();</code></pre><p>but no sound is playing through the emulator, and furthermore when i check the method mp.isPlaying() it returns false. What have I missed?!</p><p>Many thanks</p>","300037","","","","","2010-08-30 15:42:05","Android MediaPlayer issue","<android><media-player>","1","0","","",""
"3440062","1","4957359","","2010-08-09 12:40:57","7","12688","<p>I am using KSOAP2 to manage SOAP in Android but it use https for the SOAP url and I am getting this error: javax.net.ssl.SSLException: Not trusted server certificate<br>A normal error because the certificate is untrusted, but anyone knows how to workaround with this error?I can not manage the certificate because is from a other company and I don't have access to change it.</p><p>Thanks </p>","409766","","379693","","2010-08-09 13:05:12","2013-09-24 07:22:36","KSOAP 2 Android with HTTPS","<android><soap><https><ksoap2>","4","0","6","",""
"3440172","1","","","2010-08-09 12:54:35","1","3180","<p>i am inserting events in my android calendar. the code is following:</p><pre><code>ContentValues event = new ContentValues();    event.put(""calendar_id"", calId);    event.put(""title"", ""Event Title"");    event.put(""description"", ""Event Desc"");    event.put(""eventLocation"", ""Event Location"");    event.put(""allDay"", 1);    event.put(""eventStatus"", 1);    event.put(""visibility"", 0);    event.put(""transparency"", 0);    event.put(""hasAlarm"", 1);    Date d = new Date();    d.setHours(8);    d.setMinutes(30);    d.setSeconds(30);    long startTime = d.getTime();    d.setHours(12);    d.setMinutes(30);    d.setSeconds(20);    long endTime = d.getTime();    event.put(""dtstart"", startTime);    // event.put(""dtend"", endTime);    event.put(""rrule"", ""FREQ=DAILY;WKST=SU"");    // event.put(""lastDate"", endTime);    // event.put(""timezone"", ""Asia/Karachi"");    //event.put(""duration"", ""P3600S"");    //Calendar gmtC = new GregorianCalendar(TimeZone.getTimeZone(""Asia/Karachi""));    // event.put(""transparency"", 0);    // event.put(""hasAlarm"", 1); // 0 for false, 1 for true    Uri eventsUri = Uri.parse(""content://calendar/events"");    Uri url = getContentResolver().insert(eventsUri, event);</code></pre><p>i am getting the following exception:</p><pre><code>java.lang.IllegalArgumentException: allDay is true but sec, min, hour are not 0.</code></pre><p>need help!</p>","309990","","32502","","2010-08-09 15:14:27","2014-03-18 12:07:54","getting exception when inserting events in android calendar","<android><calendar><gdata-api><gdata>","5","6","1","",""
"3440215","1","","","2010-08-09 12:59:52","0","258","<p>Here is my code to fetch an image from a server location into a web service folder <code>""web content""</code>.</p><pre><code>// imports removedpublic class WebService {    public int writeToFileImage(int a) throws IOException{        File file =new File(""sdcard/myImage.jpg"");        file.createNewFile();        URL u = new URL(""http://172.29.26.40:8080/ExampleService/demo.jpg"");         URLConnection uc = u.openConnection();         uc.connect();         InputStream in = uc.getInputStream();         FileOutputStream out;        out = new FileOutputStream(file);        final int BUF_SIZE = 1 &lt;&lt; 8;         byte[] buffer = new byte[BUF_SIZE];         int bytesRead = -1;         while((bytesRead = in.read(buffer)) &gt; -1) {             out.write(buffer, 0, bytesRead);         }         in.close();        out.close();         return a;    }}</code></pre><p>But i am getting an exception: </p><pre><code>SOAP Response Envelope- &lt;soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""&gt;- &lt;soapenv:Body&gt;- &lt;soapenv:Fault&gt;  &lt;faultcode&gt;soapenv:Server.userException&lt;/faultcode&gt;   &lt;faultstring&gt;java.net.ConnectException: Connection timed out: connect&lt;/faultstring&gt; - &lt;detail&gt;  &lt;ns1:hostname xmlns:ns1=""http://xml.apache.org/axis/""&gt;01HW040207&lt;/ns1:hostname&gt;   &lt;/detail&gt;  &lt;/soapenv:Fault&gt;  &lt;/soapenv:Body&gt;  &lt;/soapenv:Envelope&gt;</code></pre><p>What could be the cause of the error?</p>","335429","","2598","","2010-08-18 13:21:49","2010-08-18 13:21:49","Fetching an image from Server","<android><web-services><soap>","0","2","","",""
"3440358","1","","","2010-08-09 13:17:33","0","863","<p>i am inserting events in my android calendar. the code is following:</p><pre><code>ContentValues event = new ContentValues();    event.put(""calendar_id"", calId);    event.put(""title"", ""Event Title"");    event.put(""description"", ""Event Desc"");    event.put(""eventLocation"", ""Event Location"");    event.put(""allDay"", 1);    event.put(""eventStatus"", 1);    event.put(""visibility"", 0);    event.put(""transparency"", 0);    event.put(""hasAlarm"", 1);    Date d = new Date();    d.setHours(8);    d.setMinutes(30);    d.setSeconds(30);    long startTime = d.getTime();    d.setHours(12);    d.setMinutes(30);    d.setSeconds(20);    long endTime = d.getTime();    event.put(""dtstart"", startTime);    // event.put(""dtend"", endTime);    event.put(""rrule"", ""FREQ=DAILY;WKST=SU"");    // event.put(""lastDate"", endTime);    // event.put(""timezone"", ""Asia/Karachi"");    //event.put(""duration"", ""P3600S"");    //Calendar gmtC = new GregorianCalendar(TimeZone.getTimeZone(""Asia/Karachi""));    // event.put(""transparency"", 0);    // event.put(""hasAlarm"", 1); // 0 for false, 1 for true    Uri eventsUri = Uri.parse(""content://calendar/events"");    Uri url = getContentResolver().insert(eventsUri, event);</code></pre><p>i am getting the following exception:</p><pre><code>java.lang.IllegalArgumentException: allDay is true but sec, min, hour are not 0.</code></pre><p>need help!</p>","309990","","","","","2013-05-03 11:13:03","getting exception when inserting events in android calendar","<android><calendar>","2","1","","",""
"3440377","1","3440461","","2010-08-09 13:20:10","3","3996","<p>I can get the country code in ISO-form using <code>TelephonyManager::getNetworkCountryIso()</code>, as it returns US for USA and such, but how can I get the numeric country dialing code?</p><p>I can't seem to find any functions provides me with the data I'm looking for, as I need a function that (for example) returns <code>01</code> for USA/Canada, <code>92</code> for Pakistan and so on.</p>","265064","","860212","","2011-09-14 19:01:39","2012-05-10 15:57:48","Get Country code","<android><locale>","1","1","1","",""
"3440459","1","","","2010-08-09 13:27:15","2","616","<p>Maximum line limits for Textview in android ?</p><p>android:maxLines=""?""</p>","398981","","","","","2012-05-11 10:55:10","Maximum line limits for Textview in android?","<android>","1","2","","",""
"3440524","1","","","2010-08-09 13:33:46","5","2325","<p>I have a legacy application and need to split it into a library project (common code) and two application projects (paid and free applications). I don't use Eclipse for development, and also don't use Ant builds provided (generated) by Android SDK (there are several reasons for that: different project directory structure, unit tests integrated into the build, integration with CruiseControl, automatic builds numbering etc), but use our custom build files instead.</p><p>I need to modify my Ant builds to make them build my applications projects that refer my library project. I looked into sample application and Ant builds shipped with SDK, but didn't understand how it is done. I saw that library project contains ""libs"" directory and""default.properties"" file with ""android.library"" property set to ""true"". I saw that applications project contains ""default.properties"" file with ""android.library.reference.X"" property set to library project directory value. But I didn't find any reference to these properties in the Ant builds (project Ant build file, and Ant builds shipped with SDK). Just placing these files into application/library project directories doesn't help, i.e. SDK tools doesn't interpret them.</p><p>My guess is that this is performed by com.android.ant.SetupTask, but I'd like to know how it is performed. My build is set of targets that call (using exec) Android SDK tools: appt, dx, apkbuilder and so on. So I'd like to know which command line parameters I need to use to make, lets say, appt tool to merge resources?</p><p>Thank you in advance.</p>","244211","","","","","2010-09-23 18:29:52","Android library projects custom builds","<android><ant><build><project>","2","0","","",""
"3440646","1","","","2010-08-09 13:51:10","1","715","<p>I've encountered a problem wile using my own subclass of android.app.Application. I have numerous activities in my application and I'm running a custom ROM which consumes quite a lot of memory. What happens is when I launch a third party activity (Camera) my Application is killed. My Application subclass stores vital data for the whole app so it can't work without it. android.app.Application doesn't have any methods for saving or restoring application state. Activity does have them but they are not suitable.</p><p>Any guesses how to perform save/restore state on Application subclass?</p><p><strong>UPDATE</strong> I've managed to do so by filling a Bundle obtained from onSaveInstanceState and restoring values in onCreate. But is there any better way?</p>","230466","","230466","","2010-08-09 17:04:46","2010-08-09 17:21:32","Save android.app.Application state","<android><restore><savestate>","1","0","","",""
"3440690","1","","","2010-08-09 13:56:33","1","8059","<p>While rotating a bitmap using matrix, vertex is not stable.. </p><blockquote><pre><code>  Matrix matrix = new Matrix();    matrix.postRotate(mDegree,100,100);    mCompasstemp = Bitmap.createBitmap(mCompPic, 0, 0, mCompPic.getWidth(), mCompPic.getHeight(), matrix, true);    mCompassHud.setImageBitmap(mCompasstemp);</code></pre></blockquote><p>Output of my code is like -bitmap will rotate.-vertex of my bitmap is not stable.-Bitmap is resizing</p><p>I need disable image resizing and make the rotation stable.Can you please suggest a solution for this?</p>","362088","","","","","2012-10-01 21:42:58","Rotating a bitmap using matrix","<android><matrix><bitmap><rotation>","3","0","3","",""
"3440744","1","","","2010-08-09 14:02:04","3","1806","<p>I am trying to profile native android code, but I am getting thefollowing error.I am running the code on a linux machine.</p><blockquote>  <p>$tracedmdump profile   post-processing  traces... </p>    <p>Static basic blocks: 64525, Dynamic  basic blocks: 87073132 </p>    <p>Static instructions: 412004, Dynamic  instructions: 509641730 </p>    <p>Elapsed seconds: 26.46, simulated  instructions/sec: 19.3M </p>    <p>generating dexlist output... </p>    <p>generating dmtrace data... </p>    <p>Error: stack overflow (500 frames)</p></blockquote><p>If anyone knows how to debug this issue...please help</p><p>Thanks and Regards,</p><p>Bharat Pawar</p>","237388","","","","","2012-02-28 08:21:48","Android native code profiling","<android><profiling><native>","1","1","1","",""
"3440927","1","3440976","","2010-08-09 14:21:06","2","2033","<p>In Android, what is the best way to write to the console. In C# I'd use either Log4Net or just Console.Write</p>","172861","","","","","2010-11-08 20:12:50","Android's version of C#'s Console.WriteLine?","<android>","4","0","1","",""
"3441112","1","","","2010-08-09 14:39:02","2","773","<p>I would like to know how to intercept incoming calls and activate loud speaker automatically. I read this class is used com.android.internal.telephony but I could not find propre documentation. Thanks for your help.</p>","415199","","","","","2012-02-12 19:45:15","Android Loud speaker and call interception","<android><sdk><telephony>","3","0","","",""
"3441192","1","3441286","","2010-08-09 14:46:54","0","156","<p>I'm been trying to figure this out for a while now, and have just become more and more confused.</p><p>I have made a Android Widget which displays two articles (title + image). In addition to this, I have buttons for flipping backward and forward through the articles. What I don't understand is how I can change the Widgets RemoteViews when the buttons are pressed. Which should be one of the most basic operations in a widget, however, I can't seem to figure it out.</p><p>So... </p><ul><li><p>Can I do this with just a OnClickListener in the AppWidgetProvider? </p></li><li><p>Or do I have to create an Activity without a window (visibility = false)?</p></li></ul><p>Please excuse my stupidity. This is probably very basic.</p>","415166","","","","","2010-08-09 14:58:06","Should one use an Activity or a Service when using a button in a Widget?","<android><activity><widget><listener><appwidget>","1","0","","",""
"3441198","1","","","2010-08-09 14:47:12","0","1910","<p>I was wondering if it is possible to display a gif animation on an image button. I followed the example on Android API BitmapDecode sample and can now display animated gifs on the canvas. </p><p>Is it possible to display this same gif on an imagebutton. I tried using the setBackgroundDrawable() and setImageDrawable() but it gives me an empty button.</p><pre><code>@Override public void onCreate(Bundle icicle) {    super.onCreate(icicle);  setContentView(R.layout.test);  ImageButton btn = (ImageButton) findViewById(R.id.ImageButton01);  SampleView p=new SampleView(this);  p.setDrawingCacheEnabled(true);  p.buildDrawingCache();      btn.setBackgroundDrawable(p.getBackground());}</code></pre><p>The SampleView() class is similar to the one provided in the <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/BitmapDecode.html"" rel=""nofollow"">BitmapDecode sample</a> (i have removed all other code snippets and it now displays only gif animation)</p><p>Thanks,New Guy.</p>","412289","","","","","2012-11-30 15:49:11","Display gif on imagebutton android","<android>","1","0","","",""
"3441262","1","","","2010-08-09 14:55:12","0","318","<p>Friend's,       I have a problem in fetching image from database,when i store the image url in database has Blob data type in sqlite,where the code for inserting is</p><p>DefaultHttpClient mHttpClient = new DefaultHttpClient();</p><pre><code>                HttpGet mHttpGet = new HttpGet(""http://www.dashfire.com/jackrobie/media/catalog/product/cache/1/image/97x144/9df78eab33525d08d6e5fb8d27136e95/a/l/alexander_1_1_1.jpg"");                HttpResponse mHttpResponse = mHttpClient.execute(mHttpGet);                if (mHttpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {                  HttpEntity entity = mHttpResponse.getEntity();                    if ( entity != null) {                      // insert to database                ContentValues values = new ContentValues();                values.put(JR_Constants.NAME, name1);                values.put(JR_Constants.PRICE, price);                values.put(JR_Constants.IMAGE_97, EntityUtils.toByteArray(entity));</code></pre><p>the values being seemed in the table has after the above,_id | name     | image_97                        | price1     mss       &amp; - (its like an alpha symbol)        $115.002     sss       &amp; -    ""                              $120.00</p><p>the code for table creation here...<br>   public void onCreate(SQLiteDatabase db) {       try{      db.execSQL(""CREATE TABLE ""+TABLE_NAME+"" (""               +_ID+"" INTEGER PRIMARY KEY AUTOINCREMENT,""               + NAME+"" TEXT,""               + IMAGE_97+"" BLOB,""
              + PRICE+"" TEXT);"");      Log.v(""JR_Data"",""table created"");      }catch(Exception e){          Log.v(""JR_Data"",""exception in table created"");</p><h1>      }</h1><h1>i need to know the format of byte array in table is it simply looks like alpha symbol or some thing else,....from my table.</h1><p>below the code i fetch the image from db has follows</p><pre><code>            ImageView myImage = (ImageView) findViewById(R.id.jr_lb_list_icon);</code></pre><p>line 1.             byte[] bb = c.getBlob(c.getColumnIndex(JR_Constants.IMAGE_97));                  try {                myImage.setImageBitmap(BitmapFactory.decodeByteArray(bb, 0, bb.length));                }catch(Exception e)                {                    Log.v(TAG, ""Error1 "" +e);                }</p><p>From above line 1. mentioned where it contains JR_Constants.IMAGE_97  its string constant.</p><p>when fetch and set the image from table it throws an nullpointer exception..what is actually wrong with it,and help me to  get image by using above code....</p><p><strong>and i'm doing above process when the device is in offline</strong></p><p>Thanks in advance.</p>","407506","","","","","2010-08-25 10:17:56","How to set image from database","<android>","1","0","","",""
"3441291","1","3441326","","2010-08-09 14:59:16","0","2333","<p>I've got the following method...</p><pre><code>public class Image extends Activity {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.menu);/* Using WebView to display the full-screen image */WebView full = (WebView)findViewById(R.id.webview);/* Set up the Zoom controls */FrameLayout mContentView = (FrameLayout) getWindow().getDecorView().findViewById(android.R.id.content);final View zoom = this.full.getZoomControls();mContentView.addView(zoom, ZOOM_PARAMS);zoom.setVisibility(View.VISIBLE);/* Create a new Html that contains the full-screen image */String html = new String();html = (""&lt;html&gt;&lt;center&gt;&lt;img src=\""1276253554007.jpg\""&gt;&lt;/html&gt;"" );/* Finally, display the content using WebView */full.loadDataWithBaseURL(""file:///sdcard/DCIM/Camera/"",                                                        html,                                                        ""text/html"",                                                        ""utf-8"",                                                        """");}}</code></pre><p>R.id.webview refrences...</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;WebView  xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/webview""android:layout_width=""fill_parent""android:layout_height=""fill_parent""/&gt;</code></pre><p>But I'm getting a <code>full cannot be resolved or is not a field</code> compile error, but full is defined as.. <code>WebView full = (WebView)findViewById(R.id.webview);</code> anyone have any idea why this isnt working?</p><p>Thanks.</p>","358438","","180538","","2011-05-26 10:28:10","2011-05-26 10:28:10","Webview not working?","<android><xml>","2","3","","",""
"3441297","1","5571836","","2010-08-09 14:59:39","3","1660","<p>Currently I am trying to compile native code for Android. The code is from the OpenCV port for Android. I pasted all the code correctly in my project and edited my make files accordingly. When I set android:debuggable to false everything works fine and I get my native library. When I try while android:debuggable is set to true I get an error. Here is a part of the log:</p><pre><code>Compile++ thumb: cxcore &lt;= AR_Still_Image/jni/cxcore/src/cxutils.cppAR_Still_Image/jni/cxcore/src/cxutils.cpp: In function 'void icvSort16u(ushort*, size_t, int)':AR_Still_Image/jni/cxcore/src/cxutils.cpp:987: internal compiler error: in reload, at reload1.c:1173Please submit a full bug report,with preprocessed source if appropriate.See &lt;http://gcc.gnu.org/bugs.html&gt; for instructions.make: *** [AR_Still_Image/obj/local/armeabi/objs/cxcore/cxcore/src/cxutils.o] Error 1</code></pre><p>From what I have found on the internet this is caused by the optimization level of the compilation. As long as the code isn't compiled so that is is debuggable afterwards everything should be fine.</p><p>Now apparently it is possible to avoid this by setting <code>APP-OPTIM := release</code> in the Application.mk or adding <code>-O2</code> to <code>LOCAL_CFLAGS</code>. I have tried both and still I get this error. </p><p>Right now I don't really care that much about debugging my native code, but I would like to have basic debugging enabled. And I don't want to keep switching android:debuggable in my manifest every time I want to compile. I'm not even sure if it is okay at all if I just set android:debuggable to false pre compiling and to true post compiling, but I am sure I will forget it every second run. </p><p>Has anyone encountered a similar problem or does anyone know how to fix this? It would be a great help. </p>","410647","","1065190","","2012-09-13 08:58:58","2012-09-13 08:58:58","Internal compiler error when compiling native Android code","<android><gcc><android-ndk>","1","0","1","",""
"3441315","1","3458485","","2010-08-09 15:01:06","0","2874","<p>What I want is a central column using GridView, but everything I try does not work. It always aligns to the left. I have tried messing around with layout_gravity and gravity to no avail. </p><p>I have a GridView in a LinearLayout:</p><pre><code>&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;    &lt;GridView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1.0""        android:numColumns=""1""        android:columnWidth=""100dp""        android:stretchMode=""spacingWidth""    /&gt;&lt;/LinearLayout&gt;</code></pre>","398640","","","","","2010-08-11 12:59:08","GridView and a central column","<android><gridview>","2","0","","",""
"3441337","1","3441425","","2010-08-09 15:03:04","0","1488","<p>I am trying to make my layout look like so.  I have tried gridviews, table layouts, and more but cant get it to look right. I want something like this.</p><p>ImageButton ImageButton2</p><p>ImageButton3  ImageButton4</p><pre><code>    ImageView1</code></pre><p>ImageButton5  ImageButton6</p><p>ImageButton6 ImageButton7 ImageButton8  (these are smaller icons)</p><pre><code>   ImageButton9 (small donate button)</code></pre><p>I just cant seem to figure out how to get the layout to work with imagebuttons. What layout should I use? And could you post example code of the xml layout if possible?</p>","411224","","","","","2010-08-09 15:40:52","Android: What is best layout to use when trying to get 2x2 image buttons, and more?","<android><layout><imagebutton><tablelayout>","2","0","","",""
"3441396","1","3441986","","2010-08-09 15:08:49","176","59006","<p>I need to implement my own attributes like in com.android.R.attr</p><p>Found nothing in official documentation so I need information about how to define these attrs and how to use them from my code.</p><p>Thanks</p>","218783","","","","","2013-12-27 23:13:17","Defining custom attrs","<android>","2","1","163","",""
"3441475","1","3442189","","2010-08-09 15:16:00","10","28612","<p>If you use an AbsoluteLayout (I know that it is deprecated, but it was the only way to solve my <a href=""http://stackoverflow.com/questions/3438656/android-scrollable-horizontal-and-vertical-imageview-with-buttons-overlayed""> problem</a>) you can give the childViews the tag <code>android:layout_x</code> and <code>android:layout_y</code> to set their absolute position within the <code>AbsoluteLayout</code>.</p><p>However I don't want to set these information in the xml, because I only know them at runtime. So how can I set these parameters at runtime programmatically? I don't see any method on the View like <code>view.setLayoutX(int x)</code> or something.</p><p>Here is my XML, which works fine, when I set the <code>layout_x</code> and <code>layout_y</code> values:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/myLayout""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;    &lt;ImageView     android:src=""@drawable/myImageView""     android:layout_width=""1298px""     android:layout_height=""945px""     android:layout_x=""0px""  android:layout_y=""0px"" /&gt; &lt;Button    android:id=""@+id/myButton1""  android:text=""23""  android:layout_width=""wrap_content""   android:layout_height=""wrap_content""  android:layout_x=""50px""  android:layout_y=""300px""  android:tag=""23""/&gt; &lt;Button    android:id=""@+id/myButton2""  android:text=""48""  android:layout_width=""wrap_content""   android:layout_height=""wrap_content""  android:layout_x=""50px""  android:layout_y=""300px""  android:tag=""48""/&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>In fact, I don't want to set any button within the xml anymore, but rather retrieve some information via remote and add buttons depending on that information.</p><p>Here is the part the code I'm using so in my <code>onCreateMethod</code> to add these buttons:</p><pre><code>  for (MyRemoteObject remoteObject: list)  {   Button button = new Button(this);   button.setOnClickListener (listener);   button.setTag(remoteObject.id);   button.setText(remoteObject.id);   // button.setLayoutX(remoteObject.x) ????   // button.setLayoutY(remoteObject.y) ????   myLayout.addView(button);  }</code></pre>","351723","","1049263","","2012-12-12 17:00:23","2014-04-13 15:03:59","Android: Change absolute position of a view programmatically","<android><runtime><position><absolutelayout>","4","0","4","",""
"3441565","1","3461127","","2010-08-09 15:27:08","0","1758","<p>I have built a test android app and signed it successfully and then sent it to someone to test via email.  They click on the attachment in the email on their android phone and get a parsing error.</p><p>They have 2.1 android  </p><p>the test app was built using 2.2  </p><p>would that cause an issue?</p><p>can email attachments of apk files not be installed directly to the phone?</p>","408112","","","","","2011-02-16 03:58:25","can not install apk from email attachment to phone getting parsing error","<android>","3","1","","",""
"3441647","1","","","2010-08-09 15:37:24","4","858","<p>I read somewhere not to exception handle when developing in Android, is that true?</p><p>If one does need to exception handle are there any logging tools for 2.1 and above?</p><p>If shouldn't exception handle, why is it not recommended to at least use the below?try {    body-code} catch (exception-classname variable-name) {    handler-code}</p>","412317","","","","","2013-03-25 07:51:57","Exception Handling","<android>","4","2","1","",""
"3441777","1","","","2010-08-09 15:51:33","0","2395","<p>I am wondering if someone can help. I would like to create a simple wallpaper test app. I have tried a few things with no success. Eventually, I started playing with gallery codes and have a few achievements. But ... I am not sure how to attach a wallpaper function to the gallery. I am new to all this (I am only a few months into learning Droid apps with eclipse) is there someplace where I can find complete Java coding and possibly the XML files for a working wallpaper? I cannot build from scratch but I am getting better reading the source code creating buttons etc. </p><p>Another option is how can I insert a save as wallpaper function to the working gallery I have? I am assuming I can set a long press function but I am not sure how to go about that either. I do have a tutorial for creating long presses but I am not sure about the proper Java setup to accompany this.</p><p>Any help will be appreciated. Keep in mind I am new to both Java and Android coding. In other words keep it as simple as possible please. Or if someone has a simple wallpaper app and they don't mind sharing the source code ... that would help immensely.</p>","","Will","280314","","2010-11-01 19:29:33","2013-12-16 16:07:48","How to set android wallpaper","<android><gallery><wallpaper>","3","1","4","",""
"3441788","1","","","2010-08-09 15:52:38","0","534","<p>I am in the process of redesigning my EE seniro design project (Digital Car Instrument Cluster) and would like to port the system from a custom light weight ubuntu to a android based system.  I was wondering can we install android onto a small atom based motherboard and if so does anyone know how we can writer driver to communicate with our usb datalogging hardware.</p>","328044","","","","","2011-06-25 01:03:10","Custom Hardware","<android><kernel>","1","1","","",""
"3441868","1","3442056","","2010-08-09 16:00:47","2","1981","<p>I need a regular method in my app. The problem is: the following timer in the code do its action just one time. And the timer do it only(the one time) if i do an action( touch the display) after the time(2000) is over. U know what i mean? Maybe it have sth to do with the ""OnTouchListener""?</p><pre><code>public class DrawView extends View implements OnTouchListener{Timer timer = new Timer();public DrawView(Context context){timer.schedule(new Task(this), 2000);}public boolean onTouch(View view, MotionEvent event){}}class Task extends TimerTask  {  private DrawView _dw;  public Task(DrawView dw){  this._dw = dw;}  public void run()    {        _dw.newgame();  }} </code></pre>","415250","","203907","","2010-08-12 18:57:16","2010-08-12 18:57:16","Timer do its work just one time","<java><android><timer>","2","1","","",""
"3442152","1","3442198","","2010-08-09 16:37:36","0","572","<p>I have a Dialog window created via the onCreateDialog() callback of my Actvity. In the Dialog I would like to allow the user to enter an email address or to select a contact from their contact list and have the email address populated based on their choice. This can be accomplished using:</p><pre><code> Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI); startActivityForResult(intent, CHOOSE_CONTACT);</code></pre><p>However since the Dialog is not itself an Activity I cannot use this method, the best I can do is</p><pre><code>context.startActivity()</code></pre><p>How can I launch the contact list from a Dialog and get a result?</p>","415219","","415219","","2010-08-10 14:34:05","2010-08-10 14:34:05","Choose Contact from a Dialog window","<android><dialog><activity>","1","0","","",""
"3442262","1","3451474","","2010-08-09 16:51:42","2","133","<p>I'm currently implementing some image processing code for Android. I'm aware of the memory limits and am happy to code within them. However, I cannot find any documentation that lets me work out how many bytes are used for each instance of a given class that I might want to instantiate (on the heap).</p><p>I'm an experienced C++ programmer and so am relatively competent at working out such struct/class sizing issues for my C++ code (taking into account processor data path width, platform alignment issues etc). I know that Java in general is at a higher level of abstraction and so that I may not be able to guarantee particular memory usage for a general Java VM. However given that android is running on a different VM, and given that developers are strongly memory constrained: I'm assuming that there may be a relatively deterministic set of rules for working out how big a given object instance will be, given knowledge of the members.</p><p>Anyone know these rules?</p><p>Thanks!</p><p>Alex</p>","415313","","","","","2010-08-19 08:00:37","Class instance sizes in Android","<android><memory-leaks><dalvik>","2","0","","",""
"3442331","1","3483065","","2010-08-09 17:00:15","2","1562","<p>can you help me by sharing your knowledge on how to draw a small rectangle on top of image in android. I have main.xml and there are some widgets. right at top, there is a image and I would like to draw a rectangle on that Image and display both while app is running. </p><p>Here is how my xml file looks like:</p><pre><code>   &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_margin=""5px"" android:padding=""20px""&gt;     &lt;ImageView    android:id=""@+id/myImageView""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:src=""@drawable/sinewave""/&gt;    &lt;TableRow&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;                &lt;TextView android:text=""00:00""                 android:id=""@+id/TextView02""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:layout_weight=""1""                android:paddingBottom=""30dip""                android:gravity=""center""&gt;            &lt;/TextView&gt;          &lt;/TableRow&gt;    &lt;TableRow android:gravity=""center""&gt;            &lt;Button android:text=""Start""                     android:id=""@+id/btnStart""                     android:layout_width=""wrap_content""                     android:layout_height=""wrap_content""                     android:padding=""20px""                    &gt;            &lt;/Button&gt;            &lt;Button android:text=""Stop""                     android:id=""@+id/btnStop""                     android:layout_width=""wrap_content""                      android:layout_height=""wrap_content""                     android:padding=""20px""                    &gt;            &lt;/Button&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;            &lt;TextView android:text=""""                android:id=""@+id/TextView01""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:paddingLeft=""5px""android:paddingRight=""5px""android:paddingTop=""10px""android:paddingBottom=""10px""                &gt;            &lt;/TextView&gt;     &lt;/TableRow&gt;    &lt;TableRow&gt;               &lt;Button android:text=""Mute Phone""                     android:id=""@+id/Button01""                     android:layout_width=""wrap_content""                     android:layout_height=""wrap_content""                    android:gravity=""center""                    android:paddingBottom=""10dip""                &gt;            &lt;/Button&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;            &lt;Button                 android:text=""Settings""                android:id =""@+id/btnClick""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:gravity=""center""                android:paddingTop=""30dip""            /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","357349","","356292","","2010-08-14 12:24:25","2012-02-06 20:11:54","Draw view on Image within xml","<android><android-widget>","2","1","","",""
"3442366","1","3442908","","2010-08-09 17:04:14","15","17269","<p>I am building many apps for Android and wish to have a menu button in the apps that basically opens a list of my other apps in the Android Market.</p><p>Is there a way to create an intent and have the Android market pop up with a search (of my company) in the market so users can buy other apps?</p><p>ian</p>","172861","","","","","2013-11-28 20:35:15","Android Link to Market from inside another app","<android><google-play>","5","0","8","",""
"3442399","1","","","2010-08-09 17:08:25","1","1290","<p>in my listview I have items with different layouts, in fact they use one sub-layout few times. I cannot use getViewTypeCount() and getItemViewType(), because I don't know how many times the sublayout will be used. Is it possible to optimize somehow getView() method and use it's convertView parameter, or do I have to inflate view each time?</p>","411690","","","","","2010-08-10 21:53:35","How to optimizie ListView with different item's layout","<android><listview>","1","0","","",""
"3442455","1","3443976","","2010-08-09 17:16:05","1","1866","<p>I have an 2 adapters extending BaseAdapater. The first Adapter (let's call it imageAdapter) loads an image base on an ID, the second adapter (pageAdapter) builds grids of images from the first adapter. I set the second adapter to a gallery. The idea is that I can sort have pages in an album where there are multiple pictures on each album. </p><p>Now I want to the imageViews to fire off clicks, so I set an onClickListener for each of the imageViews from the imageAdapter. The problem is that after I set the onClickListener, I cannot scroll the gallery by touch/fling/scrolling on the images anymore. I think it's an issue of parent/children event pass through thing.. but I am not sure how to fix it exactly. Please help.</p>","410951","","","","","2010-08-10 05:53:57","OnClickListener and OnTouchListener","<android>","2","0","","",""
"3442462","1","3491264","","2010-08-09 17:17:43","19","27405","<p>I am having a problem capturing an image and storing it from the native camera app.  Here is a sample of some of my code.</p><pre><code>_path = Environment.getExternalStorageDirectory() + ""make_machine_example.jpg"";File file = new File( _path );Uri outputFileUri = Uri.fromFile( file );Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );intent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri );startActivityForResult( intent, 0 );</code></pre><p>After the picture has been taken and I'm returned back to my original Activity, When I navigate to my sd card via Android DDMS File Explorer the picture is not there.  Anyone know why this is not being saved?</p>","408079","","408079","","2011-02-26 08:38:28","2012-11-24 05:32:26","How to capture an image and store it with the native Android Camera","<android><camera><android-intent><android-camera><android-camera-intent>","5","8","22","",""
"3442467","1","3444399","","2010-08-09 17:18:56","3","678","<p>I have an Android app which has a list view which is updated during the lifetime of the app. </p><p>I have a 'Quit' menu option which saves the list data in a thread and then finishes the app by calling finish();</p><p>How should I save the data if the app gets killed  by the system?  In particular, when should I save the data, in onStop, onDestroy or elsewhere?</p><p>NiMuSi</p>","415342","","","","","2010-08-09 21:35:33","Android: Saving ListView data when app closes","<android>","2","0","","",""
"3442496","1","3442932","","2010-08-09 17:21:36","3","1654","<p>I'm just starting with android development and have written an application to show details about the battery status.Now I wanted to put the whole thing into an widget - and here's the question:Do I really need a update service in the background to listen for ACTION_BATTERY_CHANGED intents? My first thought was to put just a line into the intet-filter tag of the widget in the AndroidManifest.xml - but obviously it's not that simple.If the UpdateService is the right way I'll do so - but I just wanted to make sure what the proper solution is</p>","415347","","415347","","2011-08-30 17:15:24","2011-09-10 23:19:31","Update android widget on condition","<android><widget><appwidget><onupdate>","3","0","1","",""
"3442545","1","","","2010-08-09 17:29:24","4","3520","<p>My application uses a large number of MapView screens and I'm trying to figure out how to manage the API key between the debug environment and production. Apparently, there is no way to change the debug application key in Eclipse so I must use a debug map API key in that environment. Conversely, there is no way to export a package for beta testing without a production application key so I must change the map API key in every view in order to create a working package.</p><p>My first idea was to do this:</p><p>All MapView.xml files have this:</p><pre><code>android:apiKey=""@string/googleMapsAPIKey""</code></pre><p>And then in strings.xml I put this:</p><pre><code>&lt;string name=""googleMapsPIKey""&gt;@string/debugGoogleMapsAPIKey&lt;/string&gt;&lt;string name=""debugGoogleMapsAPIKey""&gt;TheMagicKeyString&lt;/string&gt;</code></pre><p>If this worked, it would allow me to change a single line in strings.xml and all the MapViews would get updated in the rebuild. But it didn't work. I guess strings.xml can't make references into itself. Any other ideas?</p><p>Thanks</p>","409849","","1440565","","2014-02-10 04:12:04","2014-02-10 04:12:04","Managing Google Maps API keys","<android><google-maps><api-key>","7","0","2","",""
"3442560","1","3443037","","2010-08-09 17:30:49","0","1362","<p>I have a card game I created in android and it is possible to show the scores at any given time by clicking a menu option.I would like that scores dialog to show a different background image when it's loaded depending on factors like who's leading, etc.In my constructor, I have the following relevant code:</p><pre><code>public ScoresDialog(Context context) {    super(context);    this.setTitle(R.string.scoresDialogHeading);    setContentView(R.layout.scores_view);...}</code></pre><p>I have tried getting that view to change it in the showDialog method i wrote like so:</p><pre><code>        findViewById(R.layout.scores_view).setBackgroundColor(Color.BLUE);</code></pre><p>However, I got a NPE...I tried moving this statement to the onStart method, thinking that the view is not yet initialized but got the same error...Any thoughts on what the right way to do something like that is?Thanks,E.</p>","380168","","","","","2010-08-09 18:34:26","How do I change the background image of an Android dialog or it's view in runtime according to a flag that is sent (before the dialog is shown)","<android><user-interface><dialog>","1","0","","",""
"3442641","1","3442892","","2010-08-09 17:42:47","3","258","<p>This is the second time this has happened to me now. I changed the starting activity of my app, and put out an update, and now the icon on people's phone will not open my app. The only way they can open it is through the downloads section of their Android Market app, or if they uninstall and reinstall the app, causing them to lose ALL their data.</p><p>I have no problem with updates on my N1, but every other Android phone has a problem with this. Why?</p>","413414","","","","","2010-08-09 18:17:17","Android: Changing entry point activity to app messes up app update","<android>","1","0","0","",""
"3442655","1","","","2010-08-09 17:44:36","0","199","<p>I am trying to write an app that requires different PDF files to be opened and displayed on the E-Reader side of the eDGe's dual screens while the app is running on the LCD side.  I've been using Better Terminal Emulator to cruise around the eDGe's file system but can't seem to find the command that opens PDF files.  Does anyone know it or is there even one?  Any help is much appreciated.</p>","415370","","","","","2011-03-02 05:20:08","System call to open a pdf on Entourage eDGe's E-Reader","<android><system><call><edge>","1","0","","",""
"3442672","1","","","2010-08-09 17:46:52","0","1793","<p>I have a ListView in Screen 1 where I have a few items . The User Clicks on an item in the Listview and Screen2 pops up . But What appears in Screen2 depends on what item was clicked in Screen 1</p><p>For Ex - User Clicks A in Screen 1 - Words starting from A come up in Screen 2</p><pre><code>lv.setOnItemClickListener(new OnItemClickListener() {     public void onItemClick(AdapterView&lt;?&gt; parent, View view,         int position, long id) {         // When clicked, Open the Next Screen         Intent r=new Intent(Dummy.this ,CricksList.class );         r.putExtra(""extra"", id);         startActivityForResult(r, position);         }</code></pre><p>I have passed the item which was clicked on . But I want to Display on Screen 2 what the user clicked on - as an item in the List View . How do I do that ?? </p>","415375","","","","","2012-11-17 15:58:06","Passing Which ListView Item was Clicked to the Next Screen - Android","<android><listview><activity>","3","0","","",""
"3442772","1","","","2010-08-09 18:00:33","0","186","<p>I have an application written in Delphi and ported to C# that makes extensive use of delegates (which allows me to add new modules easily). I think it would make a great Android phone app, but Java does not do delegates natively. I've seen a couple of examples of Java codes that tries to do delegates using reflection, but that does not seem efficient for a small device application. </p><p>Any suggestions about how I would go about porting my app without extensive re-architecture?</p>","82020","","","","","2010-08-09 21:46:13","how to port an application that uses delegates to Java and the Android system","<java><android><delegates>","2","2","1","","2010-08-09 18:00:33"
"3442800","1","","","2010-08-09 18:05:34","7","3504","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2126607/official-reasons-for-software-caused-connection-abort-socket-write-error"">Official reasons for &ldquo;Software caused connection abort: socket write error&rdquo;</a>  </p></blockquote><p>I have problems with BluetoothChat I can't connect Droid .  I always get this IOException</p><pre><code>08-09 20:58:24.889: INFO/BluetoothChat(17378): MESSAGE_STATE_CHANGE: 308-09 20:58:51.053: DEBUG/BluetoothService(17378): BT_SEND_MESSAGE08-09 20:58:51.108: ERROR/BluetoothService(17378): disconnected08-09 20:58:51.108: ERROR/BluetoothService(17378): java.io.IOException: Software caused connection    abort08-09 20:58:51.108: ERROR/BluetoothService(17378):     at android.bluetooth.BluetoothSocket.readNative (Native Method)08-09 20:58:51.108: ERROR/BluetoothService(17378):     at android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:286)08-09 20:58:51.108: ERROR/BluetoothService(17378):     at android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:96)08-09 20:58:51.108: ERROR/BluetoothService(17378):     at java.io.InputStream.read(InputStream.java:133)08-09 20:58:51.108: ERROR/BluetoothService(17378):     at my.test.BluetoothChatService$ConnectedThread.run(BluetoothChatService.java:356)</code></pre><p>How can I solve this problem?</p>","366494","","8562","","2010-08-09 18:10:15","2011-12-06 13:13:40","Android Bluetooth: Software Caused Connection Abort IOException?","<android><bluetooth><rfcomm>","1","1","","2012-09-18 13:31:33",""
"3443007","1","","","2010-08-09 18:31:20","0","2975","<p>i'm an IT Student and the language i'm learning is C#, it's quite similar to Java so I gave Android programming a shot. But I have a question:Is there and event that's fired when the screen is (un)locked?And if possible, can someone show me a code snippet showing an action done when the screen is (un)locked?</p>","412932","","","","","2010-08-09 18:51:33","Android ScreenLock event?","<java><android><events><screen>","1","0","1","",""
"3443316","1","","","2010-08-09 19:06:31","1","3104","<p>I guess this question has been asked before, but I can't seem to find a proper answer/solution.</p><p>Have a note-taking app, which allows to take pictures. For that I start an intent, that starts up the built-in camera-app. So far so good.</p><p>But when I show that image in my app, it's in a much smaller format :(</p><p>The funny/weird thing is, that the camera-app did take a full-resolution picture! But for some reason I can't get the full version to show in my app???</p><p>So, when I use the standard Android Gallery app, and go to that picture, it is very obvious that it's full size (I can zoom in and see details I really can't see when I zoom in, in my own app). Also, the dimensions are really those of the original picture, taken with the 5MP camera.</p><p>In my app, they are very small. My phone has Android 2.2, but the same happens on my emulator (Android 2.1).</p><p>How should I retrieve the pictures in my app??? Tried a couple of ways, but none works :(  Don't need a complete example (allthough that's very welcome), just a few clues are enough to search for myself.</p><p>Tx in advance!!</p><p>Greetingz,Koen&lt;</p>","293840","","","","","2011-02-02 02:51:55","Android: MediaStore.Images.Media.EXTERNAL_CONTENT_URI ... show pictures in full size?","<android>","1","1","1","",""
"3443494","1","","","2010-08-09 19:32:02","0","1562","<p>How can I draw an dynamic view on top of mainscreen in android.</p><p>For example I display the main screen using  setContentView(R.layout.main);This draws many widgets and includes an image defined in main.xml this way : </p><pre><code>&lt;ImageViewandroid:id=""@+id/myImageView""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:src=""@drawable/sinewave""/&gt;</code></pre><p>Now if I would like to draw rectangle on this image, how can I do it?Thank you for your time. </p>","357349","","","","","2012-01-23 23:45:16","ondraw view and xml in android","<android>","2","1","","",""
"3443588","1","3443893","","2010-08-09 19:44:18","4","5772","<p>I would like to add a favorites star like the one in the contacts list on android.  Is there any way we can get that star or will I have to write my own?  I can't seem to find any standard GUI Elements from android other than the options menu icons.  Are there any more that I have not found?</p><p>Look at the one the right next to George Anderson.  When you click it it turns yellow.   </p><p><img src=""http://mail2web.com/services-data/images/android/contacts-on-android.jpg"" alt=""alt text""></p>","336861","","","","","2011-02-21 16:25:46","How to get favorites star","<android><gui><icons>","2","0","2","",""
"3443589","1","3443615","","2010-08-09 19:44:23","2","4929","<p>I'm kind of new to this whole thing so I need some help. I have an application that creates an ImageView OnCreate. I want to make this image clickable and have it open a browser to a specific link.</p><p>How would I do this? I'm having trouble specifically with the setOnClickListener because the parameters are not accepting an OnClickListener.</p><p>I'm developing for Android 1.6</p>","414122","","","","","2010-08-09 21:02:53","Make an image clickable","<android>","2","0","2","",""
"3443628","1","3444614","","2010-08-09 19:49:55","1","1875","<p>I'm using a ThreadSafeClientConnManager to perform simultaneous requests in background threads on Android, set up with:</p><pre><code>HttpParams params = new BasicHttpParams();HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);HttpProtocolParams.setContentCharset(params, HTTP.DEFAULT_CONTENT_CHARSET);HttpProtocolParams.setUseExpectContinue(params, true);SchemeRegistry registry = new SchemeRegistry();registry.register(new Scheme(""http"", PlainSocketFactory.getSocketFactory(), 80));registry.register(new Scheme(""https"", SSLSocketFactory.getSocketFactory(), 443));ClientConnectionManager connman = new ThreadSafeClientConnManager(params, registry);client = new DefaultHttpClient(connman, params);</code></pre><p>And executing requests with (note that I'm using outh-signpost):</p><pre><code>HttpGet request = new HttpGet(""https://"" + API_HOST + ""/"" + API_VERSION + path);OAuthConsumer consumer = new CommonsHttpOAuthConsumer(key, secret);consumer.sign(request);HttpResponse response = client.execute(request);</code></pre><p>The problem is that after a while I start getting</p><pre><code>java.net.SocketException: The operation timed out</code></pre><p>Do I need to do something to explicitly release the connection after the request?</p>","232332","","","","","2010-08-09 22:18:00","Android ThreadSafeClientConnManager Timeouts?","<android><multithreading><httprequest>","1","0","1","",""
"3443644","1","3445000","","2010-08-09 19:52:43","-1","323","<p>We continue to build our fairly small applications on Android, iPhone and other mobile operating systems. This is fine and fun in the beginning of a new era, but when mobile OS matures, gets to be the preferred device for business people in motion, they want something more. </p><p>One would guess they want the same access and capability to ERP, MRP, BI-solutions and other reporting systems in there phone, right here, right now. How would we as developers deliver these demands, in a secure yet useful way? Is there today support for this kind of applications given they are not today on the web?</p><p><strong>EDIT:</strong> I understand the fact most EIS-solutions are web based. Still they are behind company gates, heavily garded by Cheif Information Security Officer (CISO) and his/her staff. Thus they are not accessible through the open unsecure internet but insede companies intranet or internal network. To my knowledge, accessing an EIS using an adress like <a href=""https://www.thecompany.com/eis-solution/"" rel=""nofollow"">https://www.thecompany.com/eis-solution/</a> signing in with username/password isn't done today. In the old days, a VPN-solution was one way to access inside EIS-solutions, but will this be done using a mobile device as well?</p>","286244","","168868","","2013-10-17 08:52:16","2013-10-17 08:52:16","Android/iPhone to have full access of Enterprise Information System?","<android><iphone>","1","5","","",""
"3443648","1","","","2010-08-09 19:53:11","0","224","<p>Here is my code.</p><pre><code>Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType(""image/*"");intent.addCategory(Intent.CATEGORY_OPENABLE);startActivityForResult(        Intent.createChooser(                intent,                ""Select Image""),        SELECT_IMAGE_LOCAL);</code></pre><p>For some reason it is always returning -1. Any ideas what I am doing wrong?</p>","386654","","","","","2013-09-26 12:05:27","Picking image from gallery always returns resultCode -1","<android>","2","0","","",""
"3443939","1","4010379","","2010-08-09 20:33:05","8","4888","<p>I have a ListView that uses different XML files to create Views and make items out of.  One of these XML files contains a RatingBar.  Everything displays and looks excellent.</p><p>I'm trying to attach an onClick handler to the RatingBar to launch a new Activity.  My RatingBar is of style ?android:attr/ratingBarStyleSmall; so it's just an indicator (I want the small RatingBar click to take the user to an Activity where they can do various ratings).</p><p>My problem is the onClick handler for the RatingBar never gets executed.  What makes it more interesting is that I've used the same code to make a LinearLayout clickable and it works fine.  Could anyone tell me why?</p><p>My Adapter's getView looks as such:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    int type = getItemViewType(position);    // get the View for this list item    View v = convertView;    if (v == null) {        LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);        switch (type) {            // ...            case TYPE_LOOKUP:                v = vi.inflate(R.layout.layout_itemlist_itemlookup, parent, false);                LinearLayout vLookup = (LinearLayout)v.findViewById(R.id.itemlist_lookup);                if (vStore != null) {                    vStore.setOnClickListener(new View.OnClickListener() {                            public void onClick(View v) {                                // THIS HANDLER WORKS FINE                                Intent intentLaunchLookup = new Intent(ActivityItemList.this, ActivityLookup.class);                                startActivity(intentLaunchLookup);                            }                        });                }                break;            case TYPE_SEPARATOR:                v = vi.inflate(R.layout.layout_itemlist_itemseparator, parent, false);                RatingBar r = (RatingBar)v.findViewById(R.id.itemlist_rating);                if (r != null) {                    r.setOnClickListener(new View.OnClickListener() {                            public void onClick(View v) {                                // THIS HANDLER DOES NOT GET EXECUTED (r IS NOT NULL; SO THIS SHOULD HAVE BEEN CREATED)                                Intent intentLaunchRating = new Intent(ActivityItemList.this, ActivityRating.class);                                startActivity(intentLaunchRating);                            }                        });                }                break;            // ...        }    }    // …  // return the created view    return v;}</code></pre>","406790","","406790","","2010-08-09 21:15:26","2013-05-30 22:14:12","RatingBar onClick","<android><onclick><rating>","4","1","2","",""
"3443972","1","3497892","","2010-08-09 20:38:00","0","1100","<p>Currently I've been using google's static maps to display maps in a phonegap app I'm developing. But I'm wondering if there's any way to load a google map that the user could scroll into and out of? I would want similar functionality as the maps app in most mobile environments. Is there any way to incorporate that type of service into my app?</p>","372346","","","","","2010-12-11 03:33:20","Can you load dynamic maps in the phonegap framework?","<iphone><android><map><phonegap>","2","0","1","",""
"3444040","1","3444184","","2010-08-09 20:47:23","0","473","<p>I want to have my application periodically save a zip file to the cloud.</p><p>Since I don't want to set my own cloud solution, I thought of doing something similar to what the application <a href=""http://www.appbrain.com/app/tv.studer.smssync"" rel=""nofollow"">SMS Backup</a> does. It saves your Gmail credentials and when a new sms arrives it saves it to your Gmail under a specified Label and also marks it as read.</p><p>Now, I know how to send email from Java programmaticaly. My question is how to access Gmail only features such as assigning labels to the message and marking it as read. I imagine there must be some facilities built in to Android to allow you to manipulate the GMail account linked to the phone am i right?</p>","56242","","","","","2010-08-09 21:21:05","Backing up data on your Google mail account in Android","<android><gmail>","2","1","","",""
"3444107","1","","","2010-08-09 20:55:18","0","1162","<p>I have a HorizontalScrollView that consists of Images (Icons).  I need to scroll the view in ""blocks"" the width of the icons, so as to never have a ""piece"" of the icon on the screen.  I need more, but this question will give me all the other answers I need.  </p><p>Does anyone have a code example to point me to for this?</p><p>Thank You in advance.</p><p>JS</p>","410071","","","","","2010-08-18 20:09:35","HorizontalScrollView - need to scroll by width of the images","<android>","2","0","","",""
"3444119","1","","","2010-08-09 20:56:08","1","738","<p>The problem with NinePatchDrawable. Created 9.png file using a utility draw9patch, but when the throw the file in a folder res/drawable error: No resource found that matches the given name.</p>","413881","","","","","2011-05-12 15:35:53","Problem with NinePatchDrawable","<android>","3","2","","",""
"3444275","1","3459958","","2010-08-09 21:15:00","4","403","<p>I want to start off by asking for your collective patience... I am trying to learn to program for Android by trial-and-error type modification of the Google Sample code: ""Notepad Tutorial"" So far things have been very slow going. (I am also reading Head First Java :) </p><p>My goal is to add to the tutorial app an additional TextEdit field and a Button... I want the user to be able to enter text into the field, then press the button and have the text they just entered be appended to the database and then dropped down to a textView within a scrollView so that a record of the entries is visible to the viewer. Basically, my goal is to allow the user to add an indefinite number of data (depending on the number of times the button is clicked) into each database entry. I have gotten part of the way there (adding a new db field, creating the TextEdit and button etc..) but I am having trouble putting it all together... specifically how to make it work on the db end. I am not sure that I am explaining this properly... but i will attach the relevant source code to try to make it clearer.</p><p>(Note: KEY_HOUSE is the db field I added and house/mHouseText are the related variables in question)</p><p>NoteEdit.java</p><pre><code>    package com.android.demo.notepad3;import android.R.string;import android.app.Activity;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.CheckBox;import android.widget.EditText;import android.widget.TableLayout;import android.widget.TableRow;import android.widget.TextView;import android.widget.TableRow.LayoutParams;public class NoteEdit extends Activity{    private EditText mTitleText;    private EditText mBodyText;    private Long mRowId;    private NotesDbAdapter mDbHelper;    Button btn;    int counter = 0;    private EditText mHouseText;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mDbHelper = new NotesDbAdapter(this);        mDbHelper.open();        setContentView(R.layout.note_edit);        setTitle(R.string.edit_note);        mTitleText = (EditText) findViewById(R.id.title);        mBodyText = (EditText) findViewById(R.id.body);        mHouseText = (EditText) findViewById(R.id.house);        Button confirmButton = (Button) findViewById(R.id.confirm);        Button btn = (Button) findViewById(R.id.Button01);        mRowId = (savedInstanceState == null) ? null :            (Long) savedInstanceState.getSerializable(NotesDbAdapter.KEY_ROWID);        if (mRowId == null) {            Bundle extras = getIntent().getExtras();            mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID)                                    : null;        }        populateFields();        confirmButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                setResult(RESULT_OK);                finish();            }        });    btn.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {            addrow();        }    });    }    private void populateFields() {        if (mRowId != null) {            Cursor note = mDbHelper.fetchNote(mRowId);            startManagingCursor(note);            mTitleText.setText(note.getString(                    note.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE)));            mBodyText.setText(note.getString(                    note.getColumnIndexOrThrow(NotesDbAdapter.KEY_BODY)));            mHouseText.setText(note.getString(                    note.getColumnIndexOrThrow(NotesDbAdapter.KEY_HOUSE)));        }    }    @Override    protected void onSaveInstanceState(Bundle outState) {        super.onSaveInstanceState(outState);        saveState();        outState.putSerializable(NotesDbAdapter.KEY_ROWID, mRowId);    }    @Override    protected void onPause() {        super.onPause();        saveState();    }    @Override    protected void onResume() {        super.onResume();        populateFields();    }    private void saveState() {        String title = mTitleText.getText().toString();        String body = mBodyText.getText().toString();        String house = mHouseText.getText().toString();        if (mRowId == null) {            long id = mDbHelper.createNote(title, body, house);            if (id &gt; 0) {                mRowId = id;            }        } else {            mDbHelper.updateNote(mRowId, title, body, house);        }    }    private void addrow(){        //mHouseText = (EditText) findViewById(R.id.house);        String house = mHouseText.getText().toString();        // get a reference for the TableLayout                TableLayout table = (TableLayout) findViewById(R.id.TableLayout02);        // create a new TableRow        TableRow row = new TableRow(this);        // create a new TextView        TextView t = new TextView(this);        // set the text to ""text xx""        t.setText(house);        // create a CheckBox        CheckBox c = new CheckBox(this);        // add the TextView and the CheckBox to the new TableRow        row.addView(t);        row.addView(c);        // add the TableRow to the TableLayout        table.addView(row,new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));    }}</code></pre><p>NotesDbAdapter.java</p><pre><code>package com.android.demo.notepad3;import android.content.ContentValues;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log; * Simple notes database access helper class. Defines the basic CRUD operations * for the notepad example, and gives the ability to list all notes as well as * retrieve or modify a specific note. *  * This has been improved from the first version of this tutorial through the * addition of better error handling and also using returning a Cursor instead * of using a collection of inner classes (which is less scalable and not * recommended).public class NotesDbAdapter {    public static final String KEY_TITLE = ""title"";    public static final String KEY_BODY = ""body"";    public static final String KEY_HOUSE = ""house"";    public static final String KEY_ROWID = ""_id"";    private static final String TAG = ""NotesDbAdapter"";    private DatabaseHelper mDbHelper;    private SQLiteDatabase mDb;    /**     * Database creation sql statement     */    private static final String DATABASE_CREATE =        ""create table notes (_id integer primary key autoincrement, ""        + ""title text not null, body text not null, house text not null);"";    private static final String DATABASE_NAME = ""data"";    private static final String DATABASE_TABLE = ""notes"";    private static final int DATABASE_VERSION = 2;    private final Context mCtx;    private static class DatabaseHelper extends SQLiteOpenHelper {        DatabaseHelper(Context context) {            super(context, DATABASE_NAME, null, DATABASE_VERSION);        }        @Override        public void onCreate(SQLiteDatabase db) {            db.execSQL(DATABASE_CREATE);        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            Log.w(TAG, ""Upgrading database from version "" + oldVersion + "" to ""                    + newVersion + "", which will destroy all old data"");            db.execSQL(""DROP TABLE IF EXISTS notes"");            onCreate(db);        }    }    /**     * Constructor - takes the context to allow the database to be     * opened/created     *      * @param ctx the Context within which to work     */    public NotesDbAdapter(Context ctx) {        this.mCtx = ctx;    }    /**     * Open the notes database. If it cannot be opened, try to create a new     * instance of the database. If it cannot be created, throw an exception to     * signal the failure     *      * @return this (self reference, allowing this to be chained in an     *         initialization call)     * @throws SQLException if the database could be neither opened or created     */    public NotesDbAdapter open() throws SQLException {        mDbHelper = new DatabaseHelper(mCtx);        mDb = mDbHelper.getWritableDatabase();        return this;    }    public void close() {        mDbHelper.close();    }    /**     * Create a new note using the title and body provided. If the note is     * successfully created return the new rowId for that note, otherwise return     * a -1 to indicate failure.     *      * @param title the title of the note     * @param body the body of the note     * @return rowId or -1 if failed     */    public long createNote(String title, String body, String house) {        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_TITLE, title);        initialValues.put(KEY_BODY, body);        initialValues.put(KEY_HOUSE, house);        return mDb.insert(DATABASE_TABLE, null, initialValues);    }    /**     * Delete the note with the given rowId     *      * @param rowId id of note to delete     * @return true if deleted, false otherwise     */    public boolean deleteNote(long rowId) {        return mDb.delete(DATABASE_TABLE, KEY_ROWID + ""="" + rowId, null) &gt; 0;    }    /**     * Return a Cursor over the list of all notes in the database     *      * @return Cursor over all notes     */    public Cursor fetchAllNotes() {        return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TITLE,                KEY_BODY, KEY_HOUSE}, null, null, null, null, null);    }    /**     * Return a Cursor positioned at the note that matches the given rowId     *      * @param rowId id of note to retrieve     * @return Cursor positioned to matching note, if found     * @throws SQLException if note could not be found/retrieved     */    public Cursor fetchNote(long rowId) throws SQLException {        Cursor mCursor =            mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,                    KEY_TITLE, KEY_BODY, KEY_HOUSE}, KEY_ROWID + ""="" + rowId, null,                    null, null, null, null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    /**     * Update the note using the details provided. The note to be updated is     * specified using the rowId, and it is altered to use the title and body     * values passed in     *      * @param rowId id of note to update     * @param title value to set note title to     * @param body value to set note body to     * @return true if the note was successfully updated, false otherwise     */    public boolean updateNote(long rowId, String title, String body, String house) {        ContentValues args = new ContentValues();        args.put(KEY_TITLE, title);        args.put(KEY_BODY, body);        args.put(KEY_HOUSE, house);        return mDb.update(DATABASE_TABLE, args, KEY_ROWID + ""="" + rowId, null) &gt; 0;    }}</code></pre><p>NoteEdit.xml</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TableLayout android:id=""@+id/TableLayout01"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""  android:stretchColumns=""0""&gt;  &lt;TableRow android:id=""@+id/TableRow01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;TextView android:layout_width=""fill_parent""            android:layout_height=""wrap_content""             android:text=""@string/title"" /&gt;        &lt;EditText android:id=""@+id/title""           android:layout_height=""wrap_content""             android:layout_width=""wrap_content"" android:hint=""Montague St.""/&gt;  &lt;/TableRow&gt;  &lt;TableRow android:id=""@+id/TableRow02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;TextView android:layout_width=""wrap_content""            android:layout_height=""wrap_content""             android:text=""@string/body"" /&gt;        &lt;EditText android:id=""@+id/body"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:scrollbars=""vertical"" android:hint=""44""/&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;ScrollView android:id=""@+id/ScrollView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;  &lt;TableLayout android:id=""@+id/TableLayout02"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:stretchColumns=""0""&gt;    &lt;TableRow android:id=""@+id/TableRow03"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;      &lt;EditText android:id=""@+id/house"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:hint=""House Number""&gt;&lt;/EditText&gt;      &lt;CheckBox android:id=""@+id/CheckBox01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;    &lt;/TableRow&gt;    &lt;Button android:id=""@+id/Button01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Add House""&gt;&lt;/Button&gt;  &lt;/TableLayout&gt;&lt;/ScrollView&gt;    &lt;LinearLayout android:orientation=""horizontal""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;    &lt;Button android:id=""@+id/confirm""       android:text=""@string/confirm""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I recognize that my issue is extremely open ended and ""n00b""-esque, but any help, or even just a nudge in the right direction, would be greatly appreciated.</p><p>Thanks</p><p>Frank</p>","415560","","415560","","2010-08-09 21:23:37","2010-08-11 15:20:29","A very open-ended, n00b-esque question about extending the Notepad tutorial in Android","<java><android>","2","3","","2013-02-13 03:59:14",""
"3444367","1","","","2010-08-09 21:30:44","0","317","<p>I have a soundboard uploaded on the android market. The app is doing pretty well in the market(50,000+ downloads), but the developer console reports that I have an error, and this is bothering me.</p><p>All crash reports come from only one device - Motorola Droid. I've looked at what the error actually is, and it happens when I call the start() method for the MediaPlayer class. I get the following:</p><p>java.lang.NullPointerException:</p><p>at com.meeg.soundit.Soundboard.playAudio(Soundboard.java:2517)</p><p>the code for the method playAudio is as follows and line 2517 is mp.start():</p><pre><code>public void playAudio(int resid){    final MediaPlayer mp = MediaPlayer.create(this, resid);    mp.start();    mp.setOnCompletionListener(new OnCompletionListener() {        public void onCompletion(MediaPlayer arg0) {            mp.release();        }    });}</code></pre><p>Like I said, my soundboard has over 50,000 downloads, and it has 80 reports, all from the Motorola Droid. Is this something that I should ignore because 80 reports isn't much compared to how many people have used this, is there a problem with Moto Droid's and MediaPlayer, or is it just my code thats faulty?</p>","415573","","","","","2010-08-09 23:59:12","mediaplayer.start() makes app crash only on Motorola Droid devices","<java><android>","1","1","","",""
"3444429","1","","","2010-08-09 21:40:30","3","3856","<p>I'm developing on a Droid, version 2.1-update1.  My supported GL extensions include GL_OES_point_sprite and GL_OES_point_size_array.</p><p>I am unable to get point sprites to render.    The code below throws UnsupportedOperationException from GLWrapperBase at the glTexEnvi call.    If I disable textures and comment out the glTexEnvi all, it throws the same exception further down, at glPointSizePointerOES().   </p><p>Are point sprites properly supported in Android?   Has anyone gotten them working?    Or is there an issue with my code below?</p><pre><code>// Note that gl is cast to GL11gl.glEnable(GL11.GL_TEXTURE_2D);gl.glEnable(GL11.GL_BLEND);gl.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);gl.glDepthMask(false);gl.glEnable(GL11.GL_POINT_SPRITE_OES);gl.glTexEnvi( GL11.GL_POINT_SPRITE_OES, GL11.GL_COORD_REPLACE_OES, GL11.GL_TRUE );  gl.glEnableClientState(GL11.GL_VERTEX_ARRAY);gl.glVertexPointer(2, GL11.GL_SHORT, 0, .vertBuffer);gl.glEnableClientState(GL11.GL_POINT_SIZE_ARRAY_OES);gl.glPointSizePointerOES(GL11.GL_FLOAT, 0, pointSizeBuffer);</code></pre><p>Thanks</p>","379296","","44729","","2010-08-09 21:58:34","2011-11-29 11:14:16","Do OpenGL Point Sprites work in Android?","<android><opengl-es><point><sprites>","3","0","1","",""
"3444441","1","","","2010-08-09 21:42:23","0","1165","<p>I'm an experienced Java programmer and I've followed the Hello World tutorial word for word. However, the emulator loads up but the apps do not.</p><p>I tried the Hello World app and a sample project <code>GestureActivity</code>. Each time only the emulator works. My computer is reasonably fast and I've waited at least 10-20 minutes on occasions.</p><p>Is this just a case of re-installing the SDK? I re-installed the ADT to no avail.</p><p>Thanks, Daniel</p><p>Here is the console information it produces:</p><pre><code>[2010-08-09 22:36:49 - HelloAndroid] Android Launch![2010-08-09 22:36:49 - HelloAndroid] adb is running normally.[2010-08-09 22:36:49 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch[2010-08-09 22:36:49 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'NewAVD'[2010-08-09 22:36:49 - HelloAndroid] Launching a new emulator with Virtual Device 'NewAVD'</code></pre>","415580","","1232277","","2013-01-05 03:01:59","2013-01-05 03:01:59","AVD Android Emulator not loading applications","<android><emulator>","0","2","","",""
"3444552","1","3445157","","2010-08-09 22:03:18","3","1559","<p>I'm trying to use gluLookAt in an Android app to move the ""camera"" around, but I'm not seeing any results.  I've looked around and I gather that any glLoadIndentity() calls will reset the matrix, cancelling the effect of the gluLookAt.</p><p>Problem is, no matter what I put in my gluLookAt call, nothing moves.</p><p>So here's the relevant part of my surface setup:</p><pre><code>public void onSurfaceCreated(GL10 gl, EGLConfig config) {    gl.glDisable(GL10.GL_DITHER);    gl.glEnable(GL10.GL_TEXTURE_2D);    gl.glShadeModel(GL10.GL_SMOOTH);    gl.glClearColor(0f, 0f, 0f, 0.5f);    gl.glClearDepthf(1.0f);    gl.glEnable(GL10.GL_DEPTH_TEST);    gl.glDepthFunc(GL10.GL_LEQUAL);    gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);}public void onSurfaceChanged(GL10 gl, int width, int height) {    gl.glViewport(0, 0, width, height);    gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glLoadIdentity();    GLU.gluPerspective(gl, 45f, (float) width / (float) height, 0.01f, 200f);    gl.glMatrixMode(GL10.GL_MODELVIEW);}</code></pre><p>And then my frame-drawing method is:</p><pre><code>public void onDrawFrame(GL10 gl) {    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    GLU.gluLookAt(gl, 0, 0, 100, 0, 0, 0, 0, 1, 0);    for (int i = 0; i &lt; obj.size; i++) { // obj is an array of positions        obj = mObj[i];        gl.glPushMatrix();        gl.glLoadIdentity();        gl.glTranslatef(obj.position.x(), obj.position.y(), obj.position.z());        gl.glRotatef(obj.rotation.x(), 1f, 0f, 0f);        gl.glRotatef(obj.rotation.y(), 0f, 1f, 0f);        gl.glRotatef(obj.rotation.z(), 0f, 0f, 1f);        obj.draw(gl); // the objects 'draw' themselves        gl.glPopMatrix();    }}</code></pre><p>And here's an example of the draw() function of my objects, which essentially draw a bunch of elements:</p><pre><code>class SomeObject {    public void draw(GL10 gl) {        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);        gl.glEnableClientState(GL10.GL_NORMAL_ARRAY);        gl.glEnable(GL10.GL_CULL_FACE);        gl.glFrontFace(GL10.GL_CCW);        gl.glCullFace(GL10.GL_BACK);                    gl.glColor4f(1f, 0f, 0f, 1f);        gl.glDrawElements(GL10.GL_TRIANGLES, SomeObject.fCount, GL10.GL_UNSIGNED_BYTE, faceBuffer);        gl.glColor4f(1, 1, 1, 1);        gl.glDisableClientState(GL10.GL_NORMAL_ARRAY);        gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);    }}</code></pre>","138033","","44729","","2011-05-26 15:44:47","2011-05-26 15:44:47","gluLookAt not working despite using Push/PopMatrix for transforms","<android><opengl-es>","1","0","","",""
"3444612","1","","","2010-08-09 22:17:56","0","139","<p>Where is the best location to install pre-install data for your app?  (for example, sample photos).</p><p>According to this document, we should put data in ""/Android/data/your_package_name/files/""</p><p><a href=""http://developer.android.com/guide/topics/data/data-storage.html#filesExternal"" rel=""nofollow"">http://developer.android.com/guide/topics/data/data-storage.html#filesExternal</a></p><p>I am not 100% sure what should go in that location and what not....</p><p>Please advise.</p>","415604","","","","","2011-02-21 14:45:02","Best practices including pre-installed data?","<android>","1","0","","",""
"3444764","1","4624242","","2010-08-09 22:47:43","23","19558","<p>I am working on a subclass of FrameLayout that is supposed to rotate all of its children by 90 degrees. I am doing this to overcome the landscape-only camera limitation present in android 2.1 and below, by having the activity be in landscape, but placing my camera overlay into this framelayout overlay to cause it to appear as if it was portrait (<a href=""http://groups.google.com/group/android-developers/msg/ca87bb60c52f0cac"">this is how Layar does it</a>) To accomplish this, I'm adapting <a href=""http://groups.google.com/group/android-developers/msg/4c0388feef7bd3d2"">Jeff Sharkey's code</a> to rotate views. My problem is that I can rotate the Framelayout, but I cannot resize it to match the new dimensions. So on my g1, instead of a 320x480 portrait view over a 480x320 camera view in landscape, I get a 320x320 box in the middle showing my portrait view with the sides chopped off.</p><p>Here is my code so far:</p><pre><code>public class RotateLayout extends FrameLayout {    private Matrix mForward = new Matrix();    private Matrix mReverse = new Matrix();    private float[] mTemp = new float[2];    public RotateLayout(Context context) {        super(context);    }    public RotateLayout(Context context, AttributeSet attrs) {        super(context, attrs);    }    /* (non-Javadoc)     * @see android.widget.FrameLayout#onMeasure(int, int)     */    @Override    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {        super.onMeasure(widthMeasureSpec, heightMeasureSpec);        //This didn't work:        //super.onMeasure(heightMeasureSpec, widthMeasureSpec);    }    /* (non-Javadoc)     * @see android.widget.FrameLayout#onSizeChanged(int, int, int, int)     */    @Override    protected void onSizeChanged(int w, int h, int oldw, int oldh) {        super.onSizeChanged(w, h, oldw, oldh);    }    @Override    protected void dispatchDraw(Canvas canvas) {        canvas.rotate(270, getWidth()/2, getHeight()/2);        //This code will stretch the canvas to accommodate the new screen size. This is not what I want.        //float scaleX=(float)getHeight()/getWidth();        //float scaleY=(float)getWidth()/getHeight();        //canvas.scale(scaleX, scaleY,  getWidth()/2, getHeight()/2);        mForward = canvas.getMatrix();        mForward.invert(mReverse);        canvas.save();        canvas.setMatrix(mForward); //This is the matrix we need to use for proper positioning of touch events        super.dispatchDraw(canvas);        canvas.restore();    }    @Override    public boolean dispatchTouchEvent(MotionEvent event) {        final float[] temp = mTemp;        temp[0] = event.getX();        temp[1] = event.getY();        mReverse.mapPoints(temp);        event.setLocation(temp[0], temp[1]);        return super.dispatchTouchEvent(event);    }}</code></pre><p>I have tried overriding <code>OnMeasure</code> to switch the X and Y dimensions of the View, but have not been able to get that to work.Any help you can provide is greatly appreciated.</p>","381299","","1779126","","2013-04-01 06:53:34","2014-04-14 14:11:25","Rotate View Hierarchy 90 degrees","<android><android-layout><animation><android-widget>","5","5","20","",""
"3444920","1","","","2010-08-09 23:22:29","0","190","<p>I would like to apply both an icon and text to a button. The button would have the icon centered in the button and text written at the bottom, centered. I could not get the text to center and be at the bottom using android:gravity. </p><p>A side note, for a layout with 6 buttons is a Table Layout the best way to do it? There is 3 rows and 2 columns. Thanks in advance. </p><p>Another side note, why does the button lose its rounded edges when I add background color?</p>","413926","","","","","2010-08-09 23:51:45","How to layout a button","<android><button>","1","0","","",""
"3444929","1","3444981","","2010-08-09 23:24:26","4","1234","<p>Is it possible to obtain the X-Y coordinates of a home screen widget? I need to display a pop-up relative to the position of the widget, so I need to get the X and Y coordinates.</p><p>Thank you</p>","318525","","","","","2013-08-09 11:03:23","android home screen widget x-y coordinates","<android><widget>","2","0","2","",""
"3445154","1","5865878","","2010-08-10 00:22:58","1","837","<p>I'm trying to track whether people have found my Android app from an ad, or elsewhere. So I found that google analytics can keep track of that via the carefully constructed url generated by this form:</p><p><a href=""http://code.google.com/mobile/analytics/docs/android/#android-market-tracking"" rel=""nofollow"">http://code.google.com/mobile/analytics/docs/android/#android-market-tracking</a></p><p>which would look something like this:</p><p><a href=""http://market.android.com/search?q=pname:com.example.application&amp;referrer=utm_source%3Dgoogle%26utm_medium%3Dcpc%26utm_campaign%3Dcampaign"" rel=""nofollow"">http://market.android.com/search?q=pname:com.example.application&amp;referrer=utm_source%3Dgoogle%26utm_medium%3Dcpc%26utm_campaign%3Dcampaign</a></p><p>...and then adding the analytics .jar to my project and adding this to my app's manifest:</p><pre><code>&lt;!-- Used for install referrer tracking --&gt;&lt;receiver android:name=""com.google.android.apps.analytics.AnalyticsReceiver"" android:exported=""true""&gt;  &lt;intent-filter&gt;    &lt;action android:name=""com.android.vending.INSTALL_REFERRER"" /&gt;  &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>So my question is: if I want to track <strong>only referrals</strong> and nothing more, do I need any of the GoogleAnalyticsTracker.*; code in my activities?</p>","266737","","","","","2011-05-05 19:29:37","Is GoogleAnalyticsTracker.getInstance() required for tracking referrals?","<android><google-analytics><referrals>","1","0","","",""
"3445290","1","3452463","","2010-08-10 01:00:08","0","626","<p>I am trying to create a very simple application (part of my learning program), vertically oriented, with an <em>EditText</em> at the top that receives a URL, and two buttons side by side just below that say ""Get Image"" or ""Get Text"" depending on the URL typed in (<em>.html</em> vs. <em>.png</em>, for example). The resulting elements may be later scavanged for use in a real app.</p><p>I know that <em>ScrollView</em> can have only one child. Conceptually, I want the rest of the screen to be a vertically oriented content region for displaying either the text (<em>TextView</em>) of the URL and ""Get Text"" was clicked or the image (<em>ImageView</em>) in the case where it was an image and ""Get Image"" was clicked.</p><p>I tried to do this (pseudocode) in <em>main.xml</em>:</p><pre><code>&lt;LinearLayout&gt;  &lt;EditText /&gt;         --where to type the URL  &lt;Button /&gt;           --click to treat URL as text  &lt;Button /&gt;           --click to treat URL as image  &lt;FrameLayout&gt;        --(used to be ScrollView)    &lt;LinearLayout&gt;      &lt;TextView /&gt;     --content region occupied by either text      &lt;ImageView /&gt;    --or an image (but not both)    &lt;/LinearLayout&gt;  &lt;/FrameLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>in order not to violate the single-child requirement. However, this doesn't work and for now I'm not finding any sample out there that clues me in to how best to accomplish this. The last complaint I got while debugging was:</p><blockquote>  <p>Caused by:  java.lang.ClassCastException:  android.widget.TextView</p></blockquote><p>If anyone has the time and patience to steer me in some useful direction, I'd greatly appreciate it.</p><p>Thanks,</p><p>Russ Bateman</p>","339736","","339736","","2010-08-12 13:18:22","2010-08-12 13:18:22","Two children for ScrollView?","<android><android-widget>","2","1","","",""
"3445437","1","","","2010-08-10 01:38:43","1","602","<p>I'm writing an app which uses the Foreign Key Constraints which support was only just brought in for on version 2.2, and my phone is 2.1  Is there any way to upgrade the version of sqlite3 on the htc desire or any other android phone when your application installs?</p>","415686","","","","","2010-08-10 03:00:33","Can you upgrade sqlite3 version on your android?","<android><database><sqlite3><foreign-keys><upgrade>","1","0","","",""
"3445470","1","","","2010-08-10 01:49:24","0","553","<p>It's a special SD card, with an encryption chip on and some COS run on it.When I use USB debug mode, everything works fine. But after I unplug the cable, when I do the read/write to the SD card files again, it throw IOException everytime. And I found that when I plug the charger it works fine too. Is there some settings reasons about the problems?</p>","411771","","","","","2010-08-10 01:49:24","Read/Write SD card always throw IOException","<android><android-sdcard>","0","2","","",""
"3445563","1","","","2010-08-10 02:14:24","2","552","<p>I have a problem I can't seem to get around. I've created a project in Eclipse (I recreated it from another project that I thought was corrupted). There are no visible errors in any of the files, including the .xml files. However, the project root [project name] itself has an error (red 'x') and so I can't run it. </p><p>On a side note, in the default properties file the line:target=android-4 is underlined in red with the note that 'android' is not spelled correctly. I have not altered this file since it was generated. </p><p>Any clues? Target is 1.6, sdk 4. And I'm new at this :)</p>","428760","","","","","2011-06-09 06:20:09","Eclipse Android project","<android><eclipse>","4","1","","",""
"3445753","1","3447051","","2010-08-10 03:06:33","0","1284","<p>I wanna make an app which is quite similar to the official twitter client for android.</p><p>In my listView Item ,there is a TextView which has some html content,I hope the links within it can be focusable and clickable,I have used:</p><pre><code>getListView().setItemsCanFocus(true);</code></pre><p>but it still doesn't work,I don't know why.</p><p>the layout is like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/item"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" android:orientation=""horizontal""  android:padding=""6dip"" android:background=""#FFFFFF""&gt; &lt;ImageView android:id=""@+id/avatar""      android:layout_width=""wrap_content""  android:layout_height=""fill_parent""   android:layout_marginRight=""6dip""  android:src=""@drawable/default_happy_face"" /&gt; &lt;LinearLayout      android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  &gt;  &lt;RelativeLayout      android:id=""@+id/linearBanner""      android:orientation=""horizontal""      android:layout_width=""fill_parent""      android:layout_height=""20dip""&gt;   &lt;TextView android:id=""@+id/txtNickname""        android:layout_width=""wrap_content""    android:textColor=""#1C86EE""    android:text=""mmLiu"" android:layout_height=""fill_parent""/&gt;   &lt;ImageView android:id=""@+id/verified""              android:layout_width=""24dip""          android:layout_height=""24dip""          android:paddingLeft=""4dip""          android:layout_toRightOf=""@id/txtNickname""          android:background=""@drawable/verified""/&gt;      &lt;TextView android:id=""@+id/txtTime""        android:textColor=""#999999""        android:layout_height=""fill_parent""        android:layout_alignTop=""@+id/txtNickname""        android:layout_alignRight=""@layout/notice_item"" android:layout_toRightOf=""@+id/verified"" android:layout_width=""fill_parent"" android:gravity=""right"" android:text=""?????""/&gt;  &lt;/RelativeLayout&gt;  &lt;TextView android:id=""@+id/txtContent""       android:layout_width=""fill_parent""   android:layout_height=""wrap_content""    android:textColor=""#050505""   android:text=""!???? ???????116,??69????????,????????????,????,????!?????:http://1net.cn/8wf?#??#"" android:clickable=""true""/&gt; &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I hope the links can be focused instead of the whole item,this issue have been discussed in the google io,see <a href=""http://code.google.com/events/io/2010/sessions/world-of-listview-android.html"" rel=""nofollow"">here</a> and the solution is getListView().setItemsCanFocus(true);But it just doesn't work for me.</p><p>I used an comstimized adapter which extends the BaseAdapter,I don't know if that has sth to do with it.</p><p>anyone? any help ?</p>","404145","","225647","","2010-08-10 08:14:20","2010-08-10 08:14:20","How to make HTML links in a listView Item focusable?","<android><listview><item><focusable>","1","0","1","",""
"3445775","1","3445808","","2010-08-10 03:13:17","2","546","<p>I know this is a little dumb, but how do you do this? I've ""RTFM"" but I still don't understand concepts like this just don't exist in the languages I'm used to programming. Anyway, my question is simple: how does one properly set a global variable which can be used by all public void functions inside that class? </p><p>Here is some example code, I will highlight the redundancy in case you don't see it:</p><pre><code>public class baketimer extends Activity implements OnClickListener {    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        <b>final Button cupcake1 = (Button) this.findViewById(R.id.cupcake1);</b>        cupcake1.setOnClickListener(this);            }    public void onClick(View v) {        switch(v.getId()){        case R.id.cupcake1:            <b>final Button cupcake1 = (Button) this.findViewById(R.id.cupcake1);</b>            new CountDownTimer(30000, 1000) {                public void onTick(long millisUntilFinished) {                    cupcake1.setText("""" + millisUntilFinished / 1000);                }                public void onFinish() {                    cupcake1.setText(""Done!"");                }            }.start();            Toast.makeText(this, ""Mmm cupcakes!"", Toast.LENGTH_SHORT).show();            break;</code></pre><p>How would I go about declaring <code>cupcake1</code> for the entire class?</p><p>Thanks in advance!</p>","459095","","1512962","","2013-01-27 19:36:58","2013-01-27 19:36:58","How to Declare Variables","<java><android>","3","2","","",""
"3445814","1","","","2010-08-10 03:24:18","0","385","<p>I'm an android newbie having a lot of troubles with the android emulator.  I have inconsistent luck in starting up the emulator, and no luck if I start it from within eclipse instead of from the commandline (it waits forever and never boots -- not even after 24 hours).</p><p>However, since I figured out how to get it to (sometimes!) start from the command line, I have a workaround to that particular problem.  But I have no workaround for my latest problem.  When I try to run it:</p><p><code>[2010-08-09 22:08:12 - MyApp] ------------------------------<br>[2010-08-09 22:08:12 - MyApp] Android Launch!<br>[2010-08-09 22:08:12 - MyApp] adb is running normally.<br>[2010-08-09 22:08:12 - MyApp] Performing com.android.MyApp.MyApp activity launch<br>[2010-08-09 22:08:12 - MyApp] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'TestDroid'<br>[2010-08-09 22:08:12 - MyApp] WARNING: Application does not specify an API level requirement!<br>[2010-08-09 22:08:12 - MyApp] Device API version is 8 (Android 2.2)<br>[2010-08-09 22:08:14 - MyApp] Uploading MyApp.apk onto device 'emulator-5554'<br>[2010-08-09 22:08:14 - MyApp] Installing MyApp.apk...<br>[2010-08-09 22:08:15 - MyApp] Success!<br>[2010-08-09 22:08:15 - MyApp] Starting activity com.android.MyApp.MyApp on device <br></code></p><p>But nothing starts on my android instance.  MyApp doesn't even show up on the app list.</p><p>I assume I'm doing something wrong?</p>","414182","","","","","2010-08-10 19:31:19","Can't deploy Android/Google Maps app from eclipse","<android><eclipse>","2","0","","",""
"3445823","1","4545480","","2010-08-10 03:27:45","5","6489","<p>I want the items in the listview to slide in one at a time from left to right. I have the following in res/anim/slide_right.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android"" android:interpolator=""@android:anim/accelerate_interpolator""&gt;    &lt;translate android:fromXDelta=""100%p"" android:toXDelta=""0"" android:duration=""150"" /&gt;&lt;/set&gt;</code></pre><p>And in my onCreate method in my ListActivity I have:</p><pre><code>LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(this, R.anim.slide_right);mList.setLayoutAnimation(controller);</code></pre><p>When I run it, I get a RuntimeException caused by ""Unknown layout animation name: set""</p><p>What am I doing wrong?</p>","413414","","","","","2013-01-16 09:55:12","Having trouble animating listview layout","<android><listview><layout><animation>","2","1","1","",""
"3445871","1","3445900","","2010-08-10 03:44:43","1","991","<p>This is my code, it always falls into the else even when I know that the value going in (via debugger) is emtpy.  </p><pre><code>name = cursor.getString(cursor.getColumnIndex(""Genus"")) + "" "" + cursor.getString(cursor.getColumnIndex(""Species""));if(name != """" &amp;&amp; name != null)    tv.setText(name);else    tv.setText(""Error"");</code></pre>","1491425","","","","","2012-07-31 03:40:52","How can I check if a string I have returned from a cursor is emtpy or null in an Android cursor?","<java><android><string><null><cursor>","3","0","","",""
"3445979","1","","","2010-08-10 04:15:25","1","173","<p>I've been searching around for a definitive answer but have yet to find one. It seems as though the simple answer is ""no"" because the GoogleAPIs use too many Java classes that aren't included in Android.</p><p>If that's the case then I need to ask another question: what is the best way to parse information from ""http://www.google.com/finance/"" ?</p>","415746","","","","","2011-02-24 22:23:15","Is it possible to use GoogleFinanceAPI on Android?","<java><android><xml-parsing><feedparser><google-finance-api>","2","0","","",""
"3446002","1","3447398","","2010-08-10 04:22:45","0","231","<p>There is a null error, and i've been trying to solve it for 2 days.</p><p>Booking.java</p><pre><code>package one.two;import android.app.Activity;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.SimpleCursorAdapter;import android.widget.Spinner;import android.widget.TextView;import android.widget.AdapterView.OnItemSelectedListener;public class Booking extends Activity{    private DBAdapter db;     private Spinner colourSpinner;    public Cursor myCursor;    public TextView txtArrival;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        db = new DBAdapter(this);        this.setContentView(R.layout.booking);        txtArrival = (TextView) findViewById(R.id.txtArrival); // Member assignment        colourSpinner = (Spinner) findViewById(R.id.myspinner); // Member assignment        db.open();        fillData();        db.close();        colourSpinner.setOnItemSelectedListener(new MyOnItemSelectedListener());    }    private void fillData()    {        myCursor = db.getSpinnerData();        startManagingCursor(myCursor);        String[] from = new String[]{DBAdapter.KEY_ARRIVAL};        int[] to = new int[]{android.R.id.text1};        SimpleCursorAdapter adapter =        new SimpleCursorAdapter(this,R.layout.booking, myCursor, from, to );        adapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );        // Removed this line, since members is set in onCreate        colourSpinner.setAdapter(adapter);    }    public class MyOnItemSelectedListener implements OnItemSelectedListener    {        public void onItemSelected(AdapterView&lt;?&gt; arg0, View v,int position, long id)        {            boolean result = Booking.this.myCursor.moveToPosition(position);            if (result) {                String title=Booking.this.myCursor.getString(1);                Booking.this.txtArrival.setText(title);            }        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; arg0)        {            // TODO Auto-generated method stub        }    };}</code></pre><p>LogCat</p><pre><code>08-10 03:45:06.467: ERROR/AndroidRuntime(750): Uncaught handler: thread main exiting due to uncaught exception08-10 03:45:06.567: ERROR/AndroidRuntime(750): java.lang.NullPointerException08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at one.two.Booking$MyOnItemSelectedListener.onItemSelected(Booking.java:54)08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at android.widget.AdapterView.fireOnSelected(AdapterView.java:856)08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at android.widget.AdapterView.access$200(AdapterView.java:41)08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:827)08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at android.os.Handler.handleCallback(Handler.java:587)08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at android.os.Handler.dispatchMessage(Handler.java:92)08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at android.os.Looper.loop(Looper.java:123)08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at android.app.ActivityThread.main(ActivityThread.java:3948)08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at java.lang.reflect.Method.invokeNative(Native Method)08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at java.lang.reflect.Method.invoke(Method.java:521)08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)08-10 03:45:06.567: ERROR/AndroidRuntime(750):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Thank you.</p>","358218","","","","","2010-08-10 09:08:15","What's wrong with my code?","<android><eclipse><sqlite><null>","4","5","0","2011-09-03 01:57:53",""
"3446091","1","3446124","","2010-08-10 04:42:16","3","3306","<p>Say <code>MyService</code> and <code>MyClient</code> are both running, although <code>MyClient</code> is currently in the background. If <code>MyService</code> sends an Intent to <code>MyClient</code> via:</p><pre><code>Intent i = new Intent(MYService.this, MyClient.class);i.setAction(""com.test.MyService.ACTION_SERVICE"");i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(i);</code></pre><p>How do I get this Intent in MyClient? Running this code triggers onResume() in <code>MyClient</code>, but because it's already running, calling <code>getIntent()</code> returns the Intent that initially created MyClient, which is always <code>android.intent.action.MAIN</code></p>","440093","","","","","2010-09-13 13:32:10","Android: How to pass Intent via startActivity() to a running Activity?","<android>","1","0","2","",""
"3446178","1","","","2010-08-10 05:04:38","1","2253","<p>When I do some research on the Android SDK website, I know that I have to grant the permission ""FLASHLIGHT"" in order to use the light. However, I cannot find in the API any methods to control the flash light. But I believe there is a way because I can see so many apps doing this in the Android Market. How can I do so?</p>","415775","","","","","2010-11-23 20:12:19","How can I control the flashlight on the phone?","<android>","1","1","","",""
"3446201","1","3446543","","2010-08-10 05:08:53","2","947","<p>I have a bitmap that I load from the SD card by allowing the user to choose a picture to display. Once the bitmap is created, I set the Bitmap in an ImageView:</p><pre><code>mBitmap = Bitmap.createBitmap(Media.getBitmap(this.getContentResolver(), mPictureUri));mImageView.setImageBitmap(mBitmap);</code></pre><p>This works fine. But, if I change the screen orientation from portrait to landscape, and back again a few times, I always get an OutOfMemory exception.</p><p>In onPause, I call mBitmap.recycle(), and then on onResume, I call the above code again to create the bitmap and set the ImageView. Since I'm recycling the image each time, how can I get an OutOfMemory error?</p><p>In any case, since that failed, I found a post that said to try using onRetainNonConfigurationInstance() and getLastNonConfigurationInstance(). See post <a href=""http://stackoverflow.com/questions/3250987/save-cache-when-rotate-device/3252547#3252547"">http://stackoverflow.com/questions/3250987/save-cache-when-rotate-device/3252547#3252547</a>. I changed my code to work this way, and I still get an error. Changing the code, I had the call to getLastNonConfigurationInstance() in onCreate(), and removed all code in onPause and onResume.</p><p>Can someone tell me what the problem is, or provide some way to simply load an image, and then be able to pause and resume the Activity without running out of memory? Thanks.</p>","449070","","","","","2011-03-02 18:22:39","Bitmap OutOfMemory on Multiple Screen Changes","<android><memory-leaks>","3","0","1","",""
"3446202","1","","","2010-08-10 05:09:00","18","16645","<p>Is there a way to detect when a user unlocks the phone? I know about <code>ACTION_SCREEN_ON</code> and <code>ACTION_SCREEN_OFF</code>, but these seem to be fired when the screen switches on/off when pressing the power button, but not actually when the phone gets unlocked when pressing the Menu button...</p><p>I am trying to detect the unlock/lock while an activity is running, and I want to resume the activity once unlocked.</p>","415777","","1591041","","2014-02-26 03:07:42","2014-02-26 03:07:42","Android - detect phone unlock event, not screen on","<android><events><phone><unlock>","2","0","6","",""
"3446298","1","3446985","","2010-08-10 05:30:07","2","6170","<p>I'm trying to get my textview to hug the left side of the screen while the button hugs the right side (and if possible just for ocd sake have the text view center itself vertically to be in line with the button) but not do it using absolute values. Here's my coding:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextViewandroid:layout_width=""100px""android:layout_height=""wrap_content""android:layout_gravity=""left""android:text=""Change City:""/&gt;&lt;Button android:layout_width=""100px"" android:layout_height=""wrap_content"" android:layout_gravity=""right""android:text=""Click"" android:id=""@+id/citychoicebutton""/&gt;&lt;/LinearLayout&gt;</code></pre><p>I thought layout_gravity took care of what I'm trying to do but apparently not.</p>","407775","","6391","","2010-08-10 05:38:39","2013-11-22 07:33:00","Textview on left side with button on right side non absolute values","<android><user-interface><layout>","2","1","1","",""
"3446337","1","","","2010-08-10 05:37:15","0","236","<p>I just want to redirect a facebook page in my android application but each time its asking for login detailes and when I m already login it does not redirect to my facebook page URL it opens my profile.</p><p>Anyone have solution please?</p><p>Thanks.</p>","392506","","238639","","2010-08-10 05:38:50","2010-08-10 05:38:50","Facebook page doesn't redirect","<android>","0","2","","",""
"3446540","1","","","2010-08-10 06:24:00","14","12154","<p>What is difference between jav and dalvik machine?</p>","415826","","","user1670113","2012-09-14 00:46:57","2013-07-26 20:44:30","What is the difference between DVM and JVM?","<android>","5","0","4","",""
"3446583","1","3446689","","2010-08-10 06:31:45","0","531","<p>I have a set of mp3 files on my computer which i want to be the server.Now i have a web service(Songs_Collection). This web service returns the list of all songs present on the server to the user.The user can download the desired file directly from the server.</p><p>I have a small problem :</p><p>How does my web service get the list of audio files kept on the server in the folder <code>c:\Audio Files</code>.</p><p>Someone suggested that i need to keep the names in a <code>""Web Content""</code> folder, but can anyone suggest how should i approach it?</p><p><strong>I worked out on this part . But now how do I send it to the client on device ?</strong></p><p>Can i send it directly as an array? (I guess then some seriliazation-deserialization needs to be done. please suggest)<br>Or If send it as an XML file then how should I proceed? (This is more important)</p>","335429","","2598","","2010-08-18 13:33:32","2010-08-18 13:33:32","Returning an XML file from a web service to android device?","<android><web-services>","1","0","0","",""
"3446683","1","","","2010-08-10 06:53:18","6","3800","<p>I am trying to create a preference dialog window that allows the user to select more then one item in the list. Currently it only allows you to select one item. Is there an easy way to do this? I have looked all over the internet and not seen a way as of yet. Any help is appreciated!</p>","415851","","","","","2013-07-10 17:23:59","Easy way to make the ListPreference multiple choice in Android?","<android><android-preferences>","4","0","","",""
"3446718","1","","","2010-08-10 07:01:50","0","398","<p>I want to create a login application which will asks email-id and password from the user. Then this email-id and password will be checked on the email-provider server like google, or yahoo.</p><p>How can I do this?For this, I think i need to send the Request to email-provider server with email-id and password and get back the response from the email-provider server. So how can I send a request and get a response from the URL? Is there any specific format for sending request and getting response from the server??</p><p>Please help me to achieve the task.</p><p>ThanksDeepak Kumar</p>","406494","","","","","2011-03-07 10:53:12","Login with email-id and password","<android>","1","2","1","",""
"3446722","1","3448852","","2010-08-10 07:02:32","3","2961","<p>First let me clarify that i have already referred the SO question related to ""Android - TAbhost"".</p><p>I have done googling about ""Android Tabhost"" but failed to find the solution.</p><p>My problem is:</p><p>If are having &lt;3 tabs then it is fine. butSupporse if we are having 4 tabs with indicator title as TabHost1, TabHost2, TabHost3, TabHost4). But this title in Tab does not get fitted with tab. so <strong>is there any way to fit the Title Text (i.e. indicator) inside the tab ??</strong></p>","379693","","21234","","2010-10-02 11:49:24","2010-10-04 08:37:55","Android Tabhost Problem - .setIndicator","<android><android-widget><tabwidget><android-tabhost>","2","9","2","",""
"3446935","1","3502252","","2010-08-10 07:35:53","2","643","<p>I have an HTML 5 web page using CSS 3 and have tested it in more browsers than you can shake a stick at. I am getting a strange problem when viewing the page on an android phone...</p><p>When I visit the pages, all of the CSS renders, except the background colour (and luckily the foreground text colour). If I force-refresh the page, it then works. I am getting this behaviour consistently on my Android phone, firmware 1.6.</p><p>So when you load the page on a mobile, you get a white background with black text, unless you refresh the page, in which case you get a black background with white text.</p><p>The background is defined as:</p><pre><code>body{    background: #000000 url(images/overlay.png) repeat-x;    color: White;    margin: 0;    padding: 0;    text-align: center;    font-family: Arial, Helvetica, Sans-Serif;    font-size: 18px;}</code></pre><hr><p>If you happen to have an Android phone and want to actually view the problem, please visit:</p><p><a href=""http://www.webstickynotes.co.uk/"" rel=""nofollow"">http://www.webstickynotes.co.uk/</a></p><p>Log in using ""demo@webstickynotes.co.uk"" ""demo""</p><p>And make sure you tick the ""mobile"" check box.</p><hr><p>Any help would be much appreciated (even if it is just that you are on a different version of Andoid and it isn't a problem!)</p>","75525","","","","","2010-08-17 12:15:23","Android Web Page Needs Force-Refresh To Show Background Colour","<android><html5><css3>","1","2","","",""
"3447325","1","","","2010-08-10 08:51:58","2","487","<p>I was wondering it there is an API that can access the core functionality of t9 predictive text engine on Android phones.The API should have some access point like:-setCurrentLanguage-closeCurrentLanguage-appendKey(some key)For example: appendKey(4),appendKey(6),appendKey(6),appendKey(3) will give: ""good""-get current word-get next candidate-get previous candidate etc...In Symbian it is called CPtiEngine.</p><p>Thanks for help</p>","331370","","","","","2010-08-10 08:51:58","access t9 predictive text input engine on Android phones","<android>","0","0","","",""
"3447413","1","4693989","","2010-08-10 09:05:20","12","2968","<p>What is the exact difference between <code>CursorAdapter</code> and<code>ResourceCursorAdapter</code>?</p><p>Can somebody explain what are the api's that are required to <code>override</code>when implementing my own <code>ResourceCursorAdapter</code>?</p><p>I have gone through the <code>ResourceCursorAdapter</code> documentation and ableto figure out that it's constructor takes an additional layoutparameter as compared to <code>CursorAdapter</code> constructor. But I am unable tounderstand what is the significance of having an additional layoutparameter in <code>ResourceCusorAdapter</code> constructor.</p>","248132","","119895","","2012-06-19 00:30:43","2014-04-02 09:56:12","CursorAdapter vs ResourceCursorAdapter","<android>","1","0","","",""
"3447437","1","3447505","","2010-08-10 09:08:01","0","321","<p>HI all,i have 10 rows in my listview, and i want to provide different colors in each row.how can i do this???</p>","1497488","","162668","","2010-08-10 09:11:33","2010-08-10 09:17:50","colors on listview","<android>","1","0","","2012-08-22 12:00:23",""
"3447472","1","","","2010-08-10 09:12:55","0","132","<p>In my app I want to create something like this: <a href=""http://picasaweb.google.it/dr.cervo/Develop?feat=email#5503703287992443698"" rel=""nofollow"">like this</a>:</p><p><img src=""http://lh5.ggpht.com/_u_vS8mJkl4I/TGEU-wXwYzI/AAAAAAAAAPk/ERPsFfYvQkk/list.jpg"" alt=""alt text""></p><p>I thought to put five buttons inside a linear layout, but the problem is how to show the inner items at run time. Every time i click on a button i want to show the proper items and hide the others.</p>","415963","","114066","","2010-08-10 11:53:30","2010-08-10 11:53:30","Android: need help to create UI","<android>","1","0","","",""
"3447594","1","7061752","","2010-08-10 09:30:41","4","7756","<p>I want to use an alarm to run some code at a certain time. I have successfully implemented an alarm with the broadcast receiver registered in the manifest but the way i understand it, this method uses a separate class for the broadcast receiver. </p><p>I can use this method to start another activity but I cant use it to run a method in my main activity? </p><p>(http://stackoverflow.com/questions/3122564/how-can-i-notify-a-running-activity-from-a-broadcast-receiver)</p><p>So I have been trying to register my broadcast receiver in my main activity as explained in the answer above.</p><pre><code>private BroadcastReceiver receiver = new BroadcastReceiver(){    @Override    public void onReceive(Context context, Intent intent) {        Toast.makeText(context, ""hello"", Toast.LENGTH_SHORT).show();        uploadDB();             }};    public void onResume() {    super.onResume();    IntentFilter filter = new IntentFilter();    filter.addAction(null);    this.registerReceiver(this.receiver, filter);}public void onPause() {    super.onPause();    this.unregisterReceiver(this.receiver);}</code></pre><p>However I have been unable to get this to work with alarm manager, I am unsure as to how i should link the alarm intent to the broadcast receiver. Could anyone point me to an example of registering an alarm manager broadcast receiver dynamically in the activity? Or explain how i would do this?</p><p>Thanks for any help</p>","348824","","348824","","2010-08-10 11:16:17","2012-08-16 04:30:08","Android Alarm Manager with broadcast receiver registered in code rather than manifest","<android><manager><broadcastreceiver><alarm>","3","0","2","",""
"3447600","1","","","2010-08-10 09:31:08","0","831","<p>I hate to bother you all again, as this is probably me, a newbie, making some big blunder, but I'm baffled as to why my mapview only takes up a fraction of the screen.  I've been following tutorials.  My layout:</p><p><code>&lt;?xml version=""1.0"" encoding=""utf-8""?><br><br>&lt;RelativeLayout android:id=""@+id/RelativeLayout01""<br>                android:layout_width=""fill_parent""<br>                android:layout_height=""fill_parent""<br>                xmlns:android=""http://schemas.android.com/apk/res/android""><br>                <br>  &lt;com.google.android.maps.MapView <br>        android:id=""@+id/mapView""<br>        android:layout_width=""fill_parent""<br>        android:layout_height=""fill_parent""<br>        android:enabled=""true""<br>        android:clickable=""true""<br>        android:apiKey=""MY_API_KEY""<br>        /><br><br>&lt;RelativeLayout><br></code></p><p>The specified screen resolution is, as in the droid, 854x480.  It shows up in the emulator in horizontal mode (wide, not very tall).  The map starts about a third of the way from the left and ends about a third of the way from the right.  It starts at the top and ends about a third of the way from the bottom of the screen.  I have no clue why that would happen, as I specified ""fill_parent"".</p><p>Thoughts?</p>","414182","","","","","2010-08-11 08:51:03","MapView doesn't take up full screen","<android>","1","5","","",""
"3447627","1","3513615","","2010-08-10 09:35:14","4","2838","<p>I know how to display an image that is bigger than the screen. That's fairly simple and explained in details <a href=""http://stackoverflow.com/questions/3058164/android-scrolling-an-imageview%29"">here</a>, however, this method makes you able to scroll as far as you want, event if you have left the image and you just have black screen. I would like to know how we can make the scrolling stop when we reach the side of the picture...</p>","263521","","","","","2010-08-23 21:04:43","scroll an image bigger than the screen and stop at its border on Android","<android><image><scroll>","2","1","2","",""
"3447660","1","","","2010-08-10 09:38:36","0","93","<p>Friend's,  I stored image url has a byte array in database has blob type and at time of fetching this image i'm getting nullpointer exception.how can i fix this problem,here the code for fetching data from db...  String bb = c.getString(c.getColumnIndex(JR_Constants.IMAGE_97));               Log.v(TAG,bb);                 Bitmap theImage = BitmapFactory.decodeByteArray(bb, 0, bb.length);                 myImage.setImageBitmap(theImage);what i'm doing mistake here.</p>","407506","","","","","2010-08-10 09:44:23","Problem in fetching image from database","<android>","1","0","","",""
"3447723","1","","","2010-08-10 09:51:37","3","6437","<p>How to display streetview in android  AVD?I write map.setStreetView(true); but only display blue outline.</p>","415999","","","","","2011-08-08 22:47:31","about android google api-streetview","<android><google-api>","3","0","0","",""
"3447729","1","3520254","","2010-08-10 09:52:39","4","7277","<p>i'm having sometimes problems when launching my app. From time to time the screen stays black and i have to wait 10 minutes. I don't get an error message and the logcat says this:  </p><p><code>08-10 11:45:39.659: WARN/ActivityManager(104): Launch timeout has expired, giving up wake lock!<br>08-10 11:45:39.736: WARN/ActivityManager(104): Activity idle timeout for HistoryRecord{467060f0 org.ccast.contextproviders.androiddatacollector/.gui.UserInterfaceNew}</code></p>","411937","","","","","2010-08-19 09:10:28","Activity idle timeout for HistoryRecord","<android>","1","2","1","",""
"3447952","1","","","2010-08-10 10:23:08","1","559","<p>I'm having some trouble trying to create a program for Android 2.1-update1 with a background of a specific size. It seems that the only option is to scale the image according to the device screen size/orientation.</p><p>Is there a way to create an empty LinearLayout (edit: with a specific size) behind the gui widgets and then set the image as the background of this layout?</p><p>-- onik</p>","416022","","","","","2010-08-10 10:39:18","Android: Background with specific size?","<android><android-layout>","1","0","","",""
"3447988","1","","","2010-08-10 10:29:38","2","3525","<p>I was wondering if it's possible to set an automatic/dynamic margin (padding?) between elements in an Android layout without having to do it programmatically?</p><p>For example let's say there is a horizontal LinearLayout which is set to <code>android:layout_width=""fill_parent""</code> and that contains five elements. Is there a setting that evenly shares the remaining empty space of the LinearLayout to the margins of the child elements?</p><p>See image at <a href=""http://img63.imageshack.us/img63/8/margin.png"" rel=""nofollow"">http://img63.imageshack.us/img63/8/margin.png</a></p><p>Thanks for any help!</p>","416029","","416029","","2010-08-11 15:50:09","2012-12-01 13:33:19","Automatic/dynamic margin in Android layout","<android>","2","0","","",""
"3448037","1","12189785","","2010-08-10 10:36:33","0","1283","<p>Is it possible to change prompt text that says ""place the barcode inside the viewfinder..."" when launching Barcode scanner (zxing) via intent (Intent intent = new Intent(""com.google.zxing.client.android.SCAN"")) ? I want to have prompt in my language, how should i do that?</p>","324417","","","","","2012-08-30 04:15:07","How to change text when scanning barcodes with Zxing via intent in Android?","<java><android><zxing>","3","1","","",""
"3448130","1","","","2010-08-10 10:48:04","2","1399","<p>I'm developing an Android Recipe program which has database of food recipes. I have a created a database within it a table called ""recipe"" which has the following fields:</p><p>1 - _id(referred to as KEY_ID)<br>2 - recipe title(referred to as KEY_TITLE)<br>3 - number of serves(referred to as KEY_NOSERV)<br>4 - ingredients(referred to as KEY_INGREDIENT)<br>5 - procedure(referred to as KEY_PROCEDURE)<br></p><p>I have successfully implemented the display operation i.e I have done a listview which shows all the recipe titles and when I click on the title it shows me the remaining fields by extracting data  from the database. In this method I could easily bind the data form database. The data binding logic which I used for this display operation is as follows which worked well.</p><pre><code>Cursor c = rDbHelper.fetchAllRecipes();        startManagingCursor(c);        String[] from = new String[] { RecipeDbAdapter.KEY_TITLE };        int[] to = new int[] { R.id.text1 };        SimpleCursorAdapter recps =            new SimpleCursorAdapter(this, R.layout.recipe_row, c, from, to);        setListAdapter(recps);</code></pre><p>Right now I'm implementing the Search operation by using the AutoComplete Widget. The AutoComplete should show show only the recipe title. But in this I don't know how to bind the data in the AutoComplete box. I tried doing the same thing as I did in display operation but the app gets force closed. I have attached the xml and code samples as mentioned below. Please let me know as to how to do data binding to the AutoComplete Widget in this opearation.</p><p><strong>res/layout      File name : recipe_auto_list_item.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/textautocomplete""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10dp""    android:textSize=""16sp""    android:textColor=""#000""&gt;&lt;/TextView&gt;</code></pre><p><strong>res/layout        File Name:recipe_autocomplete.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:orientation=""horizontal""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:padding=""5dp""&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""RECIPE NAME:"" /&gt;    &lt;AutoCompleteTextView android:id=""@+id/autocomplete_recipe""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_marginLeft=""5dp""/&gt;&lt;/LinearLayout&gt;</code></pre><p>The data binding logic which I used in the search activity is as follows:</p><pre><code>super.onCreate(savedInstanceState);setContentView(R.layout.recipe_autocomplete);AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_recipe);Cursor c = rDbHelper.fetchAllRecipes();        startManagingCursor(c);        String[] from = new String[] { RecipeDbAdapter.KEY_TITLE };        int[] to = new int[] { R.id.textautocomplete };        SimpleCursorAdapter cur = new SimpleCursorAdapter(this, R.layout.recipe_auto_list_item, c, from, to);textView.setAdapter(cur);</code></pre><p>The fetchAllRecipes() functions extracts all the fields of the recipe table. from that I need to extract only the title and use in the autocomplete widget.</p><p>When I try to start the search operation my app gets forced closed. Kindly what logic should I use for data binding.</p>","421730","","","","","2010-08-10 12:47:14","Android AutoComplete Binding Question","<android>","1","0","","",""
"3448145","1","","","2010-08-10 10:50:02","1","1059","<p>How can I parse my local XML file located in the systems hard disk?</p>","416055","","81076","","2011-12-14 10:59:55","2012-05-11 05:22:48","xml file parsing in android","<android><xml-parsing>","1","0","1","",""
"3448332","1","","","2010-08-10 11:18:54","0","164","<p>hai ,       Can anybody help me to create a route mapping program in android which will take location's names as input and give output as route between these two locations</p>","416076","","416076","","2010-08-10 11:23:55","2010-08-10 11:23:55","android route mapping program","<android><mapping>","0","3","","",""
"3448381","1","","","2010-08-10 11:25:54","1","245","<p>I have big files to integrate into my application (videos), and thus for not not that my application occupies all the internal memory of the telephones, I saw that it was possible with Froyo to install the applications on the SD card.</p><p>I thus have to test this solution and my application settles down well on the SD card, the only problem it is that the system installs all the same my files videos (which are placed in the file /raw) on the internal memory of the telephone. Thus my question it is where to place my videos or where to make so that these also settle down on the SD carde?</p>","416081","","995926","","2012-05-05 13:42:12","2012-05-05 13:42:12","Where to place the resources of her application so that they are installed on the SD card?","<android><sd-card><android-2.2-froyo>","3","0","","",""
"3448386","1","","","2010-08-10 11:26:43","2","1562","<p>I want to know how to set Video as wallpaper or it is not possioble. I can set image as wallpaper and I can build live wallpaper but I can't set video as wallpaper ? so anyone has an idea how can I do that ?</p><p>Thanks in Advance.</p>","416082","","19750","","2011-08-31 14:25:53","2011-08-31 14:25:53","Set video as wallpaper on Android","<android><live-wallpaper>","2","2","","",""
"3448393","1","3448604","","2010-08-10 11:28:02","5","10823","<p>I am developing an Android App and would like to have a video file (mp4) bundled inside the .apk so that when the app is launched I can play a short intro video.</p><p>Unfortunately I'm having trouble figuring out where in my project folder I should place this video file, and also how to access it (the path to the file).</p><p>I am using <code>videoView.setVideoPath();</code></p><p>Any help would be greatly appreciated.  Thanks</p>","107459","","238123","","2011-02-14 16:28:32","2011-02-14 16:28:32","What is the path to your apps ""assets"" folder in Android?","<android><video><path>","2","1","2","",""
"3448406","1","","","2010-08-10 11:29:38","0","679","<p>I need to calculate how many items fit on the screen. I tried do it in this way</p><pre><code>private int callculateItemsOnPage(View layout, View item) {  if (layout == null || item == null)   return -1;  int itHeight = item.getHeight();  int layHeight = layout.getHeight();  return layHeight / itHeight; }</code></pre><p>But itHeight, layHeight permanently 0.</p><p>Can anyone help me with my issue?</p>","416085","","119895","","2010-08-10 12:51:08","2011-06-16 05:44:25","Android ListView : items fit screen","<android><listview><view>","1","2","","",""
"3448485","1","3448859","","2010-08-10 11:37:13","6","4745","<p>Id like to enable bluetooth like in <a href=""http://developer.android.com/guide/topics/wireless/bluetooth.html#SettingUp"">this example</a>.</p><p>However my class isnt a Activity but a Service and therefore I can't call startActivityForResult. How can i solve this problem?. I know there are other questions that have been answered like</p><p><a href=""http://stackoverflow.com/questions/2848775/use-startactivityforresult-from-non-activity"">http://stackoverflow.com/questions/2848775/use-startactivityforresult-from-non-activity</a></p><p>but this doesn't solve my problem because my application consists of the service and nothing else.</p>","","anon","","","","2013-11-13 15:55:17","StartActivityForResult from a Service","<java><android><bluetooth>","2","0","2","",""
"3448533","1","3458629","","2010-08-10 11:44:01","1","1464","<p>I have an app that will query a database and attempt to output results in a list format. </p><p>my first attempt was to use a simpleCursorAdapter, which worked fine for string outputs such as name and status, but would not display the time field from my cursor. My time field in my data base is of type Timestamp. the query for the time field is </p><p><code>""strftime('%H:%M',time(sql_start_date,'unixepoch')) as start_time, "" +</code> </p><p>A little bit of research and it turns out that SimpleCursorAdapters only work for strings. I found this a little confusing as I would have thought that the field start_time was in the format of a string (after all I can view the result in the Log window by saying:</p><pre><code>Log.i(TAG,start_time);</code></pre><p>So my next attempt is to use my own custom CursorAdapter:</p><pre><code>private class MyVisitsAdapter extends CursorAdapter{     private Cursor mCursor;     private Context mContext;     private final LayoutInflater mInflater;     public MyVisitsAdapter(Context context, Cursor cursor) {       super(context, cursor, true);       mInflater = LayoutInflater.from(context);       mContext = context;     }     @Override     public void bindView(View view, Context context, Cursor cursor) {      String st = cursor.getString(cursor.getColumnIndex(VisitsAdapter.KEY_CLIENT_START_TIME));      Log.i(""Check Cursor result"",st);      TextView t = (TextView) view.findViewById(R.id.start_time_display);      t.setText(st);       TextView t1 = (TextView) view.findViewById(R.id.end_time_display);       t.setText(cursor.getString(cursor.getColumnIndex(VisitsAdapter.KEY_CLIENT_END_TIME)));       t = (TextView) view.findViewById(R.id.name_entry);       t.setText(cursor.getString(cursor.getColumnIndex(VisitsAdapter.KEY_CLIENT_FULL_NAME)));     }     @Override     public View newView(Context context, Cursor cursor, ViewGroup parent) {       final View view = mInflater.inflate(R.layout.list_element, parent, false);       return view;     }   }</code></pre><p>The code fails on the line:</p><pre><code>t.setText(st);</code></pre><p>with a null pointer exception. The 'start_time_display' textview is not being found by the adapter.</p><p>The xml file with the field (list_element.xml) is as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""         &gt;    &lt;TextView     android_id=""@+id/start_time_display""     android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textSize=""16dip""   android:textColor=""#333333""   android:layout_marginLeft=""14px"" &gt;&lt;/TextView&gt;    &lt;TextView     android_id=""@+id/end_time_display""     android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textSize=""16dip""   android:textColor=""#333333""   android:layout_toRightOf=""@+id/start_time_display""  android:layout_marginLeft=""64px""&gt;&lt;/TextView&gt; &lt;TextView  android:id=""@+id/name_entry""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textSize=""16dip""   android:textColor=""#333333""   android:layout_marginLeft=""94px""  android:layout_toRightOf=""@+id/end_time_display""/&gt;       &lt;TextView  android:id=""@+id/number_entry""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textSize=""14dip""  android:textColor=""#666666""   android:layout_marginLeft=""14px""  android:layout_below=""@+id/name_entry""  /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Which, as you can see, clearly contains teh 'start_time_display' text view.</p><p>Hopefully I am missing something simple that someone with a bit more experience (I am very new to android and my Java is Tres rusty)</p><p>Thanks is advance</p><p>Kev</p>","409826","","409826","","2010-08-10 11:54:48","2010-08-11 13:14:42","Problem with custom cursor adapter for list view in Android","<java><android><listview><cursor>","1","0","","2013-03-07 01:18:34",""
"3448647","1","3449525","","2010-08-10 11:58:17","1","755","<p>My application requires current location of the user. For this I have implemented the code and I am able to get the current location. The code tries to get the best provider first and then fetches location information. The problem is that the current location is returned from NETWORK_PROVIDER if GPS_PROVIDER is disabled. If both NETWORK_PROVIDER and GPS_PROVIDER are enabled then the best provider will be GPS_PROVIDER and this takes too much time to get the current location. </p><p>So, is it alright if we set the location provider as NETWORK_PROVIDER only so that it will not matter whether GPS_PROVIDER is enabled or not.</p><p>Please let me know what is the right approach.</p><p>Regards</p><p>Sunil</p>","261566","","","","","2010-08-10 13:37:55","Location Providers in Android?","<android><location><provider>","2","0","","",""
"3448752","1","","","2010-08-10 12:12:17","4","1085","<p>I have created a WebView instead of directly linking to a link because the website has complicated redirect checks that prevent me from directly linking. However, in order for the download to complete, users have to long click on the link and save it. Users are confused. They think its broken.</p><p>I was wondering if it would be possible to somehow comprehensively obtain all the information that the WebView has pertaining to that session, and pass it to the HttpClient and if I could then intercept and download the file. My worry is that even if I could somehow start the download the file with HttpClient, I would have the same problem as before when I was attempting to manually set the referer headers to no avail.</p>","325081","","","","","2012-03-20 07:40:10","Intercepting download in webview and downloading using HttpClient","<android><cookies><download><webview><listener>","1","0","3","",""
"3448903","1","","","2010-08-10 12:30:17","1","828","<p>I'm trying to use native implementation of UDP server/client on Android, I'm using JNI to access the native code from java.</p><p>The code was tested successfully on Android 1.5 (HTC Hero) but when I tried to run the same application on Android 2.1 (HTC Legend) I got ""Stack Corruption Detected"" every time I received a packet bigger than 32 byte and the application crashed.</p><p>Does anyone has a clue what could cause the stack corruption?</p>","327967","","","","","2011-05-12 03:34:49","native UDP implementation for android","<android><udp><jni><native>","1","1","1","",""
"3448971","1","","","2010-08-10 12:37:44","0","1011","<p>Warning : Your installing software that contains unsigned content. The authenticity and validity of this software can't be established.Do you want to continue with the installation..</p><p>I tried the by downloading ADT plug in as zip file even i am getting same error.</p><p>How can i solve this issue..</p><p>I installed eclipse 3.5.2 j2ee version </p>","416143","","201199","","2010-08-10 13:35:47","2010-08-18 16:17:35","Warning when i am installing ADT plug in to eclipse 3.5.2","<java><android><eclipse>","3","1","","",""
"3449098","1","3451351","","2010-08-10 12:54:19","7","7611","<p>In the browser, you can longClick on URLs. In my WebView, you cannot. How can I make it so you can?</p>","325081","","","","","2011-07-23 13:22:26","Enable longClick in WebView","<android><browser><click><webview>","3","0","6","",""
"3449676","1","3449780","","2010-08-10 13:54:47","6","7143","<p>I've set up the LocationManager to get the current location every 2 minutes:</p><pre><code>locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 120000, 0, this);</code></pre><p>This works fine and onLocationChanged is called every 2 minutes as expected. However, it seems that it is being called multiple times over a 10-40 (a random amount) second span <em>every</em> 2 minutes. I log every location received in the onLocationChanged so here are some samples to get an idea of what is going on:</p><p>At 17:30</p><pre><code>GPS 32.0 50.66318929195404 10.735434293746948 0.0 2010.08.07 17:30:10GPS 32.0 50.66315710544586 10.735423564910889 0.0 2010.08.07 17:30:14GPS 32.0 50.66314101219177 10.735418200492859 0.0 2010.08.07 17:30:17GPS 32.0 50.66314101219177 10.735418200492859 0.0 2010.08.07 17:30:20GPS 24.0 50.66313564777374 10.735418200492859 0.5 2010.08.07 17:30:24GPS 32.0 50.663098096847534 10.735573768615723 0.0 2010.08.07 17:30:28         GPS 32.0 50.663065910339355 10.735611319541931 0.0 2010.08.07 17:30:31</code></pre><p>Then I get no more updates for 2 minutes.</p><p>At 17:32</p><pre><code>GPS 32.0 50.661821365356445 10.737022161483765 1.0 2010.08.07 17:32:39GPS 16.0 50.66170871257782 10.737043619155884 1.8200275 2010.08.07 17:32:45GPS 24.0 50.661579966545105 10.737027525901794 1.25 2010.08.07 17:32:50GPS 16.0 50.66150486469269 10.73712408542633 1.0 2010.08.07 17:32:55GPS 12.0 50.661579966545105 10.73715090751648 0.9013878 2010.08.07 17:33:01GPS 24.0 50.66139221191406 10.737038254737854 1.5811388 2010.08.07 17:33:06GPS 16.0 50.66141366958618 10.737301111221313 0.70710677 2010.08.07 17:33:12GPS 16.0 50.66141366958618 10.737301111221313 0.70710677 2010.08.07 17:33:12GPS 24.0 50.661311745643616 10.737070441246033 1.118034 2010.08.07 17:33:16GPS 16.0 50.66122591495514 10.737177729606628 1.118034 2010.08.07 17:33:22GPS 12.0 50.66124200820923 10.737220644950867 1.3462912 2010.08.07 17:33:26GPS 12.0 50.661311745643616 10.737268924713135 3.6055512 2010.08.07 17:33:25</code></pre><p>And so on... then another set of updates 2 minutes later at 17:35.</p><p>Is this the standard behavior? I was expecting to get only <em>one</em> location every 2 minutes, and the timespan in which it gives me location updates seems rather random. Ideally I would prefer to only get one location... is there a way to do this?</p>","416214","","","","","2012-03-17 04:39:31","LocationManager calling onLocationChanged too often?","<android>","3","0","5","",""
"3449748","1","","","2010-08-10 14:01:02","1","590","<p>I have the same problem related <a href=""http://code.google.com/p/android/issues/detail?id=7321"" rel=""nofollow"">here</a> on a Samsung galaxy spica and i tried all suggestions but i still don't get the nmea sentences in my application. So is there a other way to get the nmea sentences ? Is someone else facing this issue with the same device ?</p><p>Thanks.</p>","416228","","","","","2013-11-13 03:53:27","how do i get nmea sentences on android when the API method does not work","<android><nmea>","1","0","","",""
"3449883","1","","","2010-08-10 14:13:28","2","13757","<p>I'm trying to make some ""Chat view"" with speech bubbles like on the sms iPhone app.This is a row I done in the xml editor :</p><p><a href=""http://img44.imageshack.us/i/xml.png/"" rel=""nofollow"">http://img44.imageshack.us/i/xml.png/</a></p><p>But when I launch the my application, I get this :</p><p><a href=""http://img59.imageshack.us/i/resultt.png/"" rel=""nofollow"">http://img59.imageshack.us/i/resultt.png/</a></p><p>I don't know why the button to answer is so far away my Relative layout border! This is the xml code of the speech bubble:</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content""    android:background=""@drawable/bulle_chat""    android:layout_width=""fill_parent""&gt;    &lt;ImageView android:layout_alignParentLeft=""true""        android:layout_alignParentTop=""true""        android:layout_height=""40sp""        android:layout_width=""40sp""        android:id=""@+id/ImageViewPhoto""        android:scaleType=""fitXY""        android:layout_margin=""8sp""        android:src=""@drawable/lady""&gt;    &lt;/ImageView&gt;    &lt;TextView android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@+id/ImageViewPhoto""        android:layout_alignTop=""@+id/ImageViewPhoto""        android:id=""@+id/TextViewPseudo""        android:text=""Pseudo""        android:textColor=""#242424""        android:textStyle=""bold""&gt;    &lt;/TextView&gt;    &lt;TextView android:layout_below=""@id/TextViewPseudo""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:id=""@+id/TextViewDate""        android:text=""Date""        android:layout_toRightOf=""@+id/ImageViewPhoto""&gt;    &lt;/TextView&gt;    &lt;Button android:layout_alignParentRight=""true""        android:layout_alignParentTop=""true""        android:id=""@+id/ButtonAnswer""        android:layout_height=""40sp""        android:layout_width=""40sp""        android:layout_margin=""8sp""&gt;    &lt;/Button&gt;    &lt;TextView android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@+id/ImageViewPhoto""        android:layout_alignLeft=""@+id/ImageViewPhoto""        android:textColor=""#000000""        android:text=""BlbalblablbalbalbalbalbalablabalbalablaballabalbBlbalblablbalbalbalbalbalablabalbalablaballabalbalbalaBlbalblablbalbalbalbalbalablabalbalablaballabalbalbalablablaalbalabla""        android:id=""@+id/TextViewMessage""        android:layout_alignRight=""@+id/ButtonAnswer""        android:paddingBottom=""15sp""&gt;    &lt;/TextView&gt;&lt;/RelativeLayout&gt;</code></pre><p>And this is the adapter getView() method (pseudo = nickname):</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {    LayoutInflater inflater = ctx.getLayoutInflater();    View v = inflater.inflate(R.layout.chat_row, null);    TextView pseudo = (TextView)v.findViewById(R.id.TextViewPseudo);    TextView date = (TextView)v.findViewById(R.id.TextViewDate);    TextView message = (TextView)v.findViewById(R.id.TextViewMessage);    ImageView icon = (ImageView)v.findViewById(R.id.ImageViewPhoto);    Button b = (Button)v.findViewById(R.id.ButtonAnswer);    b.setId(position);    b.setOnClickListener((OnClickListener) ctx);    pseudo.setText(listMessages.get(position).getPseudo());    pseudo.setTextColor(0xFF000000);    date.setText(listMessages.get(position).getDate());    date.setTextColor(0xFF000000);        message.setText(listMessages.get(position).getText());    message.setTextColor(0xFF000000);    message.setGravity(Gravity.CLIP_HORIZONTAL);    if (listMessages.get(position).getThumb()!=null){        icon.setImageBitmap(listMessages.get(position).getThumb());    } else {        icon.setImageResource(R.drawable.unknown);    }    return v;}</code></pre><p>As you can see, I set the layout alignement parent right and top to true but it doesn't works. Other problem : if i want to change the background of my button, this one disappear!</p><p>Thanks for your help (and sorry for my english)!</p>","393590","","393590","","2010-08-10 14:55:15","2010-08-10 14:58:46","Button position in android","<android><layout><button><relativelayout>","1","1","","",""
"3449916","1","3450011","","2010-08-10 14:17:07","1","391","<p>I am trying to write an object (pilotRecord) to a file and read it back again. I understood that I didn't need to specify a path as it is internal to my app, so I want all files deleted if the app is uninstalled.</p><p>Here's my code:</p><pre><code>    fileoutputstream = openFileOutput(""test1"", Context.MODE_WORLD_WRITEABLE);    Log.d(this.getClass().getName(), ""loadPilotRecord: ""+fileoutputstream.toString());    objectoutputstream = new ObjectOutputStream(fileoutputstream);    Log.d(this.getClass().getName(), ""loadPilotRecord: ""+objectoutputstream.toString());    objectoutputstream.writeObject(pilotRecord);    objectoutputstream.close();    fileoutputstream.close();    fileinputstream = new FileInputStream(""test1"");    Log.d(this.getClass().getName(), ""loadPilotRecord: ""+fileinputstream.toString());    objectinputstream = new ObjectInputStream(fileinputstream);    Log.d(this.getClass().getName(), ""loadPilotRecord: ""+objectinputstream.toString());    pilotRecord = (PilotRecord)objectinputstream.readObject();    objectinputstream.close();    fileinputstream.close();</code></pre><p>My problem is that I get a FileNotFoundException on the following line in the above code:fileinputstream = new FileInputStream(""test1"");I'm not really sure how to find out what path it is using, or maybe there is a more obvious problem I'm just not seeing.Sorry if this is a bit basic, but I'm still trying to find my feet.The Log.d statements just output the class name and an Id.</p><p>TIA,</p><ul><li>Frink</li></ul>","131209","","","","","2014-03-19 21:25:23","FileNotFoundException when trying to read a file I've written","<java><android>","2","0","1","",""
"3449985","1","3450023","","2010-08-10 14:24:04","0","194","<p>Friend's,   I have an single image in which it set has screen home page in which it contains 5 menu icons,so i need to know how to set click events for this icons,is't possible set click event for individual icons.(how to set click events for image have 5 menus has a single image)</p>","407506","","","","","2010-08-10 14:28:28","How to set images in screen have click events to particular activity","<android>","1","0","","",""
"3450076","1","3450371","","2010-08-10 14:34:03","1","2421","<p>I have retrieved some cover art for an album (I have the id and a Bitmap) and now I want to set it into the MediaStore.</p><p>I tried a bunch of stuff:</p><pre><code>private static final Uri ARTWORK_URI = Uri.parse(""content://media/external/audio/albumart"");public static void writeArtwork(Context context, Bitmap bmp, int albumId) {        ContentResolver res = context.getContentResolver();        Uri uri = ContentUris.withAppendedId(ARTWORK_URI, albumId);        LogUtil.i(TAG, ""uri= "" + uri);        if (uri != null) {            ByteArrayOutputStream baos = new ByteArrayOutputStream();            bmp.compress(Bitmap.CompressFormat.JPEG, 50, baos);            byte[] bytes = baos.toByteArray();            LogUtil.i(TAG, ""Bytes: "" + bytes.length);            ContentValues values = new ContentValues();            values.put(""album_id"", albumId);            values.put(""_data"", bytes);            res.insert(uri, values);        }    }</code></pre><p>This gives java.lang.UnsupportedOperationException: Invalid URI content://media/external/audio/albumart/5</p><p>Also I tried:</p><pre><code>Uri artworkUri = Uri.parse(""content://media/external/audio/albumart"");Uri uri = ContentUris.withAppendedId(artworkUri, album.getId());OutputStream outStream = getContentResolver().openOutputStream(uri);bmp.compress(Bitmap.CompressFormat.JPEG, 50, outStream);</code></pre><p>But this gives FileNotFoundException.</p>","396106","","","","","2010-08-10 15:03:42","Android set Album Thumbnail","<android><insert><albumart>","1","1","3","",""
"3450081","1","3624349","","2010-08-10 14:34:26","0","547","<p>I am trying to post messages to facebook wall using Android's default Facebook client. When i try to do so i am unable to post any text messages using the same. If i pass an URL it is extracting details like the title,image and description,etc from it and posts on the wall automatically. </p><p>How could i pass text to it. I am using the following lines of code to do it.When i do so the facebook application shows an error message ""Your link could not be shared"". </p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(android.content.Intent.EXTRA_EMAIL, """"); sendIntent.putExtra(Intent.EXTRA_SUBJECT, """");String tst=""This is a sample message via Public Intent"";sendIntent.putExtra(Intent.EXTRA_TEXT, tst);sendIntent.setType(""text/plain"");</code></pre>","302328","","302328","","2010-08-25 10:47:56","2010-09-02 06:41:04","Passing data to Android Facebook default applicaiton","<android><facebook>","1","1","1","",""
"3450117","1","3450134","","2010-08-10 14:38:09","11","15218","<p>what is the difference among bool, boolean and Boolean in Java/android.</p>","397901","","2153784","","2012-02-27 16:12:03","2012-02-27 16:12:03","difference among bool, boolean and Boolean in java/android","<java><android><boolean>","2","1","1","",""
"3450387","1","","","2010-08-10 15:05:27","0","6907","<p>Wondering if anyone knows the most optimized way to handle opening an URL in android.  Here is how I am doing it:</p><pre><code>String tempUrl = helper.getUrl(tempString);            Intent i = new Intent(""android.intent.action.VIEW"", Uri.parse(""http://""+tempUrl));            startActivity(i);</code></pre><p>Must you start a new activity in order to open a URL?  </p>","2186261","","","","","2012-10-24 03:55:58","Best way to open URL in Android","<android>","1","0","","",""
"3450454","1","3450529","","2010-08-10 15:11:01","3","2209","<p>I'm trying to get the ListView by using the findViewById function, yet I'm unsure what I am trying to find or what to put. R.id.list does not work.</p><p>Thanks!</p>","312390","","","","","2012-08-30 02:12:48","How to findViewById() an @android:id/list element in an Android activity?","<android><xml>","2","0","2","",""
"3450561","1","3453419","","2010-08-10 15:23:06","0","3411","<p>I am trying to set up a scrollview in the middle of the screen, in between a header (tablelayout) and a footer (button within ralativelayout).... My problem is that while the child items (edittext and spinners) stay in the assigned area, the scrollbar extends the entire length of the screen. Any idea what I'm doing wrong? Thanks in advance.</p><p>Here is the xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TableLayout android:id=""@+id/TableLayout01"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""  android:stretchColumns=""0""&gt;  &lt;TableRow android:id=""@+id/TableRow01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;TextView android:layout_width=""fill_parent""            android:layout_height=""wrap_content""             android:text=""@string/title"" /&gt;        &lt;EditText android:id=""@+id/title""           android:layout_height=""wrap_content""             android:layout_width=""wrap_content"" android:hint=""Montague St.""/&gt;  &lt;/TableRow&gt;  &lt;TableRow android:id=""@+id/TableRow02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;TextView android:layout_width=""wrap_content""            android:layout_height=""wrap_content""             android:text=""@string/body"" /&gt;        &lt;EditText android:id=""@+id/body"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:scrollbars=""vertical"" android:hint=""44""/&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;TableRow android:id=""@+id/TableRow03"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;&lt;TextView android:id=""@+id/TextView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""House Number                 ""&gt;&lt;/TextView&gt;&lt;TextView android:id=""@+id/TextView02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Status         ""&gt;&lt;/TextView&gt;&lt;TextView android:id=""@+id/TextView03"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""# of Visits""&gt;&lt;/TextView&gt;&lt;/TableRow&gt;&lt;ScrollView android:id=""@+id/ScrollView01"" android:isScrollContainer=""true"" android:layout_width=""wrap_content"" android:clipChildren=""true"" android:clipToPadding=""true"" android:layout_height=""wrap_content"" android:layout_marginBottom=""50dip""&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:orientation=""vertical""&gt;&lt;TableLayout android:id=""@+id/TableLayout02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;TableRow android:id=""@+id/TableRow04"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;EditText android:id=""@+id/EditText01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:hint=""House Number   ""&gt;&lt;/EditText&gt;&lt;Spinner android:id=""@+id/Spinner01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;Spinner android:id=""@+id/Spinner02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow04"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;EditText android:id=""@+id/EditText01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;Spinner android:id=""@+id/Spinner01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;Spinner android:id=""@+id/Spinner02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow04"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;EditText android:id=""@+id/EditText01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;Spinner android:id=""@+id/Spinner01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;Spinner android:id=""@+id/Spinner02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow04"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;EditText android:id=""@+id/EditText01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;Spinner android:id=""@+id/Spinner01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;Spinner android:id=""@+id/Spinner02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow04"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;EditText android:id=""@+id/EditText01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;Spinner android:id=""@+id/Spinner01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;Spinner android:id=""@+id/Spinner02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow04"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;EditText android:id=""@+id/EditText01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;Spinner android:id=""@+id/Spinner01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;Spinner android:id=""@+id/Spinner02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow04"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;EditText android:id=""@+id/EditText01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;Spinner android:id=""@+id/Spinner01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;Spinner android:id=""@+id/Spinner02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow04"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;EditText android:id=""@+id/EditText01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;Spinner android:id=""@+id/Spinner01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;Spinner android:id=""@+id/Spinner02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;&lt;RelativeLayout android:layout_marginTop=""-50dip"" android:gravity=""bottom"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;&lt;Button android:id=""@+id/confirm""       android:text=""@string/confirm""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;     &lt;/RelativeLayout&gt;    &lt;/LinearLayout&gt;</code></pre>","415560","","","","","2013-03-27 07:58:02","Scrollview issue in Android layout xml","<android><xml><layout>","3","0","","",""
"3450672","1","","","2010-08-10 15:33:28","0","1477","<p>I have added the webview within scrollview in the layout. So data in webview is not fully displayed. Only in android sdk1.6 WVGA resolution, It is not working properly. </p><p>This bug is filed in android bug tracker also. For your reference, <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/d66d908993d51d65"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/d66d908993d51d65</a></p><p>Can anyone knows how to solve this very big high priority issue.</p>","404196","","","","","2010-09-20 11:52:32","Android sdk 1.6 WVGA, webview within scrollview is not working","<android><sdk><webview><scrollview>","1","1","","",""
"3450741","1","3464535","","2010-08-10 15:40:24","0","663","<p>My Android application crashes when I try to call MyCursorAdapter.bindView. Here is the LogCat log:</p><pre><code>08-10 15:22:57.269: ERROR/AndroidRuntime(463): FATAL EXCEPTION: main08-10 15:22:57.269: ERROR/AndroidRuntime(463): java.lang.NullPointerException08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at com.mohit.gtodo.TasksCursorAdapter.bindView(TasksCursorAdapter.java:28)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.widget.CursorAdapter.getView(CursorAdapter.java:186)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.widget.AbsListView.obtainView(AbsListView.java:1315)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1198)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.widget.ListView.onMeasure(ListView.java:1109)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.view.View.measure(View.java:8171)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.view.View.measure(View.java:8171)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.view.View.measure(View.java:8171)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:526)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.view.View.measure(View.java:8171)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.view.View.measure(View.java:8171)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.view.ViewRoot.performTraversals(ViewRoot.java:801)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.os.Handler.dispatchMessage(Handler.java:99)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.os.Looper.loop(Looper.java:123)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at java.lang.reflect.Method.invokeNative(Native Method)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at java.lang.reflect.Method.invoke(Method.java:521)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-10 15:22:57.269: ERROR/AndroidRuntime(463):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Here is the bindView method in my CursorAdapter:</p><pre><code>    TextView title = (TextView) view.findViewById(R.id.title);    EditText body = (EditText) view.findViewById(R.id.body);    TextView created = (TextView) view.findViewById(R.id.created);    title.setText(cursor.getString(cursor.getColumnIndex(TasksDBAdapter.KEY_TITLE)));    title.setSelected(cursor.getInt(cursor.getColumnIndex(TasksDBAdapter.KEY_COMPLETED)) &gt; 0);    body.setText(cursor.getString(cursor.getColumnIndex(TasksDBAdapter.KEY_BODY)));    created.setText(((Long)cursor.getLong(cursor.getColumnIndex(TasksDBAdapter.KEY_CREATED))).toString());</code></pre><p>Line 28 starts with <code>body.setText(cursor.getString(cursor.getColumnIndex(TasksDBAdapter.Key_BODY)));</code>Any other information needed?  </p><p><b>UPDATE</b>:  </p><pre><code>EditText body = (EditText) view.findViewById(R.id.body);</code></pre><p>Seems to be null? Here is the widget:  </p><pre><code>&lt;EditText android:id=""@+id/body"" android:layout_below=""@+id/body_txt"" android:text="""" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:minLines=""10""&gt;&lt;/EditText&gt;</code></pre>","200477","","200477","","2010-08-10 16:07:44","2010-08-12 03:25:38","NullPointerException called indirectly by SQLite database?","<java><android><sqlite3><nullpointerexception>","1","7","","",""
"3450801","1","5549761","","2010-08-10 15:46:31","5","9879","<p>In my Android application I've hidden the default title bar, introduced a TabView and added my own titlebar under that TabView's tabs.  At the moment, I'm using the ?android:attr/windowTitleStyle style which makes my new titlebar look gray and gradient.  It looks pretty good, but my screens are looking pretty grayscale.  I'd like to spice things up a bit by making this titlebar a different color gradient.</p><p>What am I looking at here?  Creating my own image and using it?  The ?android:attr/windowTitleStyle style seems to expand depending on the height of your custom titlebar; so I'm not sure it's actually a single image.</p><p>I've attempted to throw a LinearLayout over it with a bit of translucency (ex: making the color #800000FF), but the gradient style I have behind this LinearLayout disappears.</p><p>Thanks for your help</p><p>Update:</p><p>Per my answer down below, I've figured out that I can create an XML file that defines a gradient and use that.  It works fine inside a LinearLayout (titlebar_gradient) I have on my layout.  However, it is not working on the outer-most LinearLayout (background_gradient).  Could someone tell me why?  As I understand it, the ListView should be transparent...</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:background=""@drawable/background_gradient"" &gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""horizontal""  android:layout_width=""fill_parent""  android:layout_height=""47dip""  android:background=""@drawable/titlebar_gradient""  android:gravity=""center""&gt;  &lt;TextView   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:layout_weight=""1""   android:text=""Item""   style=""?android:attr/windowTitleStyle""   android:paddingLeft=""5dip""   android:maxLines=""1""   android:ellipsize=""end"" /&gt; &lt;/LinearLayout&gt;    &lt;ListView     android:id=""@+id/android:list""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""  android:paddingTop=""10dip""  android:clickable=""false""    /&gt; &lt;TextView     android:id=""@+id/android:empty""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    /&gt;&lt;/LinearLayout&gt;</code></pre>","406790","","406790","","2010-08-10 16:13:24","2011-06-08 12:17:54","Gradient styles","<android><gradient><titlebar><android-titlebar>","2","0","","",""
"3450812","1","","","2010-08-10 15:47:32","6","6343","<p>My android application displays webpages(i used webview for it). .but javascript onthe wepage is not running in a webview .If i visit the same webpage through the Browser,javascript is running . How to run javascript in an application(using a webview)?</p>","416344","","","","","2012-03-20 10:55:39","Android's Webview cannot handle javascript?","<javascript><html><android>","3","0","1","",""
"3450830","1","","","2010-08-10 15:49:41","2","2252","<p>Hi i want to deactivate the touch screen of my android device for some application.Anyone plz help me.......</p><p>Thanx in adv</p>","412168","","","","","2010-08-10 17:20:39","How to deactivate the touchscreen of android device?","<android>","3","0","","",""
"3450835","1","","","2010-08-10 15:50:07","1","166","<p>I wonder if any experienced Android developers could tell me if the animation framework is suitable for animating properties of custom Views implementing the onDraw() method or custom objects that draw onto a Canvas. Thanks!</p>","176210","","","","","2010-08-10 15:50:07","Animation Framework usage scenarios","<android><animation><android-widget>","0","0","","",""
"3450839","1","","","2010-08-10 15:50:24","5","11448","<p>How do I display an blinking text in android screen .Thank you all. </p>","357349","","","","","2013-09-26 07:08:33","Blinking Text in android view","<android><android-emulator>","5","5","1","",""
"3450870","1","3451235","","2010-08-10 15:53:21","1","1575","<p>I'm trying to have another activity launch when a list item gets clicked. Below is my code:</p><pre><code>public class AvoidForeclosure extends CustomListTitle {/** Called when the activity is first created. */private DbAdapter db;private SimpleCursorAdapter clients;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    ListView list = getListView();    setContentView(R.layout.main);    this.title.setText(""Avoid Foreclosure"");    db = new DbAdapter(this);    db.open();    fillData();    list.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick( AdapterView&lt;?&gt; parent, View view, int position, long id ) {                int viewId = view.getId();                TextView theView = (TextView) findViewById(viewId);                String name = theView.getText().toString();                Cursor clientData = db.getClientByName(name);                Intent intent = new Intent();                intent.setClass(view.getContext(), CurrentMarketValue.class);                intent.putExtra(""clientId"", clientData.getInt(0));                startActivity(intent);        }    });}private void fillData() {    // Get all of the notes from the database and create the item list    Cursor c = db.fetchAllClients();    startManagingCursor(c);    String[] from = new String[] { DbAdapter.KEY_NAME };    int[] to = new int[] { R.id.text1 };    // Now create an array adapter and set it to display using our row    clients = new SimpleCursorAdapter(this, R.layout.clientsrow, c, from, to);    setListAdapter(clients);}</code></pre><p>}</p><p>Yet when I click it, nothing happens at all. Any ideas?</p>","312390","","","","","2010-08-10 19:16:38","How to click a ListView item in Android","<android><xml>","1","5","","",""
"3451008","1","3454004","","2010-08-10 16:06:50","1","1253","<p>I am new to mobile development, but have some experience with web app development. I am looking at starting work on a mobile app that involves shooting and editing video on the phone initially for Android and possibly to be extended to other platforms. Phonegap seemed to be an interesting potential way to start both given my realm of familiarity and the potential to port to multiple platforms. I noticed that it has camera an audio recording support on Android. But how much sense does it make to develop something that relies so much on the phone's hardware on something like Phonegap? Would it be so cumbersome and poorly performing to do this way that I should just start from scratch with Java?</p>","370407","","","","","2010-08-10 22:32:18","Using phonegap for mobile video editing application","<android><mobile><video-capture><video-processing><phonegap>","1","0","","",""
"3451018","1","3451050","","2010-08-10 16:07:46","15","1300","<p>I've talked to a lot of people recently who say they are expecting to stop writing native mobile apps and start writing web apps once HTML5 gets more fully baked in mobile OSs.  I just finished my first HTML5 deep dive, and I'm not yet convinced. </p><p>Will HTML5 work as a replacement development platform for native apps, or are there certain things that <em>require</em> targeting the native runtime?</p>","416346","","811","","2010-08-17 21:02:45","2010-08-17 21:02:45","What can be achieved in a native mobile application that can't be done in a HTML5 web app?","<iphone><android><web-applications><html5><mobile>","5","8","5","","2010-08-10 17:25:21"
"3451080","1","3559680","","2010-08-10 16:15:33","3","4394","<p>I need to encode an XML document into a format that will pass through an XML parser as a string (i.e. strip tags). I then need to decode it back again and I need to do this on Android. What is the library/class in the Android API that I'm looking for?</p><p>Thanks</p>","146588","","","","","2011-07-01 14:10:24","How to encode XML on Android?","<android>","4","2","1","",""
"3451113","1","4075565","","2010-08-10 16:19:36","9","11196","<p>Assuming, that a user has written some text into an <strong>EditText</strong> and thereafter touched somewhere else on the screen, which caused the cursor position to change: How can one determine the new cursor position?</p>","402534","","1041533","","2013-01-03 06:38:42","2013-02-22 17:44:49","EditText's cursor position","<android><android-ui>","2","0","1","",""
"3451347","1","","","2010-08-10 16:48:37","5","7963","<p>I'm not sure that this is possible, perhaps someone can set me straight. I have an EditText View in an android application that has white text on a blue background. When the text is selected (via a long press and the edit dialog), I'd like have the highlight be white and change the text color to be black. Annoyingly though there does not seem to be a way to set the color of the text on highlight. You can set the highlight color using <em>textColorHighlight</em>, but not the text color, so setting a white highlight with white text results in a big white block.</p><p>It seems like it should be something trivial you can do declaratively in the xml, but though I've tried many combinations of styles and colors, I've not been able to change the color. </p><p>Checking other standard applications it seems that the text color never seems to change so I'm thinking this is something that's not easily done. I'd rather not have to subclass the EditText if at all possible just to something so simple. Am I missing something? Can this be done in the view xml?</p>","106801","","","","","2013-11-21 12:28:14","Change the Color of Highlighted text in Android","<android>","3","0","2","",""
"3451424","1","3451731","","2010-08-10 16:58:35","2","262","<p>Not sure how to word this algorithm question, actually. I have toggle buttons in an android app, each corresponding to a numbered channel. Channels are (1,n) but the toggle button ids are some unknown, unsequential (to the buttons) integer. I need to collect the channel numbers and build a command string. My 1995-based Java skills have given me this:</p><pre><code>String ch;int i = 1;for (ToggleButton toggle : toggles) {    if (toggle.isChecked()) {        ch = String.format(""+%d"", i+1);        channels = channels.concat(ch);    }} </code></pre><p>If toggle buttons 1,2,4,5,6,7,11,13,21,22,23,24,25 are checked, this code snippet successfully gives me the string <code>""+1+2+4+5+6+7+11+13+21+22+23+24+25""</code></p><p>However, what I would more like to do is have the string <code>""+1/2, +4/7, +11, +13, +21/25""</code></p><p>I wonder if there's an easier way to do this than multiple if statements:</p><pre><code>String ch;int it = 0;int last = 1;for (ToggleButton toggle : toggles ) {    if (toggle.isChecked()) {    if (it == last + 1) {            // somehow continue or note that we're only adding the ""/""        } else {            // If we're not the next one, then build the last string            // of ""n/last"" and then add "", +"" to start building next string        }    }    last++;}</code></pre><p>That seems like a bit of brute force type of algorithm, so I don't know if there's a more elegant solution that Java might have in it's bag of tricks (Or, more likely, that <strong><em>I</em></strong> should have)</p><p>Thanks.</p>","74919","","74919","","2010-08-10 17:24:55","2010-08-10 22:07:25","Concatenating strings to ""sets"" in Java","<java><android><string>","2","3","","",""
"3451502","1","3786215","","2010-08-10 17:06:02","1","4571","<p>I'm developing an application that is not intended to be released as a standard app. It'll be run on a single rooted device.</p><p>I require the ability to write to a file in the /sys/ directory. The file in question is owned by root and has -rw-rw-rw- permissions.</p><p>I am aware that there may be restrictions on the VM my code runs within that prohibit writing to this area of the file system, but I have observed another application apparently do this.</p><p>Is this possible? How might it be achieved? It doesn't matter if the phone needs to be rooted (the dev one I'm using is).</p><hr><p>I've looked into simply using a FileWriter to write to the file, causing the following error on <code>.flush()</code>:</p><pre><code>java.io.IOException: Invalid argumentat org.apache.harmony.luni.platform.OSFileSystem.writeImpl(Native Method)</code></pre><p>I've also tried executing a shell command from Java, both with and without ""su"". Which returned ""request rejected"" and ""Permission Denied"" respectively.</p><pre><code>Process process = Runtime.getRuntime().exec(""echo 'hello' &gt; /sys/file"");</code></pre><p>Lastly I've tried using the NDK and JNI in case C some how magically managed to write to this file. When attempting to <code>fflush</code> to this file I receive an EOF (meaning an error has occured).</p><hr><p>All suggestions greatly welcome!</p>","172749","","172749","","2010-08-10 17:11:05","2010-09-28 09:06:19","Android: Write to /sys/ directory","<android><permissions><filesystems><android-ndk><sys>","3","0","1","",""
"3451889","1","3453165","","2010-08-10 17:51:31","7","18609","<p>I am making an Android app.  I have a list of items displaying.  I am looking to create a popup menu just like the one that pops up when you tap the avatar of a contact in the contact list.  I have tried looking through the Android reference but can not find it.</p><p>Has anyone created one of these popup menus? A link to the reference or a code sample is fine.</p><p>Screenshot of menu:</p><p><img src=""http://www.youchoob.org/pics/popup.jpg""></p>","30786","","24874","","2011-07-27 15:29:54","2011-11-16 05:28:37","Android popup menu","<android><menu><popup><contacts>","4","7","3","",""
"3451896","1","3451995","","2010-08-10 17:52:25","5","6050","<p>What i want to do: delete an image file from the private internal storage in my app.  I save images in internal storage so they are deleted on app uninstall.</p><p>I have successfully created and saved:</p><pre><code>String imageName = System.currentTimeMillis() + "".jpeg"";FileOutputStream fos = openFileOutput(imageName, Context.MODE_PRIVATE);bitmap.compress(Bitmap.CompressFormat.JPEG, 35, fos);</code></pre><p>an image that i receive through</p><pre><code>bitmap = BitmapFactory.decodeStream(inputStream);</code></pre><p>I am able to retrieve the image later for display:</p><pre><code>FileInputStream fis = openFileInput(imageName);ByteArrayOutputStream bufStream = new ByteArrayOutputStream();DataOutputStream outWriter = new DataOutputStream(bufStream);int ch;while((ch = fis.read()) != -1)    outWriter.write(ch);outWriter.close();byte[] data = bufStream.toByteArray();bufStream.close();fis.close();imageBitmap = BitmapFactory.decodeByteArray(data, 0, data.length);</code></pre><p>I now want to delete this file permanently.  I have tried creating a new file and deleting it, but the file is not found:</p><pre><code>File file = new File(imageName);file.delete();</code></pre><p>I have read on the android developer website that i must open private internal files using the <code>openFileInput(...)</code> method which returns an InputStream allowing me to read the contents, which i don't really care about - i just want to delete it.</p><p>can anyone point me in the right direction for deleting a file which is stored in internal storage?</p>","416412","","416412","","2010-08-10 17:54:32","2010-08-10 18:05:45","Android: how to delete internal image file","<android><storage><internal>","1","0","3","",""
"3451904","1","","","2010-08-10 17:53:45","1","1984","<p>I am just starting to get setup for android development. I have installed pulsar and the proper sdks I think. I want to develop for the droid x.</p><p>I can't find any information on how to create a new project using the installed sdks. Shouldn't there be a project type for android? Nothing like this is showing up.</p><p>Are there any tutorials for getting started using pulsar for android dev?</p>","416455","","","","","2010-08-13 05:48:40","Getting started with android development on eclipse pulsar","<android><pulsar>","1","1","1","",""
"3451947","1","","","2010-08-10 17:58:32","2","3235","<p>The following will not register the Toast upon clicking. In fact, it doesn't even seem to detect a click. The parent class that CustomListTitle extends is ListActivity, so everything should be set, but it's not working. No errors, just no registering a click.</p><pre><code>package com.mtp;import android.app.Activity;import android.app.ListActivity;import android.content.Intent;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.widget.ListView;import android.widget.SimpleCursorAdapter;import android.widget.Toast;public class AvoidForeclosure extends CustomListTitle { // create variables private DbAdapter db; private SimpleCursorAdapter adapter; private ListView list;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // set to main layout        setContentView(R.layout.main);        // set title        this.title.setText(""Avoid Foreclosure"");        // open new DB connection        db = new DbAdapter(this);        db.open();        // Get all the clients and manage the cursor        Cursor c = db.fetchAllClients();        startManagingCursor(c);        String[] from = new String[] { DbAdapter.KEY_NAME };        int[] to = new int[] { R.id.text1 };        // Create an array adapter and set it to display using our row        adapter = new SimpleCursorAdapter(this, R.layout.clientsrow, c, from, to);        // Set the adapter        setListAdapter(adapter);        // get the list and set some data        list = getListView();        list.setTextFilterEnabled(true);        list.setClickable(true); }    @Override    protected void onListItemClick(ListView list, View v, int position, long id) {     // TODO Auto-generated method stub    // get the selection then attempt to make a Toast     String selection = list.getItemAtPosition(position).toString();     Toast.makeText(this, selection, Toast.LENGTH_LONG).show();      // Comment these out for now until I get a working Toast.      //Intent intent = new Intent();  //intent.setClass(v.getContext(), CurrentMarketValue.class);  //intent.putExtra(""clientId"", clientData.getInt(0));  //startActivity(intent);     super.onListItemClick(list, v, position, id);    }}</code></pre><p>And here's my main layout:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    android:id=""@+id/widget55""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:descendantFocusability=""blocksDescendants""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""Choose a current client:""    android:textStyle=""bold""    android:layout_margin=""3dip""    /&gt;   &lt;ListView   android:id=""@android:id/list""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:descendantFocusability=""blocksDescendants""   /&gt;   &lt;TextView android:id=""@android:id/empty""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""There are no Clients yet.""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>And here's my clientsrow layout that the ListView uses to populate:</p><pre><code>  &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView android:id=""@+id/text1"" xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:background=""#FF0081D3""    android:padding=""10dip""    android:textStyle=""bold""    android:inputType=""textCapWords""    android:capitalize=""words""    android:focusable=""false""    /&gt;</code></pre><p>Any ideas? Thank you! I'm so stuck and on a deadline.</p>","312390","","","","","2010-08-10 19:40:59","onListItemClick() not working for ListView in Android","<android><xml><android-widget>","1","0","","",""
"3452071","1","3481690","","2010-08-10 18:15:36","2","4066","<p>I have a class, <strong>TextViewStyled</strong>, which extends TextView</p><p>In my theme XML, how do I apply a style to all my <strong>TextViewStyled</strong> widgets on Activities with a chosen theme?</p><p>I have this simple theme, but I want to limit the Black Gold style to <strong>TextViewStyled</strong> Widgets without specifying the Black Gold in the TextViewStyled style attribute. This is one of many themes which will be switched dynamically.:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;style name=""MyThemeOneofMany"" parent=""android:Theme.NoTitleBar.Fullscreen""&gt;    &lt;item name=""android:???????????""&gt;@style/TextViewStyled_Black_Gold&lt;/item&gt;    &lt;/style&gt;    &lt;style name=""TextViewStyled_Black_Gold"" parent=""@android:style/Widget.TextView""&gt;                      &lt;item name=""android:background""&gt;#1E1921&lt;/item&gt;                  &lt;item name=""android:textColor""&gt;#A85E4F&lt;/item&gt;          &lt;item name=""android:textColorLink""&gt;#FFBC4F&lt;/item&gt;          &lt;item name=""android:textStyle""&gt;normal&lt;/item&gt;                     &lt;/style&gt;&lt;/resources&gt;</code></pre>","172861","","","","","2013-04-14 11:52:21","Android apply style to custom TextView","<android><themes><textview>","2","0","","",""
"3452292","1","3459079","","2010-08-10 18:45:05","0","815","<p>How can I get to know whether SIM is present or not in GsmServiceStateTracker.java file?</p>","308131","","","","","2010-08-11 13:59:34","Getting SIM state in GsmServiceStateTracker.java","<android>","1","0","","",""
"3452293","1","","","2010-08-10 18:45:12","-1","1381","<p>I want edit image from url using xml parsing and that image display in gridview and more image display from device image gallery.how to get image please tell solutions for that</p>","410757","","410757","","2010-08-10 18:48:31","2010-09-03 10:21:26","get image from URL using XML parsing","<android>","1","0","","",""
"3452329","1","","","2010-08-10 18:50:12","0","384","<p>I have a webview and when I do some java-script processing on it. I click on a link to play a video, after the video finishes in full screen. I want to return to my webpage in the same state I left it before clicking to play the video.</p><p>How can I do it?</p><p>Any snippets?</p><p>Thanks,Sana.</p>","402637","","","","","2010-08-10 19:30:46","How to start an activity in the onPause method?","<android>","1","0","","",""
"3452444","1","3452755","","2010-08-10 19:00:54","0","1039","<p>I am working on an application where i am saving the state of an application in an ArrayList. Now, to save this state, i tried to use Serialization. But, somewhere in the user defined object, i am using Button, which is not letting me serialize the entire object.  </p><p>I wanted to know, is there any other way of saving this array list between onPause and onResume?. I even tried onSaveInstanceState, but it doesnt have support for ArrayList. </p><p>Thanks,Chander</p>","374499","","","","","2010-08-10 19:38:34","Android: Saving ArrayList of User Defined Objects between onPause and onResume","<java><android>","1","0","","",""
"3452467","1","3453623","","2010-08-10 19:03:30","4","767","<p>I am building an app that scrapes information from web pages. To do that I have chosen to use an html scraper called <a href=""http://jsoup.org/"" rel=""nofollow"">Jsoup</a> because it's so simple to use. Jsoup is also dependent on Apache Commons Lang libray. (Together they make up a total of 385kB ).So Jsoup will be used to Download the page and parse it.</p><p>My question is if the use of these simplifying libraries, instead of using Androids built-in libraries, will make my app slower? (in terms of downloading data and parsing). </p><p>I was thinking that the internal libraries would be optimized for Android.</p>","215088","","157882","","2010-08-11 21:26:52","2010-08-11 21:26:52","Do external libraries make apps slower?","<java><android><performance><jsoup>","4","0","1","",""
"3452649","1","","","2010-08-10 19:25:40","1","2115","<p>I have been playing around with following android app example.</p><p><a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList2.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList2.html</a></p><p>I am able to trigger an action when a child is clicked however I cannot seem to figure outhow to:1. Customize the label of each child.2. Change how each child looks. (for example I would like each child to display the phone number and then two graphical buttons on the right. Each button would have a custom action tied to it.)</p><p>Any code or links would be greatly appreciated.</p>","412164","","412164","","2010-08-10 20:46:17","2013-09-03 07:57:23","SimpleCursorTreeAdapter - How to customize Child layout","<android><layout>","3","1","","",""
"3452687","1","3457996","","2010-08-10 19:30:32","5","2089","<p>I wanted to create an Android MapActivity with the map in one view, which could be flipped over and then configured in another view, then flipped back over to the map again.  The solution I came up with works, but I'm wondering if there's a better way to do this.</p><p>I copied the Rotate3DAnimation class from the Android ApiDemos, and declared these at the top of my MapActivity class:</p><pre><code>private MapView mMapView;private ViewFlipper mFlipper;private Rotate3dAnimation mInMapAnimation;private Rotate3dAnimation mInStgAnimation;private Rotate3dAnimation mOutMapAnimation;private Rotate3dAnimation mOutStgAnimation;</code></pre><p>Next, in my onCreate method of the MapActivity I did this:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.mapoverviewlayout);    // Initialize the map.    MapView mapView = (MapView) findViewById(R.id.mapview);        mapView.setBuiltInZoomControls(true);          // Obtain the view flipper.    mFlipper = (ViewFlipper)findViewById(R.id.mapviewflipper);    // Initialize the settings view and handle the setting clicks.    Button stgMapDone = (Button)findViewById(R.id.MapViewOptionsDone);    stgMapDone.setOnClickListener(new OnClickListener() {                   @Override        public void onClick(View v) {            UnitOverviewMapActivity.this.mFlipper.showNext();                       }    });}  </code></pre><p>And finally, I used a menu button to select the appropriate flip animations.  I did this because if the map flips one direction to reveal the settings view, I wanted it to flip in the reverse direction to hide the settings view.  So in my onPrepareOptionsMenu (since that's where my button was) I did this:</p><pre><code>@Overridepublic boolean onPrepareOptionsMenu(Menu menu) {    if (mInMapAnimation == null) {        mInMapAnimation = new Rotate3dAnimation(-90, 0, mMapView.getWidth() / 2, mMapView.getHeight() / 2, 0.0f, false);        mInMapAnimation.setDuration(1000);        mInMapAnimation.setStartOffset(1000);    }    if (mInStgAnimation == null) {        mInStgAnimation = new Rotate3dAnimation(90, 0, mMapView.getWidth() / 2, mMapView.getHeight() / 2, 0.0f, false);        mInStgAnimation.setDuration(1000);        mInStgAnimation.setStartOffset(1000);    }    if (mOutMapAnimation == null) {        mOutMapAnimation = new Rotate3dAnimation(0, -90, mMapView.getWidth() / 2, mMapView.getHeight() / 2, 0.0f, false);        mOutMapAnimation.setDuration(1000);    }    if (mOutStgAnimation == null) {        mOutStgAnimation = new Rotate3dAnimation(0, 90, mMapView.getWidth() / 2, mMapView.getHeight() / 2, 0.0f, false);        mOutStgAnimation.setDuration(1000);    }    if (mFlipper.getCurrentView().getId() == R.id.mapparentlayout) {        mFlipper.setInAnimation(mInStgAnimation);        mFlipper.setOutAnimation(mOutMapAnimation);    }    else {        mFlipper.setInAnimation(mInMapAnimation);        mFlipper.setOutAnimation(mOutStgAnimation);    }    return true;}</code></pre><p>This works fine, but it just seems inefficient.  I (apparently mistakenly) assumed that ""flipping"" would be a built-in feature of the ViewFlipper container. Is there a better or more efficient way to accomplish this?  </p>","415440","","","","","2010-08-11 12:03:02","Better Implementation of Rotate3dAnimation in Android ViewFlipper","<java><android>","2","0","1","",""
"3452775","1","3452964","","2010-08-10 19:41:33","0","295","<p>See title for explanation.</p><p>Here is the method I'm using:</p><pre><code>public Cursor getClientByName(String name) throws SQLException {    name = name.trim();    Cursor mCursor =         mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, KEY_NAME}, KEY_NAME + ""="" + name, null,                null, null, null, null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}</code></pre><p>And here is the call to the method:</p><pre><code>list.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View view,            int position, long vId) {            String name = ((TextView) view).getText().toString();            // Toast.makeText(AvoidForeclosure.this, name, Toast.LENGTH_LONG).show();            Cursor cD = db.getClientByName(name);            cD.moveToLast();            int id = cD.getInt(0);          Intent intent = new Intent();          intent.setClass(view.getContext(), CurrentMarketValue.class);          intent.putExtra(""clientId"", id);          startActivity(intent);        }      });</code></pre><p>Any idea why it would be throwing the ""No Column Found with name=Test"", although my DB explorer shows there is indeed a column named name and a value in a row named Test?</p>","312390","","","","","2010-08-10 20:07:07","Querying SQLite DB in Android Activity - saying no column found, although it exists","<android><sqlite>","1","0","","",""
"3452878","1","3453479","","2010-08-10 19:55:57","3","1925","<p>I have a ListView that is controlled by a standard BaseAdapter.</p><p>When the user clicks a button, I want the ListView to Scroll into view the 100th record.</p><p>How is that done?</p>","172861","","","","","2013-01-23 15:24:10","Android ListView Jump to cursor position","<android><listview>","1","0","1","",""
"3452907","1","4636605","","2010-08-10 19:58:45","29","8965","<p>One of my users let the cat out of the bag and told me they were using one of my free apps, which is monetized by ads, but they were blocking the ads with an ad blocker. They told me this mockingly, as if I can't do anything about it.</p><p>Can I do something about it? Is there a way to detect that ads are being blocked?</p>","413414","","381233","","2013-04-22 10:00:00","2013-04-22 10:00:00","How to prevent ad blocker from blocking ads on an app","<android><ads><adblock>","15","5","37","",""
"3452948","1","3453368","","2010-08-10 20:04:10","2","750","<p>I am trying to build an Android application which can take several photos taken by the camera, and merge them into one giant image. For example, I might take three photos and arrange them in a vertical stack for output as a single image. Ideally, I'd like to be able to keep the images at the original size. Unfortunately, using Bitmap.createBitmap() causes an OutOfMemoryException before even approaching the size of one photo of camera dimensions. Is this possible? Or do I just need to resort to scaling the photos before trying to merge them into a single Bitmap?</p>","416549","","","","","2010-08-10 20:58:24","How might one create a large Bitmap in Android?","<android>","1","0","","",""
"3452972","1","3454015","","2010-08-10 20:07:58","8","6836","<p>I created a custom OverlayItem class so that I could essentially have one kind of OverlayItem whose Drawable marker would set itself depending on the state of some data that I pass into it.</p><p>I have attempted to accomplish this by, on my first attempt, utilizing the <code>setMarker</code> method within the OverlayItem class.  Once that did not work I attempt to override the <code>getMarker</code> method and have it return the appropriate marker to represent the data.</p><p>Both of these attempts ended with nothing being drawn on the map...however if they are commented out the markers draw just fine (except they of course use the default marker, which isn't what I want).</p><p>Here is my code for my custom OverlayItem class (the commented out methods I have tried and they have not worked):</p><pre><code>private class MyOverlayItem extends OverlayItem {    private Context mContext;    private MyData mData;    public MyOverlayItem(GeoPoint point, MyData data, Context context) {        super(point, data.getWhat(), data.getWhere());        this.mContext = context;        this.mData = data;        /*if(data.getTemp() &gt; 200)            this.setMarker(res.getDrawable(R.drawable.icon_data_hot_l));        else if(data.getTemp() &gt; 100)            this.setMarker(res.getDrawable(R.drawable.icon_data_neutral_l));        else            this.setMarker(res.getDrawable(R.drawable.icon_data_frozen_l));*/    }    /*@Override    public Drawable getMarker(int stateBitset) {        Resources res = this.mContext.getResources();        if(this.mData.getTemp() &gt; 200)            return res.getDrawable(R.drawable.icon_data_hot_l);        else if(this.mData.getTemp() &gt; 100)            return res.getDrawable(R.drawable.icon_data_neutral_l);        return res.getDrawable(R.drawable.icon_data_frozen_l);    }*/}</code></pre><p>Is there a way to do what I am attempting to do...or do I need to make a unique OverlayItem class corresponding to each state of my data?  (Ew.)</p>","384386","","73488","","2010-08-11 01:16:41","2011-09-27 00:52:46","Custom OverlayItem not drawing","<android><google-maps><overlay><drawable>","4","0","2","",""
"3453033","1","3453071","","2010-08-10 20:15:29","0","1049","<p>I have a horizontal LinearLayout.  This LinearLayout has a checkbox next to another LinearLayout.  The layout width/height of the checkbox is wrap_content, whereas the inner LinearLayout is fill_parent/wrap_content.  The layout_weight of the inner LinearLayout is set to 1.</p><p>I've tried to add some android:padding around the checkbox to give some space around it, but no padding is given.  I've also tried android:paddingLeft/Right/etc.  How do I get some padding around my checkbox?</p><p>Note: I have an inner LinearLayout because I will be adding more TextViews</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""?android:attr/listPreferredItemHeight""&gt;    &lt;CheckBox        android:id=""@+id/mycheck""        android:text=""""        android:layout_width=""30dip""        android:layout_height=""wrap_content""        android:gravity=""center_vertical""        android:focusable=""false""        android:background=""@drawable/checkbox_background""        android:button=""@drawable/checkbox""    /&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_weight=""1""        android:layout_height=""wrap_content""&gt;        &lt;TextView            android:id=""@+id/mytext""            android:layout_width=""fill_parent""            android:layout_weight=""1""            android:gravity=""center_vertical""            android:layout_height=""wrap_content""            android:lines=""1""            android:textColor=""@color/white""            android:textSize=""10sp""            android:textStyle=""italic""        /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","406790","","","","","2011-11-28 14:10:11","Trouble padding","<android><padding><android-linearlayout>","1","0","","",""
"3453139","1","3453514","","2010-08-10 20:28:44","1","516","<p>I'm developing an application and I want to use <code>android.text.util.Regex.WEB_URL_PATTERN</code> as the pattern for the <code>Linkify</code>. But, as I have notice, I cannot import <code>android.text.util.Regex</code> for some reason.</p><p>Why so? Is there a way to workaround this?</p>","416590","","119895","","2010-08-10 21:01:01","2010-08-10 21:15:55","Cannot import android.text.util.Regex? Where is it?","<android><regex><linkify>","2","1","1","",""
"3453205","1","6028101","","2010-08-10 20:36:53","4","2141","<p>In my android app, I would like to be able to limit the maximal resolution (or size in mb) of a picture being taken.</p><p>here is how i call the camera activity : </p><pre><code>Intent intent = new Intent( MediaStore.ACTION_IMAGE_CAPTURE );intent.putExtra( MediaStore.EXTRA_OUTPUT, Uri.fromFile( new File( mTmpFilePath ) ) );intent.putExtra( ""filename"", mTmpFilePath );startActivityForResult( intent, REQUEST_CAMERA );</code></pre><p>Is there anyway to force or limit the camera resolution ?</p>","271395","","","","","2011-05-17 08:22:44","Forcing android camera resolution","<android><camera>","1","3","1","",""
"3453241","1","3453293","","2010-08-10 20:40:39","1","1776","<p>I have a source of data that changes from time to time. When it does I simply do:</p><pre><code>mylistView.setAdapter(...)</code></pre><p>which works fine and replaces the old data with the new ones. Thing is, I dunno if it is the right way to go. Is there any way to notify the view about the change in the data layer? Bear in mind I am not using a content provider and the data layer is completely hand-madeso dont make any assumption about the data layer as it is simply a List of beans.</p><p>cheers</p>","87624","","","","","2010-08-10 20:52:15","reload listView data","<android>","1","0","","",""
"3453246","1","3622128","","2010-08-10 20:41:04","1","1658","<p>I would like to know if there is any URI or action to go to a calendar app loaded in the mobile.</p><p>The question is similar to <a href=""http://stackoverflow.com/questions/3116147/intent-uri-to-go-to-favorite-contacts"">http://stackoverflow.com/questions/3116147/intent-uri-to-go-to-favorite-contacts</a></p>","402637","","","","","2010-09-01 21:02:36","Intent URI to go to Calendar App","<android>","2","0","0","",""
"3453349","1","","","2010-08-10 20:56:17","0","304","<p>Okay,</p><p>I'm and unemployed student and i want to make a game for one of adobe's mobile game contest for android phones and flash 10.1</p><p>Well, although i have cs4, i dont have cs5, and dont have the money to upgrade or buy a test phone.</p><p>So i was wondering is there still anyway to emulate testing on the android platform with flash 10.1 games, or am i out of luck.</p><p>I have the android sdk and eclipse plugin, is their by chance a way i can test the swf's from there.</p><p><strong>Edit: I might have a possible solution. I have recently learned that the Device Central in the cs5 might not expire after 30days, which would be really helpful if i can at least still test out the swf's, but just not use flash cs5. Of course i wont know for sure until a month for now ( just installed cs5 ), but im gonna ask on the adobe forums to see if i can get a faster response, and thought there might be some people who might want to know about a answer.</strong></p>","375933","","375933","","2010-08-11 23:07:48","2011-06-17 09:10:14","Flash Testing for Android Phones","<android><flash><adobe><cs4>","1","2","","",""
"3453466","1","3454778","","2010-08-10 21:11:27","0","4778","<p>I everyone. I'm very new to Android development and I want to develop an application that uses a local database. I want to show the results of queries in a DataGrid like object.</p><p>The UI would be somewhat similar to this.</p><p><img src=""http://i.stack.imgur.com/hGUGu.jpg"" alt=""http://i5.photobucket.com/albums/y163/marco2530/img1.jpg""></p><p>Is it possible to develop this kind of UI in Android? If so how can I accomplish this? Are there good tutorials I can follow?</p><p>Thank you very much.</p><p>Marco Sousa</p>","416619","","808940","","2011-07-30 16:49:41","2012-04-18 03:18:37","Android equivalent to Windows Mobile Datagrid control?","<android><datagrid>","3","1","","",""
"3453490","1","3453559","","2010-08-10 21:14:11","1","1785","<p>I've searched Google for this, but have only found similar examples--not exactly what I need. I simply need to start messaging (SMS) and email intents from my app with their ""to"" fields already populated. So I need to send a number with the sms intent and an email address with the email intent. Any help would be appreciated.</p>","378272","","379693","","2010-08-11 04:11:22","2012-08-07 04:04:57","Messaging and email intents in Android?","<android><email><sms><android-intent>","2","0","","",""
"3453513","1","3782521","","2010-08-10 21:15:54","-1","1215","<p>I've read through the docs and searched on here, but I'm not quite understanding how all the pieces fit together. Was wondering if anyone has a clear explanation of how to grab a single column of data from Contacts and have it populate an autocomplete box.</p>","246793","","82118","","2011-01-14 22:26:25","2011-01-14 22:26:25","How to get list of email addresses from Contacts for autocomplete field in Android?","<android><autocomplete><cursor><contacts>","1","1","","",""
"3453641","1","3453723","","2010-08-10 21:35:47","4","781","<p>How to detect quickly if a specified URL contains an image in Android? </p><p>I have link of type <code>http://foo.bar/w23afv</code> so naive approach like checking end of URL string won't work here.</p>","296427","","","","","2010-08-10 21:48:51","Detect if specified url is an image in Android?","<android><image><http><url>","1","0","","",""
"3453728","1","3453807","","2010-08-10 21:49:25","4","2854","<p>I have a main activity and a sub activity.The main activity starts the sub activity using startActivity, and passes an object in the intent.The sub activity reads the object out of the intent in its onCreate action.The sub activity updates the object, then returns to the main activity using startActivity, again passing the updated object back.However, the main activities onCreate function is not called, so the code it contains to read the passed object does not run.</p><p>Further investigation indicated that the main activity onPause event is firing, i.e. it is only paused when the sub activity runs, so when the sub activity starts the main activity again, it just onResumes.</p><p>Does anyone know if there would be any disadvantages if I moved my data restore/store activities to the onResume and onPause events?I'm not using the onCreate savedInstanceState, should I be?</p><p>How else do you pass a set of data items between Activities without using a database or those preferences? Should I be using a database? I have about 20 fairly individual data items.</p><p>Any help would be much appreciated,</p><ul><li>Frink</li></ul>","131209","","131209","","2010-08-10 22:21:16","2010-08-10 22:21:16","Should startActivity always run the started Activities onCreate?","<java><android>","4","0","0","",""
"3453896","1","3454731","","2010-08-10 22:14:46","0","638","<p>I create a game board with squares. The size of each square (both height and width) is phone_pixel_width/number_of_squares to maximize the size of each square on the game screen depending on resolution (oh and I do not support mdpi devices, thus it does not get to small).</p><p>Now my problem is that I also write text in these squares. If I use the same font size for HVGA screens and for WVGA (hdpi-normal) screens the font gets to big on the HVGA (mdpi-normal) screen. I was thinking about being able to select font size depending on its width and could thus adapt the font size perfectly to the calculated square width. </p><p>Is there any easy way of doing this (note: I am using TextPaint and not TextView) or do I have to calculate this myself, on the fly so to speak by creating some kind of table at start-up.</p><p>Thank you :-)</p><p>/ Henrik</p>","226342","","","","","2010-08-11 01:43:32","How to select font size and stil being future compatible depending on screen density/size/size of images in Android","<android><resolution><screen-resolution>","1","0","","",""
"3453901","1","3453922","","2010-08-10 22:16:09","1","237","<p>is it possible to query a website's api from an android app? If so, how to do you handle the return if it's in xml? </p><p>Thanks</p>","306410","","306410","","2010-08-11 22:35:39","2010-08-11 22:35:39","How to query an api in Android?","<android><api><post>","1","0","","",""
"3453918","1","","","2010-08-10 22:19:04","1","857","<p>I have an Android application that allows the user to select a photo that has already been taken. Once the user selects a photo, I grab the URI information for that photo, use that information to  create a bitmap, and then I set the bitmap in an ImageView. This all works perfectly fine.</p><p>I then give the user the option to select the picture for viewing. When the user chooses to view the picture, I launch an ACTION_VIEW intent, passing the URI data. </p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW, pictureUri);startActivity(intent);</code></pre><p>As you can see, this is very simple code, nothing special going on. The problem is that, when I run this code on my Droid running Android 2.1, about 6 or 7 times out of 10, the application will display the correct picture. But the other 3 or 4 times, I get shown the wrong picture. Also, each time the wrong picture is shown, its always the same incorrect picture being shown. The fact that I see the right picture the majority of the time leads me to believe everything I'm doing in code is fine, so can anyone tell me if you have seen this problem before, and better yet, is there a solution?</p><p>Here is the exact sequence that I observe on my Droid when I run this (Note: Image URI is already saved before I start the Activity):</p><pre><code>- I choose ""View Photo"" in the Activity- When things work, I get taken to the gallery and shown image 74- Each time things do not work, I get shown image 82</code></pre><p>Keep in mind that when I start the Activity with the URI already saved (retrieved from database), I set an ImageView based on the URI data in onCreate(), and the Image being shown in the ImageView is ALWAYS the correct image. It's not until I actually decide to view the image using ACTION_VIEW that I see odd behavior. And I know it's not something specific about these 2 photos. I observed this behavior using other photos in the past, and got the same behavior.</p>","377507","","","","","2010-08-11 15:29:05","ANDROID ACTION_VIEW showing the wrong image from URI","<android><photo>","1","0","","",""
"3453997","1","3454029","","2010-08-10 22:31:04","1","912","<p>It seems to me the snippet below should work, but ""mp.getBodyPart(1).getContent().toString()"" returns</p><blockquote>  <p>com.sun.mail.util.BASE64DecoderStream@44b07df8</p></blockquote><p>instead of the contents of the attachment.</p><pre><code>public class GMailParser {    public String getParsedMessage(Message message) throws Exception {        try {            Multipart mp = (Multipart) message.getContent();            String s = mp.getBodyPart(1).getContent().toString();            if (s.contains(""pattern 1"")) {                return ""return 1"";            } else if (s.contains(""pattern 2"")) {                return ""return 2"";            }            ...</code></pre>","398460","","","","","2010-08-11 15:07:02","Why can't I parse a javamail attachment using toString?","<java><android><imap><javamail><multipart>","2","0","1","",""
"3454157","1","","","2010-08-10 23:00:42","1","1216","<p>My android app was running ok under Eclipse, then I tried to add some GridView sample code from some online examples and now it will not build/run anymore. I keep getting the major error:</p><p>trouble processing ""javax/net/SocketFactory.class"":[2010-08-10 17:35:12 - CLife] Attempt to include a core VM class in something other than a core library.</p><p>I have never put anything to do with 'SocketFactory' in any of my code. I searched all of my code and can't find any code that I did that contains the SocketFactory.class.</p><p>I deleted my xml's and classes that I was working on that had to do with the GridView and reverted back to the code I had before, when it was running - but now I continue to get the above error. I even try to use 'Clean' but the error continues.</p><p>Does anyone know what I should do about this error?</p>","237863","","237863","","2010-08-11 08:35:23","2011-07-29 16:09:25","My Android app is getting the ""Trouble Processing"" error","<android>","2","0","1","",""
"3454158","1","","","2010-08-10 23:00:47","0","3381","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2256884/android-device-chooser-device-not-showing-up"">Android Device Chooser &mdash; device not showing up</a>  </p></blockquote><p>Does anybody have an idea what I may be doing wrong. I have installed the usb drivers and have my device running in debugging mode but when I run my basic hello world application through eclipse my device wont show up in the device chooser. I have also tried re installing the sdk and all the drivers and still no luck. Thanks to anybody that can help me out</p>","342052","","","","","2012-02-21 19:09:13","Android Device not showing up in device chooser","<android>","4","0","","2012-02-21 19:14:03",""
"3454185","1","","","2010-08-10 23:06:04","1","1554","<p>I'm working on some pitch correction software for Android, and I am looking to get fftw3 working on Android using the NDK. </p><p>The pitch correction library (talentedhack, <a href=""http://code.google.com/p/talentledhack/"" rel=""nofollow"">http://code.google.com/p/talentledhack/</a> incase anyone wants to know) depends on fftw3, so I am trying to compile fftw3 as a static library, then link it into the talentedhack shared library. Currently I've got fftw3 building as a static library, libfftw3.a, but I keep getting unresolved reference errors like this</p><pre><code>bin/ndk/local/armeabi/objs/talentedhack/fft.o: In function `fft_inverse':jni/talentedhack/fft.c:51: undefined reference to `fftwf_execute'</code></pre><p>when compiling the talentedhack shared library using ndk-build. It appears to be picking up the file correctly though, which is puzzling.</p><p>The relevant parts of my Android.mk file looks like this:</p><pre><code>LOCAL_MODULE := talentedhackLOCAL_CFLAGS := -std=c99LOCAL_SRC_FILES := talentedhack.c other_source_files.cLOCAL_C_INCLUDES := $(LOCAL_PATH)/fftw3/apiLOCAL_STATIC_LIBRARIES := fftw3LOCAL_LDLIBS := -lloginclude $(BUILD_SHARED_LIBRARY)</code></pre><p>The command that fails when ndk-build is invoked from the project top level is this one:</p><p><code>/opt/android-ndk-linux/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc -nostdlib -Wl,-soname,libtalentedhack.so -Wl,-shared,-Bsymbolic  /path/to/project/bin/ndk/local/armeabi/objs/talentedhack/circular_buffer.o /path/to/project/bin/ndk/local/armeabi/objs/talentedhack/fft.o /path/to/project/bin/ndk/local/armeabi/objs/talentedhack/formant_corrector.o /path/to/project/bin/ndk/local/armeabi/objs/talentedhack/lfo.o /path/to/project/bin/ndk/local/armeabi/objs/talentedhack/pitch_detector.o /path/to/project/bin/ndk/local/armeabi/objs/talentedhack/pitch_shifter.o /path/to/project/bin/ndk/local/armeabi/objs/talentedhack/pitch_smoother.o /path/to/project/bin/ndk/local/armeabi/objs/talentedhack/quantizer.o /path/to/project/ndk/local/armeabi/objs/talentedhack/talentedhack.o -Wl,--whole-archive -Wl,--no-whole-archive /path/to/project/bin/ndk/local/armeabi/libfftw3.a /opt/android-ndk-linux/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/libgcc.a  /opt/android-ndk-linux/build/platforms/android-8/arch-arm/usr/lib/libc.so /opt/android-ndk-linux/build/platforms/android-8/arch-arm/usr/lib/libstdc++.so /opt/android-ndk-linux/build/platforms/android-8/arch-arm/usr/lib/libm.so    -Wl,--no-undefined -Wl,-z,noexecstack -L/opt/android-ndk-linux/build/platforms/android-8/arch-arm/usr/lib -llog -Wl,-rpath-link=/opt/android-ndk-linux/build/platforms/android-8/arch-arm/usr/lib -o /path/to/project/bin/ndk/local/armeabi/libtalentedhack.so</code></p><p>I'm not sure whether this is a problem with fftw3, since I followed their instructions on porting (grab a subset of the source files, manually configure, and build them), since the system actually doesn't have fftwf_execute or any of the other functions defined in any header (that I can tell) due to using some fancy macros, or if it is a problem with Android NDK build system not dealing with static libraries correctly. Any help at all would be greatly appreciated.</p>","90119","","149841","","2011-08-01 15:27:28","2011-08-01 15:27:28","static linking fftw3 into shared library","<android><android-ndk><ld><static-linking><fftw>","0","3","2","",""
"3454293","1","","","2010-08-10 23:35:11","0","178","<p>I have an Android activity that creates custom views, and it is an expensive process. I tried to use a Handler, but when I do, the progress dialog that shows, spins like once every 5 seconds. So I tried to use an AsyncTask. Now the progressDialog spins, but then it crashes, because it isn't allowed to load the UI? How can I do this without getting ANR?</p><pre><code>08-10 19:28:21.313: ERROR/AndroidRuntime(1428): Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</code></pre>","325081","","","","","2010-08-10 23:46:14","How to load complex views concurrently","<android><multithreading><concurrency><handler><android-asynctask>","1","0","","",""
"3454589","1","","","2010-08-11 01:00:45","1","57","<p>Hi allI'm developing an application targeting sdk 2.1 unfortunately my ADP2 is on 1.6<br>I'm looking for an official way to upgrade my dev phone 2 ADP2 from 1.6 to 2.1I saw some pointers to cyanogenmod but it's chinese for me. </p><p>I don't know what is a mod and so on I suppose it's an image of the OS ? But how can I match version 2.1 with the version of the mod</p><p>thanks a lot</p>","384873","","","","","2010-08-11 01:00:45","Is someone has a nice pointer or official solution to upgrade a dev phone 2 from 1.6 to 2.1","<android>","0","2","","",""
"3454597","1","4022916","","2010-08-11 01:02:56","10","3988","<p>All the classes in Android that can be built using XML have constructors of the form:</p><pre><code>Context context, AttributeSet attrs, int defStyle</code></pre><p>What is the <code>defstyle</code> parameter?</p>","165495","","","","","2013-10-16 01:11:22","Android defstyle parameter","<android>","3","0","1","",""
"3454650","1","3455125","","2010-08-11 01:17:47","30","16164","<p>I'm spending considerable time in making my UI to work with keyboard input only. But in the end I'm not sure are there any android devices which don't have touch screen?</p><p>The last problem manifests in PreferenceActivity, where I can't find a way to select Views in my custom Preference only by keyboard...</p><p>Thanks for your replies...</p>","381466","","","","","2012-09-01 03:09:39","Are there any android devices without touch screen","<android>","6","0","9","",""
"3454710","1","","","2010-08-11 01:36:31","7","3806","<p>What I'm basically trying to achieve is custom global hot keys or in other words 'things will happen when I push certain buttons no matter which program is currently on top'.<br>I assume a service is needed.</p><p>I have a quick and dirty test that just tells me what has been pressed that will work if it is the active window.</p><pre><code>public boolean onKeyDown(int keyCode, KeyEvent event) {    char pop;    pop = (char)event.getUnicodeChar();    Toast.makeText(this, Character.toString(pop) , Toast.LENGTH_SHORT).show();    return super.onKeyDown(keyCode, event);  }</code></pre><p>But obviously if I change window or go into a text box it doesn't work.  If I stick it directly into a service (or an imputmethodservice) and launch said service nothing happens. (Some permissions required maybe?)Any suggestions where I'm going wrong?  Or a better way of capturing which button is pressed?</p><p>Thanks!</p>","416773","","","","","2013-03-08 11:06:24","onKeyDown in a service? (Global Hot Keys)","<android><onkeydown>","1","2","5","",""
"3454782","1","3455032","","2010-08-11 02:00:33","0","302","<p>How would i go about passing an image to the next page for android?</p>","358218","","","","","2012-04-14 13:52:45","Method to pass an image value?","<android><eclipse><image>","2","0","","",""
"3454893","1","","","2010-08-11 02:40:48","1","1870","<p>I'm using aapt to dump info from apks, it works fine on Mac, but failed on Ubuntu.</p><p>Here is the log from the two machine:</p><p>Mac:</p><pre><code>$ md5 test.apk MD5 (/Users/jlee/tmp/test.apk) = 022d63fa0e3e9f10f57550d8921088d9$ aapt dump badging test.apk package: name='com.i9i8.nanopage' versionCode='46' versionName='1.2.18'application: label='MoreGoodNews' icon='res/drawable/mushroom.png'launchable activity name='com.i9i8.nanopage.StartupActivity'label='MoreGoodNews' icon=''sdkVersion:'3'targetSdkVersion:'7'uses-permission:'android.permission.INTERNET'uses-permission:'android.permission.ACCESS_NETWORK_STATE'uses-permission:'android.permission.READ_PHONE_STATE'uses-permission:'android.permission.WRITE_EXTERNAL_STORAGE'mainother-activitiesother-servicessupports-screens: 'small' 'normal' 'large'locales: '--_--' 'zh' 'en'densities: '160' '240'</code></pre><p>Ubuntu(10.04):</p><pre><code>$ md5sum test.apk022d63fa0e3e9f10f57550d8921088d9  /home/jlee/tmp/test.apk$ aapt dump badging test.apkERROR getting 'android:versionName' attribute: attribute is not a string valuepackage: name='com.i9i8.nanopage' versionCode='46' $</code></pre><p>Both aapt are from the lastest android-1.6 platform, which on Linux is android-1.6_r03.</p><p>I also tried the following version of aapt on Linux:</p><pre><code>android-1.5_r04-linuxandroid-2.0_r01-linuxandroid-2.1_r02-linux</code></pre><p>None of them works.</p><p>Is this a bug of aapt? Or something that I went wrong?</p>","234939","","","","","2011-06-07 09:07:04","Why aapt dump badging doesn't work on Linux","<android><aapt>","1","0","","",""
"3455099","1","","","2010-08-11 03:35:24","2","3038","<p>I'm new in Java.</p><p>I'm trying to do</p><pre><code>import org.apache.http.Header;Header&lt;NameValuePair&gt; nvps = new HeaderList&lt;NameValuePair&gt;();//....adding some headershttppost.setHeaders(nvps);</code></pre><p>but said</p><pre><code>The type Header is not generic; it cannot be parameterized with arguments &lt;NameValuePair&gt;</code></pre><p>how I can do it? </p>","383343","","65977","","2010-08-11 03:38:29","2010-08-11 04:47:54","How make an array of org.apache.http.Header?","<java><android><generics>","2","0","","",""
"3455123","1","7738687","","2010-08-11 03:43:03","19","11233","<p>I know it's possible, but I can't figure out a way to trigger an update of my widget from the main activity.  Isn't there some general intent I can broadcast?</p>","254304","","63550","","2010-08-11 12:26:14","2014-03-05 21:36:25","Programmatically update widget from activity?","<android><activity><widget>","6","0","6","",""
"3455235","1","","","2010-08-11 04:14:47","14","8014","<p>I am using AlertDialog.Builder in order to create an input box, with EditText as the input method.</p><p>Unfortunately, the Soft Keyboard doesn't pop, although the EditText is in focus, unless you explicitly touch it again.</p><p>Is there a way to force it to pop?</p><p>I've tried the following, after the (AlertDialog.Builder).show(); but for no avail.InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);mgr.showSoftInput(input, InputMethodManager.SHOW_FORCED);</p><p>Anyone can help?</p><p>Thanks!!</p>","416843","","","","","2014-04-13 20:50:47","when using AlertDialog.Builder with EditText, the Soft Keyboard doesn't pop","<android>","5","2","5","",""
"3455294","1","3456299","","2010-08-11 04:28:46","0","353","<p><img src=""http://www.freeimagehosting.net/uploads/3e61936255.png"" alt=""Threads Picture""></p><p>I have no idea, but my app is stalling sometimes completely (not responding to touching the screen) I thought I was following all the rules for threading, but my app is apparently slowing down the Sprint EVO! I have never used an app as slow as my own. I don't get an ANR dialog, though I think I probably should get getting one. I have no idea how to make this application run like every other app I've ever used -- Not freezing. Is it not a good idea to have one <code>HttpClient</code> and keep a static reference to it for all Activities that want to use it? I used to create a new one each time, and thought that changing it to one sped it up. None of my <code>AsyncTasks</code> ever end. If I go to Activity A -> B -> C -> D the first time it will be smooth. I can press back but when I get back to A, its completely frozen, not responding to anything. That when I took that screenshot. I really have no clue what I am doing wrong. Should I manually kill my AsyncTasks on <code>Activity.onPause()</code>? </p>","325081","","","","","2010-08-11 07:42:41","Super slow apps caused by large number of unending AsyncTasks","<java><android><multithreading><blocking><unresponsive>","1","0","","",""
"3455428","1","4196725","","2010-08-11 05:05:31","3","690","<p>We're running a fairly large site, and a lot of our visitors have started using their Android based cellphones to visit the site. However when they try to login, we get an Event Validation error:</p><blockquote>  <p>Invalid postback or callback argument.  Event validation is enabled using    in configuration or &lt;%@ Page  EnableEventValidation=""true"" %> in a  page. For security purposes, this  feature verifies that arguments to  postback or callback events originate  from the server control that  originally rendered them. If the data  is valid and expected, use the  ClientScriptManager.RegisterForEventValidation  method in order to register the  postback or callback data for  validation.</p></blockquote><p>Does anyone know of a way to fix this, without disabling Event validation entirely ?</p><p>It isn't every single time they visit, but it is often enough that it's a problem.</p><p>Also we never get these on PC-based browsers (IE, FF, Chrome, Safari, Opera, etc.)</p><p>EDIT:</p><p>The page this happens on has no updatepanels, no custom __doPostback code, etc. It's pretty much vanilla with a simple LinkButton that causes the postback.</p><p>Also this error occurs on a bunch of other pages as well (Just found out about that now), so I doubt it's a lone design fault.</p><p>I think it's more likely it's an issue with the Android based browser and ASP.Net in general.</p>","116733","","116733","","2010-08-11 05:51:32","2010-11-16 17:53:16","ASP.Net Event Validation fails on Android phone browser","<asp.net><android><eventvalidation>","1","4","","",""
"3455477","1","","","2010-08-11 05:18:41","1","913","<p>I need to display progress icon in button so that user can interact other GUI elements while background task is processing.</p><p>I have searched in Android developer site and  found that we can use animated drawables but don't know how to use them. Please advise on the same.</p>","301549","","396458","","2010-08-11 05:33:21","2011-10-21 06:01:43","How can we display progress icon in button","<android>","2","2","1","",""
"3455482","1","3455520","","2010-08-11 05:19:37","5","2830","<p>I am using SQLite in a project used by an android application. Currently I am using the SQLite implementation provided in <code>android.database.sqlite</code>.</p><p>I want to make a desktop application which uses the same codebase. So I need to separate all the shared behaviour into a separate portable project/jar.</p><p>My problem is I'm currently making heavy use of <code>android.database.sqlite</code>. If possible I do not want to re-write every database access call to be compatible with JDBC or whatever I will have to use without using the android provided SQLite.</p><p>To solve this problem with minimal impact on the existing code. I intent to write a SQLite interface (compatible with <code>android.database.sqlite</code>) which the shared code will use... on android it will be implemented trivially by <code>android.database.sqlite</code>, and on the desktop it will be implemented by somehow mutilating SQLite through JDBC to match <code>android.database.sqlite</code>.</p><p>This is proving difficult as I often supply <code>Object[]</code> arrays to be bound to prepared statements which JDBC requires strict typing, and I am not familiar with JDBC at all.</p><p>Is there any other way to use SQLite in Java which is similar to <code>android.database.sqlite</code>, or any other approaches which may save me the effort (and inevitable debugging) associated with re-writing many database access points?</p><p><strong>Disclamer: I have never until now tried using JDBC.</strong></p><p><strong>Simplified question: What is the best way to use SQLite in java? JDBC, other?</strong></p>","40175","","40175","","2010-08-11 05:50:39","2010-10-02 08:20:45","Portable JDBC vs SQLite on Android","<java><android><sqlite><jdbc><portability>","3","0","","",""
"3455531","1","","","2010-08-11 05:34:53","1","158","<p>I suddenly started getting an unusual compiler error and is it making impossible to do any testing, I am running Eclipse with the plugin and compiling on the 2.1 version.</p><p>[2010-08-11 00:29:38 - PeriodTrackerv2] trouble processing ""java/net/DatagramPacket.class"":[2010-08-11 00:29:38 - PeriodTrackerv2] Attempt to include a core class (java.* or javax.*) in something other...[2010-08-11 00:29:38 - PeriodTrackerv2] 1 error; aborting[2010-08-11 00:29:38 - PeriodTrackerv2] Conversion to Dalvik format failed with error 1</p><p>I verified that this class does exist in the standard Android2.1 jar file, so I find it highly unusual a class in the actual base Jar file would be problematic.  I am not using this class in any fashion in my program.</p><p>I updated to version 2.2 and still get same error, this completely baffles me and just appeared tonight after zero issues for months.</p><p>Any ideas on how to fix this?</p><p>Cheers,Tom</p>","416881","","416881","","2010-08-11 05:52:58","2010-08-11 06:04:17","Odd compiler error, Davlik error 1 from java.net.DatagramPacket.class","<android><compiler-errors>","1","0","","",""
"3455664","1","","","2010-08-11 06:03:09","1","570","<p>In my application i am calling camera intent and capturing image successfully.But after finishing of camera intent, it comes to actual activity it destroy/change complete layout(Which is relative and table layout).Here is the images of before and after calling of camera intent. </p><p><img src=""http://www.freeimagehosting.net/uploads/bcf1876dbc.png"" alt=""alt text""><img src=""http://www.freeimagehosting.net/uploads/edca05b5d8.png"" alt=""alt text""></p><p>when i type anything in editText box then all layout shown normally.Here is the my code:-   </p><p>'</p><p>   </p><p></p><p></p><p>   </p><p>  </p><p></p><p></p><pre><code>&lt;TableRow android:layout_marginTop=""15dip"" android:layout_marginLeft=""15dip""&gt; &lt;TextView android:id=""@+id/new_name_txt""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:layout_column=""1"" android:text=""@string/user_name""  android:gravity=""center_vertical|right""  android:layout_marginRight=""5dip"" /&gt; &lt;EditText android:id=""@+id/new_name_edit""  android:layout_width=""160dip"" android:layout_height=""wrap_content""  android:singleLine=""true"" /&gt;&lt;/TableRow&gt;&lt;TableRow android:layout_marginLeft=""15dip"" android:layout_marginTop=""5dip""&gt; &lt;TextView android:id=""@+id/new_user_id_txt""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:layout_column=""1"" android:gravity=""center_vertical|right""  android:text=""@string/new_user_id"" android:layout_marginRight=""5dip"" /&gt; &lt;EditText android:id=""@+id/new_user_id_edit""  android:layout_width=""160dip"" android:layout_height=""wrap_content""  android:singleLine=""true"" /&gt;&lt;/TableRow&gt;&lt;TableRow android:layout_marginLeft=""15dip"" android:layout_marginTop=""5dip""&gt; &lt;TextView android:id=""@+id/user_name_admin_txt""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:layout_column=""1"" android:gravity=""center_vertical|right""  android:text=""User Name"" android:layout_marginRight=""5dip"" /&gt; &lt;EditText android:id=""@+id/user_name_admin_edit""  android:layout_width=""160dip"" android:layout_height=""wrap_content""  android:singleLine=""true"" /&gt;&lt;/TableRow&gt;&lt;TableRow android:layout_marginLeft=""15dip""&gt; &lt;TextView android:id=""@+id/user_paas_admin_txt""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:layout_column=""1"" android:gravity=""center_vertical|right""  android:text=""Password"" android:layout_marginRight=""5dip"" /&gt; &lt;EditText android:id=""@+id/user_pass_admin_edit""  android:layout_width=""160dip"" android:layout_height=""wrap_content""  android:singleLine=""true"" android:password=""true"" /&gt;&lt;/TableRow&gt;&lt;TableRow android:layout_marginLeft=""15dip""&gt; &lt;TextView android:id=""@+id/pharam_id_txt""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:layout_column=""1"" android:text=""@string/pharam_id""  android:gravity=""center_vertical|right""  android:layout_marginRight=""5dip"" /&gt; &lt;Spinner android:id=""@+id/pharm_id_spinner""  android:layout_width=""178dip"" android:layout_height=""55dip""  android:drawSelectorOnTop=""true"" android:prompt=""@string/hiv_pharma"" /&gt;&lt;/TableRow&gt;</code></pre><p></p><p></p><p></p><p></p><p></p><p></p><p><br>' </p><p>    </p>","385343","","","","","2010-08-11 06:03:09","Camera intent destroy/change relative layout and table layout","<android>","0","2","","",""
"3455781","1","3458083","","2010-08-11 06:24:11","2","2480","<p>I am running into a very strange situation when using the PackageManager.getInstalledPackages() method.  The first time I launch my activity I get a valid list of all the installed packages.  But the second time I launch my activity I get an empty list... What could possibly be causing this?</p><p>I am using this code to get the list:List pkgList = getPackageManager().getInstalledPackages(PackageManager.GET_ACTIVITIES);</p><p>I am building against the 1.6 SDK with compatibility for 1.5+</p><p>Thanks in advance for any suggestions/help... I'm really baffled as to the cause and can't think of what I'm doing wrong.</p>","249412","","","","","2010-08-11 12:14:19","PackageManager.getInstalledPackages() returns empty list","<android><packages><installed-applications>","1","1","1","",""
"3455785","1","","","2010-08-11 06:25:09","0","1018","<p>I have developed a application which works like <a href=""http://osama-oransa.blogspot.com/2010/03/draw-ecg-using-java-script-draw.html"" rel=""nofollow"">ECG Graph</a></p><p>I have developed this using canvas and path.</p><p>Once the plotting of lines are completed in my screen, it will start again from the 0 position. But the problem is that it gets starting overlapped.</p><p>So how can i clear that particular position?</p>","385343","","","","","2011-07-28 10:07:53","Continuous moving graph in android","<android><animation><canvas>","1","2","","",""
"3455818","1","","","2010-08-11 06:29:58","0","177","<p>I want to create a ListView which contains a RelativeLayout which contains an ImageView and another Layout (Linear). Linear Layout Contains some TextView.</p><p>How can I create this ListView??</p><p>ThanksDeepak</p>","406494","","","","","2010-08-11 07:30:16","Creating ListView which contains Layout","<android><android-widget>","1","1","","",""
"3455859","1","","","2010-08-11 06:38:58","0","692","<p>I am using this code to send a mail.</p><pre><code>final Intent mail_Intent=new Intent(Intent.ACTION_SEND);mail_Intent.setType(""plain/text"");mail_Intent.putExtra(Intent.EXTRA_EMAIL,new String[]{toText.getText().toString()});             mail_Intent.putExtra(Intent.EXTRA_SUBJECT,subjectText.getText().toString());                mail_Intent.putExtra(Intent.EXTRA_TEXT,bodyText.getText().toString());              Intent i=Intent.createChooser(mail_Intent, ""Send Mail"");startActivity(i);</code></pre><p>But on the following screen i get the default android API.I do not want that screen to popup. Is there any other way where i can silently send the mail.</p><p>Any help is appreciated. Thanks in advance..</p>","416916","","12178","","2010-08-11 06:41:52","2010-08-11 07:44:40","How to send an Email using our own own API?","<android><email>","1","1","","",""
"3455868","1","","","2010-08-11 06:40:02","0","490","<p>My app needs to download picture from internet time to time and store them to show when it runs according to the selection. how can i download the pictures and what is the way to store them in my application folder or etc. i m trying to use file output stream on application local folders such as assets and drawable but so far no luck in finding the correct path for it.</p>","377941","","","","","2010-08-11 07:22:44","SAving pictures which needed by my application","<android><download><assets>","1","0","","",""
"3455885","1","3456231","","2010-08-11 06:41:59","2","556","<p>As i have referred <a href=""http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html"" rel=""nofollow""> this site </a> for Layout Tricks.</p><p>overthere one attribute is declared as <strong><code>android:layout_weight=""1""</code></strong>.</p><p>so my confusion is regarding android:layout_weight. </p><ol><li>where is the exact use of android:layout_weight ?</li><li>Where should we use android:layout_weight ?</li></ol><p>pls anybody focus their knowledge.</p><p>Thanx</p>","379693","","379693","","2010-08-11 07:54:54","2010-08-15 20:54:27","Android - Needed help in Layout Tricks","<android><android-layout>","3","0","2","",""
"3456034","1","3456099","","2010-08-11 07:02:43","13","11881","<p>Is it possible to start an Activity from a Service? If yes, how can we achieve this?</p>","393792","","","","","2013-10-09 07:18:28","How to start an Activity from a Service?","<android>","4","0","3","",""
"3456152","1","","","2010-08-11 07:19:59","0","172","<p>This is a strange problem -- may be not a problem. </p><p>Before the last step to finish writing a application, I would use icon to replace any image. That is, all the things like </p><pre><code>&lt;ImageButton    android:id=""@+id/top""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:scaleType=""center""    android:src=""@drawable/icon"" /&gt;</code></pre><p>The problem appears then. I set the imageButton alpha to 50, then all the images' alpha low to 50, Even in different activities. I start an activity as main entry, then start another activity from main entry. I set imageButton source as icon in xml file. Then I set its alpha value to 50(any value you like), then when I finish the activity, back to the main entry, all the ""icons"" set its alpha value to 50. Then I start another activity and found all the ""icons"" there are 50 alpha.</p><p>I just wonder why? Can any one answer me? My development phone is HTC magic 1.5, official rom. Thanks!</p><p>Code 1:</p><pre><code>Runnable doHide = new Runnable() {    @Override    public void run() {        if (intHidingButtonPanelAlpha &lt;= 0) {            imageButtonTop.setVisibility(ImageButton.GONE);            imageButtonNext.setVisibility(ImageButton.GONE);            imageButtonPrevious.setVisibility(ImageButton.GONE);            imageButtonTop.setAlpha(255);            imageButtonNext.setAlpha(255);            imageButtonPrevious.setAlpha(255);            return;        }        imageButtonTop.setAlpha(intHidingButtonPanelAlpha);        imageButtonNext.setAlpha(intHidingButtonPanelAlpha);        imageButtonPrevious.setAlpha(intHidingButtonPanelAlpha);        intHidingButtonPanelAlpha -= 85;    }};</code></pre><p>Code 2:</p><pre><code>for (int i = 0; i &lt; 4; i++) {        handlerHider.postDelayed(doHide, 600 * i);    }</code></pre><p>Hope this can help you to understand what I did. At present, all imageButtons' source are drawable.icon.</p>","414787","","414787","","2010-08-29 12:21:27","2010-08-29 12:21:27","Are images in Android global?","<android><image><icons><global><alpha>","1","2","1","",""
"3456309","1","","","2010-08-11 07:43:59","3","3623","<p>I have written code for adding open network to wifi configured list.It adds the open network to configured lists and displays the same SSID's in Wifi Settings.but it adds the same network with same name extra but it doesn't shows any open network When i press on the second on alert shows with Security WEP the following text i observed with those same networks</p><p>1) Open network2) remembered , not in rangeBut i want to add open network into my list, why this extra one is added and if i connect the same network it is trying to connect to the (2) one programmatically.Actually I changed secured network to open network for this trial.It displays with open network text and when i press on that one it obtains the address and connects succesfully manually.Why this extra one is adding how can i add the open network to my list.For reference plz see the link for image.</p><p><a href=""http://www.freeimagehosting.net/uploads/3dbccfc2bd.png"" rel=""nofollow"">http://www.freeimagehosting.net/uploads/3dbccfc2bd.png</a></p><p>Code snippet :</p><pre><code>    String hotSpotSsid = hotSpot.SSID;    String hotSpotBssid = hotSpot.BSSID;    Log.i(TAG,""in RSSI Changed Acion SSID: ""+hotSpotSsid+"" BSSID: ""+hotSpotBssid);    StringBuffer sBuf = new StringBuffer(""\"""");    sBuf.append(hotSpotSsid+""\"""");    hotSpotSsid = sBuf.toString();    WifiConfiguration wifiConfiguration = new WifiConfiguration();    wifiConfiguration.SSID = hotSpotSsid;    wifiConfiguration.allowedKeyManagement.set(KeyMgmt.NONE);    wifiConfiguration.BSSID = hotSpotBssid;    wifiConfiguration.hiddenSSID = false;   // wifiConfiguration.priority = 1;    // add this to the configured networks    int inetId = wifiManager.addNetwork(wifiConfiguration);    Log.i(TAG,""INetId :""+inetId);    configs = wifiManager.getConfiguredNetworks();    Log.e(TAG,""After adding config :""+configs);    if(inetId &lt; 0) {        Log.i(TAG,""Unable to add network configuration for SSID: ""+hotSpotSsid);        return;    }else {        message=""\t Successfully added to configured Networks"";        Log.i(TAG,message);    }</code></pre><p>regards,Rajendar</p>","362544","","","","","2011-05-01 15:06:07","Unable to configure the wifi open network programmatically android?","<android><android-wifi>","2","2","1","",""
"3456319","1","","","2010-08-11 07:45:29","1","1110","<p>I would like to use the internal Contact activity to create a new Contact.Here is the code:</p><pre><code>        Intent i = new Intent();    i.setAction(ContactsContract.Intents.SHOW_OR_CREATE_CONTACT);    i.addCategory(Intent.CATEGORY_DEFAULT);    i.setData(Uri.fromParts(""tel"", ""12345678"", null));    i.putExtra(ContactsContract.Intents.EXTRA_FORCE_CREATE, true);    i.putExtra(ContactsContract.CommonDataKinds.Phone.TYPE, ContactsContract.CommonDataKinds.Phone.TYPE_WORK);     i.putExtra(ContactsContract.Intents.Insert.EMAIL, ""naoknaoknaok@gmail.com"");    i.putExtra(ContactsContract.CommonDataKinds.Email.TYPE, ContactsContract.CommonDataKinds.Email.TYPE_WORK);    i.putExtra(ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME, ""Ide"");    i.putExtra(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME, ""Vele"");    i.putExtra(ContactsContract.CommonDataKinds.Organization.COMPANY, ""Company name"");    i.putExtra(ContactsContract.CommonDataKinds.Organization.TYPE, ContactsContract.CommonDataKinds.Organization.TYPE_WORK);    i.putExtra(ContactsContract.CommonDataKinds.Organization.LABEL, ""label"");    i.putExtra(ContactsContract.CommonDataKinds.Organization.TITLE, ""job title"");    i.putExtra(ContactsContract.CommonDataKinds.Organization.DEPARTMENT, ""department"");    i.putExtra(ContactsContract.CommonDataKinds.Organization.JOB_DESCRIPTION, ""job description"");    i.putExtra(ContactsContract.CommonDataKinds.Organization.SYMBOL, ""symbol"");    i.putExtra(ContactsContract.CommonDataKinds.Organization.OFFICE_LOCATION, ""office location"");</code></pre><p>But this code only partially works. Only the phone number and the email address are visible in the activity, the other fields are unset.</p><p>Here is the screenshot from the emulator:<a href=""http://www.freeimagehosting.net/uploads/67c5d58e7d.png"" rel=""nofollow"">edit_contact1</a></p><p>Sorry for not including it, but i don't have enough reputation to include images.</p><p>Any help would be greatly appreciated !</p><p>Some update: the following code sets the 'Given name' field:</p><pre><code>i.putExtra(ContactsContract.Intents.Insert.NAME, ""simple name"");</code></pre>","416956","","416956","","2010-08-12 09:57:30","2011-01-04 23:22:22","How to properly set an android intent with the SHOW_OR_CREATE_CONTACT action?","<android><android-intent><contact>","1","0","","",""
"3456424","1","3458515","","2010-08-11 08:00:11","0","2555","<p>What codec settings will produce valid videos for playback on Android (videoView) and iOS UIWebView)?</p>","377832","","","","","2010-08-11 13:01:58","What video/audio codec settings for playback on Android and iOS","<iphone><android><video><video-streaming>","1","1","1","",""
"3456467","1","","","2010-08-11 08:05:57","4","9872","<p>I wrote an Android app that uses <code>android.os.PowerManager.reboot()</code>, and I added <code>&lt;uses-permission android:name=""android.permission.REBOOT"" /&gt;</code> in my <code>AndroidManifest.xml</code>. However, when I run the app, it always throws the following exception:</p><pre><code>java.lang.SecurityException: Neither user 10039 nor current process has android.permission.REBOOT. at android.os.Parcel.readException(Parcel.java:1247)at android.os.Parcel.readException(Parcel.java:1247)at android.os.Parcel.readException(Parcel.java:1235)at android.os.IPowerManager$Stub$Proxy.reboot(IPowerManager.java:427)at android.os.PowerManager.reboot(PowerManager.java:481)at Test.testPower(Test.java:374)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:204)at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:194)at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:186)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)at android.os.Parcel.readException(Parcel.java:1247)at android.os.Parcel.readException(Parcel.java:1235)at android.os.IPowerManager$Stub$Proxy.reboot(IPowerManager.java:427)at android.os.PowerManager.reboot(PowerManager.java:481)at com.fsl.cts.FSLPlaybackTest.testPower(FSLPlaybackTest.java:374)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:204)at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:194)at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:186)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)</code></pre><p>Is the anything I'm doing wrong, or does froyo have some problem with rebooting?</p>","416984","","309308","","2010-12-12 07:28:34","2013-11-28 09:16:45","Why does my app throw an `android.permission.REBOOT SecurityException`?","<android><permissions><reboot>","5","1","2","",""
"3456759","1","3458232","","2010-08-11 08:50:33","3","859","<p>I am using simple xml framework from <a href=""http://simple.sourceforge.net/"" rel=""nofollow"">http://simple.sourceforge.net/</a>. How can i format the date or double values? I see a function called transform but how do I apply it all double and date fields in my class?</p>","207552","","","","","2010-08-11 12:33:42","how can i format date or double values when persisting objects using simple xml","<java><android>","2","0","2","",""
"3456762","1","","","2010-08-11 08:51:00","0","207","<p>I have a query. In my application, on click of a button, I start an intent to send email. I have set the ""To"" list, ""Subject"" and attachment in my coding. Now my problem is that when the email screen is shown, user should not be able modify the email contents nor should he be allowed to remove the attachment. Only he sould be able to click on ""Send"" button. Please help me out in this. Thanks in advance. </p>","357450","","","","","2010-08-11 12:18:32","Problem in sending an email in android","<android>","1","1","","",""
"3456862","1","4075541","","2010-08-11 09:03:54","3","8637","<p>How can the Android emulator's memory capacity be increased? I have a 16MB binary file which I have to parse. But when I execute a second time it says:</p><pre><code>Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE.</code></pre><p>Can anybody help please?</p>","397901","","234175","","2011-10-10 19:18:19","2011-10-10 19:18:19","Increasing the memory capacity of the android emulator?","<android>","2","4","2","",""
"3456883","1","3456979","","2010-08-11 09:07:22","-1","217","<p>friend's,   i have an task to set horizontal swipe tabs below the header,how can i set an activity on another activity.</p>","407506","","","","","2010-08-11 12:02:18","how to place one activity on another activity","<android>","3","0","1","2012-08-25 18:11:42",""
"3456974","1","3457048","","2010-08-11 09:20:04","3","11566","<p>I am parsing an XML file through Android Pull Parser technique. First, have a look at the below XML file:</p><pre><code>&lt;childs&gt;    &lt;students&gt;        &lt;name&gt; hello &lt;/name&gt;        &lt;address&gt; xyz &lt;/address&gt;    &lt;/stdents&gt;          &lt;students&gt;        &lt;name&gt; abc &lt;/name&gt;        &lt;address&gt; def &lt;/address&gt;    &lt;/stdents&gt;      &lt;/childs&gt;</code></pre><p>Consider that I'm parsing the above file. Now, my problem is that I want to create a separate array for name and address. So while parsing, I want to store 1st student's data in <code>name[0]</code> and <code>address[0]</code> and the next student's data in <code>name[1]</code> and <code>address[1]</code>. In short, <strong>array size is extending as more data is parsed.</strong></p><p><strong>Is there any way to do so? I mean to create a dynamic extendable array?</strong> Or if there is another way to do so then please help me to fight with this problem.</p>","379693","","1128737","","2012-01-13 08:51:42","2013-09-27 06:24:39","Android Dynamic Array","<android><arrays><dynamic-arrays><xml-parsing>","2","4","3","",""
"3457102","1","","","2010-08-11 09:39:12","1","519","<p>There are some applications out there, that use a kind of standard way for showing images to the user. There is one i specially like, is the Facebook one. Facebook presents images to the user in full screen mode, with a black background. If user clicks on the image, there appears a left and/or right arrow to move to next/previous image in the album. You also have zoom controls enabled. Quite powerful and nice.</p><p>Android Market uses same arrows for switching between views, but zoom controls are not enabled. They're probably using a ImageSwitcher for that.</p><p>Does somebody know if there is a similar standard control in Android for that?. Something more like Facebook uses?</p><p>Thanks in advance!</p>","367029","","","","","2014-04-15 11:05:34","Is there a standard ImageViewer on Android?","<android><image><viewer>","2","0","","",""
"3457153","1","3457274","","2010-08-11 09:49:08","0","751","<p>I have a problem displaying the results of an sql query into a list view via SimpleCursorAdapter. This is my query:</p><pre><code>String sql = """" +""SELECT (Clients.firstname || \"" \"" ||  Clients.surname) AS client_name, "" +    ""Visits._id, "" +    ""Status.status, "" + ""strftime('%H:%M',time(sql_start_date,'unixepoch')) as start_time, "" + ""strftime('%H:%M',time(sql_end_date,'unixepoch')) as end_time "" +  ""FROM "" +         ""Visits,Clients,Status "" + ""WHERE "" +         ""Visits.status = Status.remote_id "" + ""AND "" +         ""Visits.client_id = Clients.remote_id "" + ""AND "" +  ""Visits.sql_start_date &gt; ""+checkpoint+"" "" + ""AND "" +  ""Visits.sql_end_date &lt; ""+endpoint;</code></pre><p>when I execute this query I get a typical result set like so:</p><pre><code>client_name   |Visit._id|Status.status |start_time |end_time__________________________________________________________Kevin Bradshaw|187      |Pending       |13:00      |14:00Peter Flynn   |193      |Pending       |15:00      |16:30</code></pre><p>I want to output this cursor to a listview. The problem I run into is that i can output client name and status no problems, but the start_time and end_time fields remain blank. </p><p>my cursor adapter code is this:</p><pre><code>Cursor cur = HomeScreen.this.application.getVisitsHelper().fetchVisits();startManagingCursor(cur);// the desired columns to be bound     String[] columns = new String[] {VisitsAdapter.KEY_CLIENT_FULL_NAME, VisitsAdapter.KEY_STATUS,VisitsAdapter.KEY_CLIENT_START_TIME, VisitsAdapter.KEY_CLIENT_END_TIME};// the XML defined views which the data will be bound toint[] to = new int[] { R.id.name_entry,R.id.number_entry,R.id.start_time_display,R.id.end_time_display  };// create the adapter using the cursor pointing to the desired data as well as the layout informationSimpleCursorAdapter mAdapter = new SimpleCursorAdapter(HomeScreen.this, R.layout.list_element, cur, columns, to);// set this adapter as ListActivity's adapterHomeScreen.this.setListAdapter(mAdapter);</code></pre><p>And finally my xml layout (list_element.xml) is as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""         &gt;    &lt;TextView     android_id=""@+id/start_time_display""     android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textSize=""16dip""   android:textColor=""#333333""   android:layout_marginLeft=""14px"" &gt;&lt;/TextView&gt;    &lt;TextView     android_id=""@+id/end_time_display""     android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textSize=""16dip""   android:textColor=""#333333""   android:layout_toRightOf=""@+id/start_time_display""  android:layout_marginLeft=""64px""&gt;&lt;/TextView&gt; &lt;TextView  android:id=""@+id/name_entry""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textSize=""16dip""   android:textColor=""#333333""   android:layout_marginLeft=""94px""  android:layout_toRightOf=""@+id/end_time_display""/&gt;       &lt;TextView  android:id=""@+id/number_entry""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:textSize=""14dip""  android:textColor=""#666666""   android:layout_marginLeft=""14px""  android:layout_below=""@+id/name_entry""  /&gt;&lt;/RelativeLayout&gt;</code></pre><p>So my question is, how come some of the code (i.e. status and client name) is getting output while my time fields (start_time, end_time) are not?</p><p>is it because simple cursor adapters can only deal with ints and strings and my time variables originate from sql timestamps in the database??</p><p>Thanks in advance</p><p>Kevin</p>","409826","","","","","2010-08-11 10:09:31","Andrdoid SimpleCursorAdapter / Listview problem","<android><sqlite><listview><cursors>","1","0","","",""
"3457395","1","","","2010-08-11 10:29:41","3","474","<p>I have some motion sensor samples that were recorded with an Iphone.Now I'm into calculating a distance between a user gesture and the gesture that was recorded on the Iphone. </p><p>My problem is that the sensor data on the Iphone is represented in a different way then the android sensor data. If i don't move the Iphone I get data between -1 and 1 if I don't move my Android device I get values around 9 because the sensor measures the force of gravity.</p><p>I couldn't figure out how to convert the Iphone sensor reading to compare them to my android sensor readings. The android motion sensor data is explained <a href=""http://developer.android.com/reference/android/hardware/SensorEvent.html"" rel=""nofollow"">here</a>. And the Iphone documentation contains this <a href=""https://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIAcceleration_Class/UIAcceleration_Class.pdf"" rel=""nofollow"">pdf</a>. </p>","114066","","","","","2011-07-27 11:59:49","How to convert motion sensor data from Iphone to Android?","<iphone><android><accelerometer>","1","0","2","",""
"3457406","1","3457765","","2010-08-11 10:31:05","0","3470","<p>I'm develop a download manager function which the dialog will popup when the the item was finished download. the download function was running at background.</p><p>my question is how can I know when the downloading was finished and the project is intent other activity?</p><p>for example:</p><pre><code>if(download_state == TASK_FINISH){    //download Finish    openfile();    }</code></pre><p>the above method where should I put? i try put it at onResume(), onStart() in every activity which will open by user. but unlucky it won't work.You reply is appreciated.</p><p>p/s: I'm sorry about my bad english, hope you guys understand what I'm talking about.</p><p>Thank you.</p>","409419","","","","","2012-03-30 05:59:36","how to intent a dialog when the Thread.run() finish running?","<android><activity>","1","0","1","",""
"3457526","1","","","2010-08-11 10:52:55","1","1796","<p>What I just want to do it to put some texts in the screen, together with a border that I'm doing(this border will be in the entire screen.)</p><p>The problem is that the <code>LinearLayout</code> is adding some texts to <strong>outside</strong> of the screen, and this I cannot understand why. Why the <code>LinearLayout</code> cannot just keep the elements in the screen size, even if will be very small sizes.</p><p>Take a look:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:background=""@color/White""&gt;    &lt;ImageView android:layout_height=""wrap_content""        android:minHeight=""2px"" android:maxHeight=""2px""        android:layout_gravity=""top"" android:src=""@drawable/horizontal_bar""        android:scaleType=""fitXY"" android:layout_weight=""1""        android:layout_width=""fill_parent"" /&gt;    &lt;LinearLayout android:orientation=""horizontal""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:layout_weight=""1""&gt;        &lt;ImageView android:src=""@drawable/vertical_bar""            android:minWidth=""2px"" android:maxWidth=""2px"" android:scaleType=""fitXY""            android:layout_gravity=""left"" android:layout_width=""wrap_content""            android:layout_height=""fill_parent"" android:layout_weight=""1"" /&gt;        &lt;TextView android:text=""testing"" android:layout_height=""fill_parent""            android:layout_width=""fill_parent"" android:paddingLeft=""15px""            android:textStyle=""bold"" android:textColor=""@color/grey""            android:textSize=""20px"" android:layout_weight=""1""            android:layout_gravity=""center_horizontal|center"" /&gt;        &lt;TextView android:text=""blablabla"" android:layout_height=""fill_parent""            android:layout_width=""fill_parent"" android:paddingLeft=""15px""            android:textStyle=""bold"" android:textColor=""@color/grey""            android:textSize=""20px"" android:layout_weight=""1""            android:layout_gravity=""center_horizontal|center"" /&gt;        &lt;TextView android:text=""0000"" android:id=""@+id/number""            android:layout_height=""fill_parent"" android:layout_width=""fill_parent""            android:layout_gravity=""left"" android:textStyle=""bold""            android:textColor=""@color/green"" android:textSize=""20px""            android:layout_weight=""1"" /&gt;        &lt;ImageView android:src=""@drawable/vertical_bar""            android:minWidth=""2px"" android:maxWidth=""2px"" android:scaleType=""fitXY""            android:layout_gravity=""right"" android:layout_width=""wrap_content""            android:layout_height=""fill_parent"" android:layout_weight=""1"" /&gt;    &lt;/LinearLayout&gt;    &lt;ImageView android:layout_height=""wrap_content""        android:minHeight=""2px"" android:maxHeight=""2px""        android:layout_gravity=""top"" android:src=""@drawable/horizontal_bar""        android:scaleType=""fitXY"" android:layout_weight=""1""        android:layout_width=""fill_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Where <code>horizontal_bar</code> is a image with 6x4 and <code>vertical_bar</code> is a image with 4x6.This image needs to be stretch to be able to became a border.</p><p>Any idea why the LinearLayout is going out of the screen size?</p>","417128","","119895","","2010-08-11 11:33:26","2011-02-27 20:56:36","LinearLayout usage","<android>","1","0","","",""
"3457548","1","","","2010-08-11 10:56:12","7","580","<p>I would like my app to grab an image from the phones sd card to use as the notification icon in the status bar, but android needs a resource id to build the notification with an icon.  if I load an image from my sd card, does it have an resource id and how can I get it?  or is there another way to get this to work?</p>","274365","","","","","2012-08-09 08:30:58","display icon from my sd card","<android><image><resources>","1","1","","",""
"3457695","1","3457793","","2010-08-11 11:19:12","1","5385","<p>HI all,this is my class A, where on button click , i m sending a int variable to class B</p><pre><code>Intent bgIntent = new Intent(Background.this, MainScreen.class);bgIntent.putExtra(""background"",  bgColor);startActivity(bgIntent);</code></pre><p>and on class B</p><pre><code>Intent bgIntent = getIntent();bgGlobal = bgIntent.getIntExtra(""background"",-1 );if(bgGlobal == 0) {   DetailsTextView.setBackgroundResource(R.color.a0);}else     if(bgGlobal == 1)    {        DetailsTextView.setBackgroundResource(R.color.a1);    }</code></pre><p>But the problem is i am getting a blank view.My view is not coming up with textview.is this proper to set background</p><p>""DetailsTextView.setBackgroundResource""???</p>","1497488","","137350","","2010-08-11 11:31:29","2011-05-27 05:10:01","How to pass value through Intent","<android>","1","1","1","",""
"3457697","1","3462599","","2010-08-11 11:19:15","0","435","<p>friend's   I have a task to place the horizontal scroll or swipe menu tabs in my application i did it where the appears top of the header,but my problem is to place the scroll menu has below the header</p><h2>i have RelativeLayout where it contains two elements one after another,</h2><pre><code>       TextView   -  for header       Gallery   -  for Scroll menu items </code></pre><p>from the above code Gallery content been set from my activity,</p><ul><li>for example the output i'm getting<ol><li>looks, scroll menus(Gallery) - Header</li><li>(text view defined the above layout)</li></ol></li></ul><p>========================================</p><ul><li>but i need it has <ol><li><ul><li>Header (text view defined the above layout)  -</li></ul></li><li>scroll menus(Gallery)</li></ol></li></ul><p>how can i get it.</p><p>thanks in advance.</p>","407506","","407506","","2010-08-11 11:46:26","2010-08-11 20:37:25","how to order the elements in relative layout","<android>","2","0","","",""
"3457709","1","3458001","","2010-08-11 11:20:54","0","356","<p>The Timer works fine. The problem is that the method _dw.newgame() just get executed(if two seconds are over) if i touch the display. Maybe it have sth to do with the ""OnTouchListener"" ?</p><p><pre><code>public class DrawView extends View implements OnTouchListener{Timer timer = new Timer();</p><p>public DrawView(Context context){timer.schedule(new Task(this),0, 2000);}public boolean onTouch(View view, MotionEvent event){}}</p><p>class Task extends TimerTask{private DrawView _dw; public Task(DrawView dw){ this._dw = dw;}public void run(){ _dw.newgame(); }}</pre></code></p>","415250","","","","","2010-08-11 15:28:38","Timer act only if i touch the display (OnTouchListener)","<java><android><ontouchlistener>","1","0","","",""
"3457799","1","3457864","","2010-08-11 11:32:33","2","505","<p>I have a compound UI component built up from a ViewGroup containing a number of TextView, ImageView etc. components. Many of these have StateListDrawables as their images/backgrounds. Is there any way of making them select from this drawable based on the state of the parent ViewGroup rather than the component itself? Ideally I want to be able to change the visual state of all children of the ViewGroup (text colour, image etc) based on the state of the ViewGroup, preferably without having to hook up complex logical code. This seems like a fairly common sort of requirement, so I was hoping it would be straightforward in Android - am I going to be disappointed? :)</p>","39368","","","","","2010-08-12 06:55:04","Changing displayed state of Views based on a parent ViewGroup's state","<android><view>","1","0","1","",""
"3457835","1","3459091","","2010-08-11 11:38:21","0","642","<p>Ive developed a DB for use with my app but I've realised that I actually want extend my db to incorporate images! I will be hosting the db online but for now I am using it locally for development purposes. To create my db I have been using SQLiteBrowser, which I think is a standalone version of the Firefox SQLiteManager plugin, however I cant see a way to insert an image. I recognise that an image will have to be transfered into a byte array and stored as a blob, but rather that developing this element of the db programatically, I was wondering if the was a gui tool to help me skip this developmental element! </p><p>Cheers </p>","397085","","","","","2010-08-11 14:01:10","Inserting an image into a pre-developed SQLite DB for use with Android","<android><database><sqlite>","1","0","1","",""
"3457970","1","","","2010-08-11 11:59:32","0","653","<p>How can I copy my data from xyz.xml in my assets dir to my sqllite db during development in android platform</p>","417183","","236247","","2011-06-28 14:50:50","2011-06-28 14:50:50","android: dump data from local xml file to SQLite database","<android><xml>","2","2","","",""
"3458008","1","","","2010-08-11 12:04:16","2","2941","<p>Is it possible to create files in subdirectories created under ""/data/data/packagename/files/"" directory using openFileOutput method in android?ie there is a sub-directory by name ""text"" inside the ""/data/data/packagename/files/"" directory.I want to use the openFileOutput (String name, int mode) method to write a file eg:sample.txt into this directory....Is it possible to use openFileOutput method to do it....</p><p>Can any one help me on this....</p>","417193","","","","","2010-08-11 12:17:20","Creating files in sub directories in android","<android>","1","1","1","",""
"3458156","1","3464560","","2010-08-11 12:23:42","25","22104","<p>The LogCat window is open. Sometimes LogCat displays Log messages, sometimes it does not, with or without the physical target attached. Is there an enable/disable Log somewhere in the debug environment?</p>","398460","","","","","2014-02-17 13:16:50","What enables the Android Eclipse LogCat?","<android><eclipse><logcat>","11","3","5","",""
"3458275","1","3477919","","2010-08-11 12:38:41","4","5158","<p>Is it possible to enable USB debugging (under settings/applications/development) programmatically from within my app?</p><p>I was looking at <code>Permission.WRITE_SETTINGS</code> and<a href=""http://developer.android.com/reference/android/provider/Settings.System.html"" rel=""nofollow"">http://developer.android.com/reference/android/provider/Settings.System.html</a>, but I couldn't find anything appropriate.</p>","241475","","63550","","2012-07-08 18:50:39","2012-07-08 18:50:39","Enable USB debugging (under settings/applications/development) programmatically from within an app","<android><permissions><android-manifest>","2","3","1","",""
"3458325","1","","","2010-08-11 12:43:44","-1","296","<p>I developed an android maps application on Google API 2.1 update-1 platform. And it is the simplest code to show a map on the screen, there is no other things.</p><p>However, map doesn't shown on phone. The problem is, the same program runs on my android emulator right but it is not working on my android phone properly, I mean program starts on phone but I see only greeds instead of map. phone android version is th same, 2.1 update-1. </p><p>Please help me,Thanks.</p>","404308","","","","","2010-08-11 12:49:10","I can't run my android maps aplication on phone","<android><map>","1","3","","",""
"3458372","1","3458945","","2010-08-11 12:47:51","0","165","<p>How do I know the file size in seconds mp4?</p>","413881","","","","","2010-08-11 13:45:54","Size of the audio in seconds","<android>","1","2","1","",""
"3458426","1","","","2010-08-11 12:53:12","1","301","<p>Is there any ways to check whether the Appwidget is currently being displayed on Home screen or not?</p><p>The scenario is like this,</p><p>I have 4-5 app widgets on my homescreen. My Home screen has three workspaces and my widgets are distributed over these workspaces. Now my intention is to get the appwidget that is currently being displayed in my active workspace, i.e. facing the user.</p>","301973","","1236185","","2012-10-08 17:11:36","2012-10-08 17:11:36","Appwidget : Is there any ways to check whether the Appwidget is currently being displayed on Home screen?","<android><android-widget><appwidget>","1","0","","",""
"3458498","1","","","2010-08-11 13:00:37","1","722","<p>I want to retrieve the video thumbnail from the SDCARD and show in <code>GridView</code> for both Android OS version 1.5  and 2.0. By using <code>MediaStore</code> class I can retrieve the thumbnail in only 2.0 and above but I want one common code to retrieve the Video thumbnail for 1.5 and 2.0 also.  Is this possible?. Thanks.  </p>","417242","","366898","","2012-07-11 12:54:12","2012-07-11 12:54:12","How to retrieve the Video thumbnail in android ","<android><gridview><sd-card>","1","0","0","",""
"3458533","1","","","2010-08-11 13:04:07","-1","576","<p>I need to write multiple blocks of the following chunk into a file</p><pre><code>+----------+--------------+---------------------+| FileName | Size of File | Binary Dump Of File |+----------+--------------+---------------------+</code></pre><p>There are two variants of file writers I could see. 1. FileWriter - allows writing [string,char[],one byte]2. BufferFileoutputStream - allows writing [byte array]</p><p>I need an File object that can write String,Integer and binary data. But I could not find any direct way out. We can definitely have work-arounds, like converting Strings and Integers to byte array. But is there a better alternative ??</p>","417397","","133203","","2010-08-11 13:20:25","2010-08-11 13:30:09","A question regarding Android File I/O API?","<android><file><io>","1","1","","",""
"3458641","1","3459580","","2010-08-11 13:16:06","1","1791","<p>I wrote a code to record audio of call conversation using MediaRecorder.</p><p>how can i know whether a MediaRecorder is in running state or not, to stop the recording.like </p><pre><code>boolean running;MediaRecorder mr;//what should i assign to running?        if(running){   mr.stop()}</code></pre><p>Above code is just an example.. If you do not understand my question, please tell me.. i will explain clearly with actual code..</p><p>What all i want to know is ""In which state the MediaRecorder is?"" -> recording/released/prepared/initial/etc..</p>","365184","","213269","","2011-08-15 20:23:32","2011-08-15 20:23:32","How to know whether a MediaRecorder is in running state or not?","<android><audio-recording><mediarecorder>","1","0","","",""
"3458718","1","3458905","","2010-08-11 13:24:43","0","1469","<p>I know how to center the text in the TextView and how to center the TextView inside its parent layout, but what I'm looking for is how to center a title (text centered but second line starting at the same point).</p><p>What I'm looking for is this:</p><pre><code> |  Centered  | |  right!    |</code></pre><p>or this:</p><pre><code>|    Center    |</code></pre><p>Not this (text centered):</p><pre><code> |     Too    | |  centered! |</code></pre><p>or this (TextView centered):</p><pre><code> |Centered    | |wrong!      |</code></pre><p>or this (with padding and left):</p><pre><code>|  |Also     |  ||  |wrong!   |  |</code></pre><p>Did anyone understad this? Is it possible to do this without coding the String itself?</p>","415166","","415166","","2010-08-11 14:18:16","2010-08-11 19:49:38","How to center a title in a TextView with 2 lines?","<android><android-widget><alignment><textview>","3","0","1","",""
"3458765","1","3520920","","2010-08-11 13:29:04","11","27831","<p>Can anyone shed any light on why I'm unable to click and play a youtube clip on an Android handset when placed inside a webview?</p><p>I've put a very simple app together (it's being extended, but no right away) and it has a web view assigned using the Android SDK.</p><p>The rest of the webview works as expected (text, images, css etc), however, the YouTube clips will not show, they just show as black or white rectangles (where the video embed should be).</p><p>We use the same view to display content on the iPhone app equivalent, without any issues.</p><p>This is using a basic flash embed, the Safari browser on iPhone converts these to H.264 and plays them nicely in QuickTime.</p><p>Can Android do the same??</p><p>Here is the embed code, as an example....</p><pre><code>&lt;object width=""120"" height=""73""&gt;    &lt;param name=""movie"" value=""http://www.youtube.com/watch?v=ZVYIBIlTIQs&amp;feature=youtube_gdata""&gt;&lt;/param&gt;    &lt;param name=""allowFullScreen"" value=""true""&gt;&lt;/param&gt;    &lt;param name=""allowscriptaccess"" value=""always""&gt;&lt;/param&gt;    &lt;embed src=""http://www.youtube.com/watch?v=ZVYIBIlTIQs&amp;feature=youtube_gdata"" type=""application/x-shockwave-flash"" allowscriptaccess=""always"" allowfullscreen=""true"" width=""120"" height=""73""&gt;&lt;/embed&gt;&lt;/object&gt;</code></pre>","228674","","156771","","2011-12-10 22:04:09","2011-12-10 22:04:09","How to embed a YouTube clip in a WebView on Android","<android><html><html5><iframe><youtube>","3","0","3","",""
"3459032","1","","","2010-08-11 13:54:31","2","842","<p>I have an app that works fine in Android 1.x but not in Android 2.xi need to do things different based on the version of Android the app is running on (querying contacts).is it possible to have two separate methods within the one app that i can choose based on the version of Android the app is running on?</p><p>many thanks</p><p>Ed</p>","417308","","","","","2010-08-16 17:08:21","how best to cope with different versions of Android?","<android><version>","4","0","3","",""
"3459038","1","3464532","","2010-08-11 13:55:20","2","2669","<p>Is there any unique id on Android Mobile?? If it is then how many digit it has? How can I access that through my program??</p><p>ThanksDeepak</p>","406494","","101258","","2010-08-11 14:05:27","2012-12-17 15:29:18","Unique device id","<android>","3","3","1","",""
"3459156","1","","","2010-08-11 14:07:48","0","2201","<p>I need programming help to answer the calls in android.</p>","389525","","16076","","2010-08-11 14:09:36","2010-08-11 15:04:52","How to answer calls in android programmatically?","<java><android><call>","2","3","1","2010-08-11 22:32:14",""
"3459168","1","5941620","","2010-08-11 14:08:34","9","6914","<p>In layout XML it is possible to specify <code>android:imeOptions=""actionNext""</code> which adds <code>Next</code> button in virtual keyboard and by clicking on it - focus jumps to the next field.</p><p>How to do this programmatically - e.g. based on some event trigger focus to go to the next field?</p>","283037","","","","","2012-09-11 05:13:56","imeOptions ""actionNext"" programmatically - how to jump to next field?","<android><android-widget>","2","0","1","",""
"3459245","1","","","2010-08-11 14:16:51","1","262","<p>I have implemented a timer that parses a URL every 15min (the Timer task). An Object called ParsedExampleDataSet gets that data .</p><p>Now , whenever i try to <strong>retrieve</strong> that <strong>Object or a String=Object.toString()</strong> out of the runnable I get null pointer exception and fatal errors .</p><p>How Can i retrieve it ?Is there another implementation that i could try ?Why does <strong>getBaseContext()</strong> not work inside the runnable ?</p><p>Thanks a Lot </p><p>here is most of my code where i have a problem i also added two comments where my  problem occurs </p><p>:)</p><pre><code> @Override    public void onCreate(Bundle icicle) {            super.onCreate(icicle)           final  TextView tv = new TextView(this);            TimerTask scanTask;            final Handler handler = new Handler();            Timer t = new Timer();                                  scanTask = new TimerTask() {                    public void run() {                            handler.post(new Runnable() {                                    public void run() {                                        URL url = null;                                        try {                                            url = new URL(""http://www.eurosport.fr/"");                                        } catch (MalformedURLException e3) {                                            e3.printStackTrace();                                        }                                        /* Get a SAXParser from the SAXPArserFactory. */                                        SAXParserFactory spf = SAXParserFactory.newInstance();                                        SAXParser sp;                                        try {                                            sp = spf.newSAXParser();                                        } catch (ParserConfigurationException e2) {                                            e2.printStackTrace();                                        } catch (SAXException e2) {                                            e2.printStackTrace();                                        }                                        /* Get the XMLReader of the SAXParser we created. */                                        XMLReader xr = null;                                        try {                                            sp = spf.newSAXParser();                                            xr = sp.getXMLReader();                                        } catch (SAXException e1) {                                            e1.printStackTrace();                                        } catch (ParserConfigurationException e) {                                            e.printStackTrace();                                        }                                        /* Create a new ContentHandler and apply it to the XML-Reader*/                                        ExampleHandler myExampleHandler = new ExampleHandler();                                        try {                                            sp = spf.newSAXParser();                                        } catch (ParserConfigurationException e1) {                                            // TODO Auto-generated catch block                                            e1.printStackTrace();                                        } catch (SAXException e1) {                                            // TODO Auto-generated catch block                                            e1.printStackTrace();                                        }                                        xr.setContentHandler(myExampleHandler);                                        /* Parse the xml-data from our URL. */                                        try {                                            xr.parse(new InputSource(url.openStream()));                                        } catch (IOException e) {                                            e.printStackTrace();                                        } catch (SAXException e) {                                            e.printStackTrace();                                        }                                        /* Parsing has finished. */                                        /* Our ExampleHandler now provides the parsed data to us. */                                        ParsedExampleDataSet parsedExampleDataSet =                                                                                        myExampleHandler.getParsedData();                                       System.out.println(parsedExampleDataSet.toString());                                        tv.setText(parsedExampleDataSet.toString());                                     Context context = this.getBaseContext();  // I dont understand why inside the runnable getBaseContext() does not exist ???    Bitmap mBitmap = BitmapFactory.decodeResource(getResources(),            R.raw.nature1)        context.setWallpaper(mBitmap);                                    }                           });                    }  };                    // I want to retrieve ParsedExampleDataSEt here in order to use it  is it Possible ????                    this.setContentView(tv);                   long temps=1*15*1000;                t.scheduleAtFixedRate(scanTask, 300,temps ); </code></pre>","410019","","","","","2010-10-20 23:06:30","Get Object out of a method(runnable) , timer","<java><android><bitmap><timer><runnable>","1","1","","",""
"3459304","1","","","2010-08-11 14:21:17","0","657","<p>I am making a very simple dump and display app. I would like to see my newly entered data displayed on the list found on the first tab. But I don't know where to place requery();</p><p>Here is the code for the first tab. (Displays the data from DB.)</p><pre><code>public class ListTask extends ListActivity{@Override   public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.list_task);    SQLiteDatabase db = openOrCreateDatabase(""db_alist"", 0, null);    db.execSQL(""CREATE TABLE IF NOT EXISTS tbl_alist (_id INTEGER PRIMARY KEY AUTOINCREMENT, task_name VARCHAR, task_date DATE, task_details VARCHAR);"");    Cursor c = db.rawQuery(""SELECT _id, task_name, task_date FROM tbl_alist"", null);    while(c.moveToNext()){        c.getString(c.getColumnIndex(""task_name""));        c.getString(c.getColumnIndex(""task_date""));    }    db.close();    String[] displayfields = new String[] {""task_name"", ""task_date""};    int[] displayviews = new int[] {android.R.id.text1, android.R.id.text2};    SimpleCursorAdapter sca = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_2, c, displayfields, displayviews);    this.setListAdapter(sca);}@Overridepublic void onResume(){    super.onResume();    System.out.println(""Resume?"");}@Overridepublic void onPause(){    super.onPause();    System.out.println(""Paused?"");}}</code></pre><p>I have tried doing (pseudo codes only)</p><pre><code>public class{Cursor c public void onCreate(){ ... } public void onResume(){ super.onResume(); c.requery(); }}</code></pre><p>and</p><pre><code>public class{SimpleCursorAdapter sca public void onCreate(){ ... } public void onResume(){ super.onResume(); sca.notifyDataSetChanged(); }}</code></pre><p>But BOTH don't work! Something is still wrong.</p>","417342","","417342","","2010-08-11 16:12:06","2010-08-11 16:28:38","Where would I place requery() in order to refresh the list when I add new task from another tab?","<java><android>","3","0","","",""
"3459493","1","","","2010-08-11 14:38:22","2","1323","<p>In my Android application user can fill database with imported data, then perform predefined, complex SQL query. With some data pattern, query will take very long (minutes and more on HTC Hero), while common usage will not exceed 10-15 seconds.</p><p>Is there any way to cancel pending SQLite query on Android? Timeout would be as good as well, partial results are not required. I'm performing query within <code>AsyncTask.doInBackground()</code></p><p>I know best way is optimize query or change app logic, but in this case results depends on user knowledge anyway, so I'd like to help those who enter troublesome pattern.</p>","7162","","7162","","2010-08-11 14:44:03","2011-06-07 09:56:08","Android: how cancel/interrupt/break pending SQLite query?","<android><sqlite><interrupt><cancel>","3","0","1","",""
"3459858","1","3584989","","2010-08-11 15:11:43","11","6089","<p>I have a paid app on Android Market. I've set up an HTTPS notification URL in Google Checkout settings. Yet notifications don't come.</p><p>My Google Checkout settings under Integration go like this:</p><ul><li>My company will only post digitally signed carts - checked</li><li>API callback URL - provided, it's HTTPS and it's valid</li><li>Notification as XML - checked</li><li>API version - 2.5</li><li>Notification filtering - checked</li></ul><p>Please, what am I doing wrong? Are realtime order notifications supported for Android Market at all? If so, is there a separate UI for setting those up?</p><p>EDIT: any data points would be welcome. If you sell stuff on the Market and do get those HTTP notifications, let's compare the setups.</p><p>EDIT2: seriously considering timed polling of my Google Checkout account. :(</p><p>EDIT3: contacted Google Checkout support. No substantial response for over a week. :(( On the brighter side, it is possible to retrieve the list of one's Google Checkout orders, with date and state filtering. On to retrieving order details... </p>","219159","","219159","","2010-08-25 14:21:10","2013-01-22 18:22:30","App on Android market - HTTP notifications don't come","<android><google-play>","1","2","4","",""
"3459886","1","","","2010-08-11 15:14:36","0","809","<p>I recently realized that to avoid nasty exceptions I should check <a href=""http://developer.android.com/reference/android/app/Activity.html#isFinishing%28%29"" rel=""nofollow"">isFinishing</a> in the inner AsyncTask subclasses of my activity. Where else is it a good practice to check isFinishing in an activity?</p>","143378","","143378","","2010-08-11 15:21:40","2010-08-11 16:25:47","Where to check isFinishing in an activity","<android><multithreading><activity>","1","1","","",""
"3459891","1","","","2010-08-11 15:14:55","1","317","<p>I have a tabhost with 5 tabs, and the content of each one is an ActivityGroup than can start different activities. I'm trying to redefine the clic on the selected tab of my tabHost, to go back on the main activity of this tab.  </p><p>For example, I'm in the first tab, which has a list of item. If I select one item, it replaces the content of my current tab with the new activity. And then, I want to clic on my selected tab in my TabBar, to go back to the previous activity.</p><p>My problem is to detect a clic on the selected tab, I cannot use the OnTabChangeListener, because it's not a tabChanged, and I don't find any other way ...</p><p>Thanks</p>","386745","","","","","2010-08-11 15:14:55","TabHost Clic on the selected tab","<android>","0","2","","",""
"3460092","1","3460157","","2010-08-11 15:33:57","0","1006","<p>If you have two TextViews side by side each with a varying number of lines and then want a TextView below both of these how would you implement it?</p><p>For example, if you had:</p><pre><code>&lt;TextView  android:id=""@+id/textview1""  android:layout_width=""160dip""   android:layout_height=""wrap_content""  android:layout_alignParentLeft=""true""  android:maxLines=""5"" /&gt;&lt;TextView  android:id=""@+id/textview2""  android:layout_width=""fill_parent""   android:layout_height=""wrap_content""  android:layout_toRightOf=""@id/textview1""  android:maxLines=""5"" /&gt;</code></pre><p>and then wanted a TextView to be below both of these (but as high as possible), its instinctive to try:</p><pre><code>&lt;TextView  android:id=""@+id/textview3""  android:layout_width=""fill_parent""   android:layout_height=""wrap_content""  android:layout_below=""@id/textview1""  android:layout_below=""@id/textview2"" /&gt;</code></pre><p>But clearly you can't have duplicate attributes.  So how would you do it (or do you have to resort to doing it in code?)</p>","295930","","","","","2010-08-11 15:40:16","Android RelativeLayout - using multiple layout attributes","<android><relativelayout>","1","0","","",""
"3460288","1","","","2010-08-11 15:54:34","2","414","<p>I am new to Android, and am trying to develop an app that presents a list of choices with a textfield next to each that allows the user to enter in quantity information related to each item.</p><p>What would be the best way to impliment this?  Currently my app is using a buttonlist with checkboxes next to each item to select it.  I'd like to expand this so that I can select multiples of the same item.</p><p>Any help is appreciated.</p><p>Thanks,Jason</p>","417460","","","","","2010-08-11 16:37:37","How can I create an order form?","<android><list><forms>","1","0","","",""
"3460333","1","3461883","","2010-08-11 15:59:10","0","1698","<p>I've created a custom gallery; however, the ""Set wallpaper"" button will not set the wallpaper. Here's the wallpaper.java I have. I'm just lost on how to implement OnClickListener and then set my button to use an onclicklistener like so:</p><p>buttonName.setOnClickListener(this);</p><pre><code>package com.totem;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.util.Log;import android.view.MotionEvent;import android.view.View;import android.view.ViewGroup; import android.view.Window;import android.widget.AdapterView;import android.widget.BaseAdapter;import android.widget.Gallery;import android.widget.ImageView; import android.widget.Gallery.LayoutParams;import java.io.IOException;import java.io.InputStream;public class Wallpaper extends Activity implements    AdapterView.OnItemSelectedListener, AdapterView.OnItemClickListener {private static final String LOG_TAG = ""Home"";private static final Integer[] THUMB_IDS = {    R.drawable.andy_small,};private static final Integer[] IMAGE_IDS = {       R.drawable.andy,};private Gallery mGallery;private boolean mIsWallpaperSet;public void onCreate(Bundle icicle) {    super.onCreate(icicle);    requestWindowFeature(Window.FEATURE_NO_TITLE);    setContentView(R.layout.wallpaper_chooser);    mGallery = (Gallery) findViewById(R.id.gallery);    mGallery.setAdapter(new ImageAdapter(this));    mGallery.setOnItemSelectedListener(this);    mGallery.setOnItemClickListener(this);}@Overrideprotected void onResume() {    super.onResume();    mIsWallpaperSet = false;}@SuppressWarnings(""unchecked"")    public void onItemSelected(AdapterView parent, View v, int position, long id) {    getWindow().setBackgroundDrawableResource(IMAGE_IDS[position]);}@SuppressWarnings(""unchecked"")    public void onItemClick(AdapterView parent, View v, int position, long id) {    selectWallpaper(position);}private synchronized void selectWallpaper(int position) {    if (mIsWallpaperSet) {        return;    }    mIsWallpaperSet = true;    try {        InputStream stream = getResources().openRawResource(IMAGE_IDS[position]);        setWallpaper(stream);        setResult(RESULT_OK);        finish();    } catch (IOException e) {        Log.e(LOG_TAG, ""Failed to set wallpaper "" + e);    }}@SuppressWarnings(""unchecked"")    public void onNothingSelected(AdapterView parent) {}public boolean onTouchEvent(MotionEvent event, Object Action_Down) {    getAction(Action_Down);    selectWallpaper(mGallery.getSelectedItemPosition());    return true;}    public class ImageAdapter extends BaseAdapter {    private Context mContext;    public ImageAdapter(Context c) {        mContext = c;    }    public int getCount() {        return THUMB_IDS.length;    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(final int position, View convertView, ViewGroup parent) {        ImageView i = new ImageView(mContext);        i.setImageResource(THUMB_IDS[position]);        i.setAdjustViewBounds(true);        i.setLayoutParams(new Gallery.LayoutParams(                LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));        i.setBackgroundResource(android.R.drawable.picture_frame);        return i;    }}</code></pre><p>}Parsed in 0.242 seconds, using GeSHi 1.0.8.4</p>","417467","","","","","2011-10-17 11:38:04","""Set wallpaper"" button function, Android","<java><android><wallpaper>","2","0","1","",""
"3460381","1","7021893","","2010-08-11 16:03:05","2","796","<p>I want to create a simple app which shows infos on the global quick search box in android.</p><p>I did follow some howtos but i can't get my app in the menu ""Settings->Search->Searchable Items"" which is the menu that let the user check which suggestions he wants in the QSB.</p><p>I can attach the manifest here and the searchable xml file..</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android"" package=""com.andreabaccega.marketsearch"" android:versionCode=""1"" android:versionName=""1.0""&gt; &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;  &lt;activity android:name="".Init"" android:label=""LUPO""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.SEARCH"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;   &lt;/intent-filter&gt;   &lt;meta-data android:name=""android.app.searchable""    android:resource=""@xml/searchable"" /&gt;  &lt;/activity&gt;  &lt;provider android:name=""com.andreabaccega.marketsearch.SuggestionProvider""   android:authorities=""com.andreabaccega.marketsearch.SuggestionProvider"" android:syncable=""false""/&gt; &lt;/application&gt; &lt;uses-sdk android:minSdkVersion=""7"" /&gt; &lt;uses-permission android:name=""android.permission.GET_ACCOUNTS""&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name=""android.permission.USE_CREDENTIALS""&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre><p>This is the searchable.xml file</p><pre><code>&lt;searchable xmlns:android=""http://schemas.android.com/apk/res/android"" android:label=""Teasdst"" android:searchSettingsDescription=""asd asd asd"" android:includeInGlobalSearch=""true""  android:searchSuggestAuthority=""com.andreabaccega.marketsearch.SuggestionProvider"" android:searchSuggestIntentAction=""android.intent.action.VIEW""  android:searchSuggestIntentData=""content://com.andreabaccega.marketsearch.SuggestionProvider/""  &gt;&lt;/searchable&gt;</code></pre>","314407","","","","","2011-08-11 06:47:02","Application non showing in global Quick Search Box","<android>","1","0","2","",""
"3460428","1","","","2010-08-11 16:08:44","0","299","<p>I am working through an Android tutorial from CommonsWare and cannot figure out why I am gettting my error.  Here is my code:</p><pre><code>public class Patchy extends Activity {public String DEB_TAG       = ""Patchy.java"";private DefaultHttpClient client    = null;private EditText user               = null;private EditText password           = null;private EditText status             = null;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Log.d(DEB_TAG, ""inside oncreate"");    user        = (EditText)findViewById(R.id.user);    password    = (EditText)findViewById(R.id.password);    status      = (EditText)findViewById(R.id.status);    Button send = (Button)findViewById(R.id.send);    send.setOnClickListener(onSend);    client = new DefaultHttpClient();}@Overridepublic void onDestroy() {    super.onDestroy();    client.getConnectionManager().shutdown();}private String getCredentials() {    String u = user.getText().toString();    String p = password.getText().toString();    Log.d(DEB_TAG, ""Value of u and p is "" + u + ""..."" + p);    String temp = Base64.encodeBytes((u+"":""+p).getBytes());    Log.d(DEB_TAG, ""Value of temp is "" + temp);    return temp;}private void updateStatus() {    try {        String s = status.getText().toString();        Log.d(DEB_TAG, ""Value of status is "" + s);        HttpPost post = new HttpPost(""https://identi.ca/api/statuses/update.json"");        post.addHeader(""Authorization"", ""Basic"" +getCredentials());        List&lt;NameValuePair&gt; form = new ArrayList&lt;NameValuePair&gt;();        form.add(new BasicNameValuePair(""status"", s));        post.setEntity(new UrlEncodedFormEntity(form, HTTP.UTF_8));        ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();        String responseBody = client.execute(post, responseHandler);        JSONObject response = new JSONObject(responseBody);    }catch (Throwable t) {        Log.e(DEB_TAG, ""Exception in updateStatus()"", t);        goBlooey(t);    }}private void goBlooey(Throwable t){    AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder    .setTitle(""Exception!"")    .setMessage(t.toString())    .setPositiveButton(""OK"", null)    .show();}private View.OnClickListener onSend = new View.OnClickListener() {    @Override    public void onClick(View v) {        updateStatus();    }};</code></pre><p>}and here is my LogCat error msgs:</p><blockquote>  <p>08-11 11:52:34.769: ERROR/Patchy.java(4738): Exception in updateStatus()  08-11 11:52:34.769: ERROR/Patchy.java(4738): org.apache.http.client.HttpResponseException: Unauthorized  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:71)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:59)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:657)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:627)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:616)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at example.com.patchy.Patchy.updateStatus(Patchy.java:83)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at example.com.patchy.Patchy.access$0(Patchy.java:66)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at example.com.patchy.Patchy$1.onClick(Patchy.java:106)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.view.View.performClick(View.java:2365)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.view.View.onTouchEvent(View.java:4180)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.widget.TextView.onTouchEvent(TextView.java:6696)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.view.View.dispatchTouchEvent(View.java:3710)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:885)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:885)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:885)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:885)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1695)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1111)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1679)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1696)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.os.Handler.dispatchMessage(Handler.java:99)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.os.Looper.loop(Looper.java:130)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at android.app.ActivityThread.main(ActivityThread.java:4425)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at java.lang.reflect.Method.invokeNative(Native Method)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at java.lang.reflect.Method.invoke(Method.java:521)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)  08-11 11:52:34.769: ERROR/Patchy.java(4738):     at dalvik.system.NativeStart.main(Native Method)</p></blockquote><p>On my phone a dialog pops up with the error ""Exception. org.apache.http.client.HttpResponseException: Unauthorized""</p><p>Any ideas?</p>","2186261","","","","","2010-08-11 16:36:36","Accessing Identi.ca Update Status","<android>","1","2","","",""
"3460525","1","","","2010-08-11 16:18:36","34","15881","<p>I'm building a mobile site and have the following meta tag set in the header:</p><pre><code>&lt;meta name=""viewport"" content=""width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"" /&gt;</code></pre><p>Unfortunately, this isn't working on HTC devices (HTC Hero, etc) with Android 2.1. Any ideas on how I can disable pinch-to-zoom in this browser? Works fine on the iPhone.</p>","409924","","","","","2012-01-25 08:48:33","Disable pinch/zoom in Android 2.1 browser on HTC devices","<android><mobile-website>","4","0","11","",""
"3460661","1","3539658","","2010-08-11 16:36:30","0","8366","<p>I am trying to implement the <a href=""http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MyLocationOverlay.html"" rel=""nofollow""><code>MyLocationOverlay</code></a> class from google maps. However, when I try and use my own locationManager -- I cannot get the overlay to acutally draw on the map. I am wondering if I am doing something wrong.</p><p>I don't want to call the super method(enbaleMyLocation) of the MyLocationOverlay class because that request updates from the locationManager way too quickly and will eat my battery alive.</p><p>Here is my code: </p><pre><code>private class CenterOverlay extends MyLocationOverlay {    private Context mContext;    private LocationManager mLocManager;    public CenterOverlay(Context context, MapView mapView) {        super(context, mapView);        this.mContext = context;    }    @Override    public void onLocationChanged(Location location) {        super.onLocationChanged(location);        try {            doExternalCenterOverlayTask(location);        } catch (JSONException e) {            e.printStackTrace();            ErrorHandler.serviceException(mContext);        } catch (IOException e) {            e.printStackTrace();            ErrorHandler.IOException(mContext);        } catch (ServiceException e) {            e.printStackTrace();            ErrorHandler.serviceException(mContext);        }    }    @Override    public boolean enableMyLocation() {        mLocManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);        mLocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000, 50, this);        mLocManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 5000, 25, this);        return mLocManager.isProviderEnabled(LocationManager.GPS_PROVIDER)                || mLocManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);    }    @Override    public void disableMyLocation() {        super.disableMyLocation();        mLocManager.removeUpdates(this);    }    @Override    public void onProviderDisabled(String provider) {        super.onProviderDisabled(provider);        ViewAdapter.createStandardAlertDialog(mContext,                ""Your location provider has been disabled, please re-enable it."");    }    @Override    public void onProviderEnabled(String provider) {        super.onProviderEnabled(provider);    }    @Override    public void onStatusChanged(String provider, int status, Bundle extras) {        super.onStatusChanged(provider, status, extras);        if (status == 0) {            ViewAdapter.showLongToast(mContext, ""Location is not available at this time"");        } else if (status == 1) {            //Trying to connect        } else if (status == 2) {            // Available        }    }}</code></pre>","354247","","354247","","2010-08-11 21:12:00","2011-11-17 20:40:36","Customize My Location Overlay Update Times","<android><google-maps><overlay>","2","0","4","",""
"3460828","1","3460956","","2010-08-11 16:56:11","3","271","<p>How Do I Pull The Application Version Listed in AndroidManifest.xml From Java, <code>android:versionName</code> specifically?</p>","417514","","918414","","2012-01-18 19:52:53","2012-01-18 19:52:53","How Do I Pull The Application Version Listed in AndroidManifest.xml From Java?","<android>","1","0","1","",""
"3460915","1","4262797","","2010-08-11 17:04:56","28","18407","<p>When I display a <code>WebView</code>, I don't see the soft keyboard popping up. The hard keyboard also doesn't work!</p><p>What are the usual shortcomings.</p><p>The code which I use to access the <code>WebView</code> is:</p><pre><code>package com.example.blahblah;import android.app.Activity;import android.content.Intent;import android.content.SharedPreferences;import android.os.Bundle;import android.os.Handler;import android.preference.PreferenceManager;import android.util.Log;import android.view.KeyEvent;import android.view.Window;import android.webkit.JsResult;import android.webkit.WebChromeClient;import android.webkit.WebSettings;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.Toast;public class createAccount extends Activity {private static final String LOG_TAG = ""Create Account"";private WebView mWebView;private static final String URL = blah_app.urlSelected+""createAccount.html"";    private Handler mHandler = new Handler();@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    Toast.makeText(createAccount.this, ""URL = "" +URL, Toast.LENGTH_SHORT).show();    getWindow().requestFeature(Window.FEATURE_PROGRESS);    setContentView(R.layout.webview);    getWindow().setFeatureInt(Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);    mWebView = (WebView) findViewById(R.id.webview);    WebSettings webSettings = mWebView.getSettings();    webSettings.setSavePassword(true);    webSettings.setSaveFormData(true);    webSettings.setJavaScriptEnabled(true);    webSettings.setSupportZoom(true);    final Activity activity = this;    mWebView.setWebChromeClient(new WebChromeClient() {    public void onProgressChanged(WebView view, int progress) {        activity.setProgress(progress * 1000);      }    });    mWebView.addJavascriptInterface(new DemoJavaScriptInterface(), ""demo"");    mWebView.clearCache(true);    setProgressBarVisibility(true);    mWebView.setWebViewClient(new WebViewClient() {          public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {            Toast.makeText(activity, ""Oh no! "" + description, Toast.LENGTH_SHORT).show();          }           @Override             public void onPageFinished(WebView view, String url)             {                 mWebView.loadUrl(""javascript:(function () { "" +                       ""setVariables(""+blah_app.numberSelected+"",'""+blah_app.urlSelected+""');"" +                       ""})()"");           }        });    mWebView.loadUrl(URL);}final class DemoJavaScriptInterface {    public void setData(String fname, String lname, String gacct, String phone) {        SharedPreferences prefCreateAccount = PreferenceManager.getDefaultSharedPreferences(createAccount.this);        SharedPreferences.Editor editor = prefCreateAccount.edit();        editor.putString(""FirstName"", fname);        editor.putString(""LastName"", lname);        editor.putString(""GmailAcct"", gacct);        editor.putString(""Phone"", phone);        editor.commit();        }    DemoJavaScriptInterface() {    }    /**     * This is not called on the UI thread. Post a runnable to invoke     * loadUrl on the UI thread.     */    public void clickOnAndroid() {        mHandler.post(new Runnable() {            public void run() {                mWebView.loadUrl(""javascript:wave()"");            }        });    }}/** * Provides a hook for calling ""alert"" from javascript. Useful for * debugging your javascript. */final class MyWebChromeClient extends WebChromeClient {    @Override    public boolean onJsAlert(WebView view, String url, String message, JsResult result) {        Log.d(LOG_TAG, message);        result.confirm();        return true;    }}public boolean onKeyDown(int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; mWebView.canGoBack()) {        startActivity(new Intent(getApplication(), blah_app.class));        return true;    }    return super.onKeyDown(keyCode, event);}}</code></pre>","402637","","321366","","2011-09-05 12:57:45","2013-10-24 09:11:10","WebView textarea doesn't pop up the keyboard","<android><textarea><webview>","9","5","12","",""
"3461033","1","3471532","","2010-08-11 17:18:03","3","6729","<p>===============================</p><h1>*SOLVED * : see answer below</h1><p>I dont want to use Eclipse.</p><p>From the command line:</p><p>An emulator is running. adb server is running. ""adb devices"" lists correctly and I can see my instance on an avd in the output.</p><p>However when I manually start DDMS from the command line it just keeps trying to connect. I can find no connection config issues.</p><p>Any suggestions (other than ""use Eclipse"") most welcome!</p><p>(yes, it works from within eclipse and ddms shows threads etc)</p><p>System : Debian Squeeze</p><p>Update : I ran update-java-alternatives to be sure java was set up properly for ""Java(TM) SE Runtime Environment (build 1.6.0_20-b02)"" . Not too much of a surprise to seasoned Debian users my Java is now worse ... When I run ddms from the command line I get :--</p><pre><code>(ddms:9326): Gdk-WARNING **: gdk_window_set_icon_list: icons too large04:29 E/ddms: Failed to reopen debug port for Selected Client to: 870004:29 E/ddms: Invalid argumentjava.net.SocketException: Invalid argument    at sun.nio.ch.Net.bind(Native Method)    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)    at com.android.ddmlib.MonitorThread.reopenDebugSelectedPort(MonitorThread.java:716)    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:226)04:29 E/DeviceMonitor: Connection attempts: 104:30 E/DeviceMonitor: Connection attempts: 204:31 E/DeviceMonitor: Connection attempts: 304:32 E/DeviceMonitor: Connection attempts: 404:33 E/DeviceMonitor: Connection attempts: 504:34 E/DeviceMonitor: Connection attempts: 6</code></pre>","37370","","37370","","2010-08-12 19:50:41","2012-12-21 04:05:36","Android development : ddms from command line not seeing devices","<android><eclipse><adb><jdb><ddms>","4","6","","",""
"3461227","1","3461300","","2010-08-11 17:40:43","6","4555","<p>How i can know device is connected to Wifi or 3G, programmatically</p><p>Thanks</p>","341443","","","","","2010-08-11 23:47:57","How to know device is connected to Wifi or 3G, programatically","<android><android-emulator>","1","0","3","",""
"3461519","1","","","2010-08-11 18:17:56","1","880","<p>I can now get our Android project to talk to our non-Android project. But there's still an issue:</p><ul><li><p>I are trying to have an Android class call a non Android Hello World class.</p></li><li><p>I tried compiling our non-Android Hello World class in a separate Eclipse workspace. I then packaged it into a jar. I imported that jar into our Android Hello World class.</p></li></ul><p>I then called one of the methods in the non-Android Hello World class.</p><p>When I ran the Android Hello World class as an Android application, the following runtime error occurred. Here are the Android debug logs:</p><pre><code>08-11 09:07:56.764: ERROR/AndroidRuntime(333): FATAL EXCEPTION: main08-11 09:07:56.764: ERROR/AndroidRuntime(333): java.lang.ExceptionInInitializerError08-11 09:07:56.764: ERROR/AndroidRuntime(333): at com.hello2.hello2.onCreate(hello2.java:27)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1047)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2627)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:2679)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at android.app.ActivityThread.access$2300(ActivityThr ead.java:125)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:2033)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at android.os.Handler.dispatchMessage(Handler.java:99 )08-11 09:07:56.764: ERROR/AndroidRuntime(333): at android.os.Looper.loop(Looper.java:123)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at android.app.ActivityThread.main(ActivityThread.jav a:4627)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at java.lang.reflect.Method.invokeNative(Native Method)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at java.lang.reflect.Method.invoke(Method.java:521)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:868)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:626)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at dalvik.system.NativeStart.main(Native Method)08-11 09:07:56.764: ERROR/AndroidRuntime(333): Caused by: java.lang.ExceptionInInitializerError08-11 09:07:56.764: ERROR/AndroidRuntime(333): at org.apache.log4j.Logger.getLogger(Logger.java:118)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at helloArtifactJarTest.seconddirectory.TestJar.Hello PleasePleasePrint.&lt;clinit&gt;(HelloPleasePleasePrint. java:7)08-11 09:07:56.764: ERROR/AndroidRuntime(333): ... 14 more08-11 09:07:56.764: ERROR/AndroidRuntime(333): Caused by: java.lang.VerifyError: org.apache.log4j.config.PropertySetter08-11 09:07:56.764: ERROR/AndroidRuntime(333): at org.apache.log4j.PropertyConfigurator.parseAppende r(PropertyConfigurator.java:684)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at org.apache.log4j.PropertyConfigurator.parseCategor y(PropertyConfigurator.java:647)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at org.apache.log4j.PropertyConfigurator.configureRoo tCategory(PropertyConfigurator.java:544)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at org.apache.log4j.PropertyConfigurator.doConfigure( PropertyConfigurator.java:440)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at org.apache.log4j.PropertyConfigurator.doConfigure( PropertyConfigurator.java:476)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at org.apache.log4j.helpers.OptionConverter.selectAnd Configure(OptionConverter.java:471)08-11 09:07:56.764: ERROR/AndroidRuntime(333): at org.apache.log4j.LogManager.&lt;clinit&gt;(LogManager.ja va:125)08-11 09:07:56.764: ERROR/AndroidRuntime(333): ... 16 more</code></pre><p>It seems that I can run HelloPleasePleasePrint as a Java application fine, with it properly using the log4j logger. But when we try calling a method in HelloPleasePleasePrint from the hello2 Android class, it complains about the log4j.</p><p>Any Help or references would be greatly appreciated.</p>","417594","","388299","","2010-08-28 18:04:17","2011-12-25 22:57:21","How to get Android project and std Java project to play nice?","<java><android><debugging>","2","1","","",""
"3461523","1","3461616","","2010-08-11 18:18:00","1","340","<p>I'm interested in playing around with the Android OS, but I do not need or want a phone.</p><p>It doesn't look like there are any 'non-phone' Android devices out there, so maybe there's a device that is compatible that I can flash.</p><p>Any ideas?</p>","153923","","","","","2011-01-05 17:59:34","Android Compatible Devices (non phone)","<android>","4","1","","",""
"3461528","1","","","2010-08-11 18:18:44","1","298","<p>I have a background service that is active at certain times - such as when a call comes in.  While working to optimize battery use I noticed that its onStartCommand() is being called every 10 minutes.  I wasn't doing that, so I looked...</p><pre><code>08-11 10:54:25.938: VERBOSE/com.dcd.monitor.MonitorService(32194): onStartCommand() on thread MonitorService(1)08-11 10:54:25.938: WARN/System.err(32194): java.lang.Throwable08-11 10:54:25.938: WARN/System.err(32194):     at com.dcd.monitor.MonitorService.onStartCommand(MonitorService.java:83)08-11 10:54:25.938: WARN/System.err(32194):     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3053)08-11 10:54:25.938: WARN/System.err(32194):     at android.app.ActivityThread.access$3600(ActivityThread.java:125)08-11 10:54:25.938: WARN/System.err(32194):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2096)08-11 10:54:25.938: WARN/System.err(32194):     at android.os.Handler.dispatchMessage(Handler.java:99)08-11 10:54:25.948: WARN/System.err(32194):     at android.os.Looper.loop(Looper.java:123)08-11 10:54:25.948: WARN/System.err(32194):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-11 10:54:25.948: WARN/System.err(32194):     at java.lang.reflect.Method.invokeNative(Native Method)08-11 10:54:25.948: WARN/System.err(32194):     at java.lang.reflect.Method.invoke(Method.java:521)08-11 10:54:25.948: WARN/System.err(32194):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-11 10:54:25.958: WARN/System.err(32194):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-11 10:54:25.958: WARN/System.err(32194):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Now why might that happen?  (it does have a partial wakelock on it). hmm something tells me this is staring me in the face but I'm not getting it.</p><p>Seems to me I recall reading that it's inefficient to start stuff unless needed :)</p><p>Thanks..</p>","294973","","","","","2010-08-11 18:18:44","Android service called periodically by the system?","<android><service><battery>","0","2","","",""
"3461743","1","3461896","","2010-08-11 18:46:50","2","5583","<p>I am making an app where the user can set an alarm based on GPS location. I only want 1 alarm to be active at any one time. So, when the user sets a 2nd alarm, I want to cancel the notification for the 1st alarm (then set a new notification for the 2nd alarm).</p><p>Right now, my notifications continue to stack up (as in I can't delete them, so they are all active). Here is my code where I am trying to delete the alarm and notification(s):</p><pre><code>// Stop the location alarm activityIntent intentAlarmService_delete = new Intent(v.getContext(), AlarmService.class);stopService(intentAlarmService_delete); // I think this calls onDestroy() in AlarmService class ...mNtf = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);mNtf.cancelAll();Intent alarmIntent2 = new Intent(getApplicationContext(), OneTimeAlarmReceiver.class);PendingIntent pendingIntentAlarm = PendingIntent.getBroadcast(getApplicationContext(), PENDING_INTENT_REQUEST_CODE1,     alarmIntent2, PendingIntent.FLAG_CANCEL_CURRENT);pendingIntentAlarm.cancel();</code></pre><p>This is the onDestroy() function in my AlarmService.class (I'm not really sure when this is called...)</p><pre><code>public void onDestroy(){    super.onDestroy();    mNtf.cancel(NOTIFICATION_ID1);    Intent alarmIntent = new Intent(getApplicationContext(), OneTimeAlarmReceiver.class);    PendingIntent pendingIntentAlarm = PendingIntent.getBroadcast(getApplicationContext(), PENDING_INTENT_REQUEST_CODE1,         alarmIntent, PendingIntent.FLAG_CANCEL_CURRENT);    pendingIntentAlarm.cancel();    Intent intentAlarmService = new Intent(getApplicationContext(), AlarmService.class);     stopService(intentAlarmService);     mNtf.cancel(NOTIFICATION_ID1);    mNtf.cancelAll();}</code></pre><p>Then, this is how I am setting a new alarm and notification:</p><pre><code>Intent intentAlarmService2 = new Intent(v.getContext(), AlarmService.class);startService(intentAlarmService2);</code></pre><p>By the way, my AlarmService.class is working for sure.</p><p>Thanks in advance.</p>","399717","","","","","2010-08-11 19:09:38","How to cancel Android notifications?","<android>","2","0","2","",""
"3461793","1","3462224","","2010-08-11 18:53:29","3","4817","<p>I want to create an input box with a submit button to the right. Between them they should span the width of the screen. Currently I have:</p><pre><code>LinearLayout row= new LinearLayout(context);row.setOrientation(HORIZONTAL);row.setGravity(Gravity.RIGHT);EditText input = new EditText(context);Button submit = new Button(context);submit.setText(""Submit"");row.addView(submit);row.addView(input,LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT);myView.addView(row,LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT);</code></pre><p>This results in the correct distribution of space: The submit button taking up as much space as it needs, the input button taking up the remaining space, however they are the wrong way round (the submit button is on the left, despite setting the gravity). If I take away the gravity, and reverse the order of adding the elements to the row, the input box takes up the whole width of the screen, and the submit button is not visible. What am I doing wrong?</p>","319618","","","","","2010-08-11 20:48:06","LinearLayout filled from Right to Left","<java><android>","4","0","2","",""
"3461811","1","3461829","","2010-08-11 18:56:29","2","492","<p>When developing on BlackBerry or iOS, you can deploy your application just by dropping the compiled code into a special directory, and when the simulator boots up it will check that directory and install any apps that it finds there.  Is this possible for Android?</p><p>The reason this feature is desirable is because my build system deploys builds nightly.  I want the emulator ready to go when my QA team gets in the next morning.  To do that, I have to write a script that boots up the emulator, waits for it to start up, then calls <code>adb install</code> and finally shuts down the emulator.  It would be great if I could just drop the .apk in a directory and have it ready to go the next time QA boots up the emulator.</p><p><strong>Edit:</strong><br>Someone asked for the script I described above.  It's unfortunately written in Perl, but here it is:  <a href=""http://pastebin.com/6UcNgYRs"" rel=""nofollow"">http://pastebin.com/6UcNgYRs</a></p><p><strong>Edit 2:</strong>I just found an awesome little command that can help you if you're trying to write a script like the one I mentioned above. You can have your script wait for the emulator to come online with the command <code>$ adb wait-for-device</code>!!</p>","213525","","213525","","2011-04-17 02:17:38","2011-04-17 02:17:38","Install an apk without starting the emulator","<android><android-emulator>","2","3","","",""
"3461951","1","3462629","","2010-08-11 19:14:48","1","1729","<p>I am making an app that allows the user to set an alarm based on GPS locations. I am having problems deleting the notifications I create and the alarms I set.</p><p>I have found that all the notifications and alarms are deleted permanently when I use the ""Advanced Task Killer App"". I want to implement whatever it does into my app. Does anyone know what this app does and/or where I can find the source code?</p><p>Thanks in advance.</p>","399717","","","","","2010-12-22 04:09:14","How does the Android ""Advanced Task Killer App"" work?","<android>","2","3","1","",""
"3461967","1","10129444","","2010-08-11 19:16:57","4","2590","<p>Is it possible to check if an Android device is connected to a VPN server?<a href=""http://developer.android.com/search.html#q=vpn&amp;t=0"">A search in the API</a> provides 'paltform highlights' for Android 1.6, so that doesn't fill me with much confidence.</p>","320837","","","","","2012-04-12 18:19:57","Get VPN Connection status on Android","<android><vpn>","1","1","1","",""
"3462021","1","","","2010-08-11 19:23:55","0","414","<p>I want to create a multiple line editview to enter in some notes. I want the text aligned top left and 4 rows.  How do I create that in layout xml file.  Assume I am using a linearview.</p><p>thanks,Dean</p>","412317","","","","","2010-08-11 19:34:37","Multiple Line Editview in layout XML","<android>","1","0","","",""
"3462037","1","","","2010-08-11 19:25:17","6","1676","<p>I have searched for references on this issue but all of my attempts have been unsucessful so far. I would like to know to what extent does Android supports the OMA DRM specification? Does anyone knows of a reference that states what can be expected from different versions of Android?</p><p>It seems that this specification is actually less supported with newer versions of Android (Eclair, Froyo) than it is with older version (Cupcake). For example, in my tests with download descriptors, the devices using Cupcake could download correctly while the devices using Froyo and Eclair showed the DD as xml. </p><p>In similar fashion, can we expect the support of the OMA DRM spec. to be the same for all devices running a given version of Android or does it vary with each device? (In different words: is the version of Android tailored for each device by the manufacturer)</p>","417645","","","","","2011-11-01 05:32:25","What is the situation with Android support for OMA DRM?","<android><drm>","1","0","2","",""
"3462107","1","3462231","","2010-08-11 19:33:46","1","5568","<p>I'm creating a ListActivity.  In each list item I have a View I've created which contains a RatingBar and an EditText.  In the screenshot at the bottom, you can see the virtual keyboard contains a returnline key and no ""Done"" key.  I would like to specify a different style of keyboard to use (and hopefully retain the spell checking bar).  I would like my virtual keyboard to have a ""Done"" key instead of a return key.  Can I set the style of virtual keyboard I'm wanting in the EditText's XML?  If so, how?</p><p>Thanks for your help</p><p><img src=""http://i38.tinypic.com/20t2o7r.png"" alt=""alt text""></p>","406790","","","","","2010-08-11 19:49:30","Specifying virtual keyboard type for EditText in XML","<android><edittext><virtual-keyboard>","2","0","","",""
"3462265","1","3462806","","2010-08-11 19:53:32","8","5515","<p>The default behavior of <code>ExpandableListView</code> is to collapse a group when its header is clicked.  Is it possible to prevent this from happening?</p><p>I've tried:</p><ul><li>Setting <code>OnTouchListener</code> on the list.  This interferes with scrolling.</li><li>Setting an <code>OnGroupClickListener</code> on the list (in <code>onCreate()</code>).  This works for all clicks <em>after</em> the first.</li></ul><p>Has anyone else accomplished this?  Why might the <code>OnGroupClickListener</code> miss the first click?</p><p>Thanks in advance for your suggestions.</p>","401774","","","","","2012-11-12 16:03:57","Disable collapsing of ExpandableListView","<android><android-widget><expandablelistview>","3","2","0","",""
"3462268","1","","","2010-08-11 19:53:45","0","366","<p>I'm using the Android Emulator during my Android application development. Unfortunately I think my computer is a bit slow so the emulator get some kind of timeout before several processes running in the emulator respond (at least that is what I think happen according to other threads here on stackoverflow). </p><p>This result in dialogs popping up saying "" is not responding"" with the kill/wait buttons. </p><p>My question is if it's possible to set some parameter in the emulator or something, to extend the timeout before the android system emulated thinks the process is not responding. Another (not so satisfying) way could be if I could get the emulator to always answer wait when these dialogs popup.</p>","287170","","","","","2010-08-11 19:53:45","Is it possible to prevent <processname> is not responding dialogs in Android emulator","<android><android-emulator>","0","5","","",""
"3462350","1","3730929","","2010-08-11 20:05:19","1","595","<p>I have a <code>ListActivity</code>.  Each item in the <code>ListView</code> contains a <code>RatingBar</code>.  When the user manipulates the <code>RatingBar</code>, I want to update the corresponding data attached to the Adapter.</p><p>Unfortunately, inside my <code>RatingBar</code> handler, I can't refer to the position variable.  I understand why.  I'm just having trouble finding a way around it.</p><p>How would I handle what I'm trying to do here?</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    // grab view    View v = convertView;    // set view layout    if (v == null) {        LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);        v = vi.inflate(R.layout.layout_rating_ratingbubble, null);        RatingBar r = (RatingBar)v.findViewById(R.id.rating_rating);        if (r != null) {            r.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {                    public void onRatingChanged(RatingBar ratingBar, float rating,                            boolean fromUser) {                        // CANT REFER TO position HERE                        m_items.get(position).setRating((int)rating);                    }                });        }</code></pre>","406790","","406790","","2010-08-11 20:31:11","2010-09-16 21:22:43","Altering Adapter data","<android><listview><listactivity>","3","1","","",""
"3462367","1","","","2010-08-11 20:08:36","3","4451","<p>I am trying to use the SDK's DDMS utility to capture screens off my Droid X.</p><p>I have installed the Java JDK and the Android SDK. I set up the USB driver on my Windows laptop and connected my Droid X to the USB port. Windows XP can see the Droid just fine in Windows Explorer as a removable USB device, but the DDMS utility shows no devices.</p><p>Running ""adb devices"" in a DOS window lists no devices either.</p><p>Yes, the java.exe location has been added to my PATH.Yes, the Droid is set to allow USB debugging.</p><p>So why can't DDMS see my phone?</p>","417680","","","","","2011-12-13 12:46:04","Connecting my Android phone to the DDMS SDK utility","<android><screenshot><device>","4","0","1","",""
"3462431","1","3462739","","2010-08-11 20:15:51","6","2870","<p>I have an Android App with 2 activities. I have the following in the <code>AndroidManifest</code>:</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""false""&gt;    &lt;activity android:name="".MyCellTracker"" android:label=""@string/activity1_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt; &lt;activity android:name="".DisplaySuccess"" android:label=""@string/activity2_name""&gt;&lt;/activity&gt;</code></pre><p>The activities are properly named, yet the application is using the project name rather than the <code>android:label</code> (@string/app_name) I have given it. If I go to delete the application, then I see that it is named using the <code>android:label</code>. Why is the name that is displayed under the icon on the program launcher not using <code>android:label</code> in the application node?</p>","125615","","119895","","2010-08-11 20:27:03","2010-08-11 20:53:06","How to name Android Application","<android>","2","0","1","",""
"3462505","1","","","2010-08-11 20:25:59","4","828","<p>I've tried to find any info on that subject; can't find anything. Strikes me as odd, since <kbd>JDO</kbd> sounds like the kind of thing smartphones should be very good at doing. </p><p><em>Do you know if <kbd>JDO</kbd> is possible at all on Android devices, natively, or with external apps/libraries?</em></p>","417691","","1543541","","2014-01-24 05:29:34","2014-01-24 05:29:34","Use JDO in Android","<android><jdo>","1","1","1","",""
"3462581","1","3462970","","2010-08-11 20:35:38","0","488","<p>In Android 1.6 and higher, this menu XML inflates and runs fine. But when run in 1.5 I get an error about a resource not found.</p><p>I find that when I remove the <strong>@drawable/menu_preferences</strong> from the XML in 1.5 it works fine.</p><p>Is there a 1.5 work around I can do to get the image to work?</p><p>EDIT: The image is in the <strong>drawable-mdpi</strong> folder.</p><pre><code>&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item         android:id=""@+id/menu_settings""        android:title=""@string/settings""        android:icon=""@drawable/menu_preferences"" /&gt;&lt;/menu&gt;</code></pre>","172861","","172861","","2010-08-11 20:52:33","2010-08-11 21:25:13","Android 1.5 Menu Inflator didn't find Image","<android><menu>","2","0","","",""
"3462582","1","5346347","","2010-08-11 20:35:51","6","3314","<p>I'd like to display the favicon of the website I am accessing via the android.webkit.WebView.  I've tried two ways to get it:</p><p>1) <code>WebViewClient.onPageStarted()</code> method has a favicon parameter that is always null.</p><p>2) <code>WebChromeClient.onReceivedIcon()</code> method is never called.</p><p>3) Called <code>WebView.getFavicon()</code> in <code>onPageStarted()</code> and <code>onPageFinished()</code> but it always returns null.</p><p>I haven't been able to find an example online that shows how to access the favicon.  Any hints would be greatly appreciated.</p>","244104","","244104","","2010-08-12 18:34:30","2011-03-17 23:02:43","Display the Android WebView's favicon","<android><favicon>","2","2","4","",""
"3462609","1","3462646","","2010-08-11 20:38:35","6","7948","<p>The automatic generation of the R class does not work anymore. I have tried Project -> Clean...A warning on all xml files has also showed up: “No grammar constraints (DTD or XML schema) detected for the document.” Maybe that is why the code generation have stoped. Any idea how to get the R class generated again?</p>","199138","","","","","2013-08-05 09:09:35","No R class is generated","<android><eclipse>","8","1","4","",""
"3462642","1","","","2010-08-11 20:42:08","2","1504","<p>As a webapp, not a native app on the iPhone or Andriod. Is it possible to draw with your finger? If so, how?</p><p>Anyone have or can provide a barebone simple example that just loads a blank page?</p><p>Thanks</p>","149080","","","","","2012-01-02 23:18:12","How to Draw with your Finger on an iPhone Web App HTML5 - Is it possible?","<iphone><android><html5><web-applications>","2","1","1","",""
"3462690","1","3464631","","2010-08-11 20:47:28","1","605","<p>I have a Image button which doubles as a play and stop button. I need the image in the button to change when the user click on it the first time, so that it now looks like a stop button. But this won't happen till the thread completes playing the song.</p><pre><code>ImageButton Sound;public void onClick(View v) {    selectRandomSong();    Sound.setBackgroundResource(R.drawable.stop);    v.invalidate();    if(playing)        stop();    else        play();    Sound.setBackgroundResource(R.drawable.play);}</code></pre><p><code>setBackground</code> wont reflect on the view as the invalidation does not occur. Where and how should I invalidate this?</p>","417698","","133203","","2010-08-11 21:11:25","2010-08-12 03:52:07","on android play button Icon wont change till the song is completely played","<android>","1","5","","",""
"3462843","1","3463127","","2010-08-11 21:06:59","7","7669","<p>I am trying to understand the intents that get launched when the device is unlocked. </p><p>For eg: Say my activity is running, and I press the power button (screen off, to lock the phone). INTENT.ACTION_SCREEN_OFF is launched. The activity is paused and the screen goes blank. </p><p>Now, when I press the power button again (INTENT.SCREEN_ON gets launched), the activity's onResume method is called. But the device is not yet unlocked. </p><p>What happens when the device is unlocked? To put it simply, what is the intent's action and category?</p>","400622","","","","","2010-08-11 21:49:04","Android -- What happens when device is unlocked?","<android><action><android-intent><category><unlock>","1","0","3","",""
"3462850","1","3463988","","2010-08-11 21:07:47","3","3800","<p>I have never used JUnit before, and now I'm trying to set it up on an Android project.</p><p>My project under test is fairly complex, including some JNI, but my test project, at the moment, is completely trivial.  I have found many examples (that look totally different) online of how to make a test project, but it seems that no matter which one I follow, I get the same results.</p><p>Here's my JUnit project code:</p><pre><code>package com.mycompany.myproject.test;import android.test.AndroidTestCase;public class SimpleTestCaseExample extends AndroidTestCase {    public void test_testOne() {        fail(""Just Always Fail"");    }}</code></pre><p>When I run, I see the following in Logcat:</p><pre>stdout    INSTRUMENTATION_STATUS: numtests=2stdout    INSTRUMENTATION_STATUS: test=test_testOnestdout    INSTRUMENTATION_STATUS_CODE: 0stdout    INSTRUMENTATION_STATUS: id=InstrumentationTestRunnerstdout    INSTRUMENTATION_STATUS: current=2stdout    INSTRUMENTATION_STATUS: class=com.mycompany.myproject.test.SimpleTestCaseExamplestdout    INSTRUMENTATION_STATUS: stream=stdout    INSTRUMENTATION_STATUS: numtests=2stdout    INSTRUMENTATION_STATUS: test=testAndroidTestCaseSetupProperlystdout    INSTRUMENTATION_STATUS_CODE: 1stdout    INSTRUMENTATION_STATUS: id=InstrumentationTestRunnerstdout    INSTRUMENTATION_STATUS: current=2stdout    INSTRUMENTATION_STATUS: class=com.mycompany.myproject.test.SimpleTestCaseExamplestdout    INSTRUMENTATION_STATUS: stream=.stdout    INSTRUMENTATION_STATUS: numtests=2stdout    INSTRUMENTATION_STATUS: test=testAndroidTestCaseSetupProperlystdout    INSTRUMENTATION_STATUS_CODE: 0stdout    INSTRUMENTATION_RESULT: stream=stdout    Test results for InstrumentationTestRunner=..stdout    Time: 0.07stdout    OK (2 tests)stdout    INSTRUMENTATION_CODE: -1</pre><p>But, I get the following in the Console:</p><pre>Launching instrumentation android.test.InstrumentationTestRunner on device emulator-5554Collecting test informationTest run failed: No test results</pre><p>I have tried a variety of different things, messing with the basic TestCase class, or the TestSuite class, or a variety of other options.  I tried to just go for the most trivial example because I'm really still trying to learn how this works.</p><p>Whatever I try, I see this error.</p><p>Any suggestions would be appreciated!</p><p>If I'm missing some critical information, please let me know and I'll update.</p>","397155","","","","","2010-08-12 01:00:45","Trying to run trivial Android JUnit tests. Getting: ""Test run failed: No test results"" What am I missing?","<java><android><junit>","1","0","2","",""
"3462910","1","","","2010-08-11 21:15:40","2","1569","<p>I've created a custom toolbar using a gradient inside a shape.  It looks very nice, but since we only have the option for 3 colors (startColor, centerColor, endColor) it looks very round.  I would like to do a glass effect, which requires a sharp change in color in the middle.  Basically I need 4 colors (startColor, justabovecenterColor, justbelowcenterColor, endColor).  Now I could have two shapes sitting on top of each other to get this effect, but I don't want to do this.  I'm getting into some tricky UI customization here and that would be very difficult to manage on different sized screens.</p><p>Does anyone know how I can create a glass effect?</p>","406790","","","","","2013-11-29 13:30:04","Shape glass effect","<android><gradient><shapes><shape>","3","0","1","",""
"3462968","1","","","2010-08-11 21:24:59","6","8045","<p>In Android 2.1, to unpair a bluetooth device you can go to Bluetooth settings, long-click on a device and select Unpair to unpair that device. I want to be able to do this from my application. I can retrieve a list of paired/bonded devices using <a href=""http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#getBondedDevices%28%29"">BluetoothAdapter.getBondedDevices()</a>, but I can't find how to unpair. I've explored the BluetoothChat sample, and I've searched the sdk but still can't find an API that allows this.</p><p>How can I unpair a bluetooth device?</p><p>TIA,Jack</p>","417738","","","","","2012-11-14 15:33:57","How to unpair bluetooth device using android 2.1 sdk","<android><bluetooth>","3","0","10","",""
"3463052","1","3633766","","2010-08-11 21:38:09","0","1853","<p>Currently I am going through a Sams learn Android SDK in 24 hours book and cannot get past the first hour because of the problems.</p><p>As I mentioned before, I have read all suggestions I could find on the gen folder error and I have done the clean without the build all, I have removed gen and then did a build all, I have  set the permissions on this folder to be NON read only and made sure that the version of SDK is ticked under the Java Build path option on the projects properties.</p><p>This is a clean install of eclipse and Androids SDK and I have followed the instructions carefully. </p><p>In addition to this, I find eclipse/Androids SDK unstable, for example, double clicking on the strings.xml causes eclipse to lock up and then I have to reboot or shutdown. As and when I do get to the Android Resources screen for the strings.xml I get this error:</p><blockquote>  <p>java.lang.NullPointerException</p></blockquote><p>Please can someone help as I really want to learn this language but at the moment, not getting any further than hello world!!!.</p><hr><p>Ryan thanks for your reply . When I first installed eclipse it was on 3.5. With the adk isn't this installed via the eclipse install new software option via the window menu in eclipse ? </p><p>The book is fairly current as it talks about 2.1 of Android and I have followed googles and the instructions from the book and see no differences . When I first installed this all I followed googles instructions and I hit the.java build issue and it locking up. I then decided to install it again from scratch and.following the book downloaded eclipse IDE java ee developers </p><p>To Mike - not that I have notice, you don' think it is a virus do you?</p><p>Latest on this matter - I have installed 3.5 non EE version and although I do not get the build errors anymore, I still find the eclipse interface to hang on occasions.</p>","417752","","212218","","2011-12-28 21:23:21","2013-04-09 08:05:10","Troubleshooting java.lang.NullPointerException in Android SDK tutorial exercise","<android><eclipse><sdk>","3","4","","",""
"3463074","1","","","2010-08-11 21:40:16","1","1675","<p>I have a <code>BroadcastReceiver</code> that works fine, i.e. executing this code from an Activity, the receiver receives the intent:</p><pre><code>Intent toggleIntent = new Intent(this, ToggleServicesReceiver.class);this.sendBroadcast(toggleIntent);</code></pre><p>But I am trying to do the same from a button in a Widget:</p><pre><code>public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {      ...    Intent toggleIntent = new Intent(context, ToggleServicesReceiver.class);    PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, toggleIntent, PendingIntent.FLAG_UPDATE_CURRENT);    remoteView.setOnClickPendingIntent(R.id.widget_button, pendingIntent);}</code></pre><p>The code is called (I've checked it with the debugger), but when the user clicks the button, the same <code>BroadcastReceiver</code> does not receive the <code>Intent</code>.</p><p>What could be happening?</p><p><strong>Edit</strong>: The <code>BroadcastReceiver</code> is defined in <code>AndroidManifest.xml</code>, and now I'm not sure if the <code>&lt;intent-filter&gt;</code> is needed:</p><pre><code>&lt;receiver android:name=""foo.receivers.ToggleServicesReceiver""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""foo.intent.action.SERVICES_TOGGLE"" /&gt;    &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p><strong>Edit</strong>: I've also found this in a forum, it could be related with this problem</p><blockquote>  <p>You simply can not do this.  A  BroadcastReceiver component only  ""lives"" for the duration of the call  to onReceiveIntent(); it is not  allowed to use registerReceiver in it,  because by the time you return from  that method (at which point you could  first receive anything from your  register), the component is no longer  alive, and the system could kill at  any time to reclaim memory.</p></blockquote>","12388","","12388","","2010-08-12 15:09:12","2010-08-22 11:28:56","Android : Receive custom broadcast when a button in a widget is clicked","<android><android-widget><broadcastreceiver>","1","2","","",""
"3463154","1","3463419","","2010-08-11 21:52:59","0","763","<p>I need to design a grid of 2x30 buttons on the screen with labels of names. </p><p>What's the best layout-way to create the 2 groups of buttons given the button info/color/title will be populated from a database.</p><p>I was thinking a TableLayout perhaps, then in code create the buttons and add them to cells?</p>","172861","","","","","2010-08-11 22:39:06","Android: Design option for grid of buttons?","<android><layout>","1","1","","",""
"3463317","1","3463449","","2010-08-11 22:21:27","0","1963","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3590955/intent-to-launch-the-clock-application-on-android"">Intent to launch the clock application on android</a>  </p></blockquote><p>I have a widget that displays the time and if one taps on it, it launches the com.android.alarmclock/.AlarmClock activity with an <code>PendingIntent</code>.  This works great before-Froyo, but with Froyo, I have to launch the com.android.deskclock/.AlarmClock.  So I want to put in code that checks for the class existence and launch the appropriate activity/intent.  Here is what I tried, but it does not work.</p><pre><code>Intent alarmIntent = new Intent();try {    if (Class.forName(""com.android.deskclock.AlarmClock"") != null) {    Log.i(TAG, ""setting deskclock alarm -- must be Froyo!"");    alarmIntent.setClassName(""com.android.deskclock"",        ""com.android.deskclock.AlarmClock"");    }} catch (ClassNotFoundException e) {    Log.i(TAG, ""setting alarmclock alarm -- must be Eclair!"");    alarmIntent.setClassName(""com.android.alarmclock"",        ""com.android.alarmclock.AlarmClock"");}PendingIntent pendingIntent = PendingIntent.getActivity(context, REQUEST_UPDATE_TIME_NOW,    alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);views.setOnClickPendingIntent(R.id.text_timeofday, pendingIntent);</code></pre><p>It always thinks it is ""Eclair"" and therefore fails on Froyo.  Is this the best approach, or should I check the application-level?  I prefer to work with the class existence.</p>","157804","","995926","","2012-05-05 13:42:39","2012-05-05 13:42:39","How does one launch android version dependent alarm clock?","<android><class><android-2.2-froyo><alarms>","1","1","","2012-07-12 12:14:13",""
"3463328","1","3463486","","2010-08-11 22:23:34","0","852","<p>How i can display custom error message before foreclose or Application not responding message will happen for an application.</p><p>Or</p><p>Can i display Custom message like ""Please wait....."" instead of Application not responding message.</p><p>Thank you </p>","341443","","","","","2011-10-16 22:25:23","How to display Custom message before force close or ANR message will occur","<android><android-emulator>","2","0","","",""
"3463347","1","3463617","","2010-08-11 22:27:21","1","184","<p>I've tried this and it works, but I didn't know if this was a bad thing or not, as all the help on data transfers between Activities seems to use intents.</p><p>In MainActivity I have:</p><pre><code>static PilotRecord pilotRecord = new PilotRecord(); //PilotRecord just contains data item declarations</code></pre><p>In MainActivity.onCreate:</p><pre><code>pilotRecord.fuel = 100;</code></pre><p>In MainActivity.onClick:</p><pre><code>Intent intent = new Intent(this, SubActivity.class);startActivityForResult(intent, 0);</code></pre><p>In SubActivity.onCreate I have:</p><pre><code>MainActivity.pilotRecord.fuel = 200;</code></pre><p>In SubActivity.onClick:</p><pre><code>MainActivity.pilotRecord.fuel = 300;setResult(RESULT_OK);finish();</code></pre><p>When I start MainActivity, the fuel value is 100</p><p>If I click in MainActivity, SubActivity is displayed, as expected</p><p>If I click in SubActivity, MainActivity is displayed and the fuel value is now 300</p><p>If I press the Back button, MainActivity is displayed and the fuel value is now 200</p><p>Does anyone know of any potential issues with this as it seems simpler to me than setting up intents etc.</p><ul><li>Frink</li></ul>","131209","","","","","2010-08-12 00:48:09","Can I update data members in one Activity from another Activity in the application?","<java><android>","2","0","","",""
"3463491","1","3463644","","2010-08-11 22:53:14","2","1171","<p>I put a MapView inside a ScrollView.</p><p>Also, I added zoom control to the map view</p><pre><code> mapView.setBuiltInZoomControls(true);</code></pre><p>The ScrollView scrolls correctly, but when I click on the MapView, the zoom control is not displayed. (for most of the time). Normally, the zoom control should show at botton of map view.</p><p>It seems Android confused with touch (or click) event on MapView and ScrollView.</p><p>I'd like to be able to <strong>'focus'</strong> the mapview, and shows the zoom control.</p><p>I've tried to disable the scrolling ability of ScrollView, but it doesn't work.</p><p>Any suggestion?</p><p>Thanks a lot</p>","399820","","399820","","2012-06-25 23:36:26","2012-06-25 23:36:26","MapView inside ScrollView doesn't show zoom controls","<android>","2","0","","",""
"3463504","1","","","2010-08-11 22:58:01","0","1501","<p>Im displaying a notification when app running. For any reason app showed force close message, which closes the app after clicking the force close button, I need to remove the app icon from notification area.</p><p>Please guide me hw i can do this.</p>","341443","","","","","2011-10-12 18:07:03","Remove notification when force close message occured","<android><android-emulator>","2","0","","",""
"3463864","1","","","2010-08-12 00:24:44","0","963","<p>The Android phones have a setting that allows you to force the notification volume to match the ringer volume, I can't seem to find that setting anywhere in SDK, can someone help me find out how to get and set it that specific setting?</p>","417850","","","","","2010-08-12 07:33:32","Android notification and ringer volumes, a question","<android><volume>","1","0","1","",""
"3463875","1","3463933","","2010-08-12 00:27:43","1","595","<p>Froyo apps2sd, can a widget go app2sd, once usb is mounted widget gets uninstalled, you unmount the usb it never enables again, tried enabling it programatically, no luck, can any body help</p>","392574","","995926","","2012-05-05 13:44:14","2012-05-05 13:44:14","Froyo apps2sd, can a widget go app2sd","<android><widget><usb><android-2.2-froyo>","1","0","1","",""
"3463934","1","3464120","","2010-08-12 00:46:39","1","4473","<p>I want to create a progressBar for an FTP download. The server where I am downloading the file has all of its directories and files hidden. I want to display the progress of the download. Is there any way I can get the file size? Here is my current code:</p><pre><code>   FTPclient = new FTPClient();               FTPclient.setListHiddenFiles(true);               FTPclient.connect(hostPart);               FTPclient.login(userName, passWord);               FTPclient.setFileType(FTP.BINARY_FILE_TYPE);                InputStream instream = FTPclient.retrieveFileStream(pathExcludingHostIncludingFirstSlash);            int l;            byte[] tmp = new byte[2048];            int updateCounter = 0;            int bytesDownloaded = 0;            while ((l = instream.read(tmp)) != -1) {                fos.write(tmp, 0, l);                bytesDownloaded+=2048;                updateCounter++;                if(updateCounter==3){                    kilobytesDownloaded=(bytesDownloaded / 1024);                    publishProgress((String[])null);                    updateCounter=0;                }</code></pre>","325081","","","","","2013-05-16 20:48:14","Getting FileSize before InputStream","<java><android><ftp><download><progress-bar>","2","1","1","",""
"3463993","1","3465766","","2010-08-12 01:02:05","0","459","<p>I split my inner View class from my Main class into its own file. In my main class, I have the view set as an onTouchListener which records user movement into a matrix so it can translate and scale the view. After separating it everything works but im unsure how to pass the matrix to the View for onDraw to update. Any suggestions? Thanks</p>","385051","","","","","2010-08-12 08:00:59","passing variables to an outside class","<android><view><matrix><surfaceview><ondraw>","1","0","","",""
"3464045","1","","","2010-08-12 01:14:38","6","1499","<p>I'm working on an app that launches the browser activity to perform a Twitter OAuth authorization.  This process uses a callback url which will re-launch the activity that started the browser activity in the first place.</p><p>My problem is that the browser pages remain in the history stack and when the user then clicks back from the preferences activity that launched the browser in the first place, they don't go back to the app's main activity, but instead are brought back to the browser.  I've tried adding flags to the launching intent to prevent history and reset on clear, but it doesn't seem to work when running on my phone, only on the emulators.</p><p>Here is the code I'm using to launch the browser activity:</p><pre><code>                Intent webIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl));            webIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);            webIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);            webIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);            ctx.startActivity(webIntent);</code></pre><p>Anyone have any idea what might be wrong? </p>","417876","","","","","2012-12-11 06:23:40","Opening browser activity, but prevent it from being in the activity history","<android>","4","0","3","",""
"3464198","1","3464223","","2010-08-12 01:49:42","0","495","<p>This is a very simple issue. I'm trying to put a link to an email address in a TextView, using Html.fromHtml.</p><pre><code>body.setText(Html.fromHtml(""&lt;a href=\""mailto:emailaddress+subaddress@gmail.com\""&gt;Contact&lt;/a&gt;""));</code></pre><p>When that link is clicked, a new email is addressed to ""emailaddress subaddress@gmail.com"". Notice that the plus symbol has disappeared. I've tried this:</p><pre><code>body.setText(Html.fromHtml(""&lt;a href=\""mailto:emailaddress""+'+'+""subaddress@gmail.com\""&gt;Contact&lt;/a&gt;""));</code></pre><p>and</p><pre><code>body.setText(Html.fromHtml(""&lt;a href=\""mailto:emailaddress&amp;#43;subaddress@gmail.com\""&gt;Contact&lt;/a&gt;""));</code></pre><p>to the same result.</p><p>Anyone know how I can get the link to work correctly?</p>","320837","","","","","2010-08-12 01:57:05","Gmail subaddressing ('plus sign' addressing) in Android","<android>","1","0","","",""
"3464293","1","3866310","","2010-08-12 02:15:47","2","6459","<p>I have a <code>Service</code> that creates <code>AsyncTask</code>s for downloading files. In activities, we create <code>Runnable</code>s or <code>Thread</code>s that we pass to <code>Activity.runOnUiThread()</code>. I can't access that method from a service, so how do I use <code>AsyncTask</code> correctly, (do heavy work without blocking the UI Thread)?</p>","325081","","","","","2010-10-05 17:52:31","How to Create/Run AsyncTask in Service without runOnUiThread()","<android><multithreading><blocking><android-asynctask><android-service>","1","0","2","",""
"3464307","1","3464805","","2010-08-12 02:17:16","2","5958","<p>I am trying to get input stream from something like this.</p><pre><code>InputSource myInputSource = new InputSource(activity.getResources().openRawResource(com.MYCLass.R.xml.programs));myXMLReader.parse(myInputSource);</code></pre><p>and then call parse on the parser instance i Created. Some how i get nothing.<br>Works fine if I use a server XML.... </p>","417910","","1665095","","2013-07-04 08:16:04","2013-09-22 17:25:01","How to read local xml file is resource folder as a input stream in android?","<android><xml><local>","2","0","3","",""
"3464599","1","3467952","","2010-08-12 03:42:36","3","2749","<p>I have an ExpandableListView bound to a SQLite database. To simplify things, lets assume the database contains two columns: <code>title</code> and <code>body</code>. In the ExpandableListView, there is a <code>group</code> for each <code>title</code>, and a <code>child</code>for each corresponding <code>body</code>.</p><p>Now to make things more interesting, some of the rows in the SQLite database do not have a <code>body</code> (that is... they only have a <code>title</code>). As you can see, if there is no body, then there is no reason to expand the group... because the child will be empty (i.e. String <code>body == """"</code>).</p><p>I'm searching for a way to catch a situation like this, and skip the group's expansion. I don't want a blank child to be expanded. To put it in psuedo code, I want something like this:</p><pre><code>if (body.getText() == """") {  //DO NOT EXPAND  //DO OTHER STUFF}</code></pre><p>Any suggestions?</p>","382252","","","","","2010-08-12 13:08:54","ExpandableListView - Is conditional expansion possible?","<android><expandablelistview>","1","0","0","",""
"3464636","1","3473645","","2010-08-12 03:53:19","9","6591","<p>Edit: Okay, I found a solution. Don't know that it's the proper solution, but it does work correctly. Added to the code below.</p><p>I'm trying to allow a user to select a number of directories from a checklist, and return them upon clicking a ""Submit"" button. Here's a snippet of my code. It populates the ListView with all the directories on /sdcard/, and for the initial selection (of however many I pick) when I submit, the log shows the correct choices returned. However, if I uncheck an item, and click ""Submit"" again, it still shows as if all are selected. Do I need to write a handler to uncheck an item? I thought that was taken care of by the choiceMode selection? Thanks!</p><pre><code>private SparseBooleanArray a;    directoryList.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_multiple_choice, directoryArray));    submitButton = (Button)findViewById(R.id.submit_button);    submitButton.setOnClickListener(new OnClickListener()        {        @Override        public void onClick(View v)        {            a = new SparseBooleanArray();            a.clear();            a = directoryList.getCheckedItemPositions();            for (int i = 0; i &lt; a.size(); i++)            {                //added if statement to check for true. The SparseBooleanArray                //seems to maintain the keys for the checked items, but it sets                //the value to false. Adding a boolean check returns the correct result.                                    if(a.valueAt(i) == true)                    Log.v(""Returned "", directoryArray[a.keyAt(i)]);            }                        }    });</code></pre>","321697","","321697","","2010-08-13 03:14:15","2011-12-08 08:08:07","Returning values from multiple selection ListView","<android><listview><multiple-select>","4","0","4","",""
"3464724","1","","","2010-08-12 04:14:01","6","780","<p>Continuing with the question referred in the following link:</p><p><a href=""http://stackoverflow.com/questions/3380761/how-can-i-capture-when-time-changes-in-a-timepicker-if-the-keyboard-is-being-used/"">How can I capture when time changes in a TimePicker if the keyboard is being used?</a></p><p>I could solve the problem but it only works when you use the actual keyboard.  If you use the soft keyboard I can't get it to work.</p><p>I am programming in 1.6 version of the framework.</p><p>Any help will be much appreciated.</p><p>PS: The fact that I've search everywhere for the answer and have not been able to find it tells me that this must be so very simple or very much complicated.   Help?!</p>","372475","","1402846","","2013-07-18 02:41:17","2014-02-05 21:07:55","How can I capture when time changes in a TimePicker if the ""Soft"" Keyboard is being used?","<android><android-softkeyboard><timepicker><android-timepicker>","4","0","","",""
"3464789","1","3464817","","2010-08-12 04:37:40","0","1048","<p>Say for example I have a textview in class A,<br>and I want to change background color of textview from class B through a method...<br>how can I do it?</p>","1497488","","42346","","2010-08-12 04:53:18","2010-10-12 22:58:47","change background color of textview from another class","<android>","2","0","1","",""
"3464881","1","3466796","","2010-08-12 05:06:12","2","2642","<p>I would like to be able to generate unique serial numbers for each Android device for use in unlocking an application. How could I do this?</p><p>EDIT:</p><p>The reason is I want to revamp a paid application and provide users who have paid for the old version, which will have a different package name, a way to obtain the full version by downloading an unlockable free version of the application. I would push an update to the old version that would generate and display the code that they could enter to turn the Free version into a fully functional version.</p>","325081","","325081","","2010-08-13 04:16:32","2014-03-28 15:37:25","Generating Device-Specific Serial Number","<android><algorithm><serial><unlock><trial>","5","0","3","",""
"3465094","1","3465633","","2010-08-12 06:02:18","2","2470","<p>I am trying to download Android source code for Contact,Dialer and CallLog applications from the git repository. I have tried the following on my mac(running SnowLeopard):<br>1. Create a bin dir and a android dir for putting all the downloaded files<br>2. Added both of the directories to the PATH environment variable<br>3. run the following commands to get the repo script and make it executable:</p><pre><code>$ curl http://android.git.kernel.org/repo &gt;~/bin/repo$ chmod a+x ~/bin/repo</code></pre><p>4. cd android dir5. run repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo</p><p>When I run this command, I am getting the following errors:</p><pre><code>Traceback (most recent call last):  File ""/Users/xxxx/bin/repo"", line 595, in &lt;module&gt;    main(sys.argv[1:])  File ""/Users/xxxx/bin/repo"", line 562, in main    _Init(args)  File ""/Users/xxxx/bin/repo"", line 181, in _Init    _CheckGitVersion()  File ""/Users/xxxx/bin/repo"", line 210, in _CheckGitVersion    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)  File ""/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py"", line 593, in __init__    errread, errwrite)  File ""/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py"", line 1079, in _execute_child    raise child_exceptionOSError: [Errno 2] No such file or directory</code></pre><p>A quick google search tells that I need to install git-core library. Unfortunately, I dont know if that is the real problem or not and if so, how to install it.</p><p>I am new to mac and Android and need your help.</p><p>Thanks much.</p>","366053","","","","","2010-08-12 15:17:10","Download Android code for Contacts application","<android><git><android-source>","2","2","1","",""
"3465095","1","3465102","","2010-08-12 06:02:50","0","65","<p>Booking.java</p><p>This is part of my spinner code.</p><pre><code>public void onItemSelected(AdapterView&lt;?&gt; arg0, View v,int position, long id){    boolean result = Booking.this.myCursor.moveToPosition(position);    if (result) {        String title=Booking.this.myCursor.getString(2);       Booking.this.txtArrival.setText(title);    } }</code></pre><p>There is still an error if i implement this statement</p><pre><code>    else (result){        String title2 = Booking.this.myCursor.getString(3);        Booking.this.txtArrival.setText(title2);    }</code></pre><p>Insert ; to complete statement. insert""AssignmentOperator Expression"" to complete Assignment</p><p>How would i go about solving it?</p><p>Thank you.</p>","358218","","","","","2010-08-12 06:04:18","Problem with android","<android><eclipse><spinner>","1","0","","",""
"3465155","1","3465264","","2010-08-12 06:16:11","1","239","<p>I have a mobile app, which is pretty data driven, though only through text and images.In the current version each click or touch requires pulling new data from the server (appache/php). With network delay this easily takes 1-2 seconds for the first content to appear, which is far too long.</p><p>I have heard about and considered the following options, but are not sure if some of them might be counter productive, or if I have left something important out?</p><ul><li>Download all data from the start, in a big bunch with a loading screen?</li><li>Run a prefetching thread, predicting and downloading data the user might want, in the background?</li><li>Keep the connection open to the server at all time?</li><li>Load different parts of the data in different connections in parallel? (Similar to facebook)</li><li>Use heavy data compression?</li></ul><p>A comprehensive article on the matter would also be a good answer.</p>","205521","","","","","2010-08-12 06:37:28","What are best practices for snappy mobile I/O on slow connections?","<iphone><android><networking><caching><mobile>","1","0","1","",""
"3465214","1","3465553","","2010-08-12 06:29:14","2","2941","<p>I'm doing an admin page that can view the users that exist in the system. My idea is to show a list of the users and the details in one page. I heard that using listview is very tedious. Is there any other way that is easy?</p><p>Maybe view in textview but I dont know how it works. I must put in a lot of textview on my xml? </p><p>A simple task that I need to know how to do. I just need to know how to view datas in a page, using any method.</p><p>Thank you very much! Hope to get responds soooon! =D</p><p>Dayne</p><hr><p>Hello again</p><p>Here's how a listview looks like:</p><pre><code>package log1.log2;import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.widget.ArrayAdapter;public class AdminMain extends ListActivity {static final String[] COUNTRIES = new String[] {""Macau"", ""Madagascar"", ""Malawi"", ""Malaysia"", ""Maldives"", ""Mali"", ""Malta"", ""Marshall Islands"",""Nicaragua"", ""Niger"", ""Nigeria"", ""Niue"", ""Norfolk Island"", ""North Korea"", ""Northern Marianas"", ""Norway"", ""Oman"", ""Pakistan"", ""Palau"", ""Panama"", ""Papua New Guinea"", ""Paraguay"", ""Peru""  };@Overridepublic void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, COUNTRIES));  ListView lv = getListView();  lv.setTextFilterEnabled(true);  lv.setOnItemClickListener(new OnItemClickListener() {    public void onItemClick(AdapterView&lt;?&gt; parent, View view,        int position, long id) {      // When clicked, show a toast with the TextView text      Toast.makeText(getApplicationContext(), ((TextView) view).getText(),          Toast.LENGTH_SHORT).show();    }  });}</code></pre><p>For the code above, the data is written in the codes itself. My data is in my database and I need it to be shown on the listview. I do not know how to do it. I tried a few ideas I had:</p><pre><code>public class AdminMain extends ListActivity {    DBAdapter db = new DBAdapter(this);    private String TEST;    public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          db.open();          Cursor c = (Cursor) db.getAllUser();            final String[] COUNTRIES = new String[] {            };        TEST=c.getString(1).toString();          setListAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1, TEST));          getListView().setTextFilterEnabled(true);    }}</code></pre><p>I declare a string and I tried retrieving data from database and save it to the string which is TEST. And then I tried showing it on the listview : </p><pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1, TEST));              getListView().setTextFilterEnabled(true);</code></pre><p>But I cant put 'TEST' in the listview. The error, <code>The constructor ArrayAdapter&lt;String&gt;(AdminMain, int, String) is undefined.</code> will appear.</p><p>I hope somebody will give me a good answer for this. I'm looking forward to your replies. Thank you for taking your time reading this.</p><p>-Dayne</p><hr><h2>Hello Sephy</h2><p>Here's what I edited.</p><pre><code>public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          db.open();          Cursor c = (Cursor) db.getAllUser();            /*final String[] COUNTRIES = new String[] {            };*/          final String[] TEST = c.getString(1);        //TEST[]=c.getString(1).toString();          setListAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1));          getListView().setTextFilterEnabled(true);    }</code></pre><p>As you can see I tried to put data from my database straight into the array but it can't work; <code>final String[] TEST = c.getString(1);</code>. The error message <code>Type mismatch: cannot convert from String to String[]</code> appeared.</p>","380770","","380770","","2010-08-16 01:32:32","2010-08-16 01:32:32","How can I view data from database using textview?","<android><database>","1","3","2","",""
"3465215","1","3465255","","2010-08-12 06:29:32","1","972","<p>Can anybody tell me how to get the current position of  the index while reading the binary file from <code>DataInputStream</code>? I have seen a <code>mark()</code> method but one is <code>Boolean</code> type and the other is <code>void</code>. I need to read the indexes on separate locations to use them again.</p>","397901","","22656","","2010-08-12 06:32:31","2010-08-12 06:36:09","getting current position from DataInputStream in java","<java><android>","1","0","","",""
"3465230","1","3470456","","2010-08-12 06:31:52","6","3425","<p>I am trying to create multiple notifications in my application. To identify each notification uniquely, i have given them an unique identificationId. Following is my code:</p><pre><code>private void updateNotification(int notificationId, int clockStatusID, CharSequence text) { //notificationManager.cancel(notificationId);// throws up an ongoing notification that the timer is runningLog.i(""TIMERCOUNT"", ""Notification id: "" + notificationId);Notification not = new Notification(clockStatusID, // the    // icon    // for    // the    // status    // bar    text, // the text to display in the ticker    System.currentTimeMillis() // the timestamp for the    // notification to appear);Intent intent = new Intent();intent.putExtra(""notificationID"", notificationId);intent.setAction(""actionstring"" + System.currentTimeMillis());intent.setClassName(""com.chander.time.android.activities"",""com.chander.time.android.activities.Tabs"");not.setLatestEventInfo(self,    getText(R.string.timer_notification_title),    getText(R.string.timer_on_notification_text), PendingIntent    .getActivity(this, 0, intent,        PendingIntent.FLAG_UPDATE_CURRENT));not.flags += Notification.FLAG_ONGOING_EVENT;not.flags += Notification.FLAG_NO_CLEAR;notificationManager.notify(notificationId, not);}</code></pre><p>Problem:When a notification is selected, Tabs activity is called passing the intent. I want to access the unique notificationId of the notification that was selected in Tabs. I tried intent.putExtra() to save the notificationId in the intent. But, for multiple notifications its overwriting the notificationId and returns the latest one. I dont understand as to why this is happening and how can i avoid this overwriting of notificationId.</p><p>Thanks,Chander</p>","374499","","","","","2012-02-24 20:30:01","Android: Managing Multiple Notifications","<java><android>","2","0","2","",""
"3465259","1","","","2010-08-12 06:36:42","10","10326","<p>I see these components discussed all the time on xda-developers.  I have a vague understanding of what they are and how they're related to each other, but it's not perfectly clear.  For example, the radio seems to be a lot more than just the radio.  I have a good understanding of the basic ideas as a Linux user and software developer.</p><p>To kick things off, let me present my current understanding.  I could be way off on some things:</p><p>""Radio"" - I'm not sure if this runs before the bootloader or after</p><p>HBOOT is the bootloader, the first thing that runs when you boot up your phone.  Like your regular Linux bootloader, it lets you boot off of different partitions.</p><p>There are multiple partitions on the system, at least one for HBOOT (maybe?  or is it in some kind of MBR type of area?), recovery, system and data.  All of these partitions are in the system's ""ROM"" which is not really ROM it's actually NVRAM or flash or whatever.  Hence, each of these areas can be independently flashed.</p><p>Recovery is a partition you can boot into.  It's originally meant to be a kind of ""recovery"" mode and so offers a base for hacking.  This is typically re-flashed so as to follow further modifications.  From the recovery image, you can also access the sdcard which is useful for fetching update.zip files etc.</p><p>update.zip - these are updates that can be applied from a custom recovery image.  It seems like these updates can contain more or less arbitrary code, but I'm not clear on how they get applied or where they get flashed to or applied to.</p><p>/system - gets mounted read-only (what control this?) unless you do some hacking</p><p>Where does the kernel sit?  Is there a different one in the recovery versus the regular image?Which parts form a custom ROM like CyanogenMod?What is the NAND and what does it mean to unlock the NAND?What is an RUU?SPL?Where do the WiFi and 3G radio images sit?PC36IMG.zip?PRI?</p><p>I've seen some of this explained elsewhere but I don't understand how they all fit together.</p>","418062","","","","","2013-03-16 07:51:51","Can someone explain these Android ROM hacking terms: HBOOT/bootloader, radio, recovery image, update.zip, NAND unlocking, RUU?","<android>","2","0","5","",""
"3465262","1","3465332","","2010-08-12 06:37:18","5","9139","<p>The following link states that ""A Java or RCP version of Eclipse is recommended. For Eclipse 3.5, the ""Eclipse Classic"" version is recommended.""</p><p><a href=""http://developer.android.com/sdk/installing.html"">http://developer.android.com/sdk/installing.html</a></p><p>However, Eclipse 3.6 is available and as a total newbie I am not sure whether the recommendation for ""Eclipse Classic"" over RCP (or Java) still holds true.</p><p>Can you clarify?</p><p>Thanks you.</p>","418055","","","","","2010-11-11 04:06:26","Which Eclipse version: Java, RCP or ""Eclipse Classic""?","<java><android><eclipse><rcp>","3","1","2","2013-07-18 15:36:36",""
"3465287","1","3465367","","2010-08-12 06:40:37","0","824","<p>Is there a way that trough the application, I can subscribe and unsubscribe for the ""ACTION_BOOT_COMPLETED"" message?</p><p>If so, how can I do this?</p><p>Any kind of pointer will help me.</p><p>Thanks in advance,<br>Regards,<br>Vinay</p>","362416","","","","","2010-08-12 08:41:26","onBoot Complete as user preference","<android><permissions>","3","0","1","",""
"3465316","1","3465443","","2010-08-12 06:46:45","0","170","<p>Consider the following use case.Activity 1 starts Activity 2. Activity 2 is currently in foreground. Now, Activity 1 wants to display a Dialog. Is it possible for Activity 1 to display a Dialog? What will be the error display, if any?</p>","393792","","","","","2010-08-12 07:10:27","2 Activities & A Dialog","<android>","1","0","","",""
"3465429","1","3465451","","2010-08-12 07:07:00","4","6000","<p>Register to be able to open files of custom type. Say i have .cool files, and if the user tries to oepn it, Android asks if they would like to open it with my application. How?</p>","325081","","","","","2012-02-16 10:29:31","Register to be default app for custom file type","<android><file><android-intent><handle>","2","0","1","",""
"3465456","1","3465466","","2010-08-12 07:12:13","0","341","<p>How can one achieve string localisation in Android?</p>","393792","","","","","2010-08-12 07:13:38","String Localisation in Android","<android>","1","0","","",""
"3465611","1","","","2010-08-12 07:35:06","0","776","<p>I am an experienced Java programmer just starting out with Android development.  I am going through the tutorials and am having a problem with the tab widget tutorial.  I have followed the example to the letter and keep getting the below in the log when trying to run on the emulator:</p><p><b>ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.android/.HelloTabWidget }</p><p>ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android/.HelloTabWidget } from null (pid=-1, uid=-1) requires null</b></p><p>I have searched the internet forums for the last three hours and can't find any answers to what is going on.  The tutorial I am using is here:  <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a>. I am using jre 1.6, and Android platform 2.1.  Any help will be appreciated.  I can't tell you how frustrating it is when you follow a supposed simple example and you can't get it to work.</p>","418117","","1228","","2013-08-15 12:34:23","2013-08-15 12:34:23","Android HelloTab Tutorial","<android><tabs><widget>","2","1","","",""
"3465660","1","","","2010-08-12 07:42:29","1","167","<p>I noticed that Flash allows you to insert cue's into a video file (flv).  Is something like this possible on Android?  I have a video that runs locally in my Android app and I would like to insert cues into the video which will give me callbacks when a certain portion of the video has been reached.  If this is not possible, are there any other methods to do something similar?  I have to be pretty precise with where the cue is located.</p><p>Thanks</p><p><strong>Note:</strong><br>I just found this same question on stackoverflow.  Can anyone verify that this is still the case? (That it is not possible, only by polling the video continually).  I did know of this way, but it's not the most accurate way if you need to be precise and stich dynamic pieces of video together seamlessly.</p><p><a href=""http://stackoverflow.com/questions/2800319/android-videoview-detect-point-of-time-in-video"">http://stackoverflow.com/questions/2800319/android-videoview-detect-point-of-time-in-video</a></p>","107459","","107459","","2010-08-12 09:21:18","2012-04-13 02:09:05","How can I insert cues into a video I want to play in my Android App?","<android><video><callback><cue>","1","2","","",""
"3465707","1","","","2010-08-12 07:52:02","7","4044","<p>I would like to forward all calls to my number on to the new predefined number automatically. Is it possible to forward incoming call ?</p><p>Probably it is possible for Froyo at least. I found application called Easy Call Forwarding.<a href=""http://www.appstorehq.com/easycallforwarding-android-189596/app"" rel=""nofollow"">http://www.appstorehq.com/easycallforwarding-android-189596/app</a>But many people reckon it doesn't work actually.</p><p>We can notice forwarded call by <code>onCallForwardingIndicatorChanged()</code> from <code>PhoneStateListener</code> butI have no idea how to set forwarding mode.</p>","355268","","1288","","2011-11-15 11:44:41","2014-02-25 05:51:26","Call forwarding","<android>","2","1","2","",""
"3465768","1","3465777","","2010-08-12 08:01:06","2","422","<p>My application has an IntentService which runs periodically todownload data from a remote server. The download task is run inside anAsyncTask which has reference to Application context only.</p><p>The data downloaded is for entire application and is displayed acrossfour different activities. When the download completes(AsyncTaskcompletes) the service is notified of the same. Now, the service needsto notify appropriate activity to update its view. The service is notaware of which Activity of what application is in foreground.</p><p>How do I make that connection? How does the service pass a message tothe activity in foreground that new data is available and it shouldupdate its views?</p><p>Please help.</p><p>Thanks. </p>","236128","","","","","2010-08-12 08:03:00","Ways to notify activities of download completion","<android><android-service>","1","2","","",""
"3465841","1","3465853","","2010-08-12 08:15:13","15","33155","<p>There is the way to change visibility of View, but how can I change programaticly visibility of layout defined in XML? How to get layout object?</p><pre><code>&lt;LinearLayout    android:id=""@+id/contacts_type""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:visibility=""gone""&gt;&lt;/LinearLayout&gt;</code></pre>","361832","","361832","","2010-08-12 08:34:44","2013-06-12 23:10:16","How to change visibility of layout programaticly","<android><layout><visibility>","3","0","0","",""
"3466087","1","3466104","","2010-08-12 08:59:23","2","1482","<p>I have a Activity called main. If I call</p><pre><code>Toast.makeText(this, ""Hello World from main"", Toast.LENGTH_SHORT);</code></pre><p>this works fine. However, for every other activity in my application, I cannot display a Toast. No exception, nothing in the Log but I don't see the Toast.</p><p>My main activity starts another one with an options menu:</p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case R.id.main_menu_entry:        Intent infolist = new Intent(this, infolist.class);        startActivityForResult(infolist, R.layout.infolist);        return true;    default:        return super.onOptionsItemSelected(item);     }}</code></pre><p>In my infolist activity I have another options menu which should display a Toast.</p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case R.id.infolist_menu_entry:                    // this Toast is never shown.        Toast.makeText(this, ""Hello World from infolist"", Toast.LENGTH_Short);                  return true;    default:        return super.onOptionsItemSelected(item);     }}</code></pre><p>Any ideas what could cause this issue?I am using the latest SDK with Min SDK Version = 3 and an 1.5 Emulator.</p>","98491","","","","","2013-11-28 13:57:37","Cannot display Toast from an Activity other than my main activity","<java><android><activity><toast>","2","1","","",""
"3466205","1","3468811","","2010-08-12 09:15:21","5","2568","<p>I have developed a simple application before testing it i want to check whether any memory leaks are there in the application. I don't know how to identify the leaks in Android. I am using Eclipse IDE for development.  </p><p>Is there a good introduction into finding memory leaks in Android apps somewhere?</p>","131062","","114066","","2010-08-12 10:31:38","2010-08-13 11:07:46","How to identify Memory Leaks in Android?","<android><debugging><profiling>","2","0","3","",""
"3466271","1","","","2010-08-12 09:25:00","1","1273","<p>I want to animate a layout on touching the screen.If you touch the screen the layout containg buttons on it should translate down out of the screen and again on touching the screen the layout should come up into the screen at its original position.</p><p>I am getting the problem,when I do it through programming.and It works when I do it through XML.</p><p>In programming approch it works for the first time and on second time it does not works.Even I have observed that If we click the on screen It reads all the code of starting the animation but it does not get animated but after that if we click on the button added in layout, the animation works.</p><p>Here is the code:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.Gravity;import android.view.MotionEvent;import android.view.View;import android.view.Window;import android.view.WindowManager;import android.view.View.OnClickListener;import android.view.View.OnTouchListener;import android.view.animation.Animation;import android.view.animation.AnimationUtils;import android.view.animation.LayoutAnimationController;import android.view.animation.Animation.AnimationListener;import android.webkit.WebView;import android.widget.Button;import android.widget.FrameLayout;import android.widget.LinearLayout;import android.widget.RelativeLayout;import android.widget.RelativeLayout.LayoutParams;public class BrowserDemo2 extends Activity implements AnimationListener, OnTouchListener, OnClickListener{    WebView browser;    RelativeLayout parentLayout;    LinearLayout navigationBarOuterLinearLayout;    FrameLayout navigationBarInnerFrameLayout;    Button galleryButton;    Button creditsButton;    Button viewChangeButton;    byte animationType;    public static final byte ANIM_IN = 0;    public static final byte ANIM_OUT = 1;    boolean isNavigationBarVisible = true;    boolean isAnimationInProgress;    @Override    public void onCreate(Bundle icicle)    {    super.onCreate(icicle);         setFullscreen();    setContentView(R.layout.main);      parentLayout = (RelativeLayout) findViewById(R.id.parent);    setNavigationBarLayout();    parentLayout.addView(navigationBarOuterLinearLayout);    animationType = ANIM_OUT;    animController = new LayoutAnimationController(this, null);    }       public void setNavigationBarLayout()    {    navigationBarOuterLinearLayout = new LinearLayout(this);    LayoutParams navigationBarOuterLinearLayoutParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);      navigationBarOuterLinearLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);    navigationBarOuterLinearLayout.setLayoutParams(navigationBarOuterLinearLayoutParams);       navigationBarOuterLinearLayout.setOrientation(LinearLayout.VERTICAL);       navigationBarInnerFrameLayout = new FrameLayout(this);    LayoutParams navigationBarInnerFrameLayoutParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);       navigationBarInnerFrameLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);    navigationBarInnerFrameLayout.setLayoutParams(navigationBarInnerFrameLayoutParams);    navigationBarInnerFrameLayout.setBackgroundResource(R.drawable.uitabbar);    navigationBarInnerFrameLayout.setPadding(0, 5, 0, 0);    galleryButton = new Button(this);    galleryButton.setOnClickListener(this);    galleryButton.setText(""Gallery"");    FrameLayout.LayoutParams galleryButtonParams = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER_VERTICAL | Gravity.LEFT);    galleryButton.setLayoutParams(galleryButtonParams);    creditsButton = new Button(this);    creditsButton.setOnClickListener(this);    creditsButton.setText(""Credits"");    FrameLayout.LayoutParams creditsButtonParams = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);    creditsButton.setLayoutParams(creditsButtonParams);    viewChangeButton = new Button(this);    viewChangeButton.setOnClickListener(this);    viewChangeButton.setText(""Chnage View"");    FrameLayout.LayoutParams viewChangeButtonParams = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER_VERTICAL | Gravity.RIGHT);    viewChangeButton.setLayoutParams(viewChangeButtonParams);    navigationBarInnerFrameLayout.addView(galleryButton);    navigationBarInnerFrameLayout.addView(creditsButton);    navigationBarInnerFrameLayout.addView(viewChangeButton);    navigationBarOuterLinearLayout.addView(navigationBarInnerFrameLayout);    }    public void setFullscreen()    {    requestWindowFeature(Window.FEATURE_NO_TITLE);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,        WindowManager.LayoutParams.FLAG_FULLSCREEN);    }        public void setAnimations()    {    switch(animationType)    {        case ANIM_IN:        {        isAnimationInProgress = true;        navigationBarOuterLinearLayout.setVisibility(View.VISIBLE);             animateLayout(R.anim.lower_navigation_bar_in, navigationBarOuterLinearLayout);//      parentLayout.requestFocus();//      parentLayout.requestFocusFromTouch();//      parentLayout.requestLayout();        break;        }        case ANIM_OUT:        {           isAnimationInProgress = true;        animateLayout(R.anim.lower_navigation_bar_out, navigationBarOuterLinearLayout);        break;        }    }       }    @Override    public boolean onTouchEvent(MotionEvent event)    {    if(event.getAction() == MotionEvent.ACTION_UP)    {        Log.v(""onTouch"", ""in touch realease.."");        setAnimations();    }       return true;        }    Animation layoutAnimation;    LayoutAnimationController animController;    public void animateLayout(int type, LinearLayout layout)    {    layoutAnimation = AnimationUtils.loadAnimation(this, type);    layoutAnimation.setAnimationListener(this);    animController.setAnimation(layoutAnimation);    layout.setLayoutAnimation(animController);    layout.startLayoutAnimation();    }    @Override    public void onAnimationEnd(Animation animation)    {    if(animationType == ANIM_OUT &amp;&amp; isNavigationBarVisible)    {        animationType = ANIM_IN;        isNavigationBarVisible = false;        navigationBarOuterLinearLayout.setVisibility(View.INVISIBLE);    }    else    {        animationType = ANIM_OUT;        isNavigationBarVisible = true;          }    isAnimationInProgress = false;    }    @Override    public void onAnimationRepeat(Animation animation)    {    // TODO Auto-generated method stub    }    @Override    public void onAnimationStart(Animation animation)    {    // TODO Auto-generated method stub    }    @Override    public boolean onTouch(View v, MotionEvent event)    {    return false;    }    @Override    public void onClick(View v)    {    // TODO Auto-generated method stub    }</code></pre>","418176","","289182","","2011-12-01 16:53:40","2013-07-24 17:08:04","Android: translate Animation works for the first time and not second time","<android>","1","0","","",""
"3466279","1","4964577","","2010-08-12 09:26:31","9","7736","<p>I ve been stuck on a DatePicker problem for several and i can't seem to find any solution. </p><p>I currently have a DatePickerDialog which fits quite well to my needs YET I also need to be able to hide / disable Both Day and Month field (in order to select a Month or a Year), I can't find any solution except implementing my own MonthPicker/yearPicker . the fact is I don't really know where to begin with to write a picker which has the same style as the default one.</p><p>I would be glad if any of you have sample code of custom date picjer or any simpler Idea to get to cope with my problem.</p><p>Thanks a lot</p><p>hush</p>","395843","","","","","2013-06-08 09:49:07","Custom DatePicker","<android><datepicker>","3","1","2","",""
"3466297","1","3472359","","2010-08-12 09:29:25","1","3639","<p>I have a large image. But i have to display just some portion of it. How is this possible using Android ImageView?</p>","393792","","","","","2010-08-12 21:54:35","How to display a part of an image?","<android>","2","0","4","",""
"3466334","1","","","2010-08-12 09:34:38","0","466","<p>HiI want to display WebView with the other view TextView in Android application. The text view will be visible like an header. </p><p>Thanks Deepak</p>","406494","","","","","2010-08-12 10:34:00","WebView with other View Components","<android>","1","2","","",""
"3466473","1","3521708","","2010-08-12 09:53:45","2","424","<p>I am trying to play a video through my application. </p><pre><code>public class VideoScreen extends Activity {public MediaPlayer videoMediaPlayer = new MediaPlayer();public void onCreate(final Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.videoscreen);     SurfaceView demoVideo = (SurfaceView) findViewById(R.id.demoVideo);    SurfaceHolder videoHolder = demoVideo.getHolder();    videoMediaPlayer = MediaPlayer.create(this, R.raw.help);    videoMediaPlayer.setDisplay(videoHolder);    videoMediaPlayer.setLooping(false);    videoMediaPlayer.setScreenOnWhilePlaying(true);    videoMediaPlayer.start();    }}</code></pre><p>XML File:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;         &lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""      android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;SurfaceView android:id=""@+id/demoVideo""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;&lt;/SurfaceView&gt;    &lt;/FrameLayout&gt;</code></pre><p>I can hear only sound, but no video.</p><p>But, when I try to play this video separately through file manager. It is playing perfectly. Where I am wrong? </p><p>Please help.</p>","284372","","","","","2010-10-05 18:35:24","Android: Cannot see video on HTC Hero 1.5","<android><video><media-player><surfaceview>","1","0","","",""
"3466689","1","3466935","","2010-08-12 10:24:28","0","469","<p>may I know is it possible I use the resource id but I didnt set the Content View in the activity?</p><p>for example: abc.xml have one TextView id = ""R.id.Text"". Can I use the use <code>TextView name = (TextView)findViewById(R.id.Text);</code> method in the activity which was <code>setContentView(R.layout.def);</code>?</p><p>P/S: sorry about my bad english, hope you guys understand what I'm talking about.</p><p>Thanks</p>","409419","","","","","2010-08-12 13:28:49","Resource ID question","<android><resources>","1","0","","",""
"3467194","1","3467236","","2010-08-12 11:38:33","0","401","<p>i am reading the bytes from binary file and now i have to get the index position of the stream and i am using CountingInputStream class and method getByteCount but this method returning me 0.</p><p>Here is my Code.</p><pre><code>public void readIndex(InputStream iStream)  {   SwappedDataInputStream input;   input = new SwappedDataInputStream(iStream);   int locKey;   int x=0;   int y=0;   try{   setINoOfTiles(input.readInt());   CountingInputStream cis = new CountingInputStream(iStream);   for(int i=0; i&lt;iNoOfTiles; i++)   {    x  = input.readInt()/100;    y =input.readInt()/100;    MapTileHeader tTile = new MapTileHeader(x, y, mapType);    locKey = input.readInt();    HashMap&lt;Integer, MapTileHeader&gt; iTileListOffsets = new HashMap&lt;Integer, MapTileHeader&gt;();    iTileListOffsets.put(locKey, tTile);          }   String out = IOUtils.toString(cis);   long count = cis.getByteCount();    Log.i(""count"", ""count ="" + count);   }catch(Exception e )   {    e.printStackTrace();   }  }</code></pre>","397901","","288773","","2011-09-20 08:59:47","2011-09-20 08:59:47","CountingInputStream,s method getCount() not giving any values","<java><android>","1","0","","",""
"3467201","1","","","2010-08-12 11:39:03","0","166","<p>I am creating tab bar in my application. For one tab i set map activity as tab spec content and add overlay on it. now i have to move on next map as user clicks on overlay.In short I have to create two layouts each on has map and at run time i have to set visibility and one after other.For that i create one XML layout which has linear layout as root layout and then create two separate relative layouts to hold two maps but it gives me error that unexpectedly closed.</p><p>If you know another way to do it please suggest me.                                                                               Thank You                                                                               VIkram Kadam</p>","395627","","","","","2010-08-12 14:23:51","How to add two map tangs in single xml file in Android","<android>","1","0","","",""
"3467205","1","4611060","","2010-08-12 11:39:39","13","19369","<p>In my Android application I am getting a very strange crash, when I press a button (Image) on my UI the entire application freezes and after a couple of seconds I getthe dreaded force close dialog appearing.</p><p>Here is what gets printed in the log:</p><hr><pre><code>WARN/WindowManager(88): Key dispatching timed out sending to package name/ActivityWARN/WindowManager(88): Dispatch state: {{KeyEvent{action=1 code=5 repeat=0 meta=0 scancode=231 mFlags=8} to Window{432bafa0 com.android.launcher/com.android.launcher.Launcher paused=false} @ 1281611789339 lw=Window{432bafa0 com.android.launcher/com.android.launcher.Launcher paused=false} lb=android.os.BinderProxy@431ee8e8 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{4335fc58 package name/Activity paused=false}}}WARN/WindowManager(88): Current state:  {{null to Window{4335fc58 package name/Activity paused=false} @ 1281611821193 lw=Window{4335fc58 package name/Activity paused=false} lb=android.os.BinderProxy@434c9bd0 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{4335fc58 package name/Activity paused=false}}}INFO/ActivityManager(88): ANR in process: package name (last in package name)INFO/ActivityManager(88): Annotation: keyDispatchingTimedOutINFO/ActivityManager(88): CPU usage:INFO/ActivityManager(88): Load: 5.18 / 5.1 / 4.75INFO/ActivityManager(88): CPU usage from 7373ms to 1195ms ago:INFO/ActivityManager(88):   package name: 6% = 1% user + 5% kernel / faults: 7 minorINFO/ActivityManager(88):   system_server: 5% = 4% user + 1% kernel / faults: 27 minorINFO/ActivityManager(88):   tiwlan_wifi_wq: 3% = 0% user + 3% kernelINFO/ActivityManager(88):   mediaserver: 0% = 0% user + 0% kernelINFO/ActivityManager(88):   logcat: 0% = 0% user + 0% kernelINFO/ActivityManager(88): TOTAL: 12% = 5% user + 6% kernel + 0% softirqINFO/ActivityManager(88): Removing old ANR trace file from /data/anr/traces.txtINFO/Process(88): Sending signal. PID: 1812 SIG: 3INFO/dalvikvm(1812): threadid=7: reacting to signal 3INFO/dalvikvm(1812): Wrote stack trace to '/data/anr/traces.txt'</code></pre><hr><p>This is the code for the Button (Image):</p><hr><pre><code>findViewById(R.id.endcallimage).setOnClickListener(new OnClickListener() {                    public void onClick(View v) {                        mNotificationManager.cancel(2);                        Log.d(""Handler"", ""Endcallimage pressed"");                        if(callConnected)                        elapsedTimeBeforePause = SystemClock.elapsedRealtime() - stopWatch.getBase();                        try {                            serviceBinder.endCall(lineId);                        } catch (RemoteException e) {                            e.printStackTrace();                        }                             dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.FLAG_SOFT_KEYBOARD));                            dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK));                    }            });     </code></pre><hr><p>If I comment the following out the pressing of the button (image) doesn't cause the crash:</p><hr><pre><code>try {      serviceBinder.endCall(lineId);    } catch (RemoteException e) {      e.printStackTrace();    } </code></pre><hr><p>The above code calls down through several levels of the app and into the native layer (NDK), could the call passing through several objects be leading to the force close? It seems unlikely as several other buttons do the same without issue.</p><p>How about the native layer? Could some code I've built with the NDK be causing the issue?</p><p>Any other ideas as to what the cause of the issue might be?</p>","243999","","","","","2013-10-15 11:24:44","Android - Key Dispatching Timed Out","<android><timeout><key><freeze><dispatch>","3","0","2","",""
"3467224","1","","","2010-08-12 11:41:31","0","208","<p>Can any one knows, how i can get android SDK <strong>2.0.1</strong>, i have seen developer.android.com but there is not avaiable the Android version 2.0.1. </p><p>However Available in <strong>Older versions</strong> What is that mean ? the version is obsolete ???</p><p>Kindly give me the authentic answer</p><p>Thanks in Advance.</p>","321373","","","","","2010-08-12 13:50:02","Android SDK 2.0.1","<android><sdk>","4","0","","",""
"3467240","1","","","2010-08-12 11:43:52","3","765","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2018263/android-logging"">Android logging</a>  </p></blockquote><p>In Android is there a way to disable logs/stacktrace being printed when the application is code signed and is in release mode. Is there any direct way to do it?</p><p>In Iphone i heard the logs will not be printed in release mode by default.</p>","302328","","","","","2010-08-14 11:16:26","Android logs printed in both debug and release mode","<android>","0","2","","2012-07-31 11:53:24",""
"3467254","1","3514269","","2010-08-12 11:44:28","0","2586","<p>What vector graphic formats can be used to display the in a view in an android application? As I understand, PDF is not an option at the moment, so what other options are there for storage and display of complex text+graphics?</p><p>Unfortunately, I cannot use embedded browser with Flash because I need this app to work on Android versions before 2.2.</p>","6533","","","","","2010-08-18 16:23:11","How to store and display vector text+graphics images in Android without Flash?","<android><image><vector-graphics>","1","0","1","",""
"3467334","1","3470252","","2010-08-12 11:57:07","10","11911","<p>I try to erase parts of a bitmap in my Android application by using Porter-Duff Xfermodes. </p><p>I have a green background which is overlayed by a blue bitmap. When I touch the screen a ""hole"" in the overlaying bitmap is supposed to be created making the green background visible. Instead of a hole my current code produces a black dot.</p><p>Below is my code. Any ideas, what I am doing wrong here?</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,            WindowManager.LayoutParams.FLAG_FULLSCREEN);    setContentView(new DrawView(this));}public class DrawView extends View implements OnTouchListener {    private int x = 0;    private int y = 0;    Bitmap bitmap;    Canvas bitmapCanvas;    private final Paint paint = new Paint();    private final Paint eraserPaint = new Paint();    public DrawView(Context context) {        super(context);        setFocusable(true);        setFocusableInTouchMode(true);        this.setOnTouchListener(this);        // Set background        this.setBackgroundColor(Color.GREEN);        // Set bitmap        bitmap = Bitmap.createBitmap(320, 480, Bitmap.Config.RGB_565);        bitmapCanvas = new Canvas();        bitmapCanvas.setBitmap(bitmap);        bitmapCanvas.drawColor(Color.BLUE);        // Set eraser paint properties        eraserPaint.setAlpha(0);        eraserPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));        eraserPaint.setAntiAlias(true);    }    @Override    public void onDraw(Canvas canvas) {        bitmapCanvas.drawColor(Color.BLUE);        bitmapCanvas.drawCircle(x, y, 10, eraserPaint);        canvas.drawBitmap(bitmap, 0, 0, paint);    }    public boolean onTouch(View view, MotionEvent event) {        x = (int) event.getX();        y = (int) event.getY();        invalidate();        return true;    }}</code></pre>","400334","","","","","2012-03-21 19:22:14","Erase bitmap parts using PorterDuff mode","<android><image-manipulation>","2","0","14","",""
"3467336","1","3467775","","2010-08-12 11:57:34","0","540","<p>I having a pretty slow day tday so bare with me. Basically I have an android context menu with various selections and depending on the user selection I want to start an intent. The intent starts the same activity for all the buttons but will contain different String variables depending on the selection. I am currently using a switch, case methodology for my click listener but keep running into 'duplicate local variable' problems as I try to eliminate code repetition! If anyone could provide a-bit of pseudo-code that would be even better!  </p><p>Cheers  </p>","397085","","","","","2010-08-13 10:57:33","Using a single intent with multiple buttons!","<android><variables><android-intent>","3","0","","",""
"3467461","1","3952769","","2010-08-12 12:10:51","14","12550","<p>I am working on an app that has a homescreen. This homescreen should behave like the <strong>android homescreen</strong> where you can switch between several views by flinging your finger over the touch screen.</p><p>The solution is easy. I have <strong>3 view instances</strong>, <em>right</em>, <em>left</em> and <em>current view</em>. I get this instances from the <strong>viewflipper</strong> that I initialized earlier. Since I have a HTC G1 my sreen is 320 px in width and 480 px in height.</p><p>Imagine you capture the down value of a action down motion event when you touch the screen. Then you move your finger and the screen should move in exactly the same way so you have to recalculate the view's position. It works for me so far but I am facing a strange problem. When you touch the right view without moving you finger but keeping it on the screen for less then a second the view disappears and shows the left view.</p><p>Here is my code:</p><pre><code>public class MainActivity extends Activity implements OnTouchListener{    private ViewFlipper vf;    private float downXValue;    private View view1, view2, view3;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        this.vf = (ViewFlipper) findViewById(R.id.flipper);        if(this.vf != null){             this.view1 = vf.getChildAt(0);             this.view2 = vf.getChildAt(1);               this.view3 = vf.getChildAt(2);             vf.setDisplayedChild(0);         }               LinearLayout layMain = (LinearLayout) findViewById(R.id.layout_main);         layMain.setOnTouchListener((OnTouchListener) this);    }    public boolean onTouch(View v, MotionEvent arg1) {         final View currentView = vf.getCurrentView();         final View leftView, rightView;         if(currentView == view1){             leftView = view3;             rightView = view2;         }else if(currentView == view2){             leftView = view1;             rightView = view3;         }else if(currentView == view3){             leftView = view2;             rightView = view1;         }else{             leftView = null;             rightView = null;         }         switch (arg1.getAction()){            case MotionEvent.ACTION_DOWN:{                this.downXValue = arg1.getX();                break;            }            case MotionEvent.ACTION_UP:{                float currentX = arg1.getX();                                if ((downXValue &lt; currentX)){                        if(currentView != view3){                        float t3 = (320-(currentX-downXValue))/320;                                                     this.vf.setInAnimation(AnimationHelper.inFromLeftAnimation(t3));                        this.vf.setOutAnimation(AnimationHelper.outToRightAnimation(t3));                        this.vf.showPrevious(); }                       }                    if ((downXValue &gt; currentX)){                        if(currentView != view2){                        float t = (320-(downXValue-currentX))/320;                        this.vf.setInAnimation(AnimationHelper.inFromRightAnimation(t));                        this.vf.setOutAnimation(AnimationHelper.outToLeftAnimation(t));                        this.vf.showNext();}                        }                                     }            break;            case MotionEvent.ACTION_MOVE:{                leftView.setVisibility(View.VISIBLE);                rightView.setVisibility(View.VISIBLE);                float currentX = arg1.getX();                     if(downXValue &gt; currentX){                      if(currentView != view2){                        currentView.layout((int) (currentX - downXValue),                        currentView.getTop(),                        (int) (currentX - downXValue) + 320,                        currentView.getBottom());                     }                }                if(downXValue &lt; currentX){                      if(currentView != view3){                        currentView.layout((int) (currentX - downXValue),                        currentView.getTop(),                        (int) (currentX - downXValue) + 320,                        currentView.getBottom());                    }                }                leftView.layout(currentView.getLeft()-320, leftView.getTop(),                       currentView.getLeft(), leftView.getBottom());                   rightView.layout(currentView.getRight(), rightView.getTop(),                         currentView.getRight() + 320, rightView.getBottom());                }            }        return true;    }    public static class AnimationHelper {          public static Animation inFromRightAnimation(float param) {            Animation inFromRight = new TranslateAnimation(            Animation.RELATIVE_TO_PARENT, +param,            Animation.RELATIVE_TO_PARENT, 0.0f,            Animation.RELATIVE_TO_PARENT, 0.0f,            Animation.RELATIVE_TO_PARENT, 0.0f);            inFromRight.setDuration(250);            inFromRight.setInterpolator(new AccelerateInterpolator());            return inFromRight;          }          public static Animation outToLeftAnimation(float param) {            Animation outtoLeft = new TranslateAnimation(            Animation.RELATIVE_TO_PARENT, 0.0f,            Animation.RELATIVE_TO_PARENT, -param,            Animation.RELATIVE_TO_PARENT, 0.0f,            Animation.RELATIVE_TO_PARENT, 0.0f);            outtoLeft.setDuration(250);            outtoLeft.setInterpolator(new AccelerateInterpolator());            return outtoLeft;          }          // for the next movement          public static Animation inFromLeftAnimation(float param) {            Animation inFromLeft = new TranslateAnimation(            Animation.RELATIVE_TO_PARENT, -param,            Animation.RELATIVE_TO_PARENT, 0.0f,            Animation.RELATIVE_TO_PARENT, 0.0f,            Animation.RELATIVE_TO_PARENT, 0.0f);            inFromLeft.setDuration(250);            inFromLeft.setInterpolator(new AccelerateInterpolator());            return inFromLeft;          }          public static Animation outToRightAnimation(float param) {            Animation outtoRight = new TranslateAnimation(            Animation.RELATIVE_TO_PARENT, 0.0f,            Animation.RELATIVE_TO_PARENT, +param,            Animation.RELATIVE_TO_PARENT, 0.0f,            Animation.RELATIVE_TO_PARENT, 0.0f);            outtoRight.setDuration(250);            outtoRight.setInterpolator(new AccelerateInterpolator());            return outtoRight;          }        }}</code></pre><p>I think such a Homescreen is an interesting UI element. </p><p>Any ideas?</p><hr><p><strong>You can download the working eclipse project here:</strong> <a href=""http://www.megaupload.com/?d=3M3IYGGM"" rel=""nofollow"">http://www.megaupload.com/?d=3M3IYGGM</a></p>","401025","","401025","","2011-09-14 09:35:42","2013-03-04 18:56:44","Developing an Android Homescreen","<android><viewflipper><android-animation>","3","1","29","",""
"3467623","1","3467714","","2010-08-12 12:28:09","0","1102","<p>I am working on an android application and I want to send an SMS to the phone number of the phone i.e the emulator. I know there will be no real phone number for emulator, but how can I send an SMS from the phone?</p>","655814","","79125","","2011-07-29 07:20:01","2012-01-23 12:14:45","Send an SMS to the emulator","<android>","1","2","1","",""
"3468614","1","3471078","","2010-08-12 14:14:35","1","3529","<p>In my android game I want to display a screen when it loads up with my logo saying I built the game, then after a few seconds I want this to switch to the menu screen, and then after a game is started, the screen changes to the game screen for the action to start.</p><p>I looked in to ViewFlipper but I have since concluded this is not right for the job. My question therefore is how does one go about controlling what screen/View is displayed programatically? Also, at the end of a level I want the screen to switch to a 'Stage Cleared' view before loading back in to the action.</p><p>Many thanks</p>","300037","","","","","2010-08-12 21:18:37","Switching between Views in Android","<android><views>","1","0","3","",""
"3468700","1","3468884","","2010-08-12 14:24:04","1","152","<p>I am creating a comma seperated file and don't want to give the user a way to confuse the app.</p>","398460","","","","","2010-08-12 14:42:09","Is there a built in method, InputType, or other clever way to cause an Android EditText widget to refuse to accept commas?","<java><android><edittext>","2","1","","",""
"3468712","1","3470800","","2010-08-12 14:25:05","5","3182","<p><img src=""http://img245.imageshack.us/img245/461/65254534.jpg"" alt=""m3""></p><p>Chrome using the windows' HOST file:</p><p><img src=""http://img266.imageshack.us/img266/9380/59750633.jpg"" alt=""m1""></p><p>Android emulator:</p><p><img src=""http://img821.imageshack.us/img821/7363/19470766.jpg"" alt=""m2""></p><p><strong>edit</strong></p><p>""On Windows, the emulator obtains the addresses by calling the GetNetworkParams() API. Note that this usually means that the emulator ignores the content of your ""hosts"" file (/etc/hosts on Linux/OS X, %WINDOWS%/system32/HOSTS on Windows).""</p><p>how can I use static IPs in the emulator?</p>","286557","","286557","","2010-08-25 17:52:17","2012-05-30 19:01:32","Android emulator doesn't use Windows host file?","<android><dns><android-emulator>","2","2","1","",""
"3468765","1","3469872","","2010-08-12 14:29:53","17","5052","<p>I have a <code>ListView</code> where I've defined the layout of each item in a separate XML file.  In this file I've included a <code>RatingBar</code> and an <code>EditText</code>.</p><p>I've programmatically created 7-8 items in this <code>ListView</code>.  When I scroll through them, it seems to be quite buggy.  Here are some examples:</p><ol><li><p>If I set focus to the <code>EditText</code> in the first row and then scroll down the <code>ListView</code>, random <code>EditTexts</code> from other rows will have focus.  It seems to be that the next <code>EditText</code> after the focused one disappears receives focus.  Perhaps this is intentional, but, as a user, it seems very weird.</p></li><li><p>If I set focus to an <code>EditText</code>, receive a virtual keyboard, type something, and click the ""Done"" button on my virtual keyboard, the <code>EditText</code> will empty as soon as the virtual keyboard disappears.</p></li><li><p>Sometimes, when I click an <code>EditText</code>, receive a virtual keyboard and start typing letters, the letters will disappear as soon as I type them.</p></li><li><p>When I click on an <code>EditText</code>, the virtual keyboard shows itself, but the <code>EditText</code> loses focus and I have to click the <code>EditText</code> again.</p></li><li><p>Even though I've set the <code>RatingBar</code> to <code>focusable=""false""</code>, if I move my scrollwheel, it still grabs focus.</p></li></ol><p>One of my problems is all the visible list items get redrawn when I type a character in the virtual keyboard (and since the text of the <code>EditText</code> is set to some data, which is empty, it gets cleared. I don't understand why Android would decide to redraw the list every time I type a character.</p><p>Here is the XML I'm using to draw them.  They are white bubbles, with a gray boarder, and some text, a <code>RatingBar</code> and an <code>EditText</code> inside:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:paddingTop=""10dip""    android:paddingBottom=""10dip""    android:paddingLeft=""15dip""    android:paddingRight=""15dip""    &gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:padding=""2dip""        android:background=""@drawable/shape_outer""&gt;        &lt;LinearLayout            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:padding=""2dip""            android:background=""@drawable/shape_inner""&gt;                    &lt;TextView                            android:id=""@+id/rating_category""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:textColor=""@color/dark_gray""                            android:textStyle=""bold""                            android:layout_marginBottom=""10dip"" /&gt;                        &lt;RatingBar                             android:id=""@+id/rating_rating""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:numStars=""5""                            android:rating=""0""                            android:stepSize=""1""                            android:focusable=""false""                            android:clickable=""false""                            /&gt;                        &lt;EditText                             android:id=""@+id/rating_text""                            android:layout_width=""fill_parent""                            android:layout_height=""wrap_content""                            android:layout_column=""1""                            android:padding=""6dip""                            android:textColor=""#000000""                            android:gravity=""left|top""                            android:lines=""3""                            android:hint=""Comment""                            android:imeOptions=""actionDone"" /&gt;        &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","406790","","1288","","2013-11-01 12:25:26","2013-11-13 19:35:44","Buggy ListView makes me sad","<android><listview><listviewitem><virtual-keyboard>","3","8","7","",""
"3468826","1","","","2010-08-12 14:36:23","0","59","<p>i am currently trying change a imageView in my program, it needs to changed based what the user picks from the screen before, so i was wondering how i can access an image in my drawable folder through a string path?</p><p>all the examples i have seen have been either hard coded (R.drawable.XXX) or asking for the integer id value</p><p>Cheers</p>","418526","","","","","2011-05-09 07:29:13","ViewImage change based on user input","<android>","1","0","","",""
"3468974","1","","","2010-08-12 14:50:15","3","683","<p>I placed an image in each ListView Item at the right side,In the layout xml,I set its width and length as 20dip ,kind of small,and I find it is hard to click at it cause the image only occupied 20*20 dip,I hope the length of it doesn't change,while its height full filling the parent,I tried :</p><pre><code>    android:layout_width=""20dip""    android:layout_height=""fill_parent""</code></pre><p>but it doesn't work.</p><p>Below is my xml:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/item""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:orientation=""horizontal"" android:padding=""6dip""android:background=""#FFFFFF""&gt;&lt;ImageView android:id=""@+id/avatar""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_marginRight=""6dip""    android:src=""@drawable/default_happy_face"" /&gt;&lt;RelativeLayout     android:orientation=""vertical""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_toRightOf=""@id/avatar""            android:layout_toLeftOf=""@+id/optionImg""&gt;   &lt;!-- some stuff unrelated--&gt;&lt;/RelativeLayout&gt;&lt;!-- v Pay attention here v --&gt;&lt;ImageView android:id=""@+id/optionImg""    android:layout_width=""20dip""    android:layout_height=""fill_parent""    android:layout_marginLeft=""15dip""    android:paddingLeft=""5dip""    android:adjustViewBounds=""true""    android:background=""@drawable/option_normal""    android:layout_alignParentRight=""true""    android:layout_centerVertical=""true""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>If you have carefully watch the twitter client for Android,you will find that the image at right side of each ListView Item is quite easy to click (even you have not click on the image but say for example on top of the button). I want to know how to do that.</p><p><img src=""http://www.freeimagehosting.net/uploads/889d10c435.png"" alt=""twitter image""></p><p>Any one? any help? </p>","404145","","82118","","2010-08-12 15:08:17","2012-03-07 02:24:50","How to make an image easier to click?","<android><layout><imageview>","2","0","","",""
"3469016","1","3469188","","2010-08-12 14:55:02","6","10893","<p>I'm testing an android application with a long running service. I'm using Eclipse and have the usb cord hooked up with the phone sitting next to me. Since it's a long ongoing service, I do some other work while it runs and check the logcat logs every once in a while to make sure everything is going as expected. </p><p>A few minutes ago I noticed the phone rebooting. I think it's done this before as it would explain some weird application behavior. I quickly switched over to Eclipse to see what happened and found that the logcat log was (it seems) cleared during the reboot. So there's no log of whether my app crashed (and took down the phone?!) or if there was some other problem that took down the phone and my app.</p><p>Is there anyway I can find out what happened? This is a development phone, so I don't know if it reboots/crashes often on its own, or only while my app is running. It's a Motorola Droid running Firmware version 2.1-update1.</p><p>Thanks for your help.</p>","64193","","","","","2010-08-12 16:56:57","Can I get logcat logs after phone reboots?","<android><reboot><logcat>","3","1","6","",""
"3469448","1","","","2010-08-12 15:42:18","35","59895","<p>I've been running the Android SDK for a while now in Eclipse (MAC OSX). I've downloaded the NDK and installed the C/C++ tools in Eclipse, but could anyone guide me on using the NDK? For example, do I just create an Android project like normal and build it with the NDK instead?</p><p>Really could do with a decent tutorial if anyone know of any.</p><p>EDIT: OK so I have the NDK installed now (I think) but does anyone have any idea how to use it? I got as far as this (taken from <a href=""http://sseyod.blogspot.com/2009/08/android-jnindk-notes-on-getting-started.html"" rel=""nofollow"">here</a>):</p><blockquote>  <p>Run Terminal</p>    <p>cd ~/android-ndk-1.5_r1</p>    <p>make APP=hello-jni</p></blockquote><p>In order to run the hello-jni sample application, but I get an error in terminal saying:</p><blockquote>  <p>Android NDK:  APP variable defined to  unknown applications: hellojni<br>  Android NDK:  You might want to use  one of the following:<br>  build/core/main.mk:81: <em>*</em> Android  NDK:  Aborting    .  Stop.</p></blockquote><p>Any ideas why?</p>","143979","","3283322","","2014-03-04 14:02:48","2014-03-04 14:02:48","Installing & using the Android NDK in Eclipse","<android><android-ndk><installation>","5","12","17","",""
"3469529","1","3469565","","2010-08-12 15:49:59","1","9020","<p>I am starting an app for android. I was wondering if anyone had any tutorials to get me going. Something similar to an alarm that goes off on 2 different occasions on specific dates, these dates and times should be obtained from a csv file or something similar so that i can control when and at what time the alarm goes off.</p>","229616","","958370","","2012-02-04 10:31:51","2012-08-19 21:38:50","tutorial for an alarm needed","<android><android-alarms>","2","0","","",""
"3469660","1","","","2010-08-12 16:05:52","4","2569","<p>I have a series of select elements in a form on a mobile site. These select elements are inside a scrolling pane handled through JS and CSS3 transforms, so getting a touch/click/whatever event to register on the selects was enough of a pain in the first place. However, I'm now finding, on android only, that even though the selects are getting clicked, and are getting focus- they simply refuse to open. I'm 100% sure that the selects are getting their focus event (through debug), so honestly, I am completely stumped. Without the debug, there are no other focus/blur events on the selects. It works fine on iPhone... any ideas? </p>","418623","","","","","2011-05-25 18:02:13","ANDROID WEBKIT: Select elements getting focus events, but not opening!","<javascript><html><android><mobile-webkit>","2","0","3","",""
"3469833","1","3470501","","2010-08-12 16:24:18","5","2327","<p>I'm an experienced Android developer (if such thing exists) who has never worked with OpenGL before. </p><p>There are various advantages of the Android platform (open-source, open distribution, portable, and so on) that make me think that it might be a great environment to finally get into OpenGL.</p><p>But I'm also worried that the complexity of working in a environment with limited resources might be too much for someone who has never worked with 3D graphics before. Also, it seems that Android only uses a subset of OpenGL, and I don't know how this will affect my learning experience.</p><p>What do you think? Is Android OpenGL development newcomer-friendly, or for experienced OpenGL developers only?</p>","143378","","44729","","2010-12-14 20:09:09","2010-12-14 20:09:09","Getting started with OpenGL... in Android","<android><opengl-es>","1","0","3","",""
"3469908","1","3469983","","2010-08-12 16:33:08","85","53481","<p>Is it possible to make a link such as:</p><pre><code>&lt;a href=""anton://useful_info_for_anton_app""&gt;click me!&lt;/a&gt;</code></pre><p>cause my Anton app to start up?</p><p>I know that this works for the Android Market app with the market protocol, but can something similar be done with other apps?</p><p>Here is an example of a link that will start up the Android Market:</p><pre><code>&lt;a href=""market://search?q=pname:com.nytimes.android""&gt;click me!&lt;/a&gt;</code></pre><p><strong>Update:</strong>The answer I accepted provided by eldarerathis works great, but I just want to mention that I had some trouble with the order of the subelements of the <code>&lt;intent-filter&gt;</code> tag. I suggest you simply make another <code>&lt;intent-filter&gt;</code> with the new subelements in that tag to avoid the problems I had. For instance my <code>AndroidManifest.xml</code> looks like this:</p><pre><code>&lt;activity android:name="".AntonWorld""          android:label=""@string/app_name""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.MAIN"" /&gt;        &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;    &lt;/intent-filter&gt;    &lt;intent-filter&gt;        &lt;data android:scheme=""anton"" /&gt;        &lt;action android:name=""android.intent.action.VIEW"" /&gt;        &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;        &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre>","340","","340","","2010-08-12 18:55:45","2014-03-11 16:49:54","Make a link in the Android browser start up my app?","<android>","7","2","91","",""
"3469927","1","","","2010-08-12 16:36:11","2","498","<p>I was expecting to see Categories that a particular Activitybelongs to in ActivityInfo class but I could not find anyreference to Category in the ActivityInfo class.  Anybodyknows where Category information is maintained for an Activity?</p>","378079","","","","","2010-08-12 17:21:28","Category information of an Activity through ActivityInfo class","<android><activity><category>","1","1","","",""
"3469947","1","3470211","","2010-08-12 16:38:38","0","4253","<p>I have a member variable in my Activity which is an ArrayList.  The objects populating this ArrayList are objects I have defined called RatingItem.  RatingItem has several member vars like rating, comment, id, etc.</p><p>I would like to save this ArrayList in onSaveInstanceState so it can be repopulated from onRestoreInstanceState.  What is the best way to do this?  I've never saved the state of an object of this complexity.</p><p>Thank you for your help</p>","406790","","","","","2010-08-12 17:07:46","Saving state of ArrayList of custom objects","<android>","2","0","2","",""
"3470042","1","3592060","","2010-08-12 16:49:56","6","7325","<p>Is there any URI which can point to the GMAIL App in android and help me launch it?</p>","402637","","223391","","2010-08-12 16:53:20","2014-04-13 14:19:41","Intent URI to launch Gmail App","<android>","7","0","8","",""
"3470170","1","3470754","","2010-08-12 17:03:33","0","297","<p>I have a main activity. its main.xml generates a view that holds a slider, which on click, reveles some area for conent. In this area I want to display a map. so I need a second activity. I am able to call the sub activity but I want it to be displayed in the area of the slider of the main.xml, however the map has its own mapview.xml.</p><p>any ideas?</p><p>                                      <br>                         </p>","401025","","401025","","2010-08-12 18:55:04","2011-03-22 19:24:42","Displaying a MapView with a SubAcivity","<android><map><activity><subactivity>","1","0","","",""
"3470185","1","","","2010-08-12 17:04:33","4","3372","<p>I have an compiled executable that is supposed to copy itself from the res folder, and into the /data/data/package-name/ folder, and change the permissions, and then execute. Every step completes all the way to the end. The output stream seems to be writing, etc. Except when I go check the file system, nothing has been done. I first tried with 'sh' then with 'su' (I have a rooted Cyanogen rom).</p><p>Here is the code:</p><pre><code>public class UnexecutableActivity extends Activity {    String executablePath;    TextView outputView;    private UnexecutableTask mUnexecutableTask;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        executablePath = getIntent().getData().getPath();        System.out.println(executablePath);        setContentView(R.layout.main);        outputView = (TextView)findViewById(R.id.outputView);        try {            Process process = Runtime.getRuntime().exec(""su"");        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        Runnable runexecutable = new Runnable(){            @Override            public void run() {                mUnexecutableTask = new UnexecutableTask();                mUnexecutableTask.execute("""");            }        };        runOnUiThread(runexecutable);    }    private class UnexecutableTask extends AsyncTask&lt;String, String, String&gt; {        public UnexecutableTask() {            super();        }        @Override        protected void onPostExecute(String result) {            super.onPostExecute(result);            outputView.setText(outputView.getText() + ""\n"" + executablePath + ""converted to "");        }        @Override        protected void onPreExecute() {            super.onPreExecute();            outputView.setText(""About to un-executable "" + executablePath + "" ..."");        }        @Override        protected void onProgressUpdate(String... values) {            super.onProgressUpdate(values);            outputView.setText(outputView.getText() + ""\n"" + values[0]);        }        @Override        protected String doInBackground(String... params) {        String bashEscapedPath = executablePath.replace("" "", ""\\ "");        try{            String[] commands;            publishProgress(""Loading unexecutable..."");            InputStream unexecutableInputStream = getAssets().open(""unexecutable"");            FileOutputStream fos = new FileOutputStream(getDir("""", MODE_WORLD_WRITEABLE) + ""/unexecutable"");             byte[] tmp = new byte[2048];                int l;                while ((l = unexecutableInputStream.read(tmp)) != -1) {                    fos.write(tmp, 0, l);                }                fos.flush();                fos.close();                unexecutableInputStream.close();            publishProgress(""Changing file permissions..."");            commands = new String[] {""/system/bin/chmod"",""744"", getDir("""", MODE_WORLD_WRITEABLE) + ""/unexecutable""};            Process process = Runtime.getRuntime().exec(""su"");            StringBuffer res = new StringBuffer();            DataOutputStream os = new DataOutputStream(process.getOutputStream());            DataInputStream osRes = new DataInputStream(new                    BufferedInputStream(process.getInputStream()));            for (String single : commands) {               os.writeBytes(single + ""\n"");               os.flush();               //publishProgress(String.valueOf(osRes.readByte()));            }            os.writeBytes(""exit\n"");            os.flush();            process.waitFor();            publishProgress(""Performing un-executable..."");            commands = new String[] {""/data/data/"" + getPackageName() + ""/unexecutable"", bashEscapedPath};            process = Runtime.getRuntime().exec(""su"");            res = new StringBuffer();            os = new DataOutputStream(process.getOutputStream());            osRes = new DataInputStream(process.getInputStream());            for (String single : commands) {               os.writeBytes(single + ""\n"");               os.flush();            }            os.writeBytes(""exit\n"");            os.flush();            publishProgress(""Finishing..."");            process.waitFor();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (InterruptedException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        return ""Success"";    }  }</code></pre><p>If anyone could fix this up for me, (and hopefully use sh!) I would be eternally grateful.</p>","325081","","94687","","2013-04-18 22:00:58","2013-04-18 22:00:58","Writing android app that executes linux commands","<android><shell><exec><root><superuser>","2","5","2","",""
"3470216","1","3470730","","2010-08-12 17:08:41","1","315","<p>In my application, I use a subclass of the Application object to store some references to complex objects I need to access from all of my activities.  When my app starts, the startup activity checks one of these references, in this case a Location, and if it is null, it starts the LocationListeners which populate the reference for further use.</p><p>If I back out of the app to the launcher screen, and re-launch it, the Application object still has the reference from the previous use a few moments prior.  This is fine, and is what I'd expect, but I'm curious how long the Application object is kept around once I've back'ed out of my application?  (onDestroy() has been called on all activities, nothing in the stack.)</p><p>When is it finally killed?  I know it does finally get killed as when I've not used the app in a while, it will search for location on startup (indicating the aforementioned null reference.)</p><p>(Also, is storing refs there like that a good idea?)</p><p>Thanks in advance gang!  :-)</p>","128593","","","","","2010-08-12 18:18:24","How long does my subclass of Android's 'Application' class stick around for?","<android>","1","0","","",""
"3470225","1","3470283","","2010-08-12 17:09:54","1","199","<p>I have some difficulties in finding the directory in which a given class lies.E.g. I have an external lib Plugins.jar imported and want to get the parent directory... How is it done in Android?</p><p>Afaik the Dalvik VM unpacks my Plugins.jar, optimizes it and packs it together with the rest of my app. Thus I'm not sure if there is a way to get the directory at all :/</p>","418693","","","","","2010-10-14 10:23:20","Getting the path to where my classes lie in Android","<java><android><class><path><jar>","2","0","1","",""
"3470420","1","3470774","","2010-08-12 17:36:14","27","16546","<p>I have a linear layout (oriented horizontally) that contains 3 buttons.  I want the 3 buttons to have a fixed width and be evenly distributed across the width of the linear layout.</p><p>I can manage this by setting the gravity of the linearlayout to center and then adjusting the padding of the buttons, but this works for a fixed width and won't work for changing devices or orientations.</p><pre><code>&lt;LinearLayout android:id=""@+id/LinearLayout01"" android:layout_height=""wrap_content"" android:orientation=""horizontal"" android:layout_width=""fill_parent"" android:gravity=""center""&gt;&lt;Button android:id=""@+id/btnOne""android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:width=""120dip""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/btnTwo""android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:width=""120dip""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/btnThree""android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:width=""120dip""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","69983","","","","","2013-01-02 16:46:57","is it possible to evenly distribute buttons across the width of an android linearlayout","<android><android-linearlayout>","5","0","11","",""
"3470458","1","3470568","","2010-08-12 17:40:13","5","798","<p>I just setup SVN for my java Android project through SubEclipse. Can anyone advise me on which files I should not upload to the repository? Just like in Objective C I have my build files in a separate folder, I still don't know how the build system in Java organizes files and what is considered ""build"" files. </p><p>Any advice?</p>","387018","","","","","2010-08-12 17:56:24","What java android files should I not upload to my SVN Server?","<java><android><eclipse><svn><build>","1","0","1","",""
"3470480","1","3470715","","2010-08-12 17:43:28","1","1855","<p>I have the following in a TableRow:                         </p><pre><code>        &lt;TextView             android:text=""Current""             android:id=""@+id/theScreen""             android:layout_width=""wrap_content""             android:padding=""2px""             android:typeface=""monospace""             android:textStyle=""bold""             android:gravity=""enter_vertical|center_horizontal""&gt;        &lt;/TextView&gt;        &lt;ImageView             android:id=""@+id/rightArrow""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:focusable=""false""            android:padding=""2px""            android:src=""@drawable/right_arrow""&gt;        &lt;/ImageView&gt;</code></pre><p>The image in the ImageView is 26 pixels high.  I want the text in the TextView to be centered both horizontally and vertically.  It is centered but stays at the top of the box.  I'm sure I'm overlooking something stupid...Thanks!</p>","418714","","","","","2010-08-12 18:16:51","Can't get text to center vertical and horizontal in Android TableLayout","<android>","2","1","","",""
"3470535","1","3504608","","2010-08-12 17:51:24","7","1794","<p>I've got my android app reporting usage statistics to Google analytics, and everything seems pretty  awesome, however my 'unique visitor' count is always wrong.</p><p>My account is reporting almost 30 unique visitors over the past month or so that I've been in development. The app is only installed on four devices. One of the devices is wi-fi only, and is not hooked up to a phone carrier or data plan.</p><p>So how is a 'unique visitor' defined? My current theory is that because I have uninstalled and installed the application on these devices a number of times, that each new install has become a 'unique' visitor, but I'd like to know if my theory is true or not before this gets launched in the app store. Is there some other reason my unique visitor count would be so high? Or possibly a common mistake I could be missing?</p>","259645","","","","","2010-08-17 16:14:44","What does 'unique visitor' mean in the context of Google Analytics on Android?","<android><google-analytics>","2","2","1","",""
"3470693","1","3470757","","2010-08-12 18:13:44","3","8328","<p>I've found bits and pieces of this answer scattered through other posts, but I wanted to record it here for others.</p><p>How can I simply request the user's GPS and/or Network location and, if they haven't enabled the service, prompt them to do so?</p>","205192","","","","","2011-02-28 10:21:57","Android get location or prompt to enable location service if disabled","<android><geolocation><gps>","1","0","3","",""
"3470862","1","3471022","","2010-08-12 18:36:18","1","1135","<p>I need an Android application which should be able to fetch data from the web (maybe an .apk or a .jar) and launch ""something"" from it.</p><p>If it's a ""trivial"" class there's no problem at all. This is my <strong>Loader</strong></p><pre><code>package com.m31.android.urlload;import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.FileOutputStream;import java.io.IOException;import java.lang.ClassLoader;import java.net.URL;import dalvik.system.PathClassLoader;import dalvik.system.DexClassLoader;public class Loader extends ClassLoader {    public Loader() throws IOException {        super(Loader.class.getClassLoader());    }    public Class loadClass(String className) throws ClassNotFoundException {         return findClass(className);    }    private String fetch_package(String url) throws IOException {        BufferedInputStream in = new BufferedInputStream(new URL(url).openStream());        FileOutputStream fos = new FileOutputStream(""/mnt/sdcard/_plugins/plugin1.jar"");        BufferedOutputStream bout = new BufferedOutputStream(fos,1024);        byte data[] = new byte[1024];        int count;        while((count = in.read(data,0,1024)) &gt; 0) {            bout.write(data,0,count);        }        bout.close();        in.close();        return ""/mnt/sdcard/_plugins/plugin1.jar"";    }    public Class findMyClass(String className, String url) throws IOException, ClassNotFoundException {        String path = fetch_package(url);        DexClassLoader pcl = new DexClassLoader(path, ""/mnt/sdcard/_dex/"", null, this);        return pcl.loadClass(className);    }}</code></pre><p>The problem is that the code I want to execute looks very like an application, which should have a ""simple"" view and some interaction on it.</p><p>I'm not able to invoke the ""onCreate"" method of my downloaded class.</p><p>I guess I've three streets:</p><ol><li>I look for a method which silently install the application and then runs it (is it possible?);</li><li>With your help, I understand how to initialize a second ""application"" inside my own one (with its own R and all stuff);</li><li>I write my master program to fetch data from the web and construct pages dynamically.</li></ol><p>So, I definitely need your help!</p>","258267","","571593","","2011-02-24 17:54:03","2011-02-24 17:54:03","Android application running external Code/Application?","<android><apk><urlclassloader>","2","0","2","",""
"3470918","1","3471177","","2010-08-12 18:44:18","0","888","<p>I'm hoping someone can help with this, as it's driving me absolutely nuts.</p><p>I have a ProgressDialog, which tells the user my app is connecting to a server.  It's launched using ""showDialog(CHECKING_USER_NAME_AND_PASSWORD_AVAILABILITY);"" so that the activity will manage its state for me (specifically, I want the ProgressDialog to stay visible if the device is rotated and I don't want to manage the state myself).  Therefore, I am using onCreateDialog, as described here <a href=""http://developer.android.com/guide/topics/ui/dialogs.html"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/dialogs.html</a>.</p><p>When the server responds, my app displays an AlertDialog by calling ""showDialog(USER_NAME_AND_PASSWORD_NOT_AVAILABLE);  When OK is clicked ""dismissDialog(CHECKING_USER_NAME_AND_PASSWORD_AVAILABILITY);"" is called to remove the ProgressDialog.</p><p>First I'll describe a normal working scenario.User clicks button, ProgressDialog appears, AlertDialog appears (note that I can still see a little bit of the ProgressDialog behind it, as expected), user clicks OK and both Dialogs disappear.</p><p>And here's a non-working scenario:User clicks button, ProgressDialog appears, AlertDialog appears, user rotates the device.  NOW THIS IS WHERE IT GOES BAD - now the AlertDialog is behind the ProgressDialog and the ProgressDialog is in front.  There's no way to close the ProgressDialog since it closes when the user clicks OK in the alertDialog.</p><p>I've tried moving the dismissDialog for the ProgressDialog to various places in the code (like when immedidately when the server responds), but everything I try seems to have different issues.</p><p>I stuck some toast messages in the app, and it appears the calling order of the onCreateDialog and onPrepareDialog methods gets reversed, which explains the problem.  For example, when I first launch the app I see this calling order:<br></p><p>OnCreate for the ProgressDialog<br>OnPrepare for the ProgressDialog<br>OnCreate for the alertDialog<br>OnPrepare for the alertDialog<br></p><p>Then, when I rotate the device (with the alertDialog still up) I see:<br>OnCreate for the alertDialog<br>OnPrepare for the alertDialog<br>OnCreate for the ProgressDialog<br>OnPrepare for the ProgressDialog<br></p><p>Does anyone have any suggestions?  I'm starting to feel like I need to use onSaveInstanceState, which sort of defeats the point of using showDialog in the first place.</p>","418775","","418775","","2010-08-12 20:17:08","2011-04-17 12:19:57","showDialog rotation issue when two dialogs are used","<android>","2","3","","",""
"3471066","1","3472181","","2010-08-12 19:04:53","2","4972","<p>How can I detect in a ListView that someone swiped to the left or the right?</p>","172861","","","","","2013-04-20 18:16:44","Android Swipe to left or right?","<android><gesture-recognition>","2","0","5","",""
"3471259","1","","","2010-08-12 19:26:03","0","964","<p>I have a START and STOP button in the main screen of an App. there are some GUI and threads that are instantiated when I click on START. When I click on stop, I want everything to be stopped and the activity should come back to its origin state. To the state that is exactly same like when launched (when we tapped on App icon in mobile). Is it possible to do this? I tried with finish() , this killed the app and exited . I don't want to exit from main screen. rather, on clicking STOP I want app to come back to origin or born state. Thanks. </p>","357349","","357349","","2010-08-12 19:46:05","2010-08-12 20:31:13","stop or refresh an app's activity","<android><android-emulator>","2","0","","",""
"3471276","1","3506101","","2010-08-12 19:27:56","0","112","<p>I have made an app that have to copy a file from a webpage, the following code doesn't do the job, it can't find the file</p><pre><code>File ekstern = new File(""http://192.168.13.40/cache.manifest"");copyFile(ekstern, intern);</code></pre><p>and the copyFile method:</p><pre><code>    public static void copyFile(File in, File out) throws IOException {        FileChannel inChannel = new            FileInputStream(in).getChannel();        FileChannel outChannel = new            FileOutputStream(out).getChannel();        try {            inChannel.transferTo(0, inChannel.size(),                        outChannel);        }         catch (IOException e) {            throw e;        }        finally {            if (inChannel != null) inChannel.close();            if (outChannel != null) outChannel.close();        }   }</code></pre><p>But the code says that the file doesn't exists</p><p>testing with <em>ekstern.exists()</em></p>","384380","","","","","2010-08-17 19:19:06","have ones app copy file from webpage","<android>","2","0","","",""
"3471357","1","3731011","","2010-08-12 19:39:00","1","1703","<p>I have a ListActivity where the list items are defined in another XML layout. The list item layout contains an ImageView, a CheckBox, a TextView and such.</p><p>What I want is to set an onClick listener to the CheckBox in each list item. That is easy enough. The trouble is I need that onClick handler to know which position in the list it is.</p><p>I'm attaching the listener to the CheckBox in getView after that convertView has been inflated. The getView method has a position parameter, but I cannot reference it in the onClick handler for my CheckBox. I understand why, but I don't know how to get around it.</p><p>How do I accomplish this?</p>","406790","","","","","2010-09-16 21:35:07","Adding onClick handler to View in list item","<android><onclick><adapter><android-arrayadapter>","2","0","","",""
"3471456","1","6941698","","2010-08-12 19:47:33","2","454","<p>I am hoping to use jdb to debug android apps in the emulator via the ddms go between.</p><p>I have successfully set a breakpoint in my class' onCreate and the debugger (jdb) duly breaks. However if I try to ""list"" the code it says it can not find the source file. I start jdb like this from emacs :-</p><pre><code>jdb -sourcepath=""~/programming/android/projects/myproj/src/net/richardriley/myproj"" -attach localhost:8700</code></pre><p>and I know for a fact that myact.java is there in that directory. I am a jdb newbie but isnt sourcepath the way to deal with this? And if not what should I be doing?</p>","37370","","","","","2011-08-04 12:48:33","jdb with android apps - unable to open source file","<android><jdb>","1","0","","",""
"3471503","1","","","2010-08-12 19:53:47","11","14050","<p>I am working on an application wich has its own URI prefix. (dchub:// in this case)</p><p>Searching all over and read a lot but I got a bit confused. </p><p>Is it possible to start my application when someone clicks on a link starting with <code>dchub://</code> in the browser?</p><p>So far found a lot of examples the otherway around opening the browser from your app but thats not what I'm looking for.</p><h2>Update</h2><p>Thanks a lot, i've figured that, now i'm a bit stuck in the next part. </p><pre><code>Uri data = getIntent().getData(); if (data.equals(null)) { } else {     String scheme = data.getScheme();     String host = data.getHost();     int port = data.getPort(); }</code></pre><p>i got some <code>nullpointerexception</code>s if i start the app normally, it works fine if i open from the webpage. So i thought lets include some check for nullvalue but that didn't solve it. any suggestions how i can start the app just by selecting it? </p>","418858","","805252","","2012-02-03 13:34:55","2012-10-21 06:27:41","How to listen for a custom URI","<android><uri>","3","2","5","",""
"3471504","1","3471793","","2010-08-12 19:53:47","0","568","<p>I have an app that uses a TabHost.Several of the Tabs share a common HUD.I am using a service to periodically update those values by calling an AIDL function when ready.</p><p>However, since several of the Tabs are using the same HUD I would like to abstract that part out.</p><p>I thought about having the HUD.xml use a String resource as it's value and then the abstracted class can update the String resource. However, apparently Android can not update String resources programatically.</p><p>The only alternative solution I see would be using SharedPreference.I have concerns accessing a Database everytime the value is refreshed.</p><p>Can anyone please share some options with me.</p><p>Thank you</p>","418859","","","","","2010-08-12 20:32:10","Android - Updating TextView String through AIDL Service","<android><resources><service><aidl>","1","0","","",""
"3471581","1","3472052","","2010-08-12 20:03:30","18","20399","<p>I am trying to accomplish something quite simple, yet I have found no good documentation on this. I have a webView, and I need to load a page in it that requires POST data. Seems like a simple process, yet I cannot find a way to display the result in a webView.</p><p>The process should be simple:</p><p>query(with POST data) -> webserver -> HTML response -> WebView.</p><p>I can submit data using a DefaultHttpClient, but this cannot be displayed in a WebView.</p><p>Any suggestions?</p><p>Much Thanks</p><p>Solution</p><pre><code>private static final String URL_STRING = ""http://www.yoursite.com/postreceiver"";    public void postData() throws IOException, ClientProtocolException {           List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();           nameValuePairs.add(new BasicNameValuePair(""foo"", ""12345""));           nameValuePairs.add(new BasicNameValuePair(""bar"", ""23456""));         HttpClient httpclient = new DefaultHttpClient();           HttpPost httppost = new HttpPost(URL_STRING);           httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));           HttpResponse response = httpclient.execute(httppost);           String data = new BasicResponseHandler().handleResponse(response);         mWebView.loadData(data, ""text/html"", ""utf-8"");    }</code></pre>","122105","","122105","","2010-08-13 15:24:25","2011-10-02 07:30:36","Android Webview POST","<android><post><webview>","3","0","13","",""
"3471613","1","3471777","","2010-08-12 20:07:40","13","17702","<p>I just started android and i'm running into some problems.<br>I have created a listview that is populated from a database.<br>Each row has a button to delete the item from the list and the database.  </p><p>I am able to hook up an event listener to the button but I have not been able to determine the matching database record to be deleted.  </p><p>My class is below </p><pre><code>public class FeedArrayAdapter extends ArrayAdapter&lt;Feed&gt; implements OnClickListener{    private ARssEReaderDBAdapter dba;    private String TAG = ""FeedArrayAdapter"";    public FeedArrayAdapter(Context context, int textViewResourceId, List&lt;Feed&gt; items)          {    super(context, textViewResourceId, items);    Log.w(TAG, ""List"");@Overridepublic View getView(int position, View convertView, ViewGroup parent){    Log.w(TAG, ""getView"");    View v = convertView;    if (v == null) {        LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);        v = vi.inflate(R.layout.feedlistrow, null);    }    Feed feed = getItem(position);    if (feed != null){        TextView title = (TextView)v.findViewById(R.id.TextView01);        if (title != null){            title.setText(feed.getTitle());        }        Button btnDelete = (Button)v.findViewById(R.id.btnDelete);        btnDelete.setOnClickListener(this); //btnDeleteFeedListener    }    return v;}public void onClick(View v){    Log.w(TAG, ""something got clicked: "");}}  </code></pre><p>So how can I pass the database record ID to the handler so I can use the database adapter to delete it.</p><p>Any help is greatly appreciated.</p><p>Kind regards,</p><p>Richard</p>","418874","","399769","","2012-04-20 08:19:04","2012-04-20 08:19:04","Passing a parameter to onclick listener on a button in a listview row","<android><listview><button>","2","0","6","",""
"3471851","1","","","2010-08-12 20:41:33","2","1334","<p>I have an Array that I pass to a CustomAdapter for a ListView. The array has items that are already sorted. Something like:</p><pre><code>[{""stuff"":[{""stuff_id"": ""1"", ""value"":""test123""}, {""stuff_id"": ""1"", ""value"":""test123""}, {""stuff_id"": ""2"", ""value"":""test123""}]}]</code></pre><p>The Array changes allot so I do not know haw many sections I will have. So far I am finding weird results when using a device versus using the emulator. For instance, I Logcat the position in the getView() method every time its called and with the emulator, I only get 0 once. With a device (Motorola Droid - 2.1), every forth row or so is position 0. I figure it has something to do with the screen size and reuse but i am not sure. </p><p>I tried to use login like, if(position == 0) draw section header and then if(stuff_id != previous_stuff_id) draw section header. But since the position goes back to zero, I get header rows where I should not.</p><p>Anyone seen these types of results and know how to fix them?</p>","362608","","508666","","2014-01-12 03:23:14","2014-01-12 03:23:14","Android ListViews and Dynamic Section Headers","<android><listview><header>","0","3","0","",""
"3472033","1","","","2010-08-12 21:06:00","0","234","<p>Can someone point me to an Android example with source that allows the user to scroll through the contents of an xml file that contains text entries (preferrably with arrows on the side of the screen that allow previous/next type of interaction)</p><p>I've looked through the examples on the Android site and didn't see anything similar. Any help would be GREATLY appreciated (I'm an Android newbie but experienced Java developer)</p>","428760","","238639","","2010-08-12 21:56:04","2010-08-12 21:56:04","Scroll through XML content example","<android>","1","0","","",""
"3472040","1","3560206","","2010-08-12 21:06:57","6","2945","<p>Google maps api v3 allows ""styles"" to be applied to the map, including setting the color of various features.  However, the color format it uses is HSL (or what seems like it):</p><ul><li>hue (an RGB hex string)</li><li>lightness (a floating point value between -100 and 100)</li><li>saturation (a floating point value between -100 and 100)</li></ul><p>(from the <a href=""http://code.google.com/apis/maps/documentation/javascript/maptypes.html#StyledMaps"" rel=""nofollow"">docs</a>)</p><p>I managed to find RGB to HSL converters online, but I am unsure how to specify the converted values in a way that google maps will accept.  For instance, a typical HSL value given by a converter would be: <code>209° 72% 49%</code></p><p>How does that HSL value map to the parameters I specified from the google maps api? i.e. how does a hue degree value map to an RGB hex string and how does a percentage map to a floating point value between -100 and 100?</p><p>I am still uncertain how to do the conversion.  I need to, given an RGB value, quickly convert it to what google maps expects so that the color will be identical...</p>","367486","","680093","","2011-04-08 13:54:18","2011-05-18 06:15:19","RGB value to HSL converter","<android><google-maps-api-3><rgb><hsl>","4","0","1","",""
"3472232","1","","","2010-08-12 21:33:01","2","1720","<p>hello all i wish to do is have a non threaded sms app as apposed to the default application.how would i import the current sms/mms 's on the phone to an array?</p><p>Edit:) so how is it that for instance handcent sms imports all of my existing sms messages? </p>","418946","","418946","","2010-08-13 20:35:52","2010-08-13 20:35:52","android simple list view of all sms/mms messages","<java><android><sms>","0","3","1","",""
"3472234","1","3472248","","2010-08-12 21:33:21","4","16942","<p>The following code sort of works, but fixes the number of elements in String[]. Is there a way to make a String[] add the number of elements needed dynamically?</p><pre><code>private static StringBuilder names = new StringBuilder();...public String[] getNames() {    int start = 0;    int end = 0;    int i = 0;    String[] nameArray = {"""","""","""",""""};    while (-1 != end) {        end = names.indexOf(TAB, start);                    nameArray[i++] = names.substring(start, end);        start = ++end; // The next name is after the TAB    }    return nameArray;}</code></pre>","398460","","","","","2013-09-16 05:14:14","How can a StringBuilder best be converted to a String[]?","<java><android><string><stringbuilder>","5","1","","",""
"3472390","1","","","2010-08-12 22:03:06","0","126","<p>Here's what I want to do. Please let me know if this is possible.</p><p>I have an android phone, which I want to control using the SDK to send calls, receive calls , start some application, tap the screen etc. </p><p>TIA</p>","418964","","","","","2010-09-21 14:16:08","Can I use Android SDK to test a handset?","<android><sdk><testing><phone>","1","0","","",""
"3472423","1","3472604","","2010-08-12 22:09:11","3","4096","<p>Is there a way to convert milliseconds to minutes using java.util.concurrent.TimeUnit?</p><p><a href=""http://stackoverflow.com/questions/625433/how-to-convert-milliseconds-to-x-mins-x-seconds-in-java/625624#625624"">This answer</a> seems to suggest that you can use a <code>TimeUnit.MILLISECONDS.toMinutes()</code> method, and the documentation suggests that you could use the <code>TimeUnit.MILLISECONDS.convert()</code> method with <code>TimeUnit.MINUTES</code> - the problem is that neither <code>TimeUnit.MINUTES</code> or <code>TimeUnit.MILLISECONDS.toMinutes()</code> seem to actually exist.</p><p>Am I missing something here?</p>","232332","","","","","2010-08-12 22:44:18","Android java.util.concurrent.TimeUnit Convert Milliseconds to Minutes","<android><time>","2","0","1","",""
"3472443","1","3472506","","2010-08-12 22:12:26","0","9476","<p>having a problem trying to understand how to use  a timer in android. I have an activity that sets up a timerTask in my onCreate method. I call the task on a button click and all it is supposed to do is append a textview. The problem is that I am getting a NullPointerException at <code>timer.schedule(task, TIMER_DELAY, 3*TIMER_ONE_SECOND);</code></p><p>is there any obvious reason for this that I am missing?</p><pre><code>public class UseGps extends Activity{    Button gps_button;    TextView gps_text;    LocationManager mlocManager;    TimerTask task;    Timer timer;    public final int TIMER_DELAY = 1000;    public final int TIMER_ONE_MINUTE = 60000;     public final int TIMER_ONE_SECOND = 1000;public void onCreate(Bundle savedInstanceState)        {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            gps_button = (Button) findViewById(R.id.Button);            gps_text = (TextView) findViewById(R.id.Text);            task = new TimerTask() {                            @Override                public void run() {                    gps_text.append(""Time up "");                    try {                        this.wait(TIMER_DELAY);                    }                    catch (InterruptedException e){                    }                }            };            /* Use the LocationManager class to obtain GPS locations */            double gps[] = getLastKnownGPS();            gps_text.setText(""Last known Location = ""+gps[0]+""   ""+gps[1]);            gps_button.setOnClickListener(new OnClickListener() {                public void onClick(View viewParam){                    gps_text.append(""\n\nSearching for current location. Please hold..."");                    gps_button.setEnabled(false);                    mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);                    LocationListener mlocListener = new MyLocationListener();                    mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener);                    timer.schedule(task, TIMER_DELAY, 3*TIMER_ONE_SECOND);                }            });        }}</code></pre><p>Thanks in advance</p><p>Kevin</p>","409826","","","","","2010-08-12 22:24:49","how to use an android timer","<java><android><timer>","1","4","","",""
"3472562","1","3477416","","2010-08-12 22:36:16","3","647","<p>Does the Android License Verification Library support a device logged in to multiple Google accounts?</p><p>Does it use the first Google account to determine who purchased an app?</p>","291981","","","","","2010-08-13 13:45:52","Android License Verification Library and multiple Google Accounts","<android>","1","1","1","",""
"3472603","1","3472793","","2010-08-12 22:44:05","18","21564","<p>I know this is a very noobish question -- but what is the best way to convert a <a href=""http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/GeoPoint.html""><code>GeoPoint</code></a> to a <a href=""http://developer.android.com/reference/android/location/Location.html""><code>Location</code></a> on the Android platform.</p>","354247","","709202","","2011-10-07 17:47:12","2012-09-03 10:00:17","Convert GeoPoint to Location","<android><google-maps><geolocation>","1","0","5","",""
"3472673","1","3472778","","2010-08-12 22:58:24","1","1184","<p>The default gallery widget only provides events for when items are clicked, but is there any way to tell what item is selected when only dragging the gallery around?</p>","118241","","","","","2012-05-15 06:57:29","Android Gallery Item Focused?","<java><android><gallery>","1","0","1","",""
"3472802","1","3472916","","2010-08-12 23:28:33","7","5317","<p>I'm working on an Android app and it's up to 17 classes. I want to start organizing the .java class files into a more intuitive layout. </p><p>Say I want to have a source code directory called ""views"". When I create that directory using Eclipse, it changes my package name to com.xyz to com.xyz.views. </p><p>Since this package name (com.xyz.views) is different than the rest of my app (com.xyz) is this going to cause me to do a lot of extra work to link those packages? Will this cause problems with the fact that Android Market looks at the package name and is more or less locked to the package name?</p>","268803","","881229","","2014-02-02 05:56:12","2014-02-02 05:56:12","How to organize Android source code into folders","<java><android>","2","0","2","",""
"3472815","1","","","2010-08-12 23:30:46","4","3010","<p>I'm trying to use ViewFlipper to add an animation between views, as in following a tutorial on the subject.  However, it just doesn't seem to want to work.  It'll change the pages, but I get no animation -- even if I add a huge delay to push_left_in.</p><p>Here's my onCreate:</p><pre><code>    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        viewFlipper = (ViewFlipper)findViewById(R.id.flipper);        viewFlipper.setAnimation(AnimationUtils.loadAnimation(this, R.anim.push_left_in));        mapView = (MapView)findViewById(R.id.mapView);        mapView.setBuiltInZoomControls(true);    }</code></pre><p>push_left_in comes from the Google samples.  Here's the trigger action:</p><pre><code>    @Override    public boolean onOptionsItemSelected(MenuItem item) {        // Handle item selection        switch (item.getItemId()) {        case R.id.button_map:            viewFlipper.setDisplayedChild(0);            return true;        case R.id.button_conditions_general:            viewFlipper.setDisplayedChild(1);            return true;(etc)</code></pre><p>And my layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?>&lt;LinearLayout android:id=""@+id/mainlayout""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              xmlns:android=""http://schemas.android.com/apk/res/android"">  &lt;ViewFlipper android:id=""@+id/flipper""               android:layout_width=""fill_parent""               android:layout_height=""fill_parent"">      &lt;view class=""com.google.android.maps.MapView""          android:id=""@+id/mapView""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:clickable=""true""          android:apiKey=""MY_API_KEY""          />    &lt;TableLayout                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:background=""#ffffff""                 android:stretchColumns=""1""                 >      &lt;TableRow>        &lt;TextView android:id=""@+id/field1""                  android:layout_column=""1""                          android:layout_width=""fill_parent""                  android:layout_height=""wrap_content""                  android:textColor=""#000000""                  android:textStyle=""bold""                  android:textSize=""18px""                  android:text=""@string/field1""                  >        &lt;/TextView>        &lt;EditText android:text=""100""                  android:id=""@+id/field2""                  android:layout_width=""wrap_content""                  android:layout_height=""wrap_content"">        &lt;/EditText>        &lt;TextView android:id=""@+id/field3""                  android:layout_width=""fill_parent""                  android:layout_height=""wrap_content""                  android:textColor=""#000000""                  android:textStyle=""bold""                  android:textSize=""18px""                  android:text=""%""                  >        &lt;/TextView>      &lt;/TableRow>    &lt;/TableLayout>  &lt;/ViewFlipper>&lt;/LinearLayout></code></pre><p>Thoughts?</p>","414182","","","","","2013-08-22 10:57:53","No animation with ViewFlipper?","<android>","2","3","2","",""
"3472883","1","3472940","","2010-08-12 23:43:35","0","689","<p>I am trying to draw some boxes in my activity, which will contain other layout elements, in XML. I want to do this using the relative dimensions, e.g. specify half of the height of the screen for each box. I understand that the correct way to do this is to set the initial height to 0px and use layout_weight, but I can't get the following example to work. I am expecting it to draw two identical rectangles (defined in /drawable/rect) in different vertical halves of the screen, but the screen is blank: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt; &lt;ImageViewandroid:src=""@drawable/rect""android:layout_centerHorizontal=""true""android:layout_centerVertical=""true""android:scaleType=""fitXY""  android:layout_width=""fill_parent""android:layout_height=""0px""android:layout_weight=""1""/&gt; &lt;ImageViewandroid:src=""@drawable/rect""android:layout_centerHorizontal=""true""android:layout_centerVertical=""true""  android:layout_width=""fill_parent""android:scaleType=""fitXY""android:layout_height=""0px""android:layout_weight=""1""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>Does anyone have any ideas?</p>","278638","","","","","2010-08-12 23:56:06","Can't get android:layout_weight to work","<android>","1","0","","",""
"3472941","1","3473053","","2010-08-12 23:56:09","1","105","<p>i want to integrate my application with 3rd party application, my understanding is that both application can agree of a action which can be used in intent filter for any activity to be exported which could be used when 3rd party app fires the intent with that particular action in it, any body has a better approach to this, thanks</p>","392574","","225647","","2010-08-13 00:38:36","2010-08-13 00:38:36","making your app available to 3rd party applications","<android><activity><android-intent>","1","0","","",""
"3473168","1","5344635","","2010-08-13 00:59:57","34","27438","<p>Is it possible to start an activity on the stack, clearing the entire history before it?</p><p><strong>The situation</strong></p><p>I have an activity stack that either goes A->B->C or B->C (screen A selects the users token, but many users only have a single token). </p><p>In screen C the user <em>may</em> take an action which makes screen B invalid, so the application wants to take them to screen A, regardless of whether it is already in the stack. Screen A should then be the only item on the stack in my application.</p><p><strong>Notes</strong></p><p>There are many other similar questions, but I haven't found anything that answers this exact question. I tried calling <code>getParent().finish()</code> - this always results in a null pointer exception. <code>FLAG_ACTIVITY_CLEAR_TOP</code> only works if the activity is already on the stack. </p>","165495","","56285","","2013-11-24 13:55:55","2014-02-18 18:47:58","Clear the entire history stack and start a new activity on Android","<android><android-activity><stack>","5","0","11","",""
"3473183","1","3473252","","2010-08-13 01:02:50","1","771","<p>It seems when screen orientation changes, the activity's <code>onCreate()</code> method is called. In my <code>onCreate()</code> method, I have an <code>AlertDialog</code> which pops up when the activity is called. The problem is when I switch the screen sideways, the popup is displayed again.</p><p>How can I avoid this?</p>","382252","","119895","","2010-08-13 01:25:20","2010-08-13 01:27:42","Show AlertDialog on Activity start, but not on screen orientation change?","<android><alertdialog>","1","0","","",""
"3473300","1","","","2010-08-13 01:38:29","3","304","<p>Is there a guide somewhere showing [Device] > [Settings to replicate it in AVD]??  If not, what values should I use for the Dell Streak specifically?</p>","417514","","","","","2011-04-08 22:05:29","How do I create an AVD which replicates the Dell Streak's display","<android>","1","0","","",""
"3473330","1","4235602","","2010-08-13 01:45:21","5","1371","<p>my code:</p><pre><code>for(var myLine = 0; myLine &lt; 100; myLine++)      document.getElementById(""myDiv"").innerHTML += ""line "" + myLine + ""&lt;br&gt;"";...............&lt;div style=""position:...etc; overflow:auto;"" id=""myDiv""&gt;&lt;/div&gt;</code></pre><p>this works without a glitch in every browser on all non mobile platforms.  However... when this is implemented on iPhone (Safari) or Android (webkit) the div gets filled up with the text but no scrollbar is generated when the text runs past the height of the div and the user can't ""push"" the content down either. So effectively overflow is always ""hidden"" no matter what.</p><p>I'm curious if there's some alternative approach that I'm overlooking or if this is just a bug I  have no way to get around at the moment.</p>","59947","","","","","2010-11-25 14:28:31","how do I make content scroll dynamically in a DIV on Iphone's safari or android's webkit?","<iphone><android><safari><webkit>","3","0","","",""
"3473392","1","3474022","","2010-08-13 02:03:32","2","997","<p>I am trying to find the path for the android database files on Ubuntu 10.4, because I want to access with SQLite Browser. Someone can tell?</p>","399459","","379693","","2010-10-30 08:47:23","2011-11-22 12:41:23","What is the path for Android database files on Ubuntu?[RESOLVED]","<android><database><sqlite><sqlite3>","2","0","1","",""
"3473472","1","3476158","","2010-08-13 02:26:35","2","3670","<p>I previously asked a question that I still have not been able to solve:</p><pre><code>http://stackoverflow.com/questions/3126347/android-relativelayout-how-to-alignparentbottom-when-wrapped-in-a-scrollview</code></pre><p>What I am trying to do is align a view to the bottom of the screen, using either a RelativeLayout or LinearLayout, and then wrap that layout in a scrollview to permit scrolling when necessary (for changes to landscape orientation or on small screen devices).</p><p>To date, what I find is that anything aligned to parent bottom works great as long at the bottom is visible...but if the bottom is below the scroll, the view that is aligned parent bottom jumps up to the top.</p><p>This seems like a very common design for ads that appear on the bottom, so I would think that this is possible. Is it?</p>","268648","","","","","2010-08-13 10:56:48","Android: How to align ads to the bottom of screen even if the view scrolls?","<android>","1","0","3","",""
"3473485","1","","","2010-08-13 02:30:16","0","175","<p>I want to develop a Gmail related application. But when I get the field ""fromAddress"" of conversation table from Gmail database, it is in a special rule to include sender names, like ""n3200 Nick Lai"". Does anyone know that the rule of this field displayed?</p>","314231","","307705","","2012-02-27 07:21:21","2012-02-27 07:21:21","how to parse the field ""fromAddress"" of Gmail database on Android device?","<android><gmail>","0","2","","",""
"3473518","1","3473535","","2010-08-13 02:40:51","0","2822","<p>How to calculate the date difference in Android?</p>","358218","","157882","","2010-08-13 02:50:18","2010-08-13 02:50:18","How do I calculate the date difference?","<java><android><datetime><date>","1","2","","",""
"3473585","1","3474759","","2010-08-13 02:58:57","0","507","<p>I have a ListView which has a TextView in the row. The TextView has been Linkified and has had setMovementMethod(LinkMovementMethod.getInstance()) set on it.</p><p>The ListView is no longer selectable and the ListView's getSelectedItemPosition() always return -1 .</p><p>Is there a way to know where the ListView has scrolled to in this case?</p>","172861","","","","","2010-08-13 07:26:17","Android Linkify stops getSelectedItemPosition() from working?","<android><linkify>","1","0","","",""
"3473707","1","","","2010-08-13 03:33:31","2","487","<p>Is there some place which describes the contract between Adapter and AdapterView, or between ListView and ListViewAdapter.</p><p>I'm trying to create my own ListView Adapter. It is not clear to me the sequence of method invocations nor who maybe calling these methods.</p><p>There appear to be several overlapping methods. </p><ul><li>getItem returns a data object, butyou don't know the type.</li><li>getItemViewType returns an integer. Who determines the integer? Are theydefined somewhere? Userdefined?</li><li>getView</li></ul><p>getView seems to be the only one that really matters. What other code maybe involved that would try to do something with the returned data and returned view? How can this other code know how to assign the data to the view if the type of neither is known?</p><p>A general explanation of the design would be helpful.</p>","295392","","932225","","2012-07-13 09:27:45","2012-07-13 09:27:45","Contract between Adapter and AdapterView","<android><listview><adapter><android-adapterview>","1","0","","",""
"3473735","1","3476943","","2010-08-13 03:42:57","0","2300","<p>I have a DB sorted by date, and in my output, I would like to display the elapsed time between rows.. like this..</p><blockquote>  <p>| Entry #1 on 08/10/2010 08:34 AM</p>    <p>| Entry #2 on 08/10/2010 09:45 AM  | 1 hour 11 minutes since previous entry</p>    <p>| Entry #3 on 08/11/2010 06:57 AM  | 1 day 3 hours 12 minutes since previous entry</p>    <p>| Entry #4 on 08/11/2010 08:34 PM  | 13 hours 37 hours since previous entry</p>    <p>| Entry #5 on 09/11/2011 08:48 PM  | 1 year 1 month 8 minutes since previous entry</p></blockquote><p>I've looked at getRelativeTimeSpanString() but 1) it calculates from now &amp; 2) it appends a prefix/suffix.</p><p>Is there an easier way to do this, other than creating a custom datediff method and chopping all of that together with conditions myself?</p><p>Thanks in advance.</p>","350237","","","","","2010-08-15 13:00:13","Is there a function to calculate the difference between two times and display a relative result?","<android>","1","0","1","",""
"3473738","1","","","2010-08-13 03:44:10","1","2005","<p>i am in process of making a custom UI for my app, have almost created XML based shapes for all the controls which is fine, but spinner seems to be the main problem, is their any example for making a new shape for spinner, which could be supported on 1.5 to 2.2, i know about a tutorial that tells for custom shape for spinner but that`s for less then 1.5, thanks</p>","392574","","","","","2011-01-17 13:01:02","custom UI for drop down","<android><xml><spinner>","1","1","1","",""
"3473781","1","","","2010-08-13 03:56:23","3","850","<p>I am new to Android test frameworks ,Would like to know the differences between existing test frameworks : Monkey , CTS ,Instrumentation Framework &amp; Robotium ?</p>","419154","","","","","2013-12-19 15:03:35","Android Test Frameworks","<android><testing>","1","1","1","",""
"3473815","1","","","2010-08-13 04:04:23","0","594","<p>I wanted to know if Android 2.2 (Froyo) supports Bluetooth V3 . If any of you guys know let me know.</p><p>Thank You.</p>","383347","","65977","","2010-08-13 05:35:01","2010-08-13 05:35:01","Which Version of Bluetooth does Android Froyo Support","<android><bluetooth>","1","0","","",""
"3473828","1","3475933","","2010-08-13 04:07:24","0","243","<p>Is it possible to have another layout in my main layout?Such that i can set my imageview in another layout.</p>","358218","","","","","2010-08-13 10:18:11","Is it possible to have another layout in my main layout?","<android><eclipse><image><imageview>","2","1","","",""
"3473843","1","","","2010-08-13 04:12:01","0","258","<p>I want to display an image on screen and edit it (as the paint function  in windows) and then save it to the hard disk. Any suggestions?</p>","419147","","777408","","2012-07-13 12:03:27","2012-07-13 12:03:27","How to draw anything on image and save it to hard disk on Android?","<android><image-processing><android-emulator>","0","3","","",""
"3473855","1","","","2010-08-13 04:16:28","0","572","<p>I have a test project that uses $getJSON to pull data from web services like Geonames and our own proprietary services.  The index page uses two $getJSON calls, and they load fine both when you first load the page or press the refresh.  However, if you navigate to another page and then hit the back button to go back to the index page, the page begins reloading and just stops when it hits the $getJSON calls. I've read about Android browser not caching well with the back button in 2.1 (what I'm using)- I'm fine with page reloads as long as it actually completely loads the page.</p><p>I've tried this in Firefox and it caches the index page, so there's no re-running of the JSON calls.  That's why I'm asking it here in an Android capacity- is it purely the no-caching back button thing that is the problem or is there something I could change about my $getJSON calls?</p><p>Here's the page:<a href=""http://MPulsemobile.info"" rel=""nofollow"">http://MPulsemobile.info</a></p>","419163","","","","","2012-12-09 10:32:57","Android: Browser back button will not fire $getJSON event","<android><browser><button><getjson><back>","1","0","","",""
"3473881","1","3896375","","2010-08-13 04:24:44","0","703","<p>I have an app that allows the user to take and save a new picture using the Intent ACTION_IMAGE_CAPTURE. After the user accepts the newly taken picture, I create a ContentValue object to set the picture information, and then I insert the picture into the MediaStore and send a broadcast so that the user can see the photo when opening a picture viewer app such as gallery:</p><pre><code>ContentValues newImage = new ContentValues(3);newImage.put(Media.DISPLAY_NAME, mPicName);newImage.put(Media.MIME_TYPE, ""image/png"");newImage.put(MediaStore.Images.Media.DATA, path);mPictureUri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, newImage);sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, mPictureUri));</code></pre><p>All of this code works fine. The photo is correctly saved, and I can view the photo using gallery. The problem is that when I view the photo in gallery and select ""Details"" it shows the photo name as ""null."" And yes, I know for a fact that the variable mPicName above is not null and always has the correct value.</p><p>The odd thing is that, when running my app on my Droid running Android 2.1, when I choose to copy files to/from the phone and my computer, I open up the Droid on my Windows computer, and when I go into my app's created folder for photos and view the new photo, the name is correct. Then, when I disable copying files from the phone/computer and go back into gallery to view the file on my Droid, the name is suddenly correct and is no longer null.</p><p>Can someone tell me why the name is null after my code runs, and why the name is correct after viewing the file on my computer rather than on the phone? Is there a way to get the name non-null right when the picture is saved? I'd bet that the name would be correct if I turned my phone off and turned it back on, but I'm not sure how exactly to get force things to work immediately.</p>","449070","","","","","2010-10-09 16:20:44","Android MediaStore setting photo name to NULL","<android><photo>","1","0","","",""
"3473911","1","3474111","","2010-08-13 04:34:27","3","6549","<p>I have a service which both downloads a file and saves it, and it seems I can only specify one permission.</p><pre><code>&lt;service android:enabled=""true""            android:name="".DownloadService"" android:permission=""android.permission.INTERNET""&gt;            &lt;/service&gt;</code></pre><p>or</p><pre><code>&lt;service android:enabled=""true""            android:name="".DownloadService"" android:permission=""android.permission.WRITE_EXTERNAL_STORAGE""&gt;            &lt;/service&gt;</code></pre><p>I need both.</p>","325081","","","","","2013-11-11 18:25:19","Can an Android Service have multiple Permissions?","<java><android><permissions><manifest>","2","0","1","",""
"3474013","1","","","2010-08-13 04:59:07","0","4283","<p>In my understand, Anroid app supports only SPP connection not HFP and A2DP.</p><p>However, I want to initiate HFP and A2DP connection in Android app just like selecting Bluetooth device in Bluetooth Settings menu. I'm not sure it is possible to use a intent including BluetothDevice object, so the intent receiver can initiate HFP and A2DP connection.</p><p>If you have a idea, could you let me know that?  </p>","419195","","","","","2014-02-06 06:48:12","How Android app can initiate Bluetooth HFP and A2DP connection to Bluetooth Headset?","<android>","1","0","1","",""
"3474029","1","3474463","","2010-08-13 05:01:59","2","4235","<p>I have an Android Spinner and I want to listen the event when the user press ""Back Key"" when the spinner's select panel is showing.I have implement the OnItemSelectedListener ,but the onNothingSelected(AdapterView arg0) was not invoked when press back key.<br></p><p>I just want to listen the event when user select nothing( or the select panel disappear) .<br></p><p>Is there a correct way to do this?</p><p>Thanks!</p><hr><pre><code> Spinner s1 = (Spinner) findViewById(R.id.spinner1);    ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(            this, R.array.colors, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    s1.setAdapter(adapter);    s1.setOnItemSelectedListener(            new OnItemSelectedListener() {                public void onItemSelected(                        AdapterView&lt;?&gt; parent, View view, int position, long id) {                    showToast(""Spinner1: position="" + position + "" id="" + id);                }                public void onNothingSelected(AdapterView&lt;?&gt; parent) {                    showToast(""Spinner1: unselected"");                }            });</code></pre><hr><p>This is a sample in Android 2.2 SDK,it's also not show ""Spinner1: unselected"" when the select panel disappear.</p>","419182","","","","","2010-08-13 06:35:17","why was the onNothingSelected in spinner not invoked?","<android><spinner>","1","0","2","",""
"3474210","1","","","2010-08-13 05:46:14","3","2237","<p>I've completed most of the game I'm attempting to make and throughout the project I've created one particular Activity which also calls a SurfaceView and a Thread.  I put an update() method in each of the 3 classes so they each know where the other ones are everytime something changes.  Apparently, the only way to do something like this is using static methods... This is fine until a collision occurs in my SurfaceView and I want to tell the Activity what to do. I can relay the information, but then I cannot find a way to make an AlertDialog.</p><p>I understand I cannot call showDialog() from a Static method, but I cannot find a way to make a non-static method to call it with and then call that method from a static one.  I've been searching for an answer and I've heard something about instantiating the object but I cannot figure out what that means...</p><p>If anyone has a good idea to get me around this, please let me know :)</p>","394991","","","","","2012-10-20 22:52:36","Creating AlertDialog with Static Methods?","<android><static><activity><surfaceview><alertdialog>","2","3","","",""
"3474241","1","3495841","","2010-08-13 05:52:13","1","191","<p>This has probably been asked before, but I can't find a good way of implementing it.  I'm trying to write a program that manages a form of messages, and these messages are received from an external data source.  This all works.  However, the problem comes when I try to notify the user: I would like to have the notification jump directly to the message when it is touched, but this seems to mess up the back stack.  This is probably best explained by example:</p><ol><li>I open up the message list, the main activity, and browse for a while.</li><li>I hit home and go into another app (let's say Music).</li><li>A new message is received.  A notification comes up, which I touch.  The message detail view is displayed.</li><li>Now I hit Back.  What I want to have happen is that I return to Music, but unfortunately, Back sends me to the message list, and <em>then</em> hitting Back will return me to music.</li></ol><p>The both the list and the detail activities are marked as ""singleTop"", and the exact flags that I use for the notification Intent are:</p><ul><li><code>FLAG_ACTIVITY_NEW_TASK</code></li><li><code>FLAG_ACTIVITY_CLEAR_TOP</code></li><li><code>FLAG_ACTIVITY_SINGLE_TOP</code></li></ul><p>I figure if the Messaging application can do this, why can't I?</p>","111866","","","","","2010-08-16 17:54:02","How to implement an Android detail notification?","<java><android><activity><android-manifest>","1","0","1","",""
"3474258","1","3474721","","2010-08-13 05:56:46","1","3736","<p>i have searched on the Image types supported by Android everywhere.</p><p>Actually, my confusion is <strong><code>which are image types supported by Android</code></strong> (i.e. JPEG, gif, or other) , because just now i have done camera capturing code with JPEG, but when i go and open the Albums from my HTC Hero, then i cant view photos and images which i have captured.so <strong><code>should i not captured photos with extension as .jpeg??</code></strong></p><p>The error shown in Alert box are: <strong><code>""The application Albums(process.com.htc.album) has stopped unexpectedly. Please try again"".</code></strong></p>","379693","","","","","2011-11-03 07:44:09","Android - Supported Image Types","<android><android-camera><android-image><android-photos>","2","0","2","",""
"3474287","1","3474353","","2010-08-13 06:03:21","0","716","<p>i am developing one application for displaying images and labels and its sound.i want to get this info from xml .where i need to keep xml file in android project how to get values from that xml file</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","","","","2011-03-11 12:28:02","external xml file integration in android","<android>","1","0","","",""
"3474318","1","3474643","","2010-08-13 06:11:35","2","18666","<p>I am trying to write a batch(for win) and a shell script for linux to automate key and touch events on a android UI. At the moment in a windows batch file I am starting a adb shell for each event for eg</p><pre><code>    :againadb shell am start -a android.intent.action.MAIN -n com.q.me.fui.activity/.InitActivitysleep 15adb shell sendevent /dev/input/event0 3 0 281adb shell sendevent /dev/input/event0 3 1 70adb shell sendevent /dev/input/event0 1 330 1adb shell sendevent /dev/input/event0 0 0 0adb shell sendevent /dev/input/event0 1 330 0adb shell sendevent /dev/input/event0 0 0 0   adb shell sendevent /dev/input/event0 1 330 1adb shell sendevent /dev/input/event0 0 0 0adb shell sendevent /dev/input/event0 1 330 0adb shell sendevent /dev/input/event0 0 0 0adb shell sendevent /dev/input/event0 0 0 0adb shell sendevent /dev/input/event0 0 0 0   sleep 5adb shell input keyevent 82adb shell input keyevent 20adb shell input keyevent 20adb shell input keyevent 22adb shell input keyevent 22adb shell input keyevent 22adb shell input keyevent 66sleep 5goto again</code></pre><p>The above code is infact starting a new adb shell each time. I want to avoid this. I want my batch script to start the adb shell only once and I would like to route the sendevent and other commands to the subshell, ie the adb shell.</p><p>Any idea how I can do this in win batch and Lin shell script. I have tried a few options but they dont seem to work :(</p><p>Thanks in advance.</p>","414752","","414752","","2010-08-13 06:52:45","2012-10-24 13:58:10","shell/ batch scripting to direct commands to adb shell","<android><batch-file><shell><adb>","3","0","7","",""
"3474387","1","3474619","","2010-08-13 06:24:07","1","468","<p>friends,</p><p>i have a page on which i am displaying image from gallery then i have next page button to move to next activity on that button i am using clearBitmap();to free memory used by it.</p><p>private Bitmap bitmap;</p><pre><code>oncreate(){ _image = (ImageView)findViewById(R.id.MyImage);_path = getRealPathFromURI(_data.getData());            BitmapFactory.Options options = new BitmapFactory.Options();            options.inSampleSize = 2;            bitmap = BitmapFactory.decodeFile( _path, options );_image.setImageBitmap(bitmap);next.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View view) {            Intent myIntent = new Intent(UploadImageOnly.this, ImageGallery.class);                        startActivity(myIntent);clearBitmap();}</code></pre><p>which gives me errorlogcat</p><pre><code>08-13 12:07:07.649: ERROR/AndroidRuntime(753): Uncaught handler: thread main exiting due to uncaught exception08-13 12:07:07.869: ERROR/AndroidRuntime(753): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@43c13dd008-13 12:07:07.869: ERROR/AndroidRuntime(753):     at android.graphics.Canvas.throwIfRecycled(Canvas.java:955)08-13 12:07:07.869: ERROR/AndroidRuntime(753):     at android.graphics.Canvas.drawBitmap(Canvas.java:1044)08-13 12:07:07.869: ERROR/AndroidRuntime(753):     at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:323)08-13 12:07:07.869: ERROR/AndroidRuntime(753):     at android.widget.ImageView.onDraw(ImageView.java:845)08-13 12:07:07.869: ERROR/AndroidRuntime(753):     at android.view.View.draw(View.java:6535)</code></pre><p><strong>code</strong></p><pre><code>public void clearBitmap() {        try{            if(bitmap!=null &amp;&amp; !bitmap.isRecycled()){                    bitmap.recycle();                    bitmap = null;            }            }catch(Throwable e){                    System.out.println(e.getMessage());                    e.printStackTrace();            }          System.gc();         }</code></pre>","249991","","","","","2010-08-13 07:03:03","which is the suitable method to recyle bitmap?","<android><image-processing>","1","0","1","",""
"3474401","1","","","2010-08-13 06:26:12","0","444","<p>If i click on a button on one layout it should add text view in another layout dynamically again if i click that button same procedure should get repeat.  </p>","419242","","","","","2013-04-15 06:21:42","Dynamic addition of text view by clicking on button","<android>","1","0","","",""
"3474448","1","3475772","","2010-08-13 06:33:45","2","3488","<p>I am using webview in android to display images (mainly using google ajax API), Now if I want to save an image into local storage, How do I do ? I have image url, which can be used for saving. </p>","207646","","","","","2014-04-04 03:23:43","Saving image, webview, android","<android><webview>","2","0","","",""
"3474538","1","3474878","","2010-08-13 06:47:49","2","4777","<p>Is it possible to get path of database file in android at path : ""/data/system/accounts.db""</p><p>in my app i want to use this database, but not getting its path.if i do hardcoding and remove the file i'm able to do it. But i want to access it as database so that i can drop the table.</p><p>Any help would be appreciable.</p><p>code i tried:</p><pre><code>    private SQLiteDatabase db;    File dbFile = mContext.getDatabasePath(""accounts.db"");    if (dbFile.exists())    {        db = SQLiteDatabase.openOrCreateDatabase(dbFile, null);        db.execSQL(""DROP TABLE IF EXISTS accounts"");        db.setVersion(db.getVersion()+1);    }</code></pre>","419256","","","","","2010-08-18 12:51:21","how to access path of database or file of different app in android","<android><database><path>","1","0","","",""
"3474567","1","","","2010-08-13 06:52:26","7","3715","<p>I have a problem. I am trying to make a broadcast receiver acquire a wake lock so my alarm  will wake the phone from sleep mode.</p><p>In the broadcast receiver below, the program crashes with ""source not found"" on line ""sCpuWakeLock.acquire(); when the class ""AlarmAlertWakeLock"" is called by AlarmReceiver.Any idea what's going on? Is there a better way to do what I'm trying to do?</p><p><strong>In one file:</strong></p><pre><code>import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;public class AlarmReceiver extends BroadcastReceiver {    @Override    public void onReceive(final Context context, Intent intent) {        AlarmAlertWakeLock.acquireCpuWakeLock(context);    }    }</code></pre><p><strong>In a separate file:</strong></p><pre><code>import android.content.Context;import android.os.PowerManager;public class AlarmAlertWakeLock {    private static PowerManager.WakeLock sCpuWakeLock;    static void acquireCpuWakeLock(Context context) {        if (sCpuWakeLock != null) {            return;        }        PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);        sCpuWakeLock = pm.newWakeLock(                PowerManager.PARTIAL_WAKE_LOCK |                PowerManager.ACQUIRE_CAUSES_WAKEUP,""okTag"");        sCpuWakeLock.acquire();    }    static void releaseCpuLock() {        if (sCpuWakeLock != null) {            sCpuWakeLock.release();            sCpuWakeLock = null;        }    }}</code></pre>","419262","","6391","","2010-08-13 06:56:29","2011-05-09 08:06:25","Problem acquiring wake lock from broadcast receiver","<android><broadcastreceiver><alarm>","1","0","3","",""
"3474604","1","3475938","","2010-08-13 07:00:33","2","374","<p>Is there a way to ask the mail programms on an Android Device how many unread mails they have?</p>","404655","","","","","2010-08-13 10:18:21","Get the number of unread mails on an Android Device","<android>","1","0","","",""
"3474663","1","","","2010-08-13 07:12:30","0","150","<p>Let's say, there are four apps in the system: app1, app2, app3, app4.</p><p>Be default, when the system is up, all apps will be shown in the home screen. Now if we provide a customized log in screen, user A log in, then for this user, he can only see (and use ) app1 and app2.</p><p>Then A log out, user B log in, he can only see app3 and app4.</p><p>Does API provide such capability to load the app list dynamically?</p><p>Hope someone can help, thanks.</p>","419276","","","","","2010-08-13 09:29:21","how to dynamically load the app list in android","<android>","1","0","","",""
"3474735","1","","","2010-08-13 07:22:42","0","1018","<p>I am trying to acquire a wake lock in a broadcast receiver so that my alarm clock application can wake the phone from sleep. It crashes at the following line in the code below: </p><pre><code>PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, ""My Tag"");</code></pre><p>Any ideas what's going on? Is there a better way to do this?Thanks!</p><pre><code>import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.os.PowerManager;public class RepeatingAlarmReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {          AlarmAlertWakeLock.acquireCpuWakeLock(context);         PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);         PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, ""My Tag"");         wl.acquire();    }}</code></pre>","419262","","318493","","2010-08-13 08:43:57","2010-08-13 08:47:56","Android - acquiring a hold lock from a broadcast receiver","<android><sleep><clock><alarm><wakeup>","2","1","","",""
"3474780","1","","","2010-08-13 07:30:23","1","2025","<p>The question I have is simple but hard to put in words, I'll give it a try anyways.</p><p>I am trying to load a web page in webview. However, the load time is a little bit too high.</p><ul><li>Is there any way I can put the images in the assets folder and load them from there instead?</li><li>If not, is there a way I can load the whole site from the assets folder, providing that my PHP files can still communicate with my internet database?</li></ul><p>I have already read most tutorials, but those are pretty vague when it comes to concrete help.</p>","418048","","592174","","2011-03-28 10:25:32","2013-09-20 20:08:03","Load images or whole site from local ""assets"" folder using webview","<android><webview><android-image>","3","0","","",""
"3474881","1","3474931","","2010-08-13 07:46:52","0","1557","<p>I have a long task that requires 10 / 15 seconds. I want to display a dialog, or a view or other stuff to let the user know ""hei! I'm working for you. I'm at 90%"".</p><p>Actually I have 3 layouts: the currentLayout, the progressLayout and the resultLayout. From the main activity I have a function like that:</p><pre><code>...setContentView(R.layout.progressLayout );SomeLongTask();setContentView(R.layout.resultLayout);...</code></pre><p>but the progressLayout never shows. </p><p>What's the best way to do this?</p>","50455","","","","","2010-08-13 07:54:20","How to display a waiting dialog in android","<android>","1","0","","",""
"3474911","1","3475325","","2010-08-13 07:51:06","2","2174","<p>I have a binary file which contains keys and after every key there is an image associated with it. I want to jump off different keys but could not find any method which changes the index positioning in input stream. I have seen the <code>mark()</code> method but it does not jump on different places.</p><p>Does anybody have any idea how to do that?</p>","397901","","22656","","2010-08-13 07:54:41","2010-08-13 09:09:03","changing the index positioning in InputStream","<java><android>","1","1","3","",""
"3474982","1","3475809","","2010-08-13 08:02:40","4","1118","<p>I'd like to dynamically apply styles to my views at runtime.Is there any method like View.setStyle(int style)?</p><p>Thanks</p>","218783","","","","","2010-08-13 10:02:10","Applying style dynamically","<android><themes>","1","0","","",""
"3475012","1","3917287","","2010-08-13 08:06:57","2","718","<p>I'm trying to figure out if a system event broadcast is broadcasted using ordered broadcast or normal.. The event is EVENT_REMINDER and in the source for the calendarprovider i noticed it sets up a alarmmanager to sent the broadcast. </p><p>I can't find how the alarmmanager sends it. My guess would be as a normal broadcast , But while i was trying some things i noticed i could delay the system's notification (tried up to 10 sec) by building a sleep in my broadcastreceiver. This would indicate that they are handled ordered , and the systems receiver is only called when mine has finished. </p><p>But can i be sure of this behavour?? (in all 1.5> sdk versions) the docs state that in some cases normal broadcasts are also handled ordered..due to spare of resources. </p><p>All thoughts on this are welcome.... Thanks , arnold </p>","368598","","","","","2010-10-12 17:15:29","is this systems broadcast ordered or normal broadcast?","<android><broadcast>","1","0","","",""
"3475126","1","","","2010-08-13 08:25:03","0","252","<p>I am absolutely fed with with Windows Mobile 6.0 on my XDA Orbit2. Has anyone tried putting android on it?</p>","419338","","","","","2010-08-13 08:25:03","Android on XDA Orbit2","<android><htc><xda>","0","2","","",""
"3475189","1","4021268","","2010-08-13 08:35:48","3","1091","<p>I have clickable icons on a map showing a PopupWindow just above the icon when clicked. However, if the icon is on the topmost part of the map the PopupWindow will be hidden under the Android Status Bar. The PopupWindow will automatically adjust to the right and left edges of the screen, and also to the top edge but doesn't take the status bar panel into account.</p><p>Either there should be a way to accomodate the height of the MapView, or an attribute to the PopupWindow that takes the status bar into account. Of course it's always possible to add a fixed size top margin, but the top panel have different heights on different Android units. </p><p>Can anyone help with this?Thanks!</p>","419305","","","","","2011-06-29 06:05:07","How to make MapView height take the Android status bar into account?","<android><google-maps><android-mapview><popupwindow>","1","3","1","",""
"3475207","1","","","2010-08-13 08:38:54","0","1957","<p>Did anyone implemented multi theme support for android app? Are there any common practices for this?</p><p>Thanks for any advice.</p><p><strong>UPD:</strong> The main problem for now is that android's theme engine doesn't support selectors like in CSS. For example if I have two views with ""background"" attribute there's no way to make theme engine distinguish those ones and set different backgrounds. I can specify different style for each view but this approach lacks flexibility 'cause it's impossible to apply style for whole activity at once.</p>","218783","","218783","","2010-08-13 12:25:47","2010-08-13 12:25:47","Multi theme support in android app","<android><themes>","1","3","1","",""
"3475341","1","","","2010-08-13 09:00:11","1","1210","<p>I am using AsyncTask in my application.</p><p>The problem is that when server is down the AsyncTask throws an Interrupted exception. How to track that whether server is down or not. </p><p>`</p><pre><code>HttpGet httpget = new HttpGet(urls[i]);ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();content = httpClient.execute(httpget, responseHandler);</code></pre><p>`</p><p>This same problem also occurs when the handset is kept idle for some time then keyguard gets lock and I suppose that WI-FI also gets disabled. So, when I enable the keyguard and if my application is in foreground then it gives the same exception. </p><p>Can someone please let me know what should I do in order to remove this exception? Is there in solution to this.</p><p>Please let me know what can be done.</p><p>Regards</p><p>Sunil</p>","261566","","","","","2010-08-13 09:24:04","Handling interrupted exception of AsyncTask in Android?","<android><exception><android-asynctask>","1","0","","",""
"3475350","1","3475378","","2010-08-13 09:02:12","0","2204","<p>I have 2 ImageViews which have AnimationDrawable backgrounds to animate a box opening and closing when you click on it. The 2 images are slightly overlapping (the transparent area) so they can be closer together.</p><p>The problem this is causing is that I am unable to click on regions of the 1st image where the 2nd image (transparent area) is overlapping.</p><p>Is there a way to set a clickable region of an ImageView?</p>","409853","","","","","2010-08-13 09:06:02","How to set a clickable region for an ImageView?","<android><imageview><clickable>","1","0","1","",""
"3475412","1","","","2010-08-13 09:10:37","1","839","<p>I am using gridview for displaying images. Initially I am displaying 16 images in the gridview and next I want to display 32 images in the gridview.</p><p>I want a next button at the bottom of the grid view to go to the next set of images. </p><p>How can I set button at the bottom of a gridview for Android?</p>","410757","","3800","","2011-09-22 18:56:56","2011-11-22 05:41:39","how to add text in grid view end","<android><gridview>","1","1","","",""
"3475534","1","3475618","","2010-08-13 09:25:47","1","1459","<p>I  am ne wto android.I get want to know whether we can maximize and minimize a whole application.it should work like ALT+TAB in windows.Please help me out.Thanks in advance..</p>","366916","","","","","2010-08-13 09:36:51","Maximize and minimize in android","<android>","1","0","","",""
"3475542","1","","","2010-08-13 09:27:07","0","631","<p>I builded Sqlite database in android application.First i builded main_category table in Sqlite Manager.And then i export that file to my application's raw folder.My Export file is .sql file.That it is here.</p><pre><code> CREATE TABLE ""main_category"" (""_id"" INTEGER PRIMARY KEY  NOT NULL ,""main_image"" TEXT,""word_audio_file"" TEXT,""char_audio_file"" TEXT,""hash_record"" BOOL NOT NULL ,""record"" TEXT, ""menu"" TEXT);    INSERT INTO ""main_category"" VALUES(1,'g_a.png','g_a.mp3','g_a_01.mp3','false',NULL,NULL);</code></pre><p>So I read from my application using <strong>FileInputStream.</strong>Code is here,</p><pre><code>InputStream in= new InputStream() {                @Override                public int read() throws IOException {                    File sqlfile1 = new File(""C://CellCity//workspace//GokiriKidApp//res//raw//main_category.sql"");                    return 0;                }            };            try {                InputStreamReader isr=new InputStreamReader(in);                BufferedReader br=new BufferedReader(isr);                SQL_MAIN_CATEGORY= br.readLine();                in.close();                br.close();                isr.close();            } catch (IOException e) {                e.printStackTrace();            }            Log.i(""onCreate"", ""Database Creation"");            String categoryTString=SQL_MAIN_CATEGORY;            db.execSQL(categoryTString);</code></pre><p>So When i run my code i got error: <strong>OutOfMemoryError</strong> and lock database in command line(adb shell)</p>","389389","","135152","","2011-05-25 03:12:30","2011-05-25 03:12:30","Sqlite Database is Locked In Command line(adb shell)+Android","<android><sqlite>","1","1","","",""
"3475687","1","","","2010-08-13 09:45:42","0","1535","<p>I used <a href=""http://www.devx.com/wireless/Article/39239/0/page/1"" rel=""nofollow"">this</a> tutorial to write my app. I use the DDMS Location Manager to change my location virtually.</p><p>Unfortunally I always get a location of 0.0 for long and lat. Even if I switch them later in the prog with locationchanged-method I get 0.0. </p><p>Code is this:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);  //---use the LocationManager class to obtain GPS locations---    lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);        locationListener = new MyLocationListener();    lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);     Location lastLoc = lm.getLastKnownLocation(""gps"");    curLocation = ""Standort: \nLatitude: "" + lastLoc.getLatitude() + ""\nLongitude: "" + lastLoc.getLongitude();    upperText = (TextView) findViewById(R.id.TextView01);    upperText.setText(curLocation);}</code></pre><p>and</p><pre><code>    @Override    public void onLocationChanged(Location loc)     {        if (loc != null) {            Toast.makeText(getBaseContext(),                 ""Location changed : Lat: "" + loc.getLatitude() +                 "" Lng: "" + loc.getLongitude(),                 Toast.LENGTH_SHORT).show();        }        if (loc != null)         {            upperText.setText(curLocation + ""\n\nStandort: \nLatitude: "" + loc.getLatitude()                     + ""\nLongitude: "" + loc.getLongitude());        }    }</code></pre><p>Something's missing, but I don't know what... :/</p><p>I'd be really pleased if anyone could help =)!</p>","419410","","3171","","2010-08-13 09:52:56","2011-11-16 19:08:28","GPS: loc.getLatitude/Longitude always results in 0.0","<android><get><gps>","1","2","","",""
"3475788","1","3475831","","2010-08-13 09:59:31","4","1243","<p>How do you test for, for example, and android browser in Jquery? </p><p>Cheers.</p>","269404","","","","","2010-08-13 10:04:44","Jquery, how to test for a mobile browser?","<jquery><android><browser><mobile><cross-browser>","2","0","2","",""
"3475937","1","","","2010-08-13 10:18:20","2","1059","<p>I'm new to android and want to develop application to manage inventory on mobile.</p><p>I can run the application ""Hello world"" and can communicate with database as well.</p><p>But i'am having problem with navigation and forms and controls.</p><p>for my application i want to store the inventory data in database and retrieve in a grid format and managing the data.</p><p>can any one tell how to work this out please.</p><p>providing a tutorial is also acceptable (i tried some but not successful) </p><p>Thanks in advance.</p>","404128","","404128","","2010-08-13 16:51:41","2012-03-13 13:28:14","implementing inventory application in android with sqlite database","<android><sqlite><inventory><mobile-application>","1","4","1","",""
"3475953","1","6063276","","2010-08-13 10:20:03","0","2842","<p>I used this code <a href=""http://snipplr.com/view/13772/save-image-to-media-provider-on-android/"" rel=""nofollow"">snippet</a>: </p><pre><code>ContentValues image = new ContentValues();image.put(Images.Media.TITLE, ""ImageTitle"");image.put(Images.Media.DISPLAY_NAME, ""Heart"");image.put(Images.Media.DESCRIPTION, ""Heart"");image.put(Images.Media.DATE_ADDED, dateTaken);image.put(Images.Media.DATE_TAKEN, dateTaken);image.put(Images.Media.DATE_MODIFIED, dateTaken);image.put(Images.Media.MIME_TYPE, ""image/png"");image.put(Images.Media.ORIENTATION, 0);File parent = imageFile.getParentFile();String path = parent.toString().toLowerCase();String name = parent.getName().toLowerCase();image.put(Images.ImageColumns.BUCKET_ID, path.hashCode());image.put(Images.ImageColumns.BUCKET_DISPLAY_NAME, name);image.put(Images.Media.SIZE, imageFile.length());image.put(""_data"", imageFile.getAbsolutePath());getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, image);</code></pre><p>I create the image inside the cache directory of my application. I assume that the image is not copied into the media folder by the media provider and therefore not accessible from the media gallery application. Is it possible to add an image to the media gallery without writing the file to the mass storage of the phone?</p>","114066","","114066","","2010-10-18 11:27:03","2011-05-19 18:34:56","How to save an image to the media provider in Android?","<android>","1","0","1","",""
"3476001","1","","","2010-08-13 10:29:34","1","2039","<p>Firstoff, I'm a complete newbie to Android platform development. What basically, I want to know right now is, whether there is any similar APIs available in Android SDK, which will allow events to take place, even if the main thread is blocked for some extensive operation? Something which is similar to ProcessEvents() or DoEvents() in some other platforms.</p><p>Thanks a lot in advance.</p>","86605","","","","","2010-08-13 12:27:09","Does Android have any similar API like ProcessEvents() or DoEvents() on other platforms?","<android><event-handling>","1","0","","",""
"3476016","1","3634011","","2010-08-13 10:31:09","2","6224","<p>I have tested my game on HTC Desire with Android 2.2. Game is 2D with custom defined sprites with multiple bitmap images (frames). Frames are generated from one larger image using method Bitmap.createBitmap(): <br><br><code>bitmapFrames[currentFrame][0] = Bitmap.createBitmap(image, startX, startY, width, height, matrix, true);</code><br></p><p>It works ok on Android 1.5 and 1.6 devices. Also it works ok on all emulators (1.5, 1.6, 2.1 and 2.2) but on real HTC Desire device all sprite frames are drawn. It looks like above mentioned method ignore parameters  startX, startY, width, height when creating bitmap frame.<br>Any clue about this issue?</p>","419446","","","","","2010-09-03 08:12:01","Bitmap.createBitmap() on Android 2.2 issue","<android>","1","1","3","",""
"3476031","1","3476163","","2010-08-13 10:33:59","1","570","<p>I have a 16mb binary file and I want to read bytes without using any loop. like if i want to read 16 byte i can pass 16 to some method(if there is any) and it give me my desired result... right now i am using loop for reading bytes but my application is so huge i am afraid that it do not get slow.kindly give me some hint.</p><p>thanks alot.</p>","397901","","133203","","2010-08-13 10:35:28","2011-01-20 16:53:28","reading bytes without using any loop","<java><android>","4","8","","",""
"3476061","1","","","2010-08-13 10:40:43","0","1260","<p>I just started with Android development and love it so far. To getsome experience, I am writing a little todo application. In mydatabase I have a state for a todo item, represented as int. I use acheckbox in a list view to represent this state. To bind the data tothe view, I use a subclass of SimpleCursorAdapter. I add anonClickListener to the checkbox that updates the state in the databasefor the used list item. The problem is, if I use the following code,the list is screwed up in the display (many items will be checked):</p><pre><code>@Overridepublic View getView(final int pos, View inView, ViewGroup parent) {  View view = inView;  if (view == null) {    LayoutInflater inflater = (LayoutInflater) context       .getSystemService(Context.LAYOUT_INFLATER_SERVICE);    view = inflater.inflate(R.layout.toodoolist_item, null);  }  cursor.moveToPosition(pos);  ...  checkBox.setOnClickListener(new OnClickListener() {     @Override     public void onClick(View v) {        int state = 0;        if (checkBox.isChecked()) {        titleView.setPaintFlags(titleView.getPaintFlags()            | Paint.STRIKE_THRU_TEXT_FLAG);        titleView.setEnabled(false);        state = 1;     } else {        titleView.setPaintFlags(titleView.getPaintFlags()            ^ Paint.STRIKE_THRU_TEXT_FLAG);        titleView.setEnabled(true);     }     ContentValues values = new ContentValues();     values.put(TooDooTable.STATE, state);      context.getContentResolver()        .update(ContentUris.withAppendedId(     TooDooTable.CONTENT_URI, id), values, null, null);     cursor.requery();  }}</code></pre><p>My current workaround is to use the inflater every time, even if theinView is not null:</p><pre><code> @Override public View getView(final int pos, View inView, ViewGroup parent) {   View view = inView;   LayoutInflater inflater = (LayoutInflater) context    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);   view = inflater.inflate(R.layout.toodoolist_item, null);  ...</code></pre><p>This works, but I don't understand why I have to do this hack.</p><p>What would be the best practice to update the database in aCurserAdapter and get the changes reflected immediately in the view?</p><p>Thanks</p><p>Kai</p>","419452","","419452","","2010-08-13 10:48:14","2011-04-07 19:49:40","Android SimpleCursorAdapter and Database Update","<android><database>","1","0","1","",""
"3476430","1","3476447","","2010-08-13 11:40:31","26","28566","<p>I want to access a resource like a String or a Drawable by its name and not its int id.</p><p>Which method would I use for this?</p>","1746300","","56285","","2014-02-18 17:09:56","2014-02-18 17:09:56","How to get a resource id with a known resource name?","<android><android-resources>","4","1","6","",""
"3476508","1","","","2010-08-13 11:51:52","0","526","<p>In a single Screen i have a two ScrollViews.I need to show this two scroll views by using pan view.Is there any possibility to do like this???</p>","398981","","","","","2010-08-13 11:51:52","Dynamic view size increase in android?","<android>","0","2","","",""
"3476525","1","","","2010-08-13 11:54:20","0","599","<p>In my game when the user completes a stage, I want the main game thread to pause/sleep/wait and a new activity to be launched called StageClear that displays information about points scored etc. After this has been displayed and the user has pressed continue I want the original game thread to resume where it left off. I have tried to implement this but have so far been unsuccessful, probably because I'm new to dealing with multiple threads and also the idea of synchronizing them.</p><p>I most recently tried to implement a shared package-visible object that could notify after wait was called on itself, but I am getting errors in eclipse so it won't even compile, I think because though the object is declared public in an inner class, it cannot be seen or recognised by my activity elsewhere in a file in the package.</p><p>I have already built both activities but my issue is getting the main game one to launch the other, and pause whilst it waits for this activity to finish, before the main game thread continues execution.</p><p>Any help would be much appreciated, thanks.</p>","300037","","","","","2010-08-13 12:18:51","Pausing main game thread until an Activity is started, and has finished - Android","<android><multithreading>","1","0","","",""
"3476600","1","3477237","","2010-08-13 12:05:54","23","26340","<p>Just for the Heck of it, I requested all the permissions from my application (hello world), to see what are the types of permissions that are granted and what are those that are refused! To my amusement I found about 40 of the permissions not granted! Two were returned as unknown permissions.</p><p>Here is the log of all the permissions that were denied to me - </p><pre><code>W/PackageManager(   61): Not granting permission android.permission.ACCESS_CHECKIN_PROPERTIES to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.ACCESS_SURFACE_FLINGER to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.ACCOUNT_MANAGER to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.BIND_APPWIDGET to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.BIND_DEVICE_ADMIN to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.BIND_INPUT_METHOD to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.BIND_WALLPAPER to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.BRICK to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.BROADCAST_PACKAGE_REMOVED to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.BROADCAST_SMS to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.BROADCAST_WAP_PUSH to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.CALL_PRIVILEGED to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.CHANGE_COMPONENT_ENABLED_STATE to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.CLEAR_APP_USER_DATA to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.CONTROL_LOCATION_UPDATES to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.DELETE_CACHE_FILES to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.DELETE_PACKAGES to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.DEVICE_POWER to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.DIAGNOSTIC to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.FACTORY_TEST to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.FORCE_BACK to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.GLOBAL_SEARCH to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.HARDWARE_TEST to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.INJECT_EVENTS to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.INSTALL_LOCATION_PROVIDER to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.INSTALL_PACKAGES to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.INTERNAL_SYSTEM_WINDOW to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.MANAGE_APP_TOKENS to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.MASTER_CLEAR to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.READ_FRAME_BUFFER to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Unknown permission android.permission.READ_HISTORY_BOOKMARKS in package com.robosoft.linuxtopW/PackageManager(   61): Not granting permission android.permission.READ_INPUT_STATE to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.REBOOT to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.SET_ACTIVITY_WATCHER to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.SET_ORIENTATION to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.SET_PREFERRED_APPLICATIONS to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.SET_TIME to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.STATUS_BAR to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.UPDATE_DEVICE_STATS to package com.robosoft.linuxtop (protectionLevel=2 flags=0x8444)W/PackageManager(   61): Not granting permission android.permission.WRITE_GSERVICES to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)W/PackageManager(   61): Unknown permission android.permission.WRITE_HISTORY_BOOKMARKS in package com.robosoft.linuxtopW/PackageManager(   61): Not granting permission android.permission.WRITE_SECURE_SETTINGS to package com.robosoft.linuxtop (protectionLevel=3 flags=0x8444)</code></pre><p>Now for a fact I know level two permissions are not granted to third party application developers and are reserved only for OEMs. But I am surprised as a lot of level three permissions have been denied to me (if not all!). Hence my question would be why is it so, do I need to add something else to my manifest for those permissions to be accepted? Also is not the system supposed to grant my permissions on the emulator because after all its for development? And is it intelligent as in it would reject permissions that it deems unreasonable of my application? Is android system that advanced that it understands code? </p><p>I would much appreciate it if you could actually explain me this concept in a couple of lines instead of pointing me to the regular permissions and security documentations. I have read through it a couple of times and I guess my understanding is lacking in some perspective. Hence I would much prefer to read some other attempt at explaining it to me. Thanks</p>","393459","","","","","2010-08-13 13:28:37","Why are these permissions being refused?","<android><permissions>","2","4","15","",""
"3476696","1","3477395","","2010-08-13 12:20:49","0","847","<p>I want to show an animation when the user tries to navigate between one activity to the other .How can i achieve this?</p><p>Upon googling i found that we can use styles and set animation using themes for an activity. But when i do so i am unable to see any kind of animation happening. Is it doable?</p><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/2ac12ea2bfc50908?pli=1"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/2ac12ea2bfc50908?pli=1</a></p><p><a href=""http://code.google.com/p/android/issues/detail?id=4409"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=4409</a></p><p>Can any one help me plz..</p>","302328","","302328","","2010-08-13 14:47:59","2010-08-13 14:47:59","Animating while navigating between two activities","<android><animation>","1","2","","",""
"3476723","1","","","2010-08-13 12:23:47","30","11650","<p>I am using an <code>ArrayAdapter&lt;CharSequence&gt;</code> to populate the items to list in a <code>android.widget.Spinner</code>. That works all fine.</p><p>But now I want to keep the list of items dynamic, i.e. I want to be able to add/remove items from the selection list at runtime. However, when I call <code>adapter.add(item)</code> or <code>adapter.remove(item)</code> I always get a <code>UnsupportedOperationException</code>, even though the Javadocs of the <code>ArrayAdapter</code> class describe these two methods as to be usable for exactly that intended purpose.</p><p>Is this a bug, really not implemented or what am I missing here?</p>","423411","","119895","","2010-08-13 14:17:04","2014-03-26 21:51:47","Why can't one add/remove items from an ArrayAdapter?","<android><android-widget><android-sdk-2.2>","5","2","1","",""
"3476779","1","3476840","","2010-08-13 12:30:16","18","32234","<p>I need to get the touch begin position (X, Y) , touch move position and touch end position of the screen in android.</p>","389404","","","","","2012-02-05 07:36:09","How to get the Touch position in android?","<android>","3","0","13","",""
"3476853","1","","","2010-08-13 12:38:28","1","1168","<p>is there any way to write data to a sdcard when the card is mounted as a disc via usb?</p><p>I get an permission denied exception. If I unplug it everything is fine.</p><p>I know I should be using Environment.getExternalStorageDirectory, but I don't think this would make any difference.</p><p>Code:</p><pre><code>        File file = new File(""/sdcard/Test/test.txt"");        BufferedOutputStream buf = new BufferedOutputStream(                 new FileOutputStream(file,true));         buf.write(str.getBytes());</code></pre><p>Thanks,</p><p>Nicholas</p>","334459","","","","","2010-08-13 12:40:29","How to read/write data to mounted sdcard","<android>","1","0","","",""
"3476855","1","3481792","","2010-08-13 12:38:30","2","529","<p>I am developing a financial app that stores data in a file.  I have noticed that text file i/o is pretty slow.  If I switch to a binary format, how much faster will it be?  2x?  10x?  I could write my own timing tests but I am hoping someone else has already done it.  Thanks in advance.</p>","353271","","","","","2010-08-14 02:37:01","what is the speed differential of binary versus text file i/o?","<android>","3","2","","",""
"3476930","1","","","2010-08-13 12:47:29","2","2363","<p>Whenever I try to update framework-res.apk on system/framework folder on my G1 it gives me an error:--</p><p>failed to copy 'framework-res.apk' to '/system/framework/framework-res.apk': Read-only file system</p><p>Then I tried to mount it with read write permission with this line :--</p><p>mount -o remount,rw -t yaffs2 /dev/block/mtdblock3</p><p>But it says Usage: mount [-r] [-w] [-o options] [-t type] device directory</p><p>And I read on forum that you have to access with su command But whenever I try to hit command su it says permission denied:</p><p>So can any body help me about this matter to resolve the issue ??</p><p>ThanksInAdvance</p>","286919","","","","","2011-04-24 10:25:08","Can I have a write permission in android Read-only file system?","<android><file-system>","1","1","1","",""
"3476957","1","","","2010-08-13 12:50:07","2","367","<p>I want to create a new contact list just like blacklist to store few phone numbers in android. which storage medium we need to use ??</p>","404052","","2598","","2010-08-13 12:50:58","2010-08-13 12:56:58","Where to store a contact list on an Android phone?","<java><android>","1","1","","",""
"3477093","1","","","2010-08-13 13:10:50","1","960","<p>I have a strange problem that I don't really know how to attack so I'm wondering if someone has had a similar problem before.</p><p>I override the draw(Canvas canvas, MapView mapView, boolean shadow) method in an ItemizedOverlay subclass to draw some paths, text etc. between the items. The first thing I do in the override is call super.draw with all these parameters. When I start the app, the lines that I draw in my override are where they are supposed to be, but the actual OverlayItems that the super.draw draws are way off. The interesting thing is that as I move the map towards the upper left corner (coords 0,0) the OverlayItems get nearer and nearer to the place where I expect them to be (in fact, they appear to match perfectly when I get the first item to point (0,0)). As I move the map so that the OverlayItems get further from the (0,0) point, they linearly get further from their geolocation.</p><p>In case nobody has faced this problem before and it isn't something obvious, I'll try to make a minimal example that still has this behavior and post it here. The actual code is relatively large so I'd like to avoid that much work if someone has any idea what might be the problem.</p><p>edit: an additional piece of information that might be helpful... my draw method looks like this:</p><pre><code>public void draw(Canvas canvas, MapView mapView, boolean shadow) {    super.draw(canvas, mapView, shadow);    if (!shadow) {        // code for drawing the lines etc.        // on the canvas (uses mapView.getProjection())     }}</code></pre><p>The custom part of the overlay doesn't have a shadow layer (I've used the same logic when extending Overlay without trouble). The shadow layer that gets drawn for the OverlayItems by super.draw is actually halfway between the Drawable and the expected geolocation for each particular item.</p><p>Here are tree screenshots from the avd to better illustrate what is happening. The four red pins should be on the red line above them and actually move towards the line as I slide the map towards the top left. The two pins and the line between them is drawn in my custom override, super.draw draws the four shadows and the four extra red pins.  </p><p>Since this is my first post and I can't post more than one link, I put all three screenshots on the same jpg.<br><a href=""http://tinypic.com/r/sgmxvt/4"" rel=""nofollow"">screenshot</a></p>","419564","","419564","","2010-08-13 19:22:44","2010-08-15 14:09:09","ItemizedOverlay seems to be drawing with a ""broken"" projection","<android><android-mapview><android-maps><itemizedoverlay>","2","0","1","",""
"3477190","1","","","2010-08-13 13:23:07","6","1100","<p>Is there a way to access the copy/paste api/UI in an Android / HTC Sense based phone?</p><p>I really like the way a long press works in a large canvas while using Sense. Is there a way to programmatically detect code is running on a Sense-based phone and call out to those APIs?</p>","419590","","415347","","2010-09-16 14:17:06","2010-09-26 21:12:21","HTC Sense Copy/Paste API's","<android><copy><paste><htcsense>","3","0","1","",""
"3477382","1","","","2010-08-13 13:42:48","3","1081","<p>Hey guys, I'm quite new to Android development and I wish like to develop my first app which is a picture editor.</p><p>Basically it can let the user adjust the brightness, contrast, black and white effects.</p><p>I would like to ask which package should I look for? I have roughly go through the Android API and I couldn't found any related packages. </p><p>Anyone can help me? </p>","419613","","","","","2011-07-25 17:35:55","Picture editor in Android","<android><image-processing><android-emulator>","1","0","","",""
"3477422","1","3477643","","2010-08-13 13:46:37","110","70898","<p>What is the use of <a href=""http://developer.android.com/reference/android/view/LayoutInflater.html""><code>LayoutInflater</code></a> in Android?</p>","386430","","1267383","","2012-07-23 15:53:39","2014-03-16 21:14:06","What does Layout Inflater in Android do?","<android>","6","0","29","",""
"3477571","1","","","2010-08-13 14:03:43","0","1195","<p>I need to put several listviews inner a LinearLayout. The Listviews should be wrap content to adapt the listview to their items. I need have one only scroll with which I can scroll all the listviews. I know that i can't use a scrollview because the listviews have their own scroll (but i don't need the scrolls of the listviews because i have them in wrap-content). I thought maybe puting the listviews inside the LinearLayout I will hadn't problems with the scrollview, but it didn't work, the LinearLayout was fixed to the screen, the scrollview didn't appear and the listviews ended scrollable. Without the scrollview if i have the list in wrap-content, their shown properly but i haven't any scroll and i can't see the lisviews below the screen. Really i have had this bug for one month and i haven't found any solution, i am desperate :( </p><p>My code: </p><p>XML</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/detail_info_on_top""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:background=""#FF003150""    android:orientation=""vertical""&gt;&lt;!--&lt;ScrollView android:layout_width=""fill_parent""--&gt;&lt;!--    android:layout_height=""fill_parent""--&gt;&lt;!--    android:fillViewport=""true""&gt;--&gt;    &lt;LinearLayout             android:id=""@+id/layout""            android:scrollbars=""vertical""            android:scrollbarAlwaysDrawVerticalTrack=""true""             android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""&gt;    &lt;/LinearLayout&gt;&lt;!--&lt;/ScrollView&gt;--&gt;</code></pre><p></p><p>JAVA</p><pre><code>@Overrideprotected void onCreate(Bundle icicle) {             super.onCreate(icicle);             ...             LinearLayout layout = (LinearLayout)findViewById(R.id.layout);        ArrayList&lt;SectionHolder&gt; shs = SObjectDB.SOBJECTS.get(sobject).detail;        for(SectionHolder sh : shs) {        /** layout by each section */            ListView lsvDetails = new ListView(this);                lsvDetails.setPadding(0, 0, 0, 0);                lsvDetails.setBackgroundColor(0xFFFFFFFF);                lsvDetails.setCacheColorHint(Color.TRANSPARENT);                lsvDetails.setFocusable(false);                lsvDetails.setSelected(false);                lsvDetails.setScrollContainer(false);                lsvDetails.setVerticalScrollBarEnabled(false);                LinearLayout ll = new LinearLayout(this);                LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);                           ll.setLayoutParams(llp);                ll.setOrientation(LinearLayout.VERTICAL);                ll.setFocusable(false);             /** setting section header */            TextView sv = new TextView(this);            sv.setText(sh.name);            sv.setTextSize(15);            sv.setTextColor(0xFFFFFFFF);            sv.setBackgroundColor(0xFF656565);            sv.setWidth(480);            //sv.setTypeface(null, Typeface.BOLD);            ll.addView(sv);            ...            LinkedHashMap&lt;String,String&gt; hm;             final ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();            hm = new LinkedHashMap&lt;String, String&gt;();            for(FieldHolder fs : fhs) {                hm = new LinkedHashMap&lt;String, String&gt;();                     ...                hm.put(""data"", v1);                mylist.add(hm);             }            ListView.LayoutParams lsvp = new ListView.LayoutParams(ListView.LayoutParams.FILL_PARENT, ListView.LayoutParams.WRAP_CONTENT);            lsvDetails.setLayoutParams(lsvp);            lsvDetails.setScrollbarFadingEnabled(false);            lsvDetails.setScrollingCacheEnabled(false);            lsvDetails.setSelector(R.drawable.multi_white_color);            lsvDetails.setDrawSelectorOnTop(false);            lsvDetails.setAdapter(new DetailAdapter(this, mylist, R.layout.grid_detail, new String[]{""label"", ""data""}, new int[]{R.id.lblName, R.id.lblData}));            ll.addView(lsvDetails);            layout.setVerticalScrollBarEnabled(true);            layout.setScrollbarFadingEnabled(true);            layout.setScrollBarStyle(50331648);            layout.setScrollContainer(true);            layout.setFocusable(true);            layout.setFocusableInTouchMode(true);            layout.addView(ll);         }   }</code></pre><p>How you can see i create the lisviews dinamically and i put indside the layout with a secttion header. if you have some doubt ask me I need find a solution soon.</p><p><a href=""http://www.freeimagehosting.net/image.php?6dea1468bd.png"" rel=""nofollow"">http://www.freeimagehosting.net/image.php?6dea1468bd.png</a></p>","412363","","177800","","2012-02-28 13:38:17","2012-02-28 13:38:17","Mutiple listviews with one only scrolls","<android><listview><scroll><android-listview><android-scroll>","2","2","","",""
"3477581","1","3478422","","2010-08-13 14:05:03","10","24805","<p>I want to dynamically add some views to a <code>LinearLayout</code> that is already defined in XML.</p><p>I'm able to add views to the screen but they are not being placed 'inside' the right <code>LinearLayout</code>. </p><p>How can I get a reference to this specific Layout from code, similar to getting a <code>View</code> by using <code>findViewById()</code>?</p>","419625","","114066","","2010-08-13 15:36:38","2012-09-22 10:17:47","Android: Add a view to a specific Layout from code","<android><layout>","2","1","1","",""
"3477641","1","","","2010-08-13 14:11:31","1","251","<p>I have an Activity with several RatingBars on it so my users can rate many different things.  My problem is that this makes it difficult for my users to scroll up and down the screen.</p><p>If you attempt to slide your finger vertically on the screen and the first spot you touch is over a RatingBar, the RatingBar tries to capture the gesture itself instead of passing it along once your finger moves off of it (with a RatingBar, you can swipe horizontally to move the rating up and down).</p><p>I've even tried turning focus off, but this doesn't solve my problem.</p><p>Any ideas?</p>","406790","","","","","2013-07-12 18:02:51","Remove gestures from RatingBar","<android><gesture-recognition><gesture>","1","2","","",""
"3477769","1","3480229","","2010-08-13 14:24:12","3","3639","<p>I am a bit new to Android. What I need to do is send data back and forth between an activity and a service locally. The information sent is sensitive and must not be able to be picked up by other apps. This excludes using broadcast and the onBind() function if I understand things correctly?</p><p>So the activity needs to send some string parameters to the service. Also it somehow needs to tell the service which activity started it so the service can reply to the correct class since many different activities will use this service. Once the service has fetched the information via a http request it is suppose to send that data (just a long string which will later be parsed) back to the activity that started it. How do I go about doing this? Using static variables/functions is not an option since again many actives will be using this service. Sure it would be possible to use a static array to hold the classes but that just seems ugly... It's only possible to send simple variables (not objects) via the intent? There must be a better way to do this. I have been surfing the web for hours. Any help would be greatly appreciated.</p><p><em>EDIT</em></p><p>The example found on Android Developers [http://developer.android.com/reference/android/app/Service.html#stopSelf(int)] was a great help to implement a local binder. </p><p>For those of you out there interested here is some more information on my implementation so far. </p><ol><li>Once the onServiceConnected function is called a function in the service is called to set which activity it is bound to. After that both service and activity can interact with each other back and forth. </li><li>Make sure that the thread in the service class has a handler. This enables the thread to send a message to its handler once it has completed its task. The handler then sends the result from the service back to its bound activity. Doing this through a handler makes sure the application is back on the main thread when this is done. </li></ol>","419640","","419640","","2010-08-16 11:47:50","2010-08-16 11:47:50","Android - How to send data back and forth between an activity and a service locally","<android><data><service><activity><android-intent>","1","0","1","",""
"3477843","1","3478098","","2010-08-13 14:32:30","1","1185","<p>I'm writing an Activity which fetches some XML from the web via HTTP and then parses it into a DOM.  It then pulls some required data from the DOM.</p><p>As you can imagine, this takes a few moments, so I put that code into it's own thread and then tried to set up a ProgressDialog to display while the user is waiting for that to complete.</p><p>The problem is that the ProgressDialog doesn't display at all.  If I remove the call to dismiss() then it displays after the work is done and, obviously, just sits there...</p><p>Here is my code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    progressDialog = ProgressDialog.show(this, """", ""Loading..."", true);    Thread downloadThread = new Thread(new DownloadVerseThread());    downloadThread.start();    setContentView(R.layout.main);    TextView verseView = (TextView) findViewById(R.id.displayFighterVerse);    TextView dateView = (TextView) findViewById(R.id.displayDateRange);    TextView referenceView = (TextView) findViewById(R.id.displayReference);    try {        downloadThread.join();    } catch (InterruptedException e) {        Log.e(TAG, ""Attempted to set the UI values before we were ready."");        return;    }    Log.d(TAG, ""Date: "" + date);    Log.d(TAG, ""Reference: "" + reference);    Log.d(TAG, ""Scripture: "" + scripture);    progressDialog.dismiss();    dateView.setText(date);    referenceView.setText(reference);    verseView.setText(scripture);}private class DownloadVerseThread implements Runnable {    @Override    public void run() {        try {            FighterVerseDownloader downloader = new FighterVerseDownloader();            date = downloader.getDateRange();            reference = downloader.getReference();            scripture = downloader.getScripture();        } catch (FighterVersesException e) {            Log.e(""FighterVerses"", ""Failed to get the Fighter Verse"", e);        }               }}</code></pre><p>The constructor of the FighterVersesDownloader is where all the work in terms of HTTP and DOM is done.</p><p>Any ideas on what I'm missing?  I've seen a few similar threads on this using AsyncTask, but I wanted to use good old fashioned Threads directly and the solutions suggested don't apply.</p>","398293","","","","","2010-08-13 14:59:08","ProgressDialog doesn't show up until it's too late","<android>","2","0","","",""
"3477944","1","","","2010-08-13 14:43:21","3","800","<p>I'm confused about how to write resolution independent code for an Android game and I'm looking for some concise tips and guidelines as I'm never sure what to do about the multiple versions of Android. Here's what I specifically want to do:</p><ul><li>I want to load a 100x100 pixel .png file into a Bitmap object.</li><li>When the bitmap it loaded, I want it scaled so that when I draw it to the canvas it covers the width of the screen.</li><li>I want my app to run on API 1.5 (as 15% of people still use this <a href=""http://developer.android.com/resources/dashboard/platform-versions.html"" rel=""nofollow"">http://developer.android.com/resources/dashboard/platform-versions.html</a>) and above.</li></ul><p>Can someone explain what I would do in the above situation to get the results I want? </p><p>The things I'm specifically confused about are:</p><ul><li>How does API1.6 pick which folder (e.g. -hdpi) to load a bitmap from and how does it decide what to scale it by?</li><li>Does API 1.5 have some kind of auto scaling feature? The width and height reported by the canvas seems to be scaled by the screen density.</li></ul>","419663","","","","","2010-10-07 19:18:26","Confused about Bitmap scaling when supporting different resolutions in Android","<android><mobile>","1","0","","",""
"3477951","1","","","2010-08-13 14:44:09","0","1783","<p>how can I do the step above?I'm trying to the the tutorial<a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a> ""HelloMapView"" and they reccomend to Open the AndroidManifest.xml file and add the following as a child of the <code>&lt;application&gt;</code> element:</p><pre><code>&lt;uses-library android:name=""com.google.android.maps"" /&gt;.</code></pre><p>how does this work?how can I insert that in my SDK.I'm usingEclipse SDK,Version: 3.5.2, Build id: M20100211-1343</p>","419666","","114066","","2010-08-13 15:27:58","2011-07-06 15:25:49","How to: Open the AndroidManifest.xml file and add the following as a child of the <application> element?","<android><manifest>","1","0","","",""
"3478156","1","3478533","","2010-08-13 15:05:55","0","237","<p>My first activity is creating a second activity within its onCreate:</p><pre><code>if (userName == null || password == null) {    if (!getUserNameAndPassword() ) {        // User is launching this for the first time        Intent explicitIntent = new  Intent(CreateSessionAlert.this,CreateUserNameAndPassword.class);&lt;br&gt;        startActivityForResult(explicitIntent,GET_USER_NAME_AND_PASSWORD);    }}</code></pre><p>The second activity has EditText views for the username and password along with submit and cancel buttons.  When either button is pushed, the text from username and password is sent back to activity one (via onActivityResult), which connects to a server to see if the username is available.  While connecting to the server showDialog is used to show a ProgressDialog.  When the server responds, the ProgressDialog is dismissed and an AlertDialog is shown.  This works fine as long as the device is not rotated.</p><p>Here's the problem: if the user rotates the device from within the second activity and pushes submit, the first activity re-invokes its onCreate, which ends up launching the second activity again since the username and password are still null.</p><p>Does anyone have any suggestions to get around this?</p><p>Is there a method that could be used to pass data from activity-2 to activity-1's onCreate?  I wouldn't want to use a database in this case, as that seems like overkill.</p><p>I've thought about containing the server communication and dialogs to activity 2, but then I'd have duplicate server code in activity 1 and activity 2 (activity 1 connects to the server for other things too).  Another issue I'd have with this approach is that the user has an option to cancel creating the password, in which case I want the app to finish.  If I called finish from activity 2, activity 1 would appear and I don't want that to show unless a username and password have been created.</p><p>It just occurred to me - if I could replace activity 2 with a dialog it might make things simpler.  The dialog view needs to have 2 EditTexts and 2 buttons.  Can I create something like this and use the showDialog method?  Any other ideas?</p>","418775","","114066","","2010-08-13 15:43:51","2010-08-13 15:48:05","issue with program flow when rotating device with two activities","<android><android-lifecycle>","1","1","","",""
"3478199","1","3478230","","2010-08-13 15:10:54","1","175","<p>I'm about to start developing an App for Android and I was wondering what the marketshare of various devices, by OS was. Do a majority of Android phones fall under 2.1+? Or should I look to support 1.5/1.6 too?</p><p>Also, Blackberry has a really neat list of all the devices under each OS version, with their screen resolutions and other tech specs, I couldn't really find one for Android. Does Google maintain one at all?</p><p>Also, any tips that'll let me develop across multiple devices and resolutions? I didn't particularly bother about this while developing for B'Berry and it's a pain now.</p>","116858","","119895","","2010-08-13 15:14:31","2010-08-13 15:16:51","Developing for Android - Marketshare, Device support","<android><market-share>","2","1","","2013-09-21 02:45:59",""
"3478244","1","3478262","","2010-08-13 15:16:06","5","585","<p>I am trying to write an android application and my workflow is as follows:</p><ol><li>Write some code</li><li>Click run as Android Application</li><li>Eclipse then starts the android emulator</li><li>Install the app on the emulator</li><li>Run it</li></ol><p>It seems to me that there is no need for it to start an android emulator(3) each time and to kill it. It'd be nice if there was a way an android emulator always running and eclipse just installs/uninstalls the app instead of making me wait every time.</p><p>Does anyone know a way of doing this?</p>","76252","","119895","","2010-08-13 15:19:00","2012-11-09 12:54:41","Is there a easier way of running an android application using the eclipse emulator?","<android><eclipse><android-emulator>","1","3","","",""
"3478469","1","","","2010-08-13 15:41:14","0","1803","<p>I have a problem of ssl exception when i upload data to a https server. It uploaded the data to the server correctly but when i get the response after uploading it throws an exception of ssl certificate is not trusted. I'm using the SAX parser for parsing xml file and i am using httppost method().</p>","403007","","114066","","2010-08-13 15:57:27","2013-04-11 10:29:13","How to get a response from a https server using android sdk?","<android><https>","2","2","","",""
"3478474","1","","","2010-08-13 15:41:49","5","293","<p>I would like to write an application which would be launched from the Contacts list in the phone. That is, you choose a contact using the normal contacts application, and where you can dial to the contact, send an Email or SMS, you can also launch my application with this contact's activity.How can this be done?</p>","419726","","","","","2010-08-13 17:54:20","How to launch an application from a contact in Android?","<android><contacts>","1","1","1","",""
"3478528","1","","","2010-08-13 15:47:29","2","889","<p>Is there an equivalent view structure to the iPhone default table cell? The default table cell formats an image (icon) and text in a nice looking way. Are there suggested equivalents for Android? Is there a sample somewhere?</p><p>Thanks</p>","295392","","","","","2010-08-17 03:50:26","ListView equivalent to iPhone table default table cell","<android><listview>","1","1","1","",""
"3478585","1","3480224","","2010-08-13 15:54:45","0","291","<p>Having another issue, and this one is BAFFLING!</p><p>Here we go.</p><p>We have a layout...</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;!-- Template for creating a result in MediaUpload --&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""&gt;    &lt;LinearLayout      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:orientation=""horizontal""      android:isScrollContainer=""true""      android:focusableInTouchMode=""false""      android:focusable=""false""&gt;      &lt;ImageView android:id=""@+id/imgView""       android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:maxWidth=""110dp""      android:maxHeight=""110dp""      android:minWidth=""110dp""      android:minHeight=""110dp""      android:layout_gravity=""center_vertical""      android:padding=""3dp""      android:scaleType=""center""      android:clickable=""true""      android:focusable=""true""      android:focusableInTouchMode=""true""      android:saveEnabled=""true""/&gt;      &lt;LinearLayout       android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:orientation=""vertical""      android:gravity=""center_horizontal""&gt;        &lt;TextView android:id=""@+id/img_file_name""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textColor=""@color/LinkText""        android:textStyle=""bold""        android:paddingBottom=""3dp""/&gt;        &lt;EditText android:id=""@+id/img_title""         android:hint=""Title""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:minWidth=""150dp""        android:maxHeight=""50dp""        android:inputType=""textVisiblePassword""        android:maxLength=""255""/&gt;        &lt;EditText android:id=""@+id/img_desc""         android:hint=""Description""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:minWidth=""150dp""        android:maxHeight=""50dp""        android:maxLength=""255""/&gt;      &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;    &lt;ImageView      android:src=""@drawable/divider""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:scaleType=""fitXY""      android:paddingTop=""2dp""      android:paddingBottom=""2dp""&gt;    &lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre><p>We're using this here as a template for an object that a user can upload to our site.(This is in a massive layout, so just posting what we're appending it to).</p><pre><code>&lt;LinearLayout android:id=""@+id/list_of_images""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""&gt;&lt;/LinearLayout&gt;</code></pre><p>Soo...Here's the actual issue.  When a user selects an image from their gallery, it adds correctly to our LinearLayout.  Now, one of our workers has low memory issues all the time, and the app is closed while he takes pictures or browses.  Our app is set up to save all the data (data being the Uri, Title text, Description text, etc) immediately before the user leaves the app into the savedInstanceState method.</p><pre><code>/*     * The Activity is being recycled and needs to have its instance     * saved before we lost all of the image URis!     */    protected void onSaveInstanceState(Bundle outState)    {        super.onSaveInstanceState(outState);        helper.saveEnteredData();        outState.putParcelableArray(IMAGE_URI_BUNDLE_KEY, helper.getUploadObjectArray());        outState.putParcelable(CAPTURE_IMAGE_URI_BUNDLE_KEY, currentFileURI);        outState.putInt(CURRENT_JOB_BUNDLE_KEY, reportSpinner.getSelectedItemPosition());        ArrayList&lt;ReportInfoParcelable&gt; alReps = new ArrayList&lt;ReportInfoParcelable&gt;();        for(int i = 0; i &lt; reportList.length; ++i)            alReps.add(new ReportInfoParcelable(reportList[i]));        outState.putParcelableArray(JOB_LIST_BUNDLE_KEY, alReps.toArray(new ReportInfoParcelable[alReps.size()]));    }</code></pre><p>Here is the helper.saveEnteredData()...</p><pre><code>public void saveEnteredData()    {        ViewGroup vg = null;        UploadObject object = null;        String title, desc;        for(int i = 0; i &lt; mLinearLayout.getChildCount(); i++)        {            vg = (ViewGroup) mLinearLayout.getChildAt(i);            object = alUploadObjects.get(i);            title = ((TextView) vg.findViewById(R.id.img_title)).getText().toString();            desc = ((TextView) vg.findViewById(R.id.img_desc)).getText().toString();            object.setTitle(title);            object.setDesc(desc);        }    }</code></pre><p>When the app returns from a crash after the user left the activity, when we debug through the app on return, the array of UploadObjects that return contain all the correct Uri's, titles, and descriptions, but when the app finally displays, ALL editTexts on the LinearLayout we append to, all suddenly contain the title and description of the last UploadObject in the Parcelable array.  Again, we debug through each appending of the objects, and the objects contain the correct data. We are baffled and need some help here!</p>","385565","","","","","2010-08-13 19:47:55","Dynamic Appending of Views and crashing","<android><dynamic><views>","1","1","","",""
"3478592","1","3478626","","2010-08-13 15:55:16","1","2104","<p>I have been trying to find the source for Android's Camera class so that I can examine how it calls the drivers that it is supposed to interface with. The API that android provides is insufficient for my purposes, and I am hoping to be able bypass that API. However, I am having trouble finding any documentation, and am resorting to accessing the code that is supposed to be extremely open source for samples. I have been able to access the documentation <a href=""http://developer.android.com/reference/android/hardware/Camera.html"" rel=""nofollow"">here</a>, the source for my specific phone <a href=""http://developer.htc.com/"" rel=""nofollow"">here</a>, and (what I thought was most promising) the source for Android libraries <a href=""http://android.git.kernel.org/"" rel=""nofollow"">here</a>. However, I have not been able to find android.hardware.Camera in this git repo, or any of these locations. </p>","391837","","","","","2010-08-13 18:13:53","getting android source for android.hardware.Camera","<android><git><open-source><source-code>","2","0","","",""
"3478601","1","","","2010-08-13 15:56:35","2","4317","<p>I have a RelativeLayout at the top, then below i have a ListView in the center and finally at the bottom i have another relativeLayout with an EditText and a Button inside. </p><p>I want the ListView to resize when I click on the EditText and the IME(virtual keyboard) appears. If i put adjustResize in the manifest, the Listview is resized to leave space for the IME, but the RelativeLayout with the EditText that is below is covered by the IME and I can't see what I'm writing. If I put adjustPan, the keyboard pushs up all, the ListView is not resized and i loose the top RelativeLayout.</p><p>My Code:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:background=""@drawable/application_background""    android:paddingLeft=""15px""    android:paddingRight=""15px""    android:paddingTop=""15px""    android:paddingBottom=""15px""&gt;    &lt;RelativeLayout        android:id=""@+id/rlyParentPost""        android:orientation=""vertical""        android:layout_width=""450px""        android:layout_height=""85px""        android:background=""@drawable/app_gradient_color""        android:layout_centerHorizontal=""true""&gt;        &lt;ImageView            android:id=""@+id/imgUserOfParent""            android:layout_marginLeft=""10px""            android:layout_marginTop=""10px""            android:background=""@drawable/userfeed""            android:layout_width=""64px""            android:layout_height=""64px""            android:layout_below=""@+id/logoImg""&gt;        &lt;/ImageView&gt;        &lt;TextView            android:layout_below=""@+id/logoImg""            android:layout_toRightOf=""@+id/imgUserOfParent""            android:id=""@+id/lblNameOfParent""            android:textSize=""17px""            android:textStyle=""bold""            android:layout_marginLeft=""5dip""            android:layout_marginTop=""11dip""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:textColor=""#ffffff""&gt;        &lt;/TextView&gt;        &lt;TextView            android:layout_below=""@+id/lblNameOfParent""            android:layout_toRightOf=""@+id/imgUserOfParent""            android:id=""@+id/lblBodyOfParent""            android:textColor=""#ffffff""            android:textSize=""17px""            android:layout_marginLeft=""5dip""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""&gt;        &lt;/TextView&gt;        &lt;TextView            android:layout_below=""@+id/lblBodyOfParent""            android:layout_toRightOf=""@+id/imgUserOfParent""            android:id=""@+id/lblDateOfParent""            android:textColor=""#70ccff""            android:textSize=""11px""            android:layout_marginLeft=""7dip""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""&gt;        &lt;/TextView&gt;    &lt;/RelativeLayout&gt;    &lt;RelativeLayout        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@+id/rlyParentPost""        android:id=""@+id/contentLayout""&gt;     &lt;ListView       android:isScrollContainer=""true""         android:id=""@+id/lsvComments""         android:layout_height=""515px""         android:layout_width=""450px""         android:background=""#ffffff""         android:listSelector=""@drawable/multi_white_color""         android:drawSelectorOnTop=""false""         android:divider=""#9aa5ac""         android:cacheColorHint=""#00000000""         android:dividerHeight=""1px""&gt;     &lt;/ListView&gt;     &lt;RelativeLayout         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:padding=""5dip""         android:layout_below=""@+id/lsvComments""         android:background=""@drawable/app_gradient_comments""         android:id=""@+id/contentLayout""&gt;         &lt;EditText             android:inputType=""text""             android:id=""@+id/txtComment""             android:hint=""What are you working on?""              android:textSize=""22px""             android:layout_marginLeft=""8px""             android:layout_height=""72px""             android:layout_width=""344px""&gt;         &lt;/EditText&gt;         &lt;Button             android:layout_toRightOf=""@+id/txtComment""             android:id=""@+id/cmdShare""             android:layout_width=""79px""             android:layout_height=""65px""             android:background=""@drawable/feed_comments_multi_stage""             android:layout_marginLeft=""7px""&gt;         &lt;/Button&gt;    &lt;/RelativeLayout&gt;    &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","412363","","114066","","2010-08-13 16:04:47","2014-02-12 16:06:49","How to prevent that the keyboard hides my EditText?","<android><keyboard><edittext>","4","0","","",""
"3478615","1","3478678","","2010-08-13 15:58:00","1","93","<p>I have a class that extends <code>Application</code> which has a lot of methods like:</p><pre><code>public User getUser(String name);public List&lt;User&gt; getFriends(User user);public List&lt;Game&gt; getGames(User user);</code></pre><p>which wraps a service class.</p><p>The catch here is that no method will work if I have no internet on the device.So for instance I am doing:</p><pre><code>public User getUser(String name) {        User ret = null;        try {            return myService.getUser(name);        } catch (NoInternetException e) {            NoInternetToast.show(this);        }    return ret;}</code></pre><p>Is there a way to wrap every call so I don't have to add the try catch on every method of my <code>Application</code>?</p>","119895","","","","","2010-08-13 19:09:57","Handling RunTimeExceptions of a class","<java><android><exception-handling>","1","3","","",""
"3478852","1","","","2010-08-13 16:27:07","0","2573","<p>I'm trying to get my list view to open up an alert dialog to display information when a person clicks on a selection. I have been trying several different things on the Google Developers website that have to do with this but have yet to come up with a result. Here is my code. </p><pre><code>package table.periodic;import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.AdapterView.OnItemClickListener;public class Anions extends Activity {      AlertDialog.Builder builder;    AlertDialog alertDialog;        String[] anions ={          ""Acetate"", ""Bromide"", ""Carbonate"", ""Chlorate"", ""Chloride"", ""Chlorite"", ""Chromate"",              ""Cyanide"", ""Dichromate"", ""Fluoride"", ""Hexacyanoferrate(II)"", ""Hexacyanoferrate(III)"",           ""Hydride"", ""Hydrogen Carbonate"", ""Hydrogen Sulfate"", ""Hydroxide"", ""Hypochlorite"",           ""Iodide"", ""Nitrate"", ""Nitrite"", ""Oxide"", ""Perchlorate"", ""Permanganate"", ""Peroxide"",             ""Phosphate"", ""Sulfate"", ""Sulfide"", ""Sulfite""    };      public void onCreate(Bundle icicle){        super.onCreate(icicle);         setContentView(R.layout.anions);                ListView list=(ListView)findViewById(R.id.anionlist);        list.setTextFilterEnabled(true);        ArrayAdapter&lt;String&gt; aa=new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, anions);        list.setAdapter(aa);        list.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,                long arg3) {                        String itemText = anions[arg2];        new AlertDialog.Builder(Anions.this);            Context mContext = getApplicationContext();            Dialog dialog = new Dialog(mContext);                dialog.setContentView(R.layout.custom_dialog);                dialog.setTitle(itemText);                ImageView image = (ImageView) dialog.findViewById(R.id.image);                image.setImageResource(R.drawable.hydrogen);        }        });            }     }</code></pre>","288437","","243782","","2010-08-13 17:44:33","2014-04-15 14:43:40","ListView opening a Dialog (or alert dialog)","<android><listview><dialog>","2","0","","",""
"3478944","1","3479000","","2010-08-13 16:39:47","0","858","<p>In Android, is there a way to get a list of the zip files on a web server which allows file browsing?</p>","172861","","","","","2010-08-13 16:47:25","Android Get list of files in a http (web) folder","<android>","1","0","","",""
"3478981","1","3480195","","2010-08-13 16:43:49","0","492","<p>I've chosen the path to have each Activity implement a onSharedPreferenceChangedListener.In order for a service to update values to be sent back to several Activities at once (it doesn't care which one has the focus)</p><p>When the Listener is called, I only have the key. I then have to perform a lookup of that key to get the corresponding View. This has been unsuccessful. I tried using getCurrentFocus()  and then a findViewWithTag(). Even tried a .getRoot() after getFocus().</p><p>For testing purposes I just tried getting a handle to the View outside of the Listener. I had to make sure setText ran in a runnalbe inside of the UIthread to work.</p><p>I've look at some other code and they perform a bunch of else if checks on the key. I could do this to dynamically get a handle to the view because I'll know what the id that corresponds to the string key it, but both ways seem inefficient.</p><p>This brings me to the overall question. Is that a way to populate a View's text directly from a Preference using XML? Then I wouldn't have to worry about the different Activities implementing a Listener. Everything would be contained in the XML file that I can move around freely.</p>","418859","","","","","2010-08-13 19:42:53","Android - View setText from SharedPreference Value using XML","<android><xml><view><sharedpreferences>","1","1","","",""
"3479015","1","3996544","","2010-08-13 16:49:26","4","1261","<p>I´m trying to read the values of the Light Sensor of my Nexus One, but I´mgetting only following values:</p><p>10.0</p><p>225.0</p><p>and in a few cases some values much higher.</p><p>The used code:</p><pre><code>sensorManager = (SensorManager) context                .getSystemService(Context.SENSOR_SERVICE);        sensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);        listener = new SensorEventListener() {            @Override            public void onAccuracyChanged(Sensor sensor, int accuracy) {            }            @Override            public void onSensorChanged(SensorEvent event) {                 Log.d(Constants.TAG, ""Brightness: "" + event.values[0]);            }        };        sensorManager.registerListener(listener, sensor,                SensorManager.SENSOR_DELAY_NORMAL);    }</code></pre><p>Does anybody have experience with the light sensor on the Nexus One or another Android device?Is my code the correct way to read the values?How can I get better and more accurate values?</p>","419780","","","","","2012-02-17 08:21:54","Light sensor on Nexus One returns only two distinct values","<android><nexus-one>","1","0","3","",""
"3479055","1","3479104","","2010-08-13 16:54:03","0","173","<p>in my Android application the file with name ""mainout.xml"" is creating, where ever this file created the application is not running.</p><p>any one know how to solve this problem??</p><p>Thanks.</p>","404128","","","","","2010-08-13 17:00:23","Android appication is not running when mainout.xml created","<android><mobile-application>","1","1","","",""
"3479173","1","","","2010-08-13 17:11:29","0","515","<p>I am trying to use one gallery on fill parent and one with a specific height over the first one. I want the second one to be something like a menu for the first and when you click on any of the items in it the big one will change to that item too.  </p><p>I tried using gallery and ViewFlipper but I can change the position of the ViewFlipper or the gallery. I can only make them go one position ahead or one back... How can I make a ViewFlipper or a gallery animate to a specific place in the array with pictures?</p>","419808","","419808","","2010-08-13 17:23:49","2012-04-27 06:51:16","How to navigate one Gallery/ViewFlipper from another?","<android>","0","2","","",""
"3479261","1","","","2010-08-13 17:24:00","2","723","<p>Ho do I install the new <a href=""http://www.google.com/mobile/voice-actions/index.html"" rel=""nofollow"">Google Voice Actions</a> on the emulator? </p><p>Android Market is not available on emulator. I found one APK at <a href=""http://android.modaco.com/content/software/315754/google-voice-actions-updated-quick-search-box-apks-original-testsigned/"" rel=""nofollow"">android.modaco.com</a>, but it's not working. The application crashes with following error (via ddms.bat):</p><pre><code>08-13 22:44:51.658: ERROR/AndroidRuntime(434): FATAL EXCEPTION: main08-13 22:44:51.658: ERROR/AndroidRuntime(434): Caused by: java.lang.UnsupportedOperationException: GoogleSettingsProvider not found08-13 22:44:51.658: ERROR/AndroidRuntime(434):     at com.google.android.voicesearch.LocationUtils.createLocationUtils(LocationUtils.java:48)08-13 22:44:51.658: ERROR/AndroidRuntime(434):     at com.google.android.voicesearch.RecognitionActivity.onCreate(RecognitionActivity.java:386)</code></pre><p>Alternatively, my questions question is where do I get official *.apk file for installing on emulator?</p>","229106","","229106","","2010-08-20 05:47:59","2010-08-20 05:47:59","How to install Google Voice Action on emulator","<android><android-emulator><voice>","0","2","","",""
"3479341","1","3480644","","2010-08-13 17:36:48","2","2174","<p>I extend AutoCompleteTextView and override preformFiltering function  in order to get results from database.I'm getting the results but then nothing is shown. And getView in custom adapter is never called.The strange thing that If I preload items (inside init() function) I can see them...May by anyone can point me to the right solution? Thanks.</p><pre><code>public class CityAutoCompleteTextView extends AutoCompleteTextView { private DataDatabase mCity; private CityAutoCompleteArrayAdapter mCityAutoCompleteAdapter;    private ArrayList&lt;CityAutoCompleteListItem&gt; mCityListItems; public CityAutoCompleteTextView(Context context) {   super(context);       init(); }    public CityAutoCompleteTextView(Context context, AttributeSet attrs) {         super(context, attrs);     init();         }    public CityAutoCompleteTextView(Context context, AttributeSet attrs, int defStyle) {     super(context, attrs, defStyle);     init();         }    public City getItem(int position) {     return mCityAutoCompleteAdapter.getItem(position).getCity();    }    private void init() {     mCity = new DataDatabase(this.getContext());     mCityListItems = new ArrayList&lt;CityAutoCompleteListItem&gt;();     mCityAutoCompleteAdapter = new CityAutoCompleteArrayAdapter(this.getContext(), R.layout.autocomplete_list, mCityListItems);     this.setAdapter(mCityAutoCompleteAdapter);    }    @Override    protected void performFiltering(CharSequence text, int keyCode) {     String stext = text.toString();     Cursor cur = mCity.getCitiesMatches(stext);     mCityListItems.clear();     if (cur==null) {         mCityAutoCompleteAdapter.notifyDataSetChanged();      return;     }     while(!cur.isAfterLast()) {      City city = new City(cur.getInt(0),cur.getString(1));      CityAutoCompleteListItem item = new CityAutoCompleteListItem(city, ""Unknown province/state"",cur.getString(2));      mCityListItems.add(item);      cur.moveToNext();           };     cur.close();     mCityAutoCompleteAdapter.notifyDataSetChanged();     super.performFiltering(text, keyCode);         }}</code></pre>","331308","","331308","","2010-08-13 20:39:47","2010-08-13 21:02:49","AutoCompleteTextView doesn't show dropdown","<android><autocompletetextview>","1","0","","",""
"3479428","1","","","2010-08-13 17:49:38","18","22546","<p>I have read many examples of how to create notification messages.What i wanted to achieve, is because the notification will be executed by a widget, i would likethe notification intent when clicked to clear it self when the user clicks on it.I do not have an activity to return to.The notification for my purposes will just plainly notify, nothing else.So what would be the code of an intent that just clear/cancel itself.The code below is an activity launched by a button(button code not included) the notification will be fired up by a background service.</p><pre><code>CharSequence title = ""Hello"";CharSequence message = ""Hello, Android!"";final NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);final Notification notification = new Notification(R.drawable.icon,""A New Message!"",System.currentTimeMillis());notification.defaults=Notification.FLAG_ONLY_ALERT_ONCE+Notification.FLAG_AUTO_CANCEL;Intent notificationIntent = new Intent(this, AndroidNotifications.class);PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,notificationIntent, 0);notification.setLatestEventInfo(AndroidNotifications.this, title,message, pendingIntent);notificationManager.notify(NOTIFICATION_ID, notification);</code></pre><p>Thanks</p>","364418","","","","","2014-04-14 18:23:49","Android Notification intent to clear it self","<android><notifications><android-intent><cancel>","5","0","4","",""
"3479433","1","3482090","","2010-08-13 17:50:03","3","2734","<p>After I either receive a phone call or make one, (and other undocumented interruptions) my application gets a NullPointerException when resuming my activity. Can any explain to me where it is and/or how to fix it? When my activity resumes, it is calling onCreate it seems, and it is trying to execute something that is null after Resuming. How do I prevent onCreate() from being called?</p><p>My activity seems to terminate when I press the call button, because when I try to debug this error, the debugger disconnects.</p><p>EDIT:</p><p>So, how do I handleprocess is killed -> onCreate() ? I have activities A -> B -> C -> D, and I press back all the way to A, there is no problem. But If I start another program, or another program comes to the foreground, D crashes, then C crashes, then B crashes, then A crashes!</p><p>EDIT:</p><p>I solved B,C,D crashing. It was because the class where I stored static variables was destroyed to free up resources, and my activities were getting null variables.</p><p>But when I get back to A, I get a classCastException:</p><pre><code>08-13 16:52:10.456: ERROR/AndroidRuntime(6048): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bookcessed.booksearch/com.bookcessed.booksearch.activities.ChooseProviderActivity}: java.lang.ClassCastException: android.view.AbsSavedState$108-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.os.Handler.dispatchMessage(Handler.java:99)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.os.Looper.loop(Looper.java:123)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at java.lang.reflect.Method.invokeNative(Native Method)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at java.lang.reflect.Method.invoke(Method.java:521)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at dalvik.system.NativeStart.main(Native Method)08-13 16:52:10.456: ERROR/AndroidRuntime(6048): Caused by: java.lang.ClassCastException: android.view.AbsSavedState$108-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.widget.ProgressBar.onRestoreInstanceState(ProgressBar.java:944)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.view.View.dispatchRestoreInstanceState(View.java:6138)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1209)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1209)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.view.View.restoreHierarchyState(View.java:6117)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1466)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.app.Activity.onRestoreInstanceState(Activity.java:843)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.app.Activity.performRestoreInstanceState(Activity.java:815)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1096)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2641)08-13 16:52:10.456: ERROR/AndroidRuntime(6048):     ... 11 more</code></pre><p>Here is my onCreate():</p><pre><code>super.onCreate(savedInstanceState);        tempLayout = new RelativeLayout(ChooseProviderActivity.this);        ProgressBar tempProgress = new ProgressBar(ChooseProviderActivity.this);        tempProgress.setIndeterminate(true);        tempProgress.setId(1); //I suspect this is the problem        RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(                RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);        lp.addRule(RelativeLayout.CENTER_IN_PARENT);        tempLayout.addView(tempProgress, lp);        setContentView(tempLayout);</code></pre><p>This is where I think the problem lies:</p><pre><code>tempProgress.setId(1); //I suspect this is the problem</code></pre>","325081","","325081","","2010-08-13 21:07:40","2012-02-17 13:10:23","App crashes after receving phone call","<android><crash><activity><oncreate>","7","3","","",""
"3479470","1","3479583","","2010-08-13 17:54:25","0","488","<p>I am having problems finding a way to populate a TextView with the value of a SharedPreference using XML.Is there a way to reference the preference like a string resource.Something like</p><p>TextView android:text=""@preference/name""</p>","418859","","","","","2010-10-08 01:35:59","Getting SharedPreference From XML","<android><xml><sharedpreferences>","1","0","","",""
"3479604","1","3479628","","2010-08-13 18:15:44","0","97","<p>I have a ListActivity which lists a bunch of ""things.""  If you click on one of these ""things,"" you're taken to another ListActivity which lists a bunch of ""stuff"" for that ""thing.""</p><p>Say I want to give the user the ability to edit the name of some of the ""stuff""; or even delete some of the ""stuff.""  At what point should I actually perform that action on my database?</p><p>Ex: If a row of ""stuff"" gets deleted, should the database be updated before I return my user to the list of ""things?""  Or should the user return to the list of ""things"" and then the database is updated?  Or does it not matter?</p><p>Mind you the database updating will likely happen in a service (I'll also be calling a web service to update the cloud).</p>","406790","","","","","2010-08-13 19:03:19","Small architecture question","<android><database><listview><listactivity>","3","1","","",""
"3479779","1","3479792","","2010-08-13 18:42:24","1","3264","<p>I'm battleing with extending a TextView for my Android app. I'd like to create ""bubbles"" to display text messages in a conversation, similar to the native iPhone SMS conversations. </p><p>Is there a way to implement the resizing of a background image without just stretching it? I'd like to have a single background image that keeps it's corners but get stretched only in defined areas. I think this should be possible because I've seen it in a SMS app, but I wonder how to implement that.</p>","419501","","246246","","2012-09-04 21:47:23","2012-09-04 21:47:23","How to nicely scale a background image of a TextView for Android","<android><textview>","1","0","","",""
"3479795","1","3480000","","2010-08-13 18:44:16","1","1702","<p>Below is the code to write to a file after downloading an image from the web. But somehow, it's just stuck while writing to File Stream. No Exception at all. It just stays on while loop then displays force close popup. it happens 2 or 3 out of 10.</p><pre><code>private void saveImage(String fullPath) {  File imgFile = new File(fullPath);  try {    if(imgFile.exists()) imgFile.delete();    URL url = new URL(this.fileURL);    URLConnection connection = url.openConnection();    HttpURLConnection httpConnection = (HttpURLConnection)connection;    InputStream in = httpConnection.getInputStream();    FileOutputStream fos = new FileOutputStream(imgFile);    int n = 0;    while((n = in.read()) != -1) {        fos.write(n);    }    fos.flush();    fos.close();    in.close();  }  catch(IOException e) {    imgFile.delete();    Log.d(""IOException Thrown"", e.toString());  }}</code></pre><p>When I check the file written, it's always stuck when it writes till 4576byte. (Original image size is over 150k) Is there anybody who can help me on this issue?</p>","419893","","","","","2011-09-24 06:53:23","Write problem on android application","<android><fileoutputstream>","2","0","","",""
"3479833","1","3482047","","2010-08-13 18:49:19","17","23206","<p>I would like to preemptively get the HTML code of a webpage that is to be loaded in a <code>webView</code>, parse it using regex, and display only the HTML code that I want, while letting the webpage still think it has loaded everything. </p><p>Is there any way to do that in the <code>WebViewClient.onLoadResource()</code> or similar methods?</p><p>EDIT: I tried this:</p><pre><code>class MyJavaScriptInterface   {        @SuppressWarnings(""unused"")           public void showHTML(String html, Context context)           {              new AlertDialog.Builder(context)                   .setTitle(""HTML"")                   .setMessage(html)                   .setPositiveButton(android.R.string.ok, null)               .setCancelable(false)               .create();                 pageHTML = html;         }   }@Override    public void customizeWebView(final ServiceCommunicableActivity activity, final WebView webview, final SearchResult mRom) {        mRom.setFileSize(getFileSize(mRom.getURLSuffix()));        webview.getSettings().setJavaScriptEnabled(true);        MyJavaScriptInterface interfaceA = new MyJavaScriptInterface();        webview.addJavascriptInterface(interfaceA, ""HTMLOUT"");          WebViewClient anchorWebViewClient = new WebViewClient()        {            @Override              public void onPageFinished(WebView view, String url)              {                  /* This call inject JavaScript into the page which just finished loading. */                  webview.loadUrl(""javascript:window.HTMLOUT.showHTML('&lt;head&gt;'+document.getElementsByTagName('html')[0].innerHTML+'&lt;/head&gt;');"");                Pattern pattern = Pattern.compile(""&lt;h2&gt;Winning Sc.+&lt;/h2&gt;&lt;/div&gt;(.+)&lt;br&gt;"", Pattern.DOTALL);                Matcher matcher = pattern.matcher(pageHTML);                matcher.find();</code></pre><p>The interface is never called</p>","325081","","325081","","2010-08-13 19:38:58","2013-05-23 16:41:05","Is it possible to get the HTML code from WebView","<html><android><webview>","3","0","11","",""
"3479885","1","","","2010-08-13 18:54:53","0","1399","<p>I'm not exactly sure if this is the best place for this topic but here goes..</p><p>I've reformatted my Android SD card (16GB) to HFS+ format, and pushed a Mac OS X 10.6 boot image (from a .dmg file) onto the card. I did this because I don't want to go out and buy a DL DVD-R to reinstall my operating system, and because it's a nice little experiment to test Android's limitations.</p><p>As it turns out (and no surprise here), Android can't handle the HFS+ file system. When it checks the SD card, it just thinks it's blank. And when I reboot my computer to the rEFIt boot menu, there is no option to boot from the USB drive. But I don't really want Android to read and process things from the file system. I want my iMac (Intel Core 2 Duo) to do that.</p><p>I'm thinking there must be a way for Android to force mount the SD card and allow my computer to read it's contents from the boot menu. So I'm hoping you guys can give me some insight into this, in the mean time I'll keep trying different things- I've just partitioned the SD card in two, one MS-DOS format, the other HFS+ to see what effect that will have. Thanks in advance.</p>","415746","","","","","2013-06-29 23:19:08","Android Force Mount USB Storage when SD card is formatted to HFS+","<android><osx><sd-card><file-system><usb-mass-storage>","0","2","","",""
"3479923","1","","","2010-08-13 18:58:43","0","2807","<p>I am developing an application on Android Froyo system, everything is fine, except that when I create a service, and the service will spawn several thread. In one of the thread, I want to stop the service.Apparently stopService() is out of scope in the thread class, and so is the getApplicationContext() calls.So inside a thread, can I get the current context and how?</p><p>Thanks</p>","419908","","","","","2010-08-13 19:33:51","Can not call getApplicationContext() inside a thread","<android><multithreading>","2","1","","",""
"3480015","1","3481199","","2010-08-13 19:10:05","1","544","<p>One of my applications downloads a database from a server.When I install the application onto my phone, it downloads the file correctly and loads the information, no exceptions thrown or anything.</p><p>However, when I upload the apk into the Android Market Place and download it onto the phone, the application downloads the database and then crashes, saying that the sqlite handler was not able to open up the database.</p><p>Here's the progression of code:</p><p>In the SQLiteOpenHelper:</p><pre><code>this.FULL_DB_PATH = new String(this.getWritableDatabase().getPath());this.getWritableDatabase();// Code for retrieving the database off of the server:private void copyDataBase(){        InputStream myInput=null;        OutputStream myOutput=null;        try{            // opening connections            URL url = new URL(""server_url_here"");            URLConnection ucon=url.openConnection();            myInput = ucon.getInputStream();                 myOutput = new FileOutputStream(this.FULL_DB_PATH);            // write to the db here            byte[] buffer = new byte[1024*1024];            int length;            while ((length = myInput.read(buffer))&gt;0){                myOutput.write(buffer, 0, length);            }            myOutput.flush();            myOutput.close();            myInput.close();        }         catch(Exception e)         {                try{                    myOutput.flush();                    myOutput.close();                    myInput.close();                }                catch(Exception es){}         }    }</code></pre><p>I don't know why my colleague is saving the db with a mp3 extension but...it works when we're installing the apk ad-hoc.</p><p>For:</p><pre><code>myOutput = new FileOutputStream(this.FULL_DB_PATH);</code></pre><p>I've also tried:</p><pre><code>myOutput = this.getApplicationContext().openFileOutput(this.FULL_DB_PATH, Context.MODE_WORLD_READABLE);</code></pre><p>But that doesn't work either.</p><p>Any help is greatly appreciated!! I've been tearing my hair out for a couple of hours over this and I just want it to end haha.</p>","158584","","","","","2010-08-16 09:15:03","Database seems to disappear after my application downloads it. Ideas?","<android><database><sqlite><file-io><download>","3","0","","",""
"3480048","1","3480159","","2010-08-13 19:16:18","1","1519","<p>I want to run some code when an app is launched, so my broadcast receiver has to be notified when user open any app.</p><p>Is there any way to do it?</p>","419921","","","","","2011-09-13 21:00:09","Registering my broadcast receiver to run when an app is launched?","<android>","2","0","","",""
"3480201","1","3480235","","2010-08-13 19:43:31","235","174434","<p>I finally managed to obfuscate my Android application, now I want to test it by installing the <a href=""http://en.wikipedia.org/wiki/APK_%28file_format%29"">APK</a> file and running it on the emulator.                                  </p><p>How can I install an APK file on the Android Emulator?</p>","242769","","205926","","2014-01-18 11:45:20","2014-03-14 10:19:59","How do you install an APK file in the Android emulator?","<android><android-emulator><install><apk>","10","5","90","",""
"3480287","1","","","2010-08-13 19:58:38","2","5255","<p>I created a test Activity that installs a shortcut of itself on the Android Home screen.  When you click a button, the Activity is supposed to remove the same shortcut it just created.  However, nothing I do seems to delete the shortcut.</p><p>Here is the Java code (ShortcutTest.java):</p><pre><code>import java.net.URISyntaxException;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class ShortcutTest extends Activity {    String shortcutUri;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        addShortcut(getBaseContext());        Button button = (Button)findViewById(R.id.Button01);        button.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                removeShortcut(getBaseContext());                finish();            }        });    }    public void addShortcut(Context context) {        Intent shortcutIntent = new Intent();        shortcutIntent.setClassName(""com.telespree.android.client"", ""com.telespree.android.client.ShortcutTest"");        shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);        Intent intent = new Intent();        intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);        intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, ""ShortcutTest"");        intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(context, R.drawable.icon));        intent.setAction(""com.android.launcher.action.INSTALL_SHORTCUT"");        shortcutUri = intent.toUri(MODE_WORLD_WRITEABLE);        context.sendBroadcast(intent);    }    public void removeShortcut(Context context) {        Intent intent = null;        try {            intent = Intent.parseUri(shortcutUri, 0);        } catch (URISyntaxException e) {        }        intent.setAction(""com.android.launcher.permission.UNINSTALL_SHORTCUT"");        context.sendBroadcast(intent);    }}</code></pre><p>Here is the Manifest:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.telespree.android.client""      android:versionCode=""1""      android:versionName=""1.0""&gt;      &lt;permission        android:name=""com.android.launcher.permission.UNINSTALL_SHORTCUT""        android:permissionGroup=""android.permission-group.SYSTEM_TOOLS""        android:protectionLevel=""normal""        /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".ShortcutTest""                  android:label=""@string/app_name"" android:theme=""@android:style/Theme.Translucent""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-permission android:name=""com.android.launcher.permission.INSTALL_SHORTCUT""/&gt;    &lt;!--     &lt;uses-permission android:name=""com.android.launcher.permission.UNINSTALL_SHORTCUT""/&gt;     --&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre><p>I'm almost positive there is some kind of permissions problem, though I've seen other posts on the Internet that indicates this should be possible.  </p><p>Any advice is greatly appreciated.</p><p>Thanks.</p>","112788","","","","","2014-04-09 06:00:49","Trying to UNINSTALL_SHORTCUT but shortcut won't go away","<android><activity><android-intent><manifest><shortcut>","4","0","3","",""
"3480372","1","3630205","","2010-08-13 20:14:53","0","1791","<p>Im trying to insert values on Android SQLite Database. The question is, I? trying to insert a word, the table has 3 columns, ID, WORD, COUNT.</p><p>When I insert a word in the database, some method will verify if this word exists on the database. If yes, it will increment the value of COUNT for this word.</p><p>Example. I have a word ""Question"" in the database with COUNT value 1, and i want to insert it again, the method will find this word and if I want to insert ""qUeSTion"" it doesnt matter, it will return ""Question"" for me when I retrieve the data, and it will increment the value of COUNT from 1 to 2. Got it??</p><p>SO here is my code. I'm having problems when try to do this, this verification. I dont know what method to use, etc. I'm using SQLiteStatement for insert. But the methods which offers doesn work. Any Idea of what use?</p><p>Thanks.</p><p><strong>Class DataHelper</strong></p><pre><code>public class DataHelper {private static final String DATABASE_NAME = ""sms.db"";private static final int DATABASE_VERSION = 1;private static final String TABLE_NAME = ""words"";private Context context;private SQLiteDatabase db;private SQLiteStatement insertStmt;private static final String INSERT = ""insert into ""   + TABLE_NAME + ""(word) values (?)"";public DataHelper(Context context) {  this.context = context;  OpenHelper openHelper = new OpenHelper(this.context);  this.db = openHelper.getWritableDatabase();  this.insertStmt = this.db.compileStatement(INSERT);}public long insert(String word) {  this.insertStmt.bindString(1, word);                return this.insertStmt.executeInsert();}public List&lt;String&gt; selectAll() {  List&lt;String&gt; list = new ArrayList&lt;String&gt;();  Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""word""},     null, null, null, null, ""id desc"");  if (cursor.moveToFirst()) {     do {        list.add(cursor.getString(0));      } while (cursor.moveToNext());  }  if (cursor != null &amp;&amp; !cursor.isClosed()) {     cursor.close();  }  return list;}}</code></pre><p><strong>Class SMS</strong> <em>This is the class where I get the words and insert in database</em></p><pre><code>public class SMS extends Activity { private DataHelper dh;      private static TextView txtView;                final Uri CONTENT_URI = Uri.parse(""content://sms/sent"");    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    this.dh = new DataHelper(this);            txtView =    (TextView)findViewById(R.id.txtView);                           Cursor cursor = getContentResolver().query(CONTENT_URI, null, null, null, null);                                            String body;                                                if(cursor.moveToFirst()){            body = cursor.getString(cursor.getColumnIndexOrThrow(""body"")).toString();            if(body == """"){                Toast.makeText(getBaseContext(), ""There is no words to save!"", Toast.LENGTH_LONG).show();            }                else{                                                   StringTokenizer st = new StringTokenizer(body);                    while(st.hasMoreTokens()){                                                           this.dh.insert(st.nextToken());                                                      Toast.makeText(getBaseContext(), ""The set of words has been updated!"", Toast.LENGTH_LONG).show();                                                                                                                                  }                    List&lt;String&gt; words = this.dh.selectAll();                    StringBuilder sb = new StringBuilder();                    sb.append(""Set of words:\n\n"");                    for (String w : words) {                        sb.append(w + "" "");                    }                                           Log.d(""EXAMPLE"", ""words size - "" + words.size());                                           txtView.setText(sb.toString());                }        }             }    }   </code></pre>","399459","","399459","","2012-06-23 13:49:16","2012-06-23 13:49:16","Increment and insert Integer values on Android SQLite Database","<android><database><sqlite><insert>","1","4","","",""
"3480456","1","3480520","","2010-08-13 20:27:40","21","22625","<p>I have two questions:</p><p>1) how do I change the color of the seek bar (path) from yellow (the default color) to white. What I mean to say is, while I slide the thumb , it turns the line traversed from grey to yellow.  I want track/line to either remain grey or white..Basically I want just the thumb to move with no color change in the seek bar.</p><p>2)How to change the thumb of seekbar from rectangle to circle/sphere/round shape. </p><p>any pointers will be appreciated. </p>","357349","","","","","2012-08-31 16:14:49","Seek bar, change path color from yellow to white","<android><android-emulator>","2","0","14","",""
"3480471","1","3515297","","2010-08-13 20:30:18","3","1307","<p>I have an app that has a free, and a paid version. I put all the free version code into a library, which I reference from a new free version project, and the paid version project. </p><p>I noticed that the library, and now my projects all have a properties file, and my preferences stopped working completely. It seems that depending on what namespace the code executes in, it gets a different result when you query for SharedPreferences.</p><p>What is the best way to deal with this? Both apps have the same preferences as of now, but I will probably extend the paid version later and add preferences that don't exist in the free version.</p>","413414","","","","","2010-08-18 18:19:40","Dealing with shared preferences stored in a library","<android><sharedpreferences>","1","2","","",""
"3480529","1","","","2010-08-13 20:42:33","14","2200","<p>I have 3 <code>autocompletetextview</code>'s in which i set its adapter to be an <code>ArrayAdapter&lt;String&gt;</code> with a very simple <code>textview</code> layout.</p><p>The <code>autocompletextview</code> hint results are showing, but are under the onscreen keyboard(i can see part of it).  how can i make the results show above the <code>autocompletetextview</code> rather than below?</p><pre><code>    airline = (AutoCompleteTextView)findViewById(R.id.airline);    airline.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.autcomplete_dropdown, AIRLINES_AUTOCOMPLETE_ARRAY));    departLocation = (AutoCompleteTextView)findViewById(R.id.departLocation);    departLocation.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.autcomplete_dropdown, LOCATIONS_AUTOCOMPLETE_ARRAY));    arriveLocation = (AutoCompleteTextView)findViewById(R.id.arriveLocation);    arriveLocation.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.autcomplete_dropdown, LOCATIONS_AUTOCOMPLETE_ARRAY));</code></pre>","416412","","2050874","","2013-06-05 16:12:00","2014-02-18 10:38:29","android autocompletetextview hint results hidden under keyboard","<android><autocompletetextview>","1","0","3","",""
"3480574","1","3480698","","2010-08-13 20:51:43","0","6423","<p>I'm trying to query a word, for this Im using the db.query method. But I want use a where clause, I've done like this on my code, but, the emulator returns an error.</p><pre><code>public String select(String wrd) {  String list = new String();  Cursor cursor = this.db.query(TABLE_NAME, new String[] {""word""},     ""word like "" + wrd + """", null, null, null, ""id desc"");  if (cursor.moveToNext()) {     do {        list = cursor.getString(0);      } while (cursor.moveToNext());  }  if (cursor != null &amp;&amp; !cursor.isClosed()) {     cursor.close();  }  return list;</code></pre><p>}</p><p>Im calling this method in other class, parsing a String argument.</p><pre><code>Cursor cursor = getContentResolver().query(CONTENT_URI, null, null, null, null);                                            String body;                                                if(cursor.moveToFirst()){            body = cursor.getString(cursor.getColumnIndexOrThrow(""body"")).toString();            if(body == """"){                Toast.makeText(getBaseContext(), ""There is no words to save!"", Toast.LENGTH_LONG).show();            }                else{                    String words = this.dh.select(""Testando"");                    StringTokenizer st = new StringTokenizer(body);                    while(st.hasMoreTokens()){                         if(words == st.nextToken())                         Toast.makeText(getBaseContext(), ""found! ""+words+"""", Toast.LENGTH_LONG).show();                         this.dh.insert(st.nextToken());                                                      Toast.makeText(getBaseContext(), ""The set of words has been updated!"", Toast.LENGTH_LONG).show();                                                                                                                                  }                                           StringBuilder sb = new StringBuilder();                    sb.append(""Set of words:\n\n"");                    sb.append(words + "" "");                                        txtView.setText(sb.toString());                }        }  </code></pre>","399459","","","","","2011-10-19 07:21:52","How to implement where clause on Android Query method?","<android><database><sqlite><select>","1","3","2","",""
"3480663","1","","","2010-08-13 21:07:36","3","1805","<p>I've written an Android application and I would like the application to be able to recognize when the Android device is plugged into a PC via the USB or even better, know when it is connected and adb logcat is running. Is this possible?</p><p>My purpose is to write traces to a separate circular buffer (which would get written to the sdcard occasionally) except when the device is connected e.g., via Eclipse and logcat is running - in that case, I would like to display the traces as part of logcat as they occur.</p>","420008","","","","","2010-08-13 21:40:00","How to tell if USB is connected to android device?","<android>","1","0","","",""
"3480682","1","","","2010-08-13 21:10:19","0","544","<p>I'm playing around with an app I have written whose main activity is a TabActivity. I was considering allowing the user to navigate between tabs with a fling gesture, but I find that I can only detect flings on one of my four tabs. </p><p>public class WSGesture extends TabActivity implements OnGestureListener {</p><p>private GestureDetector gestureScanner;</p><p>@Override onCreate(Bundle savedInstanceState){</p><p>gestureScanner = new GestureDetector(this);<br>...<br>}   </p><p>.<br>.<br>.<br>@Override<br>public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,<br>    float velocityY) {<br>    Log.v(TAG, ""onFling called, velX: "" + velocityX + "", velY: "" + velocityY);  </p><pre><code>return true;  </code></pre><p>}</p><p>public boolean onTouchEvent(MotionEvent me){<br>    return gestureScanner.onTouchEvent(me);</p><p>}</p><p>When I execute this code, I only see onFling being called when one particular tab is set as the current tab. For the other three, I get nothing. It's always the third out of four, if that matters.</p>","419998","","419998","","2010-08-13 22:44:23","2011-03-02 05:50:26","fling not working with TabActivity","<android>","1","3","","",""
"3480700","1","3495999","","2010-08-13 21:13:46","1","1187","<p>I have an Android activity that displays a list of log entries (using a cursor adapter and listview). When one of the entries is touched it kicks off an intent (passed with a bundle object containing the log details as strings) to another activity. The new activity is supposed to display the details in a custom TableView xml file I created, but I can not figure out how to bind the bundle strings to the id's defined in the TextView of the TableView.</p><p>I have included most my code below so you can see what I am trying to accomplish.</p><p>ViewEntry Class:</p><pre><code>public class ViewEntry extends Activity{public void onCreate(Bundle icicle){  super.onCreate(icicle);  setContentView(R.layout.view_list);  setTitle(R.string.view_entry_title);  TableView lv= (TableView)findViewById(R.id.viewlayout);    Bundle extras = getIntent().getExtras();    if (extras != null){        String date = extras.getString(plbDbAdapter.KEY_DATE);        String ident = extras.getString(plbDbAdapter.KEY_IDENT);        String type  = extras.getString(plbDbAdapter.KEY_TYPE);         String from  = extras.getString(plbDbAdapter.KEY_FROM);         String to  = extras.getString(plbDbAdapter.KEY_TO);         String remark  = extras.getString(plbDbAdapter.KEY_REMARK);         String[] from = new String[] { ""date_h"", ""ident_h"", ""type_h"", ""from_h"", ""to_h"", ""remark_h""};        int[] to = new int[] { R.id.v_date, R.id.v_ident, R.id.v_type, R.id.v_from, R.id.v_to, R.id.v_remark };        ArrayAdapter details = new ArrayAdapter(this, R.layout.view_list, from, to);        setAdapter(details);        List&lt;HashMap&lt;String, String&gt;&gt; fillList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();        HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();                    map.put(""date_h"", date);                    map.put(""ident_h"", ident);                    map.put(""type_h"", type);                    map.put(""from_h"", from);                    map.put(""to_h"", to);                    map.put(""remark_h"", remark);                    fillList.add(map);        SimpleAdapter viewadapt = new SimpleAdapter(this, fillList, R.layout.view_list, from, to);        lv.setAdapter(viewadapt);    }         </code></pre><p>}</p><p>Here is view_list.xml I am trying to bind to:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:id=""@+id/viewlayout""    android:stretchColumns=""1""&gt; &lt;TableRow&gt;    &lt;TextView        android:gravity=""left""        android:text=""Date:""        android:padding=""3dip"" /&gt;    &lt;TextView        android:id=""@+id/v_date""        android:gravity=""right""        android:padding=""3dip"" /&gt;</code></pre><p>                                                                                                                        </p><p>I know what I am trying to do isn't right but hopefully it helps illustrate my intention.</p>","420013","","420013","","2010-08-15 20:24:04","2010-08-16 18:14:37","Binding stings to TableView/TextView IDs","<android>","1","1","","",""
"3480709","1","","","2010-08-13 21:15:05","4","3101","<p>I've written a web-app in HTML and Javascript for iPhone and Android which involves the dragging and dropping images.</p><p>You initiate the drag by holding your finger over the image for about a second.  However, Android then pops up the message giving me the option to save the image, set it as wallpaper etc.</p><p>How can I prevent Android from doing this?  Is there a metatag I can use?  Some javascript?</p>","385990","","","","","2011-12-03 21:49:06","Preventing the Android ""long press"" to save images","<javascript><android><image><drag>","3","0","","",""
"3480715","1","3480756","","2010-08-13 21:15:57","65","44170","<p>I would like to play around with some ideas and develop a soft keyboard for Android to replace the default one.</p><ul><li><p>Is there any general information about soft keyboard development for Android out there? Any best practices or guidelines?</p></li><li><p>Can I do with my keyboard application pretty much anything I could do with a normal Android application?</p></li><li><p>Can I do HTTP connections to synchronize keyboard data with a cloud DB and other phones I have?</p></li><li><p>Can I open other windows/screens from a key press, e.g. to display a custom input interface different to a normal QWERTY one. If that doesn't work, can I use a pop-up dialog instead?</p></li></ul>","184367","","","","","2014-01-27 22:40:24","How to develop a soft keyboard for Android?","<android><keyboard>","3","0","51","",""
"3480769","1","3480927","","2010-08-13 21:25:53","17","6131","<p>I'm creating a custom widget by extending <code>LinearLayout</code>:</p><pre><code>public class MyWidget extends LinearLayout {    private static Paint PAINT = new Paint(Paint.ANTI_ALIAS_FLAG);    static {        PAINT.setColor(Color.RED);    }    public MyWidget(Context context) {        this(context, null);    }    public MyWidget(Context context, AttributeSet attrs) {        super(context, attrs);    }    @Override    protected void onDraw(Canvas canvas) {        super.onDraw(canvas);        canvas.drawCircle(canvas.getWidth() / 2, canvas.getHeight()/2, canvas.getWidth()/2, PAINT);        // never gets called :-(    }    @Override    protected void dispatchDraw(Canvas canvas) {        super.dispatchDraw(canvas);        // this gets called, but with a canvas sized after the padding.    }}</code></pre><p>I can add children just fine, but I'm never getting my custom <code>onDraw()</code> being called. <code>dispatchDraw()</code> gets called, but that seems to have a different canvas (the one that's within the padding. I need to draw on the whole layout area). Is there some flag that needs to get set to get <code>onDraw()</code> called for the layout?</p>","90934","","","","","2010-08-13 21:55:09","Custom Widget using LinearLayout not getting onDraw()","<android><android-widget><android-linearlayout><ondraw>","1","1","4","",""
"3480846","1","3480931","","2010-08-13 21:39:32","2","1702","<p>Is there a way to automatically answer an incoming cell call from an android application? I know it can be detected etc. but can it be programmatically answered?</p>","420008","","","","","2013-02-14 03:10:37","Is there a way to automatically answer incoming cell calls?","<android>","1","2","2","",""
"3480999","1","3481298","","2010-08-13 22:09:02","6","6608","<p>When creating my SQLite database in Android I set the database locale - db.setLocale(new Locale(""cz_CZ"")). This is a Czech locale.</p><p>A SELECT statement works and takes the locale into account, for example:</p><pre><code>SELECT * from table WHERE name='sctzy' COLLATE LOCALIZED </code></pre><p>Will find the entry 'šctžý'.</p><p>But using LIKE will fail:</p><pre><code>SELECT * from table WHERE name LIKE '%sctzy%' COLLATE LOCALIZED </code></pre><p>No row is returned.</p><p>BTW. There is no java.text.Normalized class in Android. I thought I could make a second column with a normalized text, stripped of special characters, which would be used for searching - but I am missing a class or way how to normalize the String.</p>","420047","","","","","2013-11-28 09:03:12","Using COLLATE in Android SQLite - Locales is ignored in LIKE statement","<android><database><sqlite><locale><collate>","3","1","","",""
"3481046","1","","","2010-08-13 22:18:26","0","1090","<p>What's the best way to detect when a Home Screen Widget has gained or lost focus? An example of losing focus is if the user navigates to another screen or if another screen popped up in front of the Widget.</p>","440093","","","","","2010-08-13 22:21:09","Android: Detect when a Widget has gained/lost focus","<android>","1","0","","",""
"3481079","1","3659832","","2010-08-13 22:26:34","6","12345","<p>I'm using this code to post on Facebook, but it does not work with the official Facebook app because it tries to send as a link. Is there any way around this?</p><pre><code>Intent s = new Intent(android.content.Intent.ACTION_SEND);s.setType(""text/plain"");s.putExtra(Intent.EXTRA_SUBJECT, ""Quote"");s.putExtra(Intent.EXTRA_TEXT, qoute);startActivity(Intent.createChooser(s, ""Quote""));</code></pre>","326423","","844882","","2012-03-22 05:00:55","2012-04-19 17:15:10","Android Facebook Intent","<android><facebook>","1","2","13","",""
"3481332","1","3481673","","2010-08-13 23:45:54","2","124","<p>Im creating a custom layout and I want to use the text declared in the <code>layout.xml</code> file in my layout.</p><p>Like when I create a <code>TextView</code> in XML and set <code>android:text=@string/text1</code> when I run the app text view automatically loads the text from android:text. So how can I access attributes declared in the layout XML file in my custom component.</p>","419921","","238639","","2010-08-14 01:43:07","2010-08-14 01:47:40","How do I used values declared in XML on my custom layout?","<android>","2","0","","",""
"3481434","1","3481536","","2010-08-14 00:21:08","2","2841","<p>1- How can i disable multi tasking?My application is a  socket based game, every time i start the app, it MUST load the main page first to start the socket connection?I do not want the user to be able to run my application in background.Is this possible to do?</p><p>2- I do not want the user to be able to use the back button, to navigate between pages, users must only use the buttons available in my application to navigate? is this possible?</p>","242769","","","","","2010-08-14 01:01:38","Android ==> disable multi tasking?","<android><multitasking>","1","4","2","",""
"3481591","1","3481646","","2010-08-14 01:18:13","6","9379","<p>I am trying to do a listview which looks like this:<img src=""http://pici.se/pictures/hjFksZvLx.jpg"" alt=""alt text""> </p><p>It has two parts, the left is left-aligned and contains two textviews which are single line and truncated.The right is part also has two textviews but they are right-aligned and have constant size. The main problem is that the right part does not align to the right.If I use a static width to push it to the right side it works pretty good, but then it does not look good in landscape mode.</p><p>I thought it should be simple to accomplish. But it wasn't.</p><p>First I tried with Linearlayout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""horizontal""&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:id=""@+id/L1""        android:layout_height=""fill_parent""        android:layout_weight=""0.8""        android:layout_width=""0dip""&gt;        &lt;TextView            android:id=""@+id/text1""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:lines=""1""            android:ellipsize=""end""            android:scrollHorizontally=""true""            android:text=""Long text Long text Long text Long text Long text Long text Long text"" /&gt;        &lt;TextView            android:id=""@+id/text2""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:lines=""1""            android:ellipsize=""end""            android:scrollHorizontally=""true""            android:text=""Short text"" /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:id=""@+id/L2""        android:layout_gravity=""top|right""        android:layout_height=""fill_parent""        android:layout_weight=""0.2""        android:layout_width=""0dip""&gt;        &lt;TextView            android:id=""@+id/text4""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""right""            android:text=""12:12"" /&gt;        &lt;TextView            android:id=""@+id/text3""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""64%""            android:layout_gravity=""right"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I have been fiddling with the weight property, but it doesn't seem to help. Right part does not align to the right at all.</p><p>And then I tried with Relativelayout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""&gt;    &lt;TextView        android:id=""@+id/text1""        android:layout_height=""wrap_content""        android:lines=""1""        android:scrollHorizontally=""true""        android:layout_alignParentTop=""true""        android:text=""Long text Long text Long text Long text Long text Long text Long text""        android:layout_alignParentLeft=""true""        android:ellipsize=""end""        android:layout_width=""275dp"" /&gt;    &lt;TextView        android:id=""@+id/text2""        android:layout_height=""wrap_content""        android:lines=""1""        android:ellipsize=""end""        android:scrollHorizontally=""true""        android:text=""Long text Long text Long text Long text Long text Long text Long text""        android:layout_below=""@+id/text1""        android:layout_alignParentLeft=""true""        android:layout_width=""275dp"" /&gt;    &lt;TextView        android:id=""@+id/text3""        android:layout_height=""wrap_content""        android:text=""12:12""        android:layout_gravity=""right""        android:layout_alignParentRight=""true""        android:layout_alignBaseline=""@+id/text1""        android:layout_width=""40dp""        android:layout_alignRight=""@+id/text4"" /&gt;    &lt;TextView        android:id=""@+id/text4""        android:layout_height=""wrap_content""        android:layout_gravity=""right""        android:text=""64%""        android:layout_alignParentRight=""true""        android:layout_alignBaseline=""@+id/text2""        android:layout_width=""40dp"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Same problem here, the right part is not aligning to the the right properly, and I have to use a static size of android:layout_width to push it to the other side.And if don't use a static size the text start clipping each other.</p>","215088","","","","","2010-08-14 01:36:57","Aligning right and left with linear or relativelayout with truncated text?","<java><android><gui>","1","0","1","",""
"3481680","1","3481735","","2010-08-14 01:51:17","6","5340","<p>What is an effective way to determine how much free space is on the SD card?</p>","172861","","","","","2012-04-03 10:10:52","Android How Much space is free on the SD card?","<android>","4","2","4","",""
"3481869","1","","","2010-08-14 03:14:25","0","696","<p>This is my first time using jodatime and i've got a stackoverflow error that i have no idea how to fix. I'm creating an android app that needs to be able to display the days between when a sqlite record was created and today. As far as i can tell everything is working correctly except jodatime. I got this error when building the project</p><pre>[2010-08-10 02:08:50 - Grow Journal Beta] processing org/joda/time/DateTimeUtils.class...[2010-08-10 02:08:50 - Grow Journal Beta] processing org/joda/time/DateTimeZone$1.class...[2010-08-10 02:08:50 - Grow Journal Beta] warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)[2010-08-10 02:08:50 - Grow Journal Beta] processing org/joda/time/DateTimeZone$Stub.class...</pre><p>This is the logcat:</p><pre>08-13 22:12:11.823: ERROR/AndroidRuntime(6537): Uncaught handler: thread main exiting due to uncaught exception08-13 22:12:11.893: ERROR/AndroidRuntime(6537): java.lang.StackOverflowError08-13 22:12:11.893: ERROR/AndroidRuntime(6537):     at java.util.Hashtable.get(Hashtable.java:274)08-13 22:12:11.893: ERROR/AndroidRuntime(6537):     at java.util.Properties.getProperty(Properties.java:177)08-13 22:12:11.893: ERROR/AndroidRuntime(6537):     at java.lang.System.getProperty(System.java:440)08-13 22:12:11.893: ERROR/AndroidRuntime(6537):     at java.lang.System.getProperty(System.java:412)08-13 22:12:11.893: ERROR/AndroidRuntime(6537):     at org.joda.time.DateTimeZone.getDefault(DateTimeZone.java:132)08-13 22:12:11.893: ERROR/AndroidRuntime(6537):     at org.joda.time.DateTimeZone.forID(DateTimeZone.java:190)08-13 22:12:11.893: ERROR/AndroidRuntime(6537):     at org.joda.time.DateTimeZone.getDefault(DateTimeZone.java:132)</pre><p>After looking around a bit i figure i just need to recompile the jodatime binary my self.I've been using eclipse, I created a new project, and imported the jodatime source. When I attempt to compile I get this in the console:</p><pre><code>Usage: java org.joda.time.tz.ZoneInfoCompiler &lt;options&gt; &lt;source files&gt;</code></pre><p>where possible options include:  -src     Specify where to read source files  -dst     Specify where to write generated files</p><p>Not really sure where to go from here. Any help would be greatly appreciated. Thanks for your time.</p><p>StackTrace from overflow:</p><pre>Thread [ main] (Suspended (exception StackOverflowError))       DateTimeZone.getDefault() line: 147     ISOChronology.getInstance() line: 86        DateTimeUtils.getChronology(Chronology) line: 231       DateConverter(AbstractConverter).getChronology(Object, Chronology) line: 82     DateTime(BaseDateTime).(Object, Chronology) line: 170     DateTime.(Object) line: 168       PlantsCursorAdapter.newView(Context, Cursor, ViewGroup) line: 71        PlantsCursorAdapter(CursorAdapter).getView(int, View, ViewGroup) line: 182      ListView(AbsListView).obtainView(int) line: 1274        ListView.measureHeightOfChildren(int, int, int, int, int) line: 1147        ListView.onMeasure(int, int) line: 1060     ListView(View).measure(int, int) line: 7966     TableLayout(ViewGroup).measureChildWithMargins(View, int, int, int, int) line: 3077     TableLayout(LinearLayout).measureChildBeforeLayout(View, int, int, int, int, int) line: 888     TableLayout.measureChildBeforeLayout(View, int, int, int, int, int) line: 453       TableLayout(LinearLayout).measureVertical(int, int) line: 350       TableLayout.measureVertical(int, int) line: 465     TableLayout.onMeasure(int, int) line: 428       TableLayout(View).measure(int, int) line: 7966      FrameLayout(ViewGroup).measureChildWithMargins(View, int, int, int, int) line: 3077     FrameLayout.onMeasure(int, int) line: 245       FrameLayout(View).measure(int, int) line: 7966      LinearLayout.measureVertical(int, int) line: 464        LinearLayout.onMeasure(int, int) line: 278      LinearLayout(View).measure(int, int) line: 7966     PhoneWindow$DecorView(ViewGroup).measureChildWithMargins(View, int, int, int, int) line: 3077       PhoneWindow$DecorView(FrameLayout).onMeasure(int, int) line: 245        PhoneWindow$DecorView(View).measure(int, int) line: 7966        ViewRoot.performTraversals() line: 767      ViewRoot.handleMessage(Message) line: 1650      ViewRoot(Handler).dispatchMessage(Message) line: 99     Looper.loop() line: 123     ActivityThread.main(String[]) line: 4595        Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]      Method.invoke(Object, Object...) line: 521      ZygoteInit$MethodAndArgsCaller.run() line: 860      ZygoteInit.main(String[]) line: 618     NativeStart.main(String[]) line: not available [native method]  </pre><p>DateTimeZone.class source is <a href=""http://google.com/codesearch/p?hl=en#6vTamNAQOVE/src/java/org/joda/time/DateTimeZone.java&amp;q=jodatime%20DateTimeZone.class&amp;sa=N&amp;cd=2&amp;ct=rc"" rel=""nofollow"">Here</a></p>","393328","","393328","","2010-08-14 13:08:45","2010-09-30 12:47:40","Recompile jodatime?","<java><android><jodatime>","3","3","","",""
"3482010","1","","","2010-08-14 04:32:07","0","1062","<p>I'm trying to figure out how to launch an activity in my app from a custom URI such as myapp://myuriactivity</p><p>I've read a lot about the intent and intent filters in the android references and also read several examples, but for some reason I can't get my simple test to work.  Below is my manifest file, can anyone tell me what I'm doing wrong?  With the below file, if I open the browser and try to navigate to <a href=""http://org.test.launchtest"" rel=""nofollow"">http://org.test.launchtest</a> it just says the page doesn't exist.  Shouldn't this work?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>                                                                            </p><pre><code>&lt;activity android:name="".MyUriActivity""&gt;        &lt;intent-filter&gt;&lt;action android:name=""android.intent.action.VIEW"" /&gt;&lt;category android:name=""android.intent.category.DEFAULT"" /&gt;&lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;&lt;data android:scheme=""http"" android:host=""org.test.launchtest"" /&gt;</code></pre><p>     </p>","417876","","","","","2010-08-15 06:02:11","Can't get intent filter to launch activity from a uri","<android><android-intent>","1","1","","",""
"3482020","1","3483281","","2010-08-14 04:35:20","1","846","<p>I have a service running (Socket), this is how i start the service.</p><pre><code>Intent s = new Intent(this, Socket.class);startService(s);</code></pre><p>in every activity i check for the user to select the home button, as soon as the home button is clicked i need to destroy the socket, so i have the below code on every activity in my app:</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event){           if (keyCode == KeyEvent.KEYCODE_HOME)    {        Intent s = new Intent(this, Socket.class);        stopService(s);    }       return true;}</code></pre><p>but this doesn't seem to stop my service?<br>Am i missing something? I need to destroy my service as soon as the home button is clicked.</p>","242769","","12707","","2010-08-14 04:47:39","2010-08-14 12:33:51","Starting and stopping services","<android><service>","1","0","","",""
"3482037","1","3482114","","2010-08-14 04:42:30","1","117","<p>Hi I am generating the random numbers and do some functionality with that .but when i change the otientation new random numbers are coming.But I want portrait random nimbers.For this give me some suggestions.Thanks in advance</p>","454808","","","","","2010-08-14 05:14:06","Random numbers are changed when orientaion is changed","<android>","1","0","","",""
"3482086","1","","","2010-08-14 05:03:37","5","7560","<p>This question seems embarassingly simple, yet it vexes me still. I am using the standard ADT and Eclipse Android environment to build my Android app. The apk is named after the project name in Eclipse, but I want to name the apk something different...How can I customize the name of the apk artifact that is produced when the project builds? </p>","268648","","","","","2013-04-23 19:42:52","Android: How to set the name of the compiled APK?","<android>","3","2","","",""
"3482254","1","3482326","","2010-08-14 06:08:22","0","107","<p>I'm sure all must have seen Twitter application for android. How can i show livewallpaper inside application on my dashboard screen, just like twitter is doing.</p><p>I need to do the same thing as they have done, where and image will keep floating around when user views home screen of the application.</p><p>Any help would do!!!</p><p>Thanks in advance..</p>","376148","","","","","2010-08-14 06:40:27","Incorporating LiveWallpaper in application","<android><wallpaper>","1","0","","",""
"3482598","1","3482684","","2010-08-14 08:28:44","1","602","<p>I know i am doing a small mistake.</p><p>I am using LinearLayout and i want to place the ""icon-image"" at ""Center"".I am using the following code:</p><pre><code>&lt;LinearLayout         android:id=""@+id/LinearLayout01""         android:orientation=""vertical""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         xmlns:android=""http://schemas.android.com/apk/res/android""&gt;   &lt;LinearLayout         android:id=""@+id/LinearLayout02""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:orientation=""horizontal""        android:layout_weight=""0""&gt;        &lt;ImageView             android:id=""@+id/ImageView01""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:src=""@drawable/icon""            android:layout_gravity=""center_vertical|center_horizontal|center""&gt;        &lt;/ImageView&gt;   &lt;/LinearLayout&gt;   &lt;LinearLayout&gt;         ............   &lt;/LinearLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>As you see above, i have also set <strong><code>layout_gravity</code></strong>.</p><p>Now my problem is, <strong><code>if i set android:layout_width=""wrap_context"" instead of ""fill_parent"" in Child Linear Layout (i.e. LinearLayout02) then it works fine. but then whats should i do to set icon-image at Center while setting fill_parent</code></strong>?</p><p>Pls anybody focus their knowledge and let me help to find out the mistake.Pls help me.</p><p>Thanx,</p><p>Paresh</p>","379693","","","","","2010-08-14 09:03:45","Android - Layout gravity/width related problem","<android><android-layout><android-linearlayout>","1","0","1","",""
"3482635","1","","","2010-08-14 08:43:59","11","14116","<p>I have a SQLite db that size is over 2.6 GiB. (The db contains maps.)This db is used by RMaps app. When move the maps to some parts at maximum zoom, the app suddenly closes. However, there is no force close message, no report button. So, I've got an idea that it is caused by reading blocks that are beyond a certain limit e.g. max(int). Since RMaps is just using simple SQL statements, I think that the problem is not in RMaps but rather in Android SQLite driver.</p><p>Is there a size limit of SQLite database on Android?</p><p>(I have Froyo on Nexus One, but I do not think that this is just a problem of Froyo.)</p><p>Log output:</p><pre><code>08-14 10:24:51.689 I/ActivityManager(   81): Starting activity: Intent { act=android.intent.action.SEARCH flg=0x10000000 cmp=com.robert.maps/.MainMapActivity (has extras) }08-14 10:25:01.879 E/AndroidRuntime(12441): FATAL EXCEPTION: pool-1-thread-208-14 10:25:01.879 E/AndroidRuntime(12441): android.database.sqlite.SQLiteDiskIOException: disk I/O error08-14 10:25:01.879 E/AndroidRuntime(12441):     at android.database.sqlite.SQLiteQuery.native_fill_window(Native Method)08-14 10:25:01.879 E/AndroidRuntime(12441):     at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:70)08-14 10:25:01.879 E/AndroidRuntime(12441):     at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:283)08-14 10:25:01.879 E/AndroidRuntime(12441):     at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:264)08-14 10:25:01.879 E/AndroidRuntime(12441):     at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:171)08-14 10:25:01.879 E/AndroidRuntime(12441):     at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:248)08-14 10:25:01.879 E/AndroidRuntime(12441):     at com.robert.maps.utils.CashDatabase.getTile(CashDatabase.java:49)08-14 10:25:01.879 E/AndroidRuntime(12441):     at org.andnav.osm.views.util.OpenStreetMapTileFilesystemProvider$7.run(OpenStreetMapTileFilesystemProvider.java:501)08-14 10:25:01.879 E/AndroidRuntime(12441):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)08-14 10:25:01.879 E/AndroidRuntime(12441):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)08-14 10:25:01.879 E/AndroidRuntime(12441):     at java.lang.Thread.run(Thread.java:1096)08-14 10:25:01.889 I/ActivityManager(   81): Process com.robert.maps (pid 12441) has died.08-14 10:25:01.899 I/WindowManager(   81): WIN DEATH: Window{45131410 com.robert.maps/com.robert.maps.MainMapActivity paused=false}</code></pre><p>The SQLite db is stored on SD card, there is enough space.</p>","121968","","995926","","2012-05-05 13:44:47","2012-05-05 13:44:47","What is a maximum size of SQLite database on Android?","<android><sqlite><android-2.2-froyo>","2","4","3","",""
"3482674","1","","","2010-08-14 09:01:26","4","9772","<p>Trying to figure what's wrong with my codings. I followed a blog post from <a href=""http://evgenyg.wordpress.com/2010/05/01/uploading-files-multipart-post-apache"" rel=""nofollow"">here</a>.</p><p>I managed to get the codes to actually upload the file to a PHP web service. However, for some reason although I've set explicitly the MIME type for the file, PHP shows that the MIME is just a blank string and therefore rejected.</p><p>Here's my codings:</p><pre><code>public String SendPost(String fn, String bid, String caption, String uid, String APIKey, String postHash)         throws ParseException, ClientProtocolException, IOException {    HttpClient httpclient = new DefaultHttpClient();    httpclient.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);    HttpPost httppost = new HttpPost(UrbURL);    Log.i(""POSTFN"", fn);    Log.i(""POSTFN"", bid);    Log.i(""POSTFN"", caption);    Log.i(""POSTFN"", uid);    Log.i(""POSTFN"", APIKey);    Log.i(""POSTFN"", postHash);    String postAuth = uid + postHash;    postAuth = md5(postAuth);    postAuth = postAuth.substring(0, 16);    //Log.i(""POSTAUTH"", postAuth);    MultipartEntity mp = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);    /*File tempImg = new File(fn);    FileBody bin = new FileBody(tempImg, ""image/jpg"");*/    mp.addPart(""business_photo"", new FileBody(new File(fn), ""image/jpg""));    //StringBody s = new StringBody(bid, ""text/plain"", Charset.forName( ""UTF-8"" ));    mp.addPart(""business_id"", new StringBody(bid, ""text/plain"", Charset.forName( ""UTF-8"" )));    //s = new StringBody(caption, ""text/plain"", Charset.forName( ""UTF-8"" ));    mp.addPart(""photo_caption"", new StringBody(caption, ""text/plain"", Charset.forName( ""UTF-8"" )));    //s = new StringBody(uid, ""text/plain"", Charset.forName( ""UTF-8"" ));    mp.addPart(""user_id"", new StringBody(uid, ""text/plain"", Charset.forName( ""UTF-8"" )));    //s = new StringBody(APIKey, ""text/plain"", Charset.forName( ""UTF-8"" ));    mp.addPart(""apikey"", new StringBody(APIKey, ""text/plain"", Charset.forName( ""UTF-8"" )));    //s = new StringBody(postAuth, ""text/plain"", Charset.forName( ""UTF-8"" ));    mp.addPart(""auth"", new StringBody(postAuth, ""text/plain"", Charset.forName( ""UTF-8"" )));    httppost.setEntity(mp);    String response = EntityUtils.toString( httpclient.execute( httppost ).getEntity(), ""UTF-8"" );    httpclient.getConnectionManager().shutdown();    return response;}</code></pre><p>Many thanks before :)</p>","420275","","213269","","2011-08-31 14:03:09","2014-04-12 09:53:31","Android Multipart HTTP Post does not send the File's MIME type","<android><httpclient><http-post><mime-types><multipartform-data>","5","0","4","",""
"3482742","1","3482757","","2010-08-14 09:28:02","331","147995","<p>I know we can set the following value to the <strong><code>android:gravity</code></strong> and  <strong><code>android:layout_gravity</code></strong> </p><ol><li>center</li><li>center_vertical</li><li>center_horizontal, etc.</li></ol><p>But i am confused regarding these both.</p><p>what is the difference between the usage of <code>android:gravity</code> and <code>android:layout_gravity</code>?</p>","379693","","379693","","2011-11-23 09:51:06","2014-03-01 12:26:41","Android - gravity and layout_gravity","<android><android-layout>","7","1","94","",""
"3482974","1","","","2010-08-14 10:53:12","1","135","<p>I have installed all the pre-requisite to start android development.</p><ol><li>Installed JDK</li><li>Downloaded and unzipped Android SDK and ran SDK.exe. Selected the SDK i wanted to work with.</li><li>Installed Eclipse.</li><li>Downloaded ADT and configured it for eclipse.</li><li>Created a AVD.6 Created a new Hello World project.</li><li>Set teh run configuration pointing the configuration to hello world.</li></ol><p>When i run the application on the emulator, it doesnt give any error but also doesnt display Hello World. All is displayed is ANDROID and nothing else.</p><p>What could be wrong?</p><hr><pre><code>Console output[2010-08-14 11:40:25 - Hello World] ------------------------------[2010-08-14 11:40:25 - Hello World] Android Launch![2010-08-14 11:40:25 - Hello World] adb is running normally.[2010-08-14 11:40:25 - Hello World] Performing android.HelloWorld.HelloWorld activity launch[2010-08-14 11:40:25 - Hello World] Automatic Target Mode: launching new emulator with compatible AVD 'my_avd'[2010-08-14 11:40:25 - Hello World] Launching a new emulator with Virtual Device 'my_avd'[2010-08-14 11:40:29 - Hello World] New emulator found: emulator-5554[2010-08-14 11:40:29 - Hello World] Waiting for HOME ('android.process.acore') to be launched...[2010-08-14 11:40:41 - Hello World] emulator-5554 disconnected! Cancelling 'android.HelloWorld.HelloWorld activity launch'!</code></pre>","420320","","14637","","2010-08-14 10:54:47","2012-10-18 06:35:02","Starting with Android","<android>","2","0","","",""
"3482981","1","4596652","","2010-08-14 10:55:52","5","3236","<p>I'm doing a simple program using ""MultiAutoCompleteTextView"" to prompt the common words when I </p><p>inputing several letters. </p><p>code:</p><pre><code>    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(            this,            android.R.layout.simple_dropdown_item_1line,             ary);    MultiAutoCompleteTextView textView = (MultiAutoCompleteTextView) findViewById(R.id.editText);    textView.setAdapter(adapter);    textView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());    private String[] ary = new String[] {    ""abc"",    ""abcd"",    ""abcde"",    ""abcdef"",    ""abcdefg"",    ""hij"",    ""hijk"",    ""hijkl"",    ""hijklm"",    ""hijklmn"",    };</code></pre><p>Now,when I input 'a'and choose ""abcd"" but the result become to ""abcd,"". How to replace the comma to a space?</p><p>Thank you!   </p>","395158","","","","","2011-01-04 17:44:40","How to replace the comma with a space when I use the ""MultiAutoCompleteTextView""","<android><android-widget>","3","0","5","",""
"3483110","1","3483528","","2010-08-14 11:45:05","18","32952","<p>How to set font to textview, which is created at runtime?</p><p>i created textview</p><pre><code>Textview tv = new TextView(this);      tv.setTextSize(20);</code></pre><p>like I can change the size<br>i want to set font style to ""Verdana"".</p><p>How to do this??regardsshishir</p>","1497488","","492624","","2011-11-23 16:02:42","2014-04-08 00:21:40","set font at runtime, Textview","<android><fonts><textview>","5","0","15","",""
"3483123","1","","","2010-08-14 11:47:43","4","4540","<p>I am developing an application which requires use of an SQLite database. I have implemented fetching the data, but I am facing problems when I try to insert data. The problem that I am having is that the new data I enter is not stored, i.e nothing is new is being entered into the database.</p><p>This is my insert code, <code>myDataBase</code> is an instance of SQLiteDatabase.</p><pre><code>public void insertTitle(String Recipe)  {      ContentValues initialValues = new ContentValues();      initialValues.put(COLUMN_NAME,value);      myDataBase.insert(ZRECIPE, null, initialValues);   }</code></pre>","420340","","2025","","2012-03-14 09:08:29","2013-12-05 14:21:06","Data not inserting in Sqlite database in android","<android><sqlite>","3","0","1","",""
"3483124","1","","","2010-08-14 11:48:04","1","857","<p>android emulator doesn't start when i check the scale display to real size checkbox.any idea why would this happen ?This only happens when i try to lunch it from eclipse but when i open it with cmd with the scale switch it works just fine.</p>","72443","","72443","","2010-08-15 13:43:04","2010-08-15 13:43:04","android emulator problem with scale display to real size","<android><android-emulator>","0","2","","",""
"3483182","1","3483221","","2010-08-14 12:04:43","4","1610","<p>With this sample code, the activity is told to finish, but continues execution afterwards and displays the message.  I'm trying to understand why this happens.  The only fix I can think of is to place 'return' after finish.</p><pre><code>public void someMethod() {    if( valueIsTrue) {        startActivity(new Intent(this, NewActivity.class));        CurrentActitivy.this.finish();        // return;  // if uncommented, Toast doesn't show    }    Toast.maketext(this, ""Some message"", Toast.LENGTH_SHORT).show();}</code></pre>","386541","","","","","2010-08-14 12:17:24","Activity finish method waits to finish?","<android>","1","0","","",""
"3483263","1","","","2010-08-14 12:26:15","1","785","<p>Can Android application request to download on SD card in android 2.1 and lower.Also I want to know if the application can request some folders that contain videos to download on the sd card ? and how to do that ?</p><p>Thanks in advance.</p>","419979","","","","","2010-08-14 12:43:59","Android application download on SD card","<android>","1","0","","",""
"3483344","1","3483432","","2010-08-14 12:51:02","0","186","<p>I would like my app to do something when another application is opened.</p><p>The current approach I have taken is to create a broadcast receiver that monitors all</p><pre><code>android.intent.action.MAIN</code></pre><p>events, but either I am not doing it correctly or the way I am going about it is incorrect. The section of the manifest looks like this:</p><pre><code>&lt;receiver android:name="".GetApp""&gt;         &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;</code></pre><p>I included the launcher category just as a test. GetApp currently is only set to make a log entry when called.</p><p>If anyone has any experience doing something like this your help would be greatly appreciated!</p>","420377","","","","","2010-08-14 13:09:57","I want my Android app to know when another application has been started","<android><android-manifest>","1","0","","",""
"3483403","1","3483504","","2010-08-14 13:03:23","4","2021","<p>It would be nice if StackOverflow had a section where we could post tutorials like mine so that I can answer literally hundreds of questions that have been asked here with a single blow. See... every day I read questions about how to pass complex objects between activities, how to save state so that your app can resume after orientation change, how to update listviews when the data changes, etc, etc.</p><p>Here is the second part of a tutorial series I posted on my blog... I hope that you actually read it... because I haven't seen any examples like it anywhere... and it has changed how I think about developing for Android across the board. The question is... is there a downside or negative affect of developing like this?</p><p><a href=""http://androidworkz.com/2010/08/14/beyond-smart-lists-how-observable-singletons-change-the-game/"" rel=""nofollow"">Beyond Smart Lists – How Observable Singletons change the game</a>.</p><p>Please read through both of these tutorials carefully... I will answer any questions about it here that I can... I really want to know what you think about this and if it might solve issues for you.</p><p><strong>NOTE TO MODERATORS:</strong> there are no advertisements of any kind on my blog.. so don't just close this because you think I am spamming somehow... I am not going to duplicate my post here. And... really I want to know if there is a flaw in this approach.</p>","386654","","386654","","2010-08-14 13:08:41","2010-08-14 13:28:55","Is it acceptable practice to use Singleton Objects to save state or share data between Activities?","<android><singleton><observable>","1","8","1","","2010-08-14 13:03:23"
"3483595","1","3483607","","2010-08-14 13:53:04","3","7337","<p>We are converting out suite of iPhone apps written in .NEt MonoTouch to Android.</p><p>How do we catch, then publish exceptions so that they are reported via the Android Market?</p>","172861","","","","","2011-10-14 15:47:44","Android Exception Handling","<android><exception-handling>","5","0","3","",""
"3483629","1","3484312","","2010-08-14 14:01:00","2","497","<p>I have a <code>View</code> comprised of two <code>TextView</code> if first is too wide can I get the second to display on the next line?</p><p>Is there a solution?</p><pre><code>&lt;LinearLayout android:orientation=""horizontal""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;TextView android:text=""If this text is too wide""android:textSize=""20px""android:textStyle=""bold""android:id=""@+id/del01""android:paddingTop=""3px""android:paddingBottom=""3px""android:gravity=""left""android:layout_width=""wrap_content""android:layout_height=""wrap_content"" /&gt;&lt;TextView android:text=""I want this on a different line""android:id=""@+id/del02""android:gravity=""center_horizontal""android:layout_width=""wrap_content""android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre>","420415","","119895","","2010-08-14 14:11:52","2010-08-14 17:10:05","Android Layout - Text Too Wide?","<android><layout>","1","5","1","",""
"3483676","1","","","2010-08-14 14:12:04","1","110","<p>We're building a mobile web for Android devices. But we met some compatibility issue of Android browsers in different OS versions.</p><p>We wanted to known some detailed information of the HTML/JS/CSS compatibility of Android Browser between version. Is there any official document for this? We searched around and found few about it.</p><p>Thanks in prior.</p>","372859","","","","","2011-05-18 14:18:51","Where to find a compability list of Android browsers in different OS versions?","<android><browser><compatibility>","0","0","","",""
"3483690","1","5878481","","2010-08-14 14:14:32","7","39882","<p>I just tried the current Google sample for <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList1.html"" rel=""nofollow""><code>ExpandableListiew</code></a>:</p><p>This sample seem very simple and easy to use, but what I would like to do is to say that one of the category has no child. I removed all the children but the problem is that the arrow still appears on this current line.</p><p>For instance, imagine that I remove all <em>""Cat Names""</em>, the arrow is still there and when I click on it, the arrow just change. How to remove this arrow and launch an activity instead?</p>","327402","","427763","","2012-07-27 13:39:34","2012-07-27 13:39:34","ExpandableListView sample from Google","<android><expandablelistview>","2","0","4","",""
"3483714","1","3484153","","2010-08-14 14:20:56","1","1026","<p>I need to display results from a SQL join in a ListView/ListActivity.</p><p>I've created a cursor:</p><pre><code>Cursor cursor = db.rawQuery(LIST_JOIN_SQL, null);</code></pre><p>and if I iterate through the cursor, the results are exactly what I expect.  However when I try and use a SimpleCursorAdapter to display these results in a ListView I get a runtime exception because there is no column called ' id'.</p><pre><code>SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.item, cursor, FROM, TO);</code></pre><p>Where FROM and TO are defined as:</p><pre><code>private static String[] FROM = { ""name"", };private static int[] TO = { R.id.name, };</code></pre><p>Now I figure I'm probably using the wrong approach here, as it seems SimpleCursorAdapters aren't meant for displaying results of joins.</p><p>What approach would you recommend here?  I'm restricted to using Android 1.6 APIs.</p>","233602","","","","","2010-08-14 16:19:46","Displaying results of a SQL join in a ListActivity","<android><sqlite><listview><cursor><listactivity>","2","0","1","",""
"3483767","1","3483893","","2010-08-14 14:32:36","1","838","<p>I am working on an android app that uses google maps. now I would like to know whether there is a possibility to color a google map e.g. have a different color for roads and other shapes.</p><p>E.g have something like this <a href=""http://odopod.com/contact/"" rel=""nofollow"">http://odopod.com/contact/</a></p>","401025","","73488","","2010-08-14 14:55:33","2010-08-14 15:12:15","Color a Google Map, Android","<android><google-maps>","2","0","","",""
"3483809","1","3707285","","2010-08-14 14:42:05","10","1570","<p>I'm writing a horizontal tv-view, similar to the ones you know form tivo systems and similar. For each channel there is a row with the programmes for the next 6 hours or so, with a width proportional with their play time.</p><p>My Idea is to write a custom widget for each row, and stack these on top of each other. This should allow me to load the data incrementally, rather than using one big custom view. I will however still need forward/backward buttons in the top of the page, that updates all rows when clicked.</p><p><img src=""http://img695.imageshack.us/img695/7163/77622951.png""></p><p>Now I'm unsure wether I should place these Views in a ListView or a LinearLayout.</p><p>I have collected the follwing pros and cons:</p><ul><li>ListView<ul><li>Pros<ul><li>Memory efficient - Recycles hidden Views</li><li>Seams to be used by everyone, in the Android community, for anything.</li><li>It might be easier to make it lazy, when updating the rows, and thus require less cpu.</li></ul></li><li>Cons<ul><li>Overkill - I wont be using most of the features it has to offer</li><li>It may be slightly more difficult to attach the clickListeners.</li></ul></li></ul></li><li>LinearLayout<ul><li>Pros<ul><li>Simple to use. Does what you'd expect.</li></ul></li><li>Cons<ul><li>I haven't seen it used anywhere for long lists.</li><li>Perhaps it is slower?</li></ul></li></ul></li></ul><p>The ""Seams to be used by everyone"" argument for ListView also contains the ""Master"" Twitter app, which Google uses to show off ""Good Android design"". They also don't seam to be using most of its features.</p><p>Do you have any experience with this kind of work? Are there any reccomandations I've missed when reading through the docs?</p>","205521","","","","","2013-04-16 07:36:15","ListView vs LinearLayout","<android><performance><listview><android-linearlayout>","2","2","","",""
"3483886","1","4403533","","2010-08-14 14:58:08","3","817","<p>In my app I need to download a lot of images for data in a ListView. I do lazy loading and it works rather fast, but still there is a 1-3 secs delay before the first image shows up. My research in the delay shows that the data transfer takes 50% of the time.</p><p>Now, I believe that If I could do incremental loading of the images, I would be able to show half an image after just 75% of the delay, which is quite good.</p><p>I use <code>Drawable.createFromStream</code> which uses <code>BitmapFactory.decodeResourceStream</code> internally. But even though it takes a stream, it doesn't paint anything before all data is downloaded and decoded.</p><p>Do you know a way to load and paint images incrementally with the default Android lib? Or perhaps a good independent one out there?</p><p><img src=""http://1.bp.blogspot.com/_GTM_W5mVPTU/TETLoIzCOaI/AAAAAAAAAIU/1_u5-WwQT_I/s400/thr.png"" alt=""Screenshot of an ImageDownloader app""></p>","205521","","","","","2010-12-09 21:56:05","Incremental loading of images","<android><image><lazy-loading><incremental>","2","2","1","",""
"3483939","1","3483959","","2010-08-14 15:13:49","0","744","<p>This is my list view item:<br><img src=""http://i38.tinypic.com/2vv520k.jpg"" alt=""alt text""><br>I want to put an OnClickListener on the Checkbox. But I need to get the list item that the CheckBox is in, via row id. How can I do that in the <code>onClick</code> method.</p>","200477","","200477","","2010-08-14 15:24:01","2010-08-14 15:24:01","Get the row id of the current item in ListView","<java><android><checkbox><onclick>","1","1","","",""
"3483966","1","3484001","","2010-08-14 15:21:41","1","751","<p>Is there a tool/library/class/function for formatting XML when displaying it in a TextView in Android? I need to present some XML snippets to users and was looking for a convenient way to achieve this, rather than having to parse and format it manually...</p><p>Thanks</p>","146588","","","","","2010-08-14 15:32:56","Formatting XML for display in a TextView?","<android>","1","0","","",""
"3483977","1","3484105","","2010-08-14 15:25:35","2","384","<p>I have a ContentProvider which is declared in the Manifest, when is it really created ? When the application is launched but before launching the first activity ? When the first query/update/insert is done ? When ?</p>","179872","","","","","2013-10-28 18:54:16","When is a ContentProvider really created?","<android><android-contentprovider>","2","0","1","",""
"3483982","1","3485838","","2010-08-14 15:27:32","2","723","<p>We are converting apps to Android from .NET</p><p>Is there a Java equivalent of the .NET Path.Combine() function?</p><p>Currently we check the / on each folder etc before building paths.</p>","172861","","","","","2010-08-15 01:28:58","Android Converting .NET Path.Combine to java?","<.net><android>","1","0","","",""
"3484046","1","","","2010-08-14 15:46:47","6","4961","<p>Using a twitter search URL ie. <a href=""http://search.twitter.com/search.rss?q=android"">http://search.twitter.com/search.rss?q=android</a> returns CSS that has an item that looks like:</p><pre><code>&lt;item&gt;      &lt;title&gt;@UberTwiter still waiting for @ubertwitter  android app!!!&lt;/title&gt;      &lt;link&gt;http://twitter.com/meals69/statuses/21158076391&lt;/link&gt;      &lt;description&gt;still waiting for an app!!!&lt;/description&gt;      &lt;pubDate&gt;Sat, 14 Aug 2010 15:33:44 +0000&lt;/pubDate&gt;      &lt;guid&gt;http://twitter.com/meals69/statuses/21158076391&lt;/guid&gt;      &lt;author&gt;Some Twitter User&lt;/author&gt;      &lt;media:content type=""image/jpg"" height=""48"" width=""48"" url=""http://a1.twimg.com/profile_images/756343289/me2_normal.jpg""/&gt;      &lt;google:image_link&gt;http://a1.twimg.com/profile_images/756343289/me2_normal.jpg&lt;/google:image_link&gt;      &lt;twitter:metadata&gt;        &lt;twitter:result_type&gt;recent&lt;/twitter:result_type&gt;&lt;/twitter:metadata&gt;&lt;/item&gt;</code></pre><p>Pretty simple.  My code parses out everything (title, link, description, pubDate, etc.) without any problems.  However, I'm getting null on:</p><pre><code>&lt;google:image_link&gt;</code></pre><p>I'm using Java to parse the RSS feed.  Do I have to handle compound localnames differently than I would a more simple localname?</p><p>This is the bit of code that parses out Link, Description, pubDate, etc:</p><pre><code>@Override    public void endElement(String uri, String localName, String name)            throws SAXException {        super.endElement(uri, localName, name);        if (this.currentMessage != null){            if (localName.equalsIgnoreCase(TITLE)){                currentMessage.setTitle(builder.toString());            } else if (localName.equalsIgnoreCase(LINK)){                currentMessage.setLink(builder.toString());            } else if (localName.equalsIgnoreCase(DESCRIPTION)){                currentMessage.setDescription(builder.toString());            } else if (localName.equalsIgnoreCase(PUB_DATE)){                currentMessage.setDate(builder.toString());            } else if (localName.equalsIgnoreCase(GUID)){                currentMessage.setGuid(builder.toString());            } else if (uri.equalsIgnoreCase(AVATAR)){                currentMessage.setAvatar(builder.toString());            } else if (localName.equalsIgnoreCase(ITEM)){                messages.add(currentMessage);            }             builder.setLength(0);           }    }</code></pre><p>startDocument looks like:</p><pre><code>@Override    public void startDocument() throws SAXException {        super.startDocument();        messages = new ArrayList&lt;Message&gt;();        builder = new StringBuilder();    }</code></pre><p>startElement looks like:</p><pre><code>@Override    public void startElement(String uri, String localName, String name,            Attributes attributes) throws SAXException {        super.startElement(uri, localName, name, attributes);        if (localName.equalsIgnoreCase(ITEM)){            this.currentMessage = new Message();        }     }</code></pre><p>Tony</p>","420460","","420460","","2010-08-14 16:52:32","2012-09-06 17:26:39","How can I parse a namespace using the SAX parser?","<java><android><xml><parsing>","5","1","2","",""
"3484117","1","3654233","","2010-08-14 16:08:45","0","946","<p>A few weeks ago I asked exactly the same question <a href=""http://stackoverflow.com/questions/3053554/retrieve-contacts-nickname"">here</a>. At first, I thought the answers solved my problem, but they didn't. I just didn't notice that I wasn't able to solve my problem with those answers.</p><p>However, what I've got now is:</p><pre><code>final Cursor phoneCursor = context.getContentResolver().query(Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(""'"" + incomingNumber + ""'"")), null, null, null, null);phoneCursor.moveToFirst();String lookupString = phoneCursor.getString(phoneCursor.getColumnIndex(PhoneLookup.LOOKUP_KEY));final Cursor dataCursor = context.getContentResolver().query(ContactsContract.Data.CONTENT_URI, null, ContactsContract.Data.LOOKUP_KEY + ""="" + ""'"" + lookupString + ""'"", null, null);dataCursor.moveToFirst();Log.e(""smn"", ""display_name: "" + dataCursor.getString(dataCursor.getColumnIndex(ContactsContract.Data.DISPLAY_NAME)));Log.e(""smn"", ""nickname: "" + dataCursor.getString(dataCursor.getColumnIndex(ContactsContract.Data.DATA1)));</code></pre><p>Output looks like this:</p><pre><code>08-14 17:41:02.106: ERROR/smn(20146): display_name: Tom Tasche08-14 17:41:02.106: ERROR/smn(20146): nickname: null</code></pre><p><a href=""http://stackoverflow.com/questions/3053554/retrieve-contacts-nickname/3054083#3054083"">This answer</a> told me that Nicknames are held in Data-table, but although I'm querying Data-table, I don't retrieve the contact's alias saved in my addressbook.</p><p><img src=""http://dl.dropbox.com/u/811795/device.png"" alt=""contact with alias""></p><p>I already tried it the other way: I inserted a new alias for this contact. And that worked fine. So, nicknames seem to work.Additionally, I've printed out every field that's saved in Data-table, again, without no luck.</p><p>Any ideas? Maybe I'm doing something completely wrong, but at the moment I don't see what's the problem...</p><p>Thanks for your help</p><p>Tom</p>","198996","","","","","2010-09-06 20:51:03","retrieve contact's nickname, part 2","<android><contacts>","1","2","","",""
"3484136","1","","","2010-08-14 16:15:37","4","804","<p>I want to write a program in Java that uses fast Fourier transformation.The program reads data every 5 milliseconds seconds from sensors and is supposed to do something with the data every 200 milliseconds based on the data from the last five seconds.</p><p>Is there a good library in Java that provides a way to do Fourier transformation without recalculating all five seconds every time?</p>","25282","","313137","","2010-08-14 17:59:11","2010-08-14 17:59:11","On the fly calculation of Fourier transformation in Java","<java><android><fft>","1","3","1","",""
"3484320","1","3484937","","2010-08-14 17:11:17","3","2631","<p>I have the following in my Activity that I use to download a users films in their LoveFilm queue, but the ProgressDialog never appears.</p><pre><code>public class MyListActivity extends Activity {    SharedPreferences prefs;    ProgressDialog m_progressDialog;    Thread listThread;    User user;    private Runnable threadProc_initializeQueue = new Runnable() {        public void run() {            user.fetchQueues();            Queue defaultQueue = user.getDefaultQueue();            defaultQueue.fetchTitles();            m_progressDialog.dismiss();        }    };    /* (non-Javadoc)     * @see android.app.Activity#onCreate(android.os.Bundle)     */    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        prefs = getSharedPreferences(getString(R.string.app_name), MODE_PRIVATE);        // Authenticate the user if needs be.        if(!prefs.getBoolean(""isAuthenticated"", false)) {            Intent i = new Intent(this, OAuthActivity.class);            startActivity(i);            finish();        } else {            // Get the users default list.            LoveDroid app = (LoveDroid) getApplication();            user = new User(app);            m_progressDialog = ProgressDialog.show(MyListActivity.this, ""Please Wait"", ""Loading"", true);            listThread = new Thread(null, threadProc_initializeQueue);            listThread.run();        }    }</code></pre><p>I've seen others with this problem, and they all basically get around to recommending a line that looks like mine</p><pre><code>m_progressDialog = ProgressDialog.show(MyListActivity.this, ""Please Wait"", ""Loading"", true);</code></pre><p>The rest of the code works, the users films are downloaded via the thread, but the dialog never shows up, it takes a few seconds too, it's not like the dialog is being dismissed before it's had time to appear.</p>","11470","","","","","2010-08-14 20:17:21","ProgressDialog doesn't appear","<android>","2","0","1","",""
"3484505","1","","","2010-08-14 18:03:07","0","207","<p>I have a list, and I want 'Next' and 'Previous' buttons at the bottom of the list. I've tried to make the ListAdapter for the list something other than simple_list_item_1, but Android won't let me. I keep getting '... can't be resolved'.</p><p>Now, simple_list_item_1 is some kind of magical unicorn that is impossible to find, so I can't change it.</p><p>How can I put my buttons on the screen?</p>","8522","","6391","","2010-08-15 04:36:23","2010-08-15 04:36:23","How do I add a button to my list when I'm forced to use simple_list_item_1?","<android><listview><layout>","1","0","","",""
"3484643","1","","","2010-08-14 18:44:12","32","30797","<p>I would to enter in some comments into the layout XML files, how would I do that?</p><p>thanks,Dean</p>","412317","","5171","","2010-08-14 18:48:59","2013-10-20 20:24:59","How to - Comments in layout xml","<android><xml>","5","0","4","",""
"3484779","1","3485781","","2010-08-14 19:24:51","1","1032","<p>What is the simplest way to draw pixels, lines and circles on a View?I want to move a cross cursor around, so nothing particularly intensive.</p><p>I thought I could extend SurfaceView and add it to an XML and it would just work, but it just appears black, however, when I look at the layout view of localmap.xml in eclipse, the graphics appear as expected.</p><p>Any ideas? My onDraw is never called on the emulator, and even calling invalidate on the class makes no difference. I shall keep trying but can anyone see anything I've missed? or is there a better way entirely?</p><ul><li>Frink</li></ul><p>localmap.xml contains the following (in a RelativeLayout)</p><pre><code>  &lt;com.example.android.game.LocalMapViewandroid:id=""@+id/localmap_map""android:layout_width=""fill_parent""android:layout_above=""@id/localmap_planettext""android:layout_below=""@id/header""/&gt;</code></pre><p>LocalMapView.java contains the following (amongst other things)</p><pre><code>public class LocalMapView extends SurfaceView {Paint mPaint = new Paint();//Construct a LocalMapView based on inflation from XMLpublic LocalMapView(Context context, AttributeSet attrs) {    super(context, attrs);    // allow the map to receive the focus    setFocusable(true);</code></pre><p>}</p><pre><code>private void drawPixel(Canvas canvas, int x, int y, int colour) {    mPaint.setColor(colour);    if ((x &gt;= MAP_MIN_X) &amp;&amp; (x &lt; MAP_MAX_X) &amp;&amp; (y &gt;= MAP_MIN_Y) &amp;&amp; (y &lt; MAP_MAX_Y)) {        canvas.drawPoint(((float)x * mScaleMapToScreenX), ((float)y * mScaleMapToScreenY), mPaint);    }}private void drawCircle(Canvas canvas, int x, int y, int radius, int colour) {    mPaint.setColor(colour);canvas.drawCircle(((float)x), ((float)y), ((float)radius), mPaint);}@Overridepublic void onDraw(Canvas canvas) {    super.onDraw(canvas);           drawCircle(canvas, MAP_MAX_X/2, MAP_MAX_Y/2, 1, 0xFF00FFFF);    drawPixel(canvas, MAP_MAX_X/2, MAP_MAX_Y/2, 0xFF000000);}</code></pre>","131209","","","","","2010-08-15 01:00:31","Simple simple 2D graphics in a view","<android>","1","0","","",""
"3484794","1","3484917","","2010-08-14 19:28:17","3","1104","<p>Lets say I have 2 mobile phones which are 50 meters away from each other and I would like to send a very small packet of data from mobile-A to mobile-B, without using any communication to cellular tower.</p><p>To make it simpler, I would like to build an app which implements a Peer to Peer connection for 2 mobiles in the same radius (in the same area).</p><p>Is this feasible using the technology of smartphones these days?  (Android for example)</p>","178016","","","","","2014-01-16 01:28:49","Communicating between two smartphones without using a Cellular Tower - Peer to Peer","<android><networking><mobile><p2p><gsm>","2","0","","",""
"3484820","1","3484829","","2010-08-14 19:34:52","0","347","<p>I have a service running on my android application, the service is a socket class that has to run through the whole application, i create it when my first activity loads.How can i get an instance of this socket class so that i can call a function in this class.</p><pre><code>For example//how can i get an instance of the running service?MyService s = getService();s.writeDataToServer(""hello"");</code></pre>","242769","","","","","2010-08-15 04:00:14","Android ==> Service question?","<android><service>","3","0","","",""
"3484839","1","3486084","","2010-08-14 19:39:29","1","3851","<p>I tried to test my application on my android phone, but the it can't be able to detect the device compatibility. The debug mode on phone is enabled.</p><p>My phone: Motorola.My ubuntu: 10.04.IDE: Eclipse.</p><p>I even tried to add the following line:SUBSYSTEMS==”usb”, ATTRS{idVendor}==”22b8?, ATTRS{idProduct} ==”41db”, MODE=”0600""to my /etc/udev/rules.d/90-android.rules.</p><p>But every time I tried to run the application, the device can't be detectable.</p>","411604","","411604","","2010-08-14 19:57:06","2010-08-15 03:28:29","How to connect the android phone on Ubuntu 10.04","<android><ubuntu>","2","0","1","",""
"3484850","1","3484869","","2010-08-14 19:41:50","0","145","<p>I want to create a layout like this:</p><p>On the top a TextView, after it a scrollable list of words, in the bottom two buttons.</p><p>But in order to create a scrollable list I think I must use ListActivity, but I want to create an Activity so the only scrollable part is the list and the TextView and buttons are fixed.</p><p>How can I do this?</p>","419921","","","","","2010-08-14 19:47:28","Add a List to my layout","<android>","1","0","","",""
"3485019","1","","","2010-08-14 20:39:24","0","257","<p>Here is my custom ListView item.<br><img src=""http://i38.tinypic.com/2vv520k.jpg"" alt=""ListView item""><br>The problem is that I want it to update my database whenever it is clicked. And to do that I need to get the row id of the ListItem of the CheckBox that was clicked. Also could you please post a code sample.</p>","200477","","","","","2010-08-14 20:39:24","Update database on CheckBox click in Android?","<java><android><sqlite><listviewitem>","0","2","","",""
"3485249","1","3857329","","2010-08-14 21:48:33","2","352","<p>I'm developing an Android application using Android 1.5. I'm using an older version of the SDK because I'm building it to run on a single G1 phone.</p><p>I've been using a 2.1 emulator without any problems, but when I tried taking a look on my Nexus One (2.2), the application immediately stopped responding. I then tried a 2.2 emulator with the same result.</p><p>Has anyone seen a similar problem or know of a possible solution?</p><p>The project isn't very complicated. I have a service running in the background that listens to incoming text messages and passes those messages on to a database. When I run the program in debug mode, it never hits a breakpoint on the first line of the first activity. It is as if it cannot even load.</p>","301839","","","","","2010-10-04 16:44:40","Why won't a Android 1.5 app run on Android 2.2 phone or emulator?","<android><android-emulator><android-2.2-froyo>","2","1","","",""
"3485454","1","3486107","","2010-08-14 22:54:17","2","1014","<p>While developing for Android, I am unable to open more than one main.xml file in an Eclipse editor at a time.  Each time I open one, it simply replaces the editor (tab) of the first main.xml with the new one, instead of opening a new tab - even if the contents of the existing tab were unsaved!</p><p>Even stranger, I can open multiple main.xml files from different projects with no problems.  This only happens when they're within the same project.</p><p>Any idea how to fix or work around this?  It's a real time-waster.</p><p>(Running Eclipse Classic 3.5.2 64bit w/ADT 0.9.7 on Win7 Home Premium x64)</p><p><em><strong>Edit for clarity:</em></strong></p><p>It's not the same file opened twice. In one project, there is a file called ""main.xml"" in a directory called ""Layout"". There is another file also called ""main.xml"" in a directory called ""Layout-Land"". These two files cannot be opened at the same time.  I'm not sure if this is a problem with Eclipse or with ADT.</p><p><em><strong>More info:</em></strong></p><p>For kicks I created two new files in those same directories (both called ""item.txt"") and they both opened properly (each in their own tab).  I renamed them both to ""item.xml"" and tried opening them again, and sure enough they fought for the same tab.  This leads me to believe ADT is at fault since xml files in these layout directories are opened with ADT's layout tool.  I could be wrong though.</p>","420474","","420474","","2010-08-15 02:16:07","2010-08-15 03:43:05","Unable to open both main.xml files from layout & layout-land at the same time?","<android><eclipse><adt>","2","3","","",""
"3485514","1","3485526","","2010-08-14 23:19:04","0","1064","<p>I am making my TextView clickable and want the text to change as I click on it. So the TextView starts out saying ""Al"" and when its clicked I want it to change to say, let just say ""Hi"" for now. And then also go back when clicked again. Here is my code.</p><pre class=""lang-java prettyprint-override""><code>package table.periodic;import android.app.Activity; import android.content.Intent; import.os.Bundle; import android.view.ContextMenu; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.TextView;public class Aluminum extends Activity{    public Button next;     public TextView symbol;       public static final int ONE_ID = Menu.FIRST+1;     public static final int TWO_ID = Menu.FIRST+2;     public static final int THREE_ID = Menu.FIRST+3;    public static final int FOUR_ID = Menu.FIRST+4;     public static final int FIVE_ID = Menu.FIRST+5; public static    final int SIX_ID = Menu.FIRST+6;    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.aluminum);         symbol = (TextView) findViewById(R.id.symbol);          symbol.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                symbol = (TextView) findViewById(R.id.symbol);                if (""Al"".equals(symbol.getText()));                symbol.setText(""Hi"");                if (""Hi"".equals(symbol.getText()));                symbol.setText(""Al"");            }  });        next = (Button) findViewById(R.id.next);        next.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                Intent next = new Intent(Aluminum.this, Aluminum2.class);                startActivity(next);}});    }       public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo){        populateMenu(menu);    }    public boolean onCreateOptionsMenu(Menu menu){        populateMenu(menu);        return(super.onCreateOptionsMenu(menu));    }    public boolean onOptionsItemSelected(MenuItem item){        return(applyMenuChoice(item)||                super.onOptionsItemSelected(item));    }    public boolean onContextItemSelected(MenuItem item){        return(applyMenuChoice(item)||                super.onContextItemSelected(item));    }    private void populateMenu(Menu menu){        menu.add(Menu.NONE, ONE_ID, Menu.NONE, ""Help"");        menu.add(Menu.NONE, TWO_ID, Menu.NONE, ""Home"");        menu.add(Menu.NONE, THREE_ID, Menu.NONE, ""List"");        menu.add(Menu.NONE, FOUR_ID, Menu.NONE, ""Table"");    }    private boolean applyMenuChoice(MenuItem item){        switch (item.getItemId()){        case ONE_ID:            Intent help = new Intent(this, Help.class);            startActivity(help);            return(true);        case TWO_ID:            Intent table = new Intent(this, table.class);            startActivity(table);            return(true);        case THREE_ID:            Intent list = new Intent(this, List.class);            startActivity(list);            return(true);        case FOUR_ID:            Intent Classic = new Intent(this, Classic.class);            startActivity(Classic);            return(true);        }   return false;    }}</code></pre>","288437","","1100940","","2013-06-25 17:02:19","2013-06-25 17:02:19","Click TextView and Changing the Text","<android><textview>","1","0","","",""
"3485683","1","3491806","","2010-08-15 00:18:12","0","5060","<p>I'm trying to get an alert box to show up 5 seconds after my application starts on Android. But it's not working and I don't know why. Here is the code:</p><pre><code>package com.example.helloandroid;import java.util.Timer;import java.util.TimerTask;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.os.Bundle;public class HelloAndroid extends Activity {public void showalert() {    /* alert box--------------------------- */    AlertDialog dialog=new AlertDialog.Builder(HelloAndroid.this).create();    dialog.setTitle(""Test"");    dialog.setMessage(""Test"");    dialog.setButton(""Test 1"",    new DialogInterface.OnClickListener()    {    public void onClick(DialogInterface dialog, int whichButton)    {    /* Do some stuff */    }    });    dialog.setButton2(""Test 2"",    new DialogInterface.OnClickListener()    {    public void onClick(DialogInterface dialog, int whichButton)    {    /* Do some stuff */    }    });    dialog.setButton3(""Test 3"",    new DialogInterface.OnClickListener()    {    public void onClick(DialogInterface dialog, int whichButton)    {    /* Do some stuff */    }    });    dialog.show();    /* -------------------------------------- */}/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    new Timer().schedule(new TimerTask()    {         public void run()         {             showalert();        }     }, 5000);    setContentView(R.layout.main);}}</code></pre><p>Can anyone see what I am doing wrong? Why doesnt the alert show up...? Thanks for your help!</p><p>Best whishes,Michael</p><p><strong>EDIT (This is the working code after some modifying):</strong></p><pre><code>package com.example.helloandroid;import java.util.Timer;import java.util.TimerTask;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.os.Bundle;import android.os.Handler;public class HelloAndroid extends Activity {    public void showalert() {        /* alert box--------------------------- */        AlertDialog dialog=new AlertDialog.Builder(HelloAndroid.this).create();        dialog.setTitle(""Test"");        dialog.setMessage(""Test"");        dialog.setButton(""Test 1"",        new DialogInterface.OnClickListener()        {        public void onClick(DialogInterface dialog, int whichButton)        {        /* Do some stuff */        }        });        dialog.setButton2(""Test 2"",        new DialogInterface.OnClickListener()        {        public void onClick(DialogInterface dialog, int whichButton)        {        /* Do some stuff */        }        });        dialog.setButton3(""Test 3"",        new DialogInterface.OnClickListener()        {        public void onClick(DialogInterface dialog, int whichButton)        {        /* Do some stuff */        }        });        dialog.show();        /* -------------------------------------- */    }    public final void timerAlert(){         Handler handler = new Handler();        handler.postDelayed(new Runnable() {            public void run() {                showalert();            }        }, 5000);    }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        timerAlert();    }}</code></pre>","420712","","420712","","2010-08-20 17:37:16","2012-10-30 09:44:22","Timer in Android not working","<android><timer>","3","0","1","",""
"3485730","1","","","2010-08-15 00:38:54","3","1158","<p>Firstly, no OAuth or other things supported in the server-side, just a normal username-password database querying.</p><p>I want to implement an android client for the web site. My questions are:</p><ol><li>How to login safely? with HTTPS?</li><li>How to store user login information safely in the phone to make user login without any input in the next time.</li><li>If user do some actions after login, how to id himself? how to keep the session?By copy and resend some cookies like ""jsessionid"" ?</li></ol>","238061","","","","","2012-08-19 03:25:03","How to implement login functionality in an Android app safely?","<android><session><login><https><authentication>","1","1","","",""
"3485802","1","3485819","","2010-08-15 01:09:43","1","345","<p>How would I ask the current activity for a list of any ProgressDialog's visible so that I can call their Hide() method?</p>","172861","","","","","2010-08-15 01:21:22","Android Kill all Open ProgressDialogs?","<android><progressdialog>","1","1","","",""
"3486055","1","3486245","","2010-08-15 03:15:30","18","27847","<p>I am writing an app that requires the user's current location (lastknownlocation won't be very helpful) and displays a list of all the closest ""items"" to them taken from the database.</p><p>I have got the finding of the closest items working well but only using a hardcoded latitude and longitude location for the time being but now it is time to implement finding the actual location.</p><p>Can anyone provide an example of how to have the app find the current fine location in the background and have the app wait. I only need the location once not updates as the person moves. I have implemented a location listener however I understand getting a GPS fix can be slow. I have seen other examples using last known location or implementing the location listener which continues to run and update however as my Activity needs the location coordinates before it can display anything the app just crashes. I need to show a Progress Dialog while its searching.</p><p>How can I have the locationlistener run once in the background and then remove location updates once it finds the location. I need the rest of the application to wait until it has a GPS location or timeout after say 20-30seconds. I would like a ProgressDialog up so the user knows that something is going on, but it just has to be the spinning loading animation not a percentage or anything. If possible I would like the user to be able to cancel the dialog if they are sick of waiting which then they can search by typing suburb etc instead.</p><p>I have been trying to do it with threads but it is getting way more complicated than I feel it should be and still not working anyway. On iPhone this is much more simple?</p><p>Can anyone provide a nice way of doing this, I have been ripping my hair out for a week on this and it is really putting me behind schedule for the rest of the app completion date.</p><p>In summary I want to:<br>* Find current coordinates<br>* Show Progress Dialog while getting location<br>* Have app be able to wait for successful location or give up after a certain time?<br>* If Successful: Dismiss Progress Dialog and use coordinates to run my other methods for finding items closeby.<br>* If Failed to get location: Dismiss Progress Dialog and show error message, and encourage user to use menu to go to Search Activity.<br>* Use these coordinates if the user chooses map view from the menu, to show current location on the map and pins dropped at all the nearby items by using their coordinates from the database.</p><p>Thanks guys, I hope I have explained myself well enough. Any questions just ask, I will be checking back regularly as I am keen to get this part completed.Cheers</p><p><strong>EDIT</strong><br>Code as requested</p><p><strong>locationList activity file</strong>  </p><pre><code>protected void onStart(){    super.onStart();    // ....    new LocationControl().execute(this);}private class LocationControl extends AsyncTask&lt;Context, Void, Void&gt;{    private final ProgressDialog dialog = new ProgressDialog(branchAtmList.this);    protected void onPreExecute()    {        this.dialog.setMessage(""Determining your location..."");        this.dialog.show();    }    protected Void doInBackground(Context... params)    {        LocationHelper location = new LocationHelper();        location.getLocation(params[0], locationResult);        return null;    }    protected void onPostExecute(final Void unused)    {        if(this.dialog.isShowing())        {            this.dialog.dismiss();        }        useLocation(); //does the stuff that requires current location    }}public LocationResult locationResult = new LocationResult(){    @Override    public void gotLocation(final Location location)    {        currentLocation = location;    }};  </code></pre><p><strong>LocationHelper class</strong>  </p><pre><code>    package org.xxx.xxx.utils;import java.util.Timer;/*imports*/public class LocationHelper{    LocationManager locationManager;    private LocationResult locationResult;    boolean gpsEnabled = false;    boolean networkEnabled = false;    public boolean getLocation(Context context, LocationResult result)    {               locationResult = result;        if(locationManager == null)        {            locationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);        }            //exceptions thrown if provider not enabled            try            {                gpsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);            }            catch (Exception ex) {}            try            {                networkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);            }            catch (Exception ex) {}            //dont start listeners if no provider is enabled            if(!gpsEnabled &amp;&amp; !networkEnabled)            {                return false;            }            if(gpsEnabled)            {                locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListenerGps);            }            if(networkEnabled)            {                locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListenerNetwork);            }            GetLastLocation();            return true;    }    LocationListener locationListenerGps = new LocationListener() {        public void onLocationChanged(Location location)        {            locationResult.gotLocation(location);            locationManager.removeUpdates(this);            locationManager.removeUpdates(locationListenerNetwork);        }        public void onProviderDisabled(String provider) {}        public void onProviderEnabled(String provider) {}        public void onStatusChanged(String provider, int status, Bundle extra) {}    };    LocationListener locationListenerNetwork = new LocationListener() {        public void onLocationChanged(Location location)        {            locationResult.gotLocation(location);            locationManager.removeUpdates(this);            locationManager.removeUpdates(locationListenerGps);        }        public void onProviderDisabled(String provider) {}        public void onProviderEnabled(String provider) {}        public void onStatusChanged(String provider, int status, Bundle extra) {}    };    private void GetLastLocation()    {            locationManager.removeUpdates(locationListenerGps);            locationManager.removeUpdates(locationListenerNetwork);            Location gpsLocation = null;            Location networkLocation = null;            if(gpsEnabled)            {                gpsLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);            }            if(networkEnabled)            {                networkLocation = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);            }            //if there are both values use the latest one            if(gpsLocation != null &amp;&amp; networkLocation != null)            {                if(gpsLocation.getTime() &gt; networkLocation.getTime())                {                    locationResult.gotLocation(gpsLocation);                }                else                {                    locationResult.gotLocation(networkLocation);                }                return;            }            if(gpsLocation != null)            {                locationResult.gotLocation(gpsLocation);                return;            }            if(networkLocation != null)            {                locationResult.gotLocation(networkLocation);                return;            }            locationResult.gotLocation(null);    }    public static abstract class LocationResult    {        public abstract void gotLocation(Location location);    }}</code></pre><p>This really seems like a big effort just to get the current location once? I do not require updates or anything? Is there not a simpler way of having the application wait for a result? I have been stuck on this for so long.</p>","387317","","387317","","2011-09-07 15:03:59","2011-09-15 05:24:33","Android find GPS location once, show loading dialog","<android><gps><progressdialog><locationlistener>","3","0","17","",""
"3486162","1","","","2010-08-15 04:12:12","3","13155","<p>this is my first post..</p><p>so I'm learning Android &amp; Java (coming from Actionscript), and I'm working on a project where :  </p><p>I'm trying to click an ImageView, have that ImageView swap images for a second, then return to the original image.  ( this is for a tapping game )</p><p>sounds easy enough, right?    I've spent the whole day trying to get a standard Java Timer / TimerTask to work.. no luck..  </p><p>is there a better way? I mean, is there an Android specific way to do something like this?  If not, then what is the ideal way?</p><p>thanks for all your help in advance guys!-g</p>","420775","","","","","2011-09-02 07:29:44","Android: how to use a timer","<java><android><timer>","2","1","3","",""
"3486243","1","","","2010-08-15 04:52:34","1","3457","<p>I have been reading much from various sources on ways to update a widget that is using ImageView Canvas and Draw method to display a clock with a seconds hand.</p><p>It must be updated every second. What is the most efficient way to do this? Use a <code>Service</code>, the Alarm Manager, Handlers?</p><p>It can be done, e.g., the Android app <a href=""http://www.androidzoom.com/android_applications/tools/arc-clock-widget_jimn.html"" rel=""nofollow"">""Arc Clock Widget""</a>.</p><p>Anyone with any ideas?</p><p>Thanks,Tom</p>","420790","","6391","","2010-08-15 06:36:29","2012-08-09 21:53:42","How to update an Android widget every second ... to draw a clock with a seconds hand?","<android><appwidget>","1","3","","",""
"3486255","1","","","2010-08-15 04:58:10","0","317","<p>I want to program a function that the toast exist when there is nothing in the ""edittext"" box (id / password), but it dosen't work. </p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.content.Intent;import android.widget.EditText; import android.widget.Toast; import android.view.View.OnClickListener; import android.text.Editable; public class Test extends Activity{  /** Called when the activity is first created. */  @Override  public void onCreate(Bundle savedInstanceState)  {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button button1 = (Button) findViewById(R.id.button1);    EditText id = (EditText) findViewById(R.id.id);    EditText pwd = (EditText) findViewById(R.id.pwd);    Editable Str_id;    Editable Str_pwd;    Str_id = id.getText();    Str_pwd = pwd.getText();    button1.setOnClickListener(new Button.OnClickListener()    {      public void onClick(View v){        if(Str_id==null || Str_pwd == null){        Toast.makeText(Test.this, ""Please Enter User ID / Password"", Toast.LENGTH_LONG).show();     }    });    }  }</code></pre>","420789","","","","","2012-01-15 19:01:48","How the detect the ""edittext"" box whether it is nothing in Android?","<android>","2","0","","",""
"3486285","1","","","2010-08-15 05:09:22","0","615","<p>I have a simple appWidget that displays an image.  The image is selected in the configuration activity and the widget is updated via the remove view.  This is done on a button push executing the code below:</p><pre><code>Intent intent = new Intent(context, KidDialog.class);intent.setData(selectedImage);PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);widgetView.setOnClickPendingIntent(R.id.centerBrd, pendingIntent);widgetView.setImageViewUri(R.id.widImg, selectedImage);appWidgetManager.updateAppWidget(appWidgetId, widgetView);Intent resultValue = new Intent();resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);setResult(RESULT_OK, resultValue);finish();`</code></pre><p>As you can see, it is also seeing an PendingIntent for the onClickListener of the image.  I don't think that is relevant here.  Anyway, this work great.  The widget does exactly what I want it to.  Until I restart the device.  </p><p>When I restart the widget loads with the default view from the xml in the apk.  It does not keep the image update from the initial configuration. My questions is how do I get the widget to load back up after a restart with the updated view set during the configuration activity?  I will also need to reset the onClick Pendingintent, but I will save that for later.  I expect they are related anyway.  So I am out of ideas.</p>","420796","","","","","2010-08-16 10:02:54","appWidget layout reseting after device restart","<android><reboot><appwidget>","1","0","1","",""
"3486296","1","","","2010-08-15 05:15:17","1","5654","<p>My website is really very simple HTML based site. My site is located here: <a href=""http://www.threesite.com"" rel=""nofollow"">http://www.threesite.com</a></p><p>How can I convert this simple HTML site compatible with iPhone or Droid? Do I need to convert the same into PHP based site and then convert? Your help will be much appreciated.</p>","420799","","","","","2012-05-25 09:58:19","I want to convert my HTML site into iPhone or Droid compatible site. How can I do that?","<iphone><design><android>","1","0","","",""
"3486569","1","3486712","","2010-08-15 07:29:39","1","2935","<p>I'm trying to build a conversation list for SMS messages.  Therefore I'm reading ""content://sms/conversations"" and read the first few messages of each conversation to find the communication partners' phone numbers.  With these numbers I try to retrieve the contact_id from ContactsContract.CommonDataKinds.Phone to fetch the rest of the person's information from the contacts database. </p><pre><code>String[] returnVals = new String[] {ContactsContract.CommonDataKinds.Phone.CONTACT_ID};Cursor pCur = thisContent.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,             returnVals,             ContactsContract.CommonDataKinds.Phone.DATA1 + "" = \"""" + phoneNumber + ""\"""",             null,             null);</code></pre><p>When I rotate through this query's results I see that some contacts weren't found, although they are stored in the contact database.  For example, one number that is associated with one of my contact list and is located in the States that seems to be stored with dashes.  I understand that this might be a problem, but other numbers I extracted from the threads are stored the way they appear in the text messages and still don't get found.</p><p>So my questions are: </p><ol><li>Is this the right approach? Am I missing something? Is there an easier way to achieve this?</li><li>What I will get back from ContactsContract.CommonDataKinds.Phone is a reference to the _ID of the persons contact. I suppose I can't handle that like a proper long type _ID, but how do I need to do that?</li><li>Is there a tutorial regarding SMS handling in Android besides the SDK's documentation in terms of surrounding tasks like this one? </li></ol>","419501","","","Roger Pate","2010-08-15 14:07:07","2010-08-15 14:07:07","How to query ContactsContract.CommonDataKinds.Phone on Android?","<android><sms><phone-number>","1","0","","",""
"3486819","1","","","2010-08-15 09:18:32","8","7326","<p>friends:I want to implement my own Tokenizer base on the file""MultiAutoCompleteTextView.java"",</p><p>but I encounter an error ""<code>com.android.internal.R cannot be resolved</code>"" when I try to </p><p>import ""<code>MultiAutoCompleteTextView.java</code>"" to my project.</p><p>code:</p><pre><code>public class MultiAutoCompleteTextView extends AutoCompleteTextView {    private Tokenizer mTokenizer;    public MultiAutoCompleteTextView(Context context) {        this(context, null);    }    public MultiAutoCompleteTextView(Context context, AttributeSet attrs) {        this(context, attrs, com.android.internal.R.attr.autoCompleteTextViewStyle);    }    public MultiAutoCompleteTextView(Context context, AttributeSet attrs, int defStyle)     {        super(context, attrs, defStyle);    }    .    .    .}</code></pre><p>I haven't research any solutions to resolve this problem.How to correct ""com.android.internal.R.attr.autoCompleteTextViewStyle"" my own attr?</p><p>Thank you for any suggestions.</p>","395158","","395158","","2010-08-15 12:05:29","2013-04-29 09:40:39","How to resolve the error ""com.android.internal.R cannot be resolved"" when I using the android file 'MultiAutoCompleteTextView.java',","<android>","3","2","1","",""
"3486864","1","","","2010-08-15 09:38:46","0","261","<p>The integers pass successfully but string is failed. What's the problem?</p><p>Result:<a href=""http://img580.imageshack.us/img580/2079/app2v.jpg"" rel=""nofollow"">http://img580.imageshack.us/img580/2079/app2v.jpg</a></p>","420789","","","","","2011-02-15 07:25:47","How to bundle a string correctly to other Activity in Android?","<android>","1","2","","",""
"3487131","1","","","2010-08-15 11:17:31","5","4770","<p>I am developing on Windows machine.</p><p>I was working quite well until yesterday, when I saw the the update prompt and updated my ADT plugin.</p><p>Today when I tried debugging my test project, I experienced either one the following cases:</p><p>1) Logcat stops forever on the message ""sending wait chunk"". </p><p>The console reads:</p><pre><code>[2010-08-15 19:05:58 - TestProject] Project dependency found, installing: Project  [2010-08-15 19:05:58 - Project] Uploading Project.apk onto device 'emulator-5554'  [2010-08-15 19:05:58 - Project] Installing Project.apk...  [2010-08-15 19:06:08 - Project] Success!  [2010-08-15 19:06:08 - ProjectTest] Launching instrumentation  android.test.InstrumentationTestRunner on device emulator-5554[2010-08-15 19:06:08 - ProjectTest] Collecting test information  [2010-08-15 19:06:14 - ProjectTest] Sending test information to Eclipse  [2010-08-15 19:06:14 - ProjectTest] Running tests...  </code></pre><p>And Logcat reads:</p><pre><code>D/ActivityManager(   84): Uninstalling process com.mat.project  I/ActivityManager(   84): Start proc com.mat.project for added application com.mat.project: pid=341 uid=10029 gids={3003, 1015}  I/System.out(  341): Sending WAIT chunk</code></pre><p>I have to terminate the AVM manually. This is the most frequent case.</p><p>2) Logcat shows the following message, and test project fails:</p><pre><code>[2010-08-15 18:42:40 - (My project)] Test launch failed: Could not connect to:  : 51154[2010-08-15 18:42:40 - (My project)] Connect to Eclipse test result listener failed</code></pre><p>3) Eclipse stops responding.</p><p>The above cases happens even when the test unit contains nothing.</p><p>Also it just doesn't not work in debug. The test case runs successfully if it is not in debug mode (But there are still some glitches, like Logcat sometimes won't emit debug messages). </p><p>I have tried the followings, but still no luck:</p><ol><li>Reinstall the Android SDK</li><li>Download the latest version of Eclipse and download the ADT plugin again</li><li>Running Eclipse with -clean switch</li><li>Clean the test and test target projects and build again</li><li>Switched to a new workspace and configure my projects again</li><li>Clear user data while start debugging in the AVM</li><li>Configure a new AVM</li></ol><p>It would be grateful if anyone can shed a light on me.</p><p>Thanks in advance!</p>","420905","","","","","2012-11-06 11:46:05","Debugging Android project in Eclipse suddenly doesn't work anymore","<android><eclipse>","4","0","2","",""
"3487161","1","","","2010-08-15 11:28:22","0","871","<p>Background; I am in the process of writing an Android messaging application that needs to know the current user's phone number. This is then used to connect to other users using the application.</p><p>My application relies on looking up the user's number from Android's Settings -> About Phone -> Phone identity -> Phone number (this can at times be blank.. but that is a separate problem).</p><p>I am assuming that the above Phone number contains the user's full number. ie, my UK Android phone shows my number as: +447832xxxxxxxx, where 44 is the UK's international dialling code and 7832 is the operator.</p><p>Is it safe to assume that all Androids phones would include the international dialling code, which starts with +?</p><p>I would be indebted if any Android users could have a quick look at their Android settings and confirm whether Phone number is displayed as +international code+operator+number, i.e. US Android sets start with +1xxxxxx.</p>","402110","","","","","2010-08-16 14:47:32","Poll: Phone number in Android About -> Phone Identity and International Dialling Codes","<android>","3","2","","","2010-08-15 11:53:21"
"3487216","1","3487227","","2010-08-15 11:44:10","4","5966","<p>Hopefully this is a simple one as I've been asking loads recently...</p><p>I am trying to draw the a white circle with the following code:</p><pre><code>mPaint.setColor(0xFFFFFFFF);canvas.drawCircle(x, y, radius, mPaint);</code></pre><p>but it is being displayed as a solid disk, how do I get it to just display as an circular outline with a transparent centre?</p><p>I've had a look in the help and it makes no sense to me, probably because I'm not used to the drawing terms like stroke and dither. What's wrong with background and border eh?</p><p>-Frink</p>","131209","","","","","2010-08-15 11:51:28","How to draw a circle with transparent middle","<android>","2","0","","",""
"3487247","1","6108156","","2010-08-15 11:54:15","14","6808","<p>I'm trying to create custom attributes to my button but I dont know which format I must use to images in attributes declaration...</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;declare-styleable name=""TCButton""&gt;        &lt;attr name=""Text"" format=""string""/&gt;        &lt;attr name=""BackgroundImage"" format=""android:drawable""  /&gt;    &lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre><p>Error is in the format=""android:drawable""...</p>","419921","","419921","","2012-02-28 18:13:11","2012-08-02 23:57:44","Format attribute value ""android:drawable"" not valid","<android>","1","0","4","",""
"3487282","1","","","2010-08-15 12:09:18","0","570","<p>I have a question i have created sdcard image file using mksdcard 100M sdcard.img and tried alot of tutorials on net to start the emulator with the sdcard . However none is working, I have tried to start the project and add in run configration additional emulator command line options but the sdcard not appearing in the DDMS !! I have tired the command line in cmd emulator -avd  -sdcard  and the emulator starts without the sdcard . So anyone knows what am I doing wrong ? </p>","416082","","","","","2011-06-23 05:57:23","SDcard with android emulator","<android>","2","2","","",""
"3487300","1","","","2010-08-15 12:15:19","0","1215","<p>I am adding <strong>ksoap2-j2se-full-2.1.2.jar</strong> as external jar into Android project &amp; accessing the <strong>SOAP API</strong> to access <strong>.NET webservices from Android application</strong>.<strong>The size of the ksoap2-j2se-full-2.1.2.jar is 96 KB</strong> &amp; so I dont want to increase the size of the Android application by using the external jar.</p><p>Kindly provide an <strong>alternate option by which we can access the .NET webservice from Android application so that the size of the Android application get reduced</strong>.</p><p>Warm Regards,</p><p>Chiranjib </p>","420943","","","","","2010-10-19 03:55:23","Alternative to using KSOAP for accessing WebService from Android application due to KSOAP jar size","<android>","1","2","","",""
"3487389","1","3487413","","2010-08-15 12:42:32","24","33084","<p>How can I convert a String to a Uri in Java (Android)? i.e.:</p><pre><code>String myUrl = ""http://stackoverflow.com"";</code></pre><p><strong>myUri = ???;</strong></p>","2699","","480659","","2013-07-30 12:41:07","2013-07-30 12:41:07","Convert String to Uri","<java><android><string><uri>","2","0","8","",""
"3487398","1","6130089","","2010-08-15 12:45:47","19","4632","<p>I can't find the source code for the Android Development Tools Plugin for Eclipse.  It seems to have been moved a few times, and when I google the question, the answers point to the wrong places.  Also <a href=""http://source.android.com/discuss"">http://source.android.com/discuss</a> seems to be down.</p>","353826","","","","","2012-12-07 05:49:09","Where can I find the source code for the Android Development Tools (ADT) plugin for the Eclipse IDE?","<android><eclipse><plugins><source-code><adt>","3","0","3","",""
"3487611","1","","","2010-08-15 13:45:09","0","570","<p>I want to show the softkeyboard, but it does not work.Here is my code:    public void onCreate(Bundle savedInstanceState) {</p><pre><code>    super.onCreate(savedInstanceState);    myTextView myTextView = new myTextView(this);    setContentView(myTextView);}</code></pre><p>public class myTextView extends EditText{</p><p>public boolean onTouchEvent(){</p><p>if(action == ACTION_DOWN){</p><p>super.onTouchEvent(event);</p><p>} }</p><p>When i touch the screen, the softkeyboard does not appear, but the alertDialog ""edit text"" appears, which appears on normal edittexts when you long touch them. This additional code in the onCreate has no affection:InputMethodManager input = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);input.showSoftInput(myTextView, 0);</p><p>Thanks for help,Fr4gg0r</p>","392249","","392249","","2010-08-15 14:03:20","2010-08-29 19:13:02","Android: Trigger the softkeaboard in custom edittext","<android><triggers><android-softkeyboard>","2","0","","",""
"3487697","1","","","2010-08-15 14:09:07","7","1059","<p>With Oracle suing Google over Dalvik's patent infringements, I'm wanting to get off the Java bus I've been on for 10+ years.  I really enjoy coding in Java, love the tools (eclipse, profilers, etc...), cross platform, garbage collection, etc...  What is the best alternative out there?  I'd like to build cool gui's, mobile apps, web apps, back-end integration, pretty much everything and anything.  I don't really want to invest in learning 5 different languages for 5 different scenarios if possible.  I'd love to be contributing to FOSS.  Even if many things aren't there yet, I want to get on the train with a technology that is headed in the right direction.  I supported Java out of the box with 1.0 implementations because it got me off of MS choke-hold.  Now I want to get off the Java train for the same reason - Oracle!  I looked briefly at Parrot VM.  I've never felt too comfortable with Dynamic languages, but if they are really the way to go, I'll battle that early learning curve.  Tried Ruby on Rails for a while, and it was okay, though I missed my Eclipse debugger, code completion, etc., so didn't last long.  Trying out Groovy...but I want to distance myself from any litigation and really want to support freedom.  I'd prefer not to program in C or C++, don't want to do memory management.  So, in conclusion, what is a good next step for an old Java hand?  What languages have seasoned Java professionals moved onto?  Do I need to worry about things like Scala that are designed to run on the JVM?  What does this lawsuit about Dalvik mean?</p>","420994","","","","","2010-08-15 14:20:18","what is the most viable free alternative to java language?","<java><android><oracle><dalvik>","4","10","1","2010-08-15 14:19:50",""
"3487735","1","3488083","","2010-08-15 14:17:13","2","1428","<p>I am looking for the right UI widget to use for this requirement:</p><p>When the user clicks a button, a modal list appears, the user clicks and item and then the focus is returned to the active Activity.</p>","172861","","","","","2010-08-16 15:50:02","Android Popup picker?","<android><user-interface>","3","0","","",""
"3487746","1","3489664","","2010-08-15 14:19:37","3","302","<p>When I write web apps I rely on frameworks like jQuery, likewise in WinForm I use DevExpress's UI.</p><p>Is there a UI framework with fancy looking buttons, graphics, transitions etc etc that I can rely on to build great looking apps ?</p>","172861","","","","","2010-08-15 23:10:02","Android Suite of UI controls?","<android><user-interface><frameworks>","1","0","0","",""
"3487875","1","3488087","","2010-08-15 14:55:10","3","2077","<p>I have a new earthquake notification android app thats in it's initial release version. I have  a problem currently. My app has a service running in background, this schedules itself to run every X period. To schedule itself it needs to run atleast once. Currently that happens when you boot the phone. Obviously I do not want user to reboot his phone, once he installs the app.</p><p>Also what I do not want is to have my app UI invoke it everytime it runs. Because that would clearly screw up the user scheduling. I need to instead know that either when my UI app runs for first time on a phone, it should be able to run the service so that it can schedule itself and keep running as expected in future. </p><p>Alternative way that I could solve it is, that if I know a list of existing alarms to wake a service, as then I would know if an app is already running or not.</p><p>If you'd like to see the app source code or run a binary file; Please look at the following github <a href=""http://github.com/priyaaank/SeismicDroid/downloads"" rel=""nofollow"">url</a> </p><p>I hope I am clear in my intent. Just to give some background on app; It's a notification app for android phone which generates notification when an earthquake happens and also shows the affected area on map with additional functionality.It has a UI app, that shows the list of earthquakes in past. And a service that monitors for new ones.</p><p>Thanks in advance.</p>","57847","","","","","2010-08-15 15:52:15","Running Code On First Run of Android App","<android><service><scheduling><alarmmanager>","2","0","1","",""
"3488035","1","3516566","","2010-08-15 15:35:27","0","463","<p>I'm trying to make a customized build (as described in the porting guide - <a href=""http://source.android.com/porting/build_new_device.html"" rel=""nofollow"">http://source.android.com/porting/build_new_device.html</a>) and always end up with the error messagemake: <em>*</em> No rule to make target <code>vendor/company/emh-board/kernel', needed by</code>out/target/product/emh-board/kernel'. Stop.</p><p>Does anyone know why this is happening. I start build using the ""make PRODUCT-emh-user""My AndroidBoard.mk looks like</p><pre><code># make file for new hardware  from #LOCAL_PATH := $(call my-dir)## this is here to use the pre-built kernelifeq ($(TARGET_PREBUILT_KERNEL),)TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/kernelendif#file := $(INSTALLED_KERNEL_TARGET)ALL_PREBUILT += $(file)$(file) : $(TARGET_PREBUILT_KERNEL) | $(ACP)        $(transform-prebuilt-to-target)## no boot loader, so we don't need any of that stuff..  #LOCAL_PATH := vendor/company/emh-board#include $(CLEAR_VARS)## include more board specific stuff here? Such as Audio parameters.     #</code></pre>","181150","","","","","2010-08-18 20:50:30","Problem with customized android build","<android><porting>","1","0","1","",""
"3488047","1","","","2010-08-15 15:39:03","0","2026","<p>new to the community.  been up all night trying to flesh out the underlying html reading system that's at the core of my app's functionally.  I could really use a fresh pair of eyes on this one.</p><p>Problem: While trying to return a string to be displayed on my app's home activity, I've run into an issue where I'm almost certain that the data was taken in correctly, cleaned up into XML via ""Html Cleaner"" (http://htmlcleaner.sourceforge.net/), and pulled through Jaxen (opensource Xpath) the result should display some text.  Problem is of course, dispite my efforts I've yet to figure out exactly why it wont.  My code follows below.</p><p>As a test I'm trying to pull the word ""maps"" from the <a href=""http://www.google.com"" rel=""nofollow"">http://www.google.com</a> home page which is inside an  tag with the hyperlink ""http://maps.google.com/maps?hl=en&amp;tab=wl"" (which i'm using to uniquely identify the tag):</p><pre><code>public class home extends Activity {  TextView text1;  //** Called when the activity is first created. */  @Override  public void onCreate(Bundle savedInstanceState)  {   super.onCreate(savedInstanceState);   setContentView(R.layout.main);   text1 = (TextView)findViewById(R.id.text1);   text1.setText(LoadHTMLFromURL(""http://www.google.com""));  }  private String LoadHTMLFromURL(String url)  {   try   {    // Load data from URL          InputStream is = (InputStream) new URL(url).getContent(); //generate     BufferedReader reader = new BufferedReader(new InputStreamReader(is));     StringBuilder stringBuilder = new StringBuilder();     String line = null;     while ((line = reader.readLine()) != null)      {      stringBuilder.append(line + """");     }     is.close();     String HTMLout = stringBuilder.toString();     // Clean up HTML input.     //Initialize HTML Cleaner.     HtmlCleaner cleaner = new HtmlCleaner();     // This next line Cleans the html and exports it to a Tagnode named ""node""     TagNode node = cleaner.clean(HTMLout);     // This is the xpath parsing info     String SearchTerm = ""//a[@href='http://maps.google.com/maps?hl=en&amp;amp;tab=wl']"";     Object[] info_nodes = node.evaluateXPath(SearchTerm);     TagNode info_node = (TagNode) info_nodes[0];              String info = info_node.getChildren().iterator().next().toString().trim();              return info;   }   catch (Exception e)    {    System.out.println( ""Inside: home.LoadHTMLFromURL()"" + ""Exc=""+e);    return null;   }  } }</code></pre><p>I apologize for the clutter, and lack of neatness in the code, still a mid to low range programer in a ""learn as you go"" stage of my ability.  Any advice is appreciated.</p><p>side note: I ran a string containing some hand made simple XML to test if it would read the info, and it worked perfectly but not on xml generated from html webpages. </p>","421041","","1583","","2010-08-15 15:46:15","2011-04-12 11:57:38","Xpath and HTML Cleaner problem, no data returned","<android><xml><url><xpath><html-parsing>","1","4","","",""
"3488170","1","3488209","","2010-08-15 16:12:59","2","142","<p>I'm getting an ""Invalid Character Constant"" under the "" 'D "" just after UPDATE. Any Ideas?ORIGINAL :</p><pre>public Cursor fetchAllJournals(String sort) {            mDb.rawQuery(UPDATE 'DATABASE_JOURNAL_TABLE'SET 'KEY_JOURNAL_NOTES' =(SELECT COUNT(*) FROM 'DATABASE_HOMES_TABLE'WHERE 'DATABASE_JOURNAL_TABLE'.'KEY_JROWID' = 'DATABASE_HOMES_TABLE'.'KEY_HOME_JOURNALID'))return mDb.query(DATABASE_JOURNAL_TABLE, new String[] {KEY_JROWID, KEY_JOURNAL_TITLE, KEY_JOURNAL_NOTES, KEY_JDATE},null , null, null, null, sort ,null);        }</pre><p>ANSWER:</p><pre> public Cursor fetchAllJournals(String sort) {            mDb.execSQL(""UPDATE ""+DATABASE_JOURNAL_TABLE+"" SET ""+KEY_JOURNAL_NOTES+"" "" +                    "" = (SELECT COUNT(*) FROM ""+DATABASE_HOMES_TABLE+"" WHERE ""                    +DATABASE_JOURNAL_TABLE+"".""+KEY_JROWID+"" = ""+DATABASE_HOMES_TABLE +""."" + KEY_HOME_JOURNALID+"")"");            return mDb.query(DATABASE_JOURNAL_TABLE, new String[] {KEY_JROWID,                     KEY_JOURNAL_TITLE, KEY_JOURNAL_NOTES, KEY_JDATE},null , null, null, null, sort ,null);        }</pre>","393328","","393328","","2010-08-15 18:55:15","2010-08-15 18:55:15","How do I update the field of a table with the count of another table? SQLite, Java, Android","<java><android><sqlite>","1","0","","",""
"3488221","1","","","2010-08-15 16:30:42","6","569","<p>I have just started with Android development and bought a handset(HTC Hero) for test and usage purposes. The sad part is that it doesn't display one of the scripts (Devanagari to be precise). Hence, I would like to contribute to the Android project to help render it. However, since I have just started I have no ideas of where to look for and begin with !</p><p>To be very precise, I would like to contribute for proper rendering of Nepali Language (Devanagari Script) for the Android OS. Directions please ?</p><p>For ex. I would like to be able to see the following in an Android device rendered properly.</p><p>?? ???? ?????? ????? ?? ?</p>","126216","","126216","","2010-08-15 20:17:15","2010-09-05 19:06:56","How do I contribute to the Android project on supporting/rendering non-English language?","<android><unicode><render><contribute>","1","0","1","",""
"3488247","1","3492561","","2010-08-15 16:37:16","0","558","<p>I have a scrollable and zoomable map which has a low res copy of the map which is drawn when the zoom scale is small and a tile system when the user zooms in past a certain point. The problem im having is that the very first time the tiles are drawn there is a short, but noticable lag. After that initial lag everything is smooth. The GC isnt running, and all the bitmaps are loaded at launch time. Any idea what exactly is going on so i can take care of the lag? Or any way for a work around? Thanks. Heres the code below:</p><pre><code>            canvas.drawBitmap(map, null, bgRect,paint);            if(matrix[0]&gt;.9){                 mapPicture = makeMyMap(xScale,yScale); //make/update our map.                 mapPicture.draw(canvas);              }</code></pre>","385051","","","","","2010-08-16 11:08:27","What happens in the system when canvas.drawBitmap is called?","<android><canvas><bitmap><drawrect><surfaceview>","1","0","","",""
"3488266","1","","","2010-08-15 16:43:52","0","586","<p>I am trying to make an Accordian control where each section would have its own view accompanied with its own activity.  With the TabHost I can add tabs based on Intents and it is this behavior I am trying to understand how to use.  So given an intent or an activity how can i get the view?</p>","67959","","244296","","2010-08-15 18:13:41","2010-08-16 14:00:45","How to get a view from an Activity similar to a TabHost","<android>","1","0","2","",""
"3488661","1","3488726","","2010-08-15 18:25:31","3","10585","<p>I'm trying to open database as follows :</p><pre><code>SQLiteDatabase myDatabase;myDatabase = openOrCreateDatabase(""sudoku.db"", Context.MODE_PRIVATE, null);</code></pre><p>This code works fine when I implement it in the Service class, but when I try to implement this in the onPostExecute eventhandler of the GeneraterThread class,implementing AsyncTask, I get the following error :</p><p><code>The method openOrCreateDatabase(String, int, null) is undefined for the type GeneraterThread</code></p>","395028","","932324","","2014-04-02 21:31:02","2014-04-02 21:31:02","The method openOrCreateDatabase(String, int, null) is undefined","<android>","3","0","","",""
"3488664","1","7250902","","2010-08-15 18:26:06","84","23384","<p>This question has been asked before - but with no satisfying answer at all! So I'm trying it again.</p><p>I want to give my application launcher icon (the one that is displayed on the startscreen!) a different, shorter caption. It seems the launcher takes its label from the mainfest section about the main activity's label, as here:</p><pre><code>&lt;activity android:name=""MainActivity"" android:label=""@string/app_short_name""&gt;&lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.MAIN"" /&gt;    &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;&lt;/intent-filter&gt;</code></pre><p></p><p>I already changed the original reference to my app's name @string/app_name to a different, shorter string resource here.</p><p>BUT - big <strong>BUT</strong>: this also of course changes this activity's default title! And I did not want that to happen, there's enough space for a long application name! Setting the long title again in <code>onCreate</code> using the <code>setTitle(int)</code> method does no good either, because the short name will be visible to the user for a short time, but long enough to notice!</p><p>And - please don't answer my question by refering to a custom titlebar... I do not want to go that long way, just because of a stupid string title! It's a pain to draw a custom title bar for so little effect!</p><p>Is there <strong>no easy way</strong> to just give the launcher a different string to display?Thanks for your answers!</p><p><strong>Edit:</strong> One more reason why having a custom titlebar is a pain is that it will not look like the default titlebar, I would have to explicitly do things to make it look alike on each device! And that can't be a solution if, after all, I don't want a different appearance!</p>","273456","","273456","","2010-08-15 20:15:27","2013-07-29 22:05:53","Android Launcher label vs. activity title","<android><label><android-manifest><titlebar><launcher>","4","0","37","",""
"3488764","1","","","2010-08-15 18:55:33","2","3461","<p>On my android phone (2.1) I'm seeing a strange behavior with setTimeout when keeping a finger pressed on the touchscreen for a while.</p><p>This very simple code in fact works fine (1 call each second), until I scroll for a while the window (2-3 seconds are sufficient), when it stops being called</p><pre><code>$(document).ready(function(){    spam();});function spam(){    console.log(""cia"")    setTimeout(spam, 1000);}</code></pre>","421141","","436938","","2012-04-26 09:08:31","2013-06-03 14:05:32","setTimeout not called in android webkit","<javascript><android>","5","1","3","",""
"3488806","1","3488991","","2010-08-15 19:08:37","3","521","<p>I have a auto-complete textbox in which the user makes a selection. From here I want to load a tabbed layout which is based on the user selection. The problem is I cant figure out a clean way to pass that selection to each of the tabs. At the moment I can pass an intent to the 'tabhost' activity and then pass to each child activity explicitly, however this just seems like messy iterative code to me! So basically how can I pass my intent data bundles to the tabs activities cleanly &amp; efficiently! Psuedo code is also very welcome ;) </p><p>Cheers guys  </p>","397085","","","","","2010-08-15 19:58:51","Android Tabs & Intents","<android><android-intent><android-tabhost>","2","0","","",""
"3488844","1","3488894","","2010-08-15 19:19:16","0","151","<p>Android 2.1 - I'm trying to work with the Camera via a widget.</p><p>My widget sets up and calls mCamera = Camera.open();, I can do everything with the camera, but when I go to release the camera via a 2nd widget click, mCamera.release(); throws a NullPointerException.</p><p>How much I find out why that is?</p>","421152","","","","","2010-08-15 19:47:59","What might cause a NullPointerException when running Camera.release()?","<android>","2","0","","",""
"3488880","1","3488904","","2010-08-15 19:28:07","1","156","<p>I am working on an Android project where a group of buttons needs to show on the bottom of every screen (activity) in the application.  The group of buttons are basically a navigation bar.  I want to know the best way to do this without creating new buttons for every activity.  I have been around programming (C++/C#) for many years but am pretty new to Android and Java so if someone can point me in a general direction, it would be appreciated.</p><p>Thanks.</p>","421149","","","","","2010-08-15 21:11:34","Group of Views (controls) on multiple screens","<java><android><activity>","2","0","","",""
"3489045","1","3489065","","2010-08-15 20:16:03","3","2572","<p>It does not seem possible to use REGEXP in a SQLite query in Android. If it is possible, please point me in the right direction.</p><p>Is there a way to use a LIKE condition to query for an expression at the beginning of any word in the result? </p><p>Example:  </p><hr><p><strong>Entries:</strong><br> 1. Minimum<br> 2. Aluminum<br> 3. Last Minute</p><p><strong>Query:</strong><br>""min""</p><p><strong>Desired Result</strong><br>(1) Minimum<br>(3) Last Minute </p><p><strong>NOT</strong><br>(2) Aluminum</p><hr><p>This is basically my current code, which would return (2)Aluminum:</p><pre><code>public Cursor search(String query) {    return mDb.query(TABLE, COLUMNS, KEY_NAME +"" like ?"", new String[] { ""%""+query+""%"" }, null, null, null);}</code></pre><p>Any help will be greatly appreciated!</p>","377260","","377260","","2010-08-16 06:53:49","2010-08-16 06:53:49","SQLite LIKE alternative for REGEXP, Match Start of Any Word","<android><sqlite>","1","0","","",""
"3489068","1","3489615","","2010-08-15 20:21:53","0","1455","<p>Is this even possible without calling a specific package?  I have found countless examples of sending email via intent, but I can find nothing about simply opening the default email client on the device via button press (preferably with a chooser dialog in case the user has multiple clients).</p>","420474","","","","","2012-01-09 23:21:16","How do I launch the email client directly to inbox view?","<android><android-intent>","2","2","1","",""
"3489164","1","3489611","","2010-08-15 20:42:47","6","3650","<p>I have an activity. In this activity I want to start another activity using startActivityForResult(). I understand that my basic activity is started within a process with a main GUI thread. But as far as I understand, startActivityForResult() is asynchronious which means that my new activity will be executed in a different thread. I can't find information regarding the threads inside. If there is only one GUI thread, how does these functions work asynchroniously ? </p>","421181","","73488","","2010-08-16 01:18:52","2010-08-16 02:36:16","What is the mechanism behind startActivityForResult() in Android?","<android><multithreading>","2","0","1","",""
"3489235","1","","","2010-08-15 20:58:29","1","1019","<p>I want to use a number of ShapeDrawables in my application, which are all similar, but with different colours etc. Obviously I could just define them all in separate xml files, but is there a more efficient way to have one xml definition, instantiate various objects and change the colour either in code or xml? You could perhaps do this by calling mutate() on one ShapeDrawable defined in xml, but this returns a Drawable, rather than a shape drawable.</p>","278638","","","","","2013-02-25 08:34:30","multiple drawables from one xml file","<android><drawable>","2","0","","",""
"3489280","1","3489367","","2010-08-15 21:11:43","0","4617","<p>I have a database table with 3 columns: _id, name, groupName</p><p>It looks similar to this:</p><p>1    Tom    group1</p><p>2    Sam    group1</p><p>3    Ted    group2</p><p>4    Jerry  group3</p><p>5    Me     group3</p><p>I want to query the database table for groupName. I have tried this:</p><pre><code>public Cursor getAllGroups() {      return db.query(DATABASE_TABLE_1, new String[] {KEY_GROUP},             null, null, null, null, null);}</code></pre><p>And this returns a cursor along: (group1, group1, group2, group3, group3). </p><p>Is there a way to get only unique groups? (So I would end up with a cursor along: (group1, group2, group3)</p><p>Thanks in advance.</p>","399717","","","","","2010-08-16 19:13:43","Android database query","<android>","3","0","","",""
"3489427","1","3489481","","2010-08-15 21:52:00","4","4825","<p>I'm new to the Android framework and I can't get past first base with SQLite.</p><p>I'm trying to build a very simple application that has a EditText search box, which when a key is pressed performs a Like %word% search on a SQLite database for for the text entered in the EditText box, and displays the results in a ListView.</p><p>N.B. the below code included debugging and commented code, sorry I haven't got round to cleaning it up yet.</p><p>The Activate is</p><pre><code>public class sustainable_fish extends Activity {private String keycodeToAscii(int arg2){    String retvar = """";    switch(arg2){    case KeyEvent.KEYCODE_A: retvar = ""a"";break;    case KeyEvent.KEYCODE_B: retvar = ""b"";break;</code></pre><p>snipped, but you get the idea.</p><pre><code>    case KeyEvent.KEYCODE_RIGHT_BRACKET: retvar = "")"";break;    default: retvar = """"; break;    };    return retvar;} Context that = getApplicationContext(); fishDB dh = new fishDB(getApplicationContext());private OnKeyListener search = new OnKeyListener() {    public boolean onKey(View arg0, int arg1, KeyEvent arg2) {        @SuppressWarnings(""unused"")        Cursor cur = null;        String searchData;        EditText myEditText = (EditText) findViewById(R.id.fish_search);        CharSequence edit_text_value = myEditText.getText();        searchData = edit_text_value.toString();        searchData = searchData + keycodeToAscii(arg2.getKeyCode() );        Log.d(""onKey"", ""searchData = ""+searchData);        /*        Commented out because as the database doesn't work, so theirs no point just yet searching.        cur = fish.search(searchData);        if (cur != null)        {            String[] displayFields = new String[] {cur.getString(2),                    cur.getString(1)};            int[] displayViews = new int[] { R.id.fish_rank,                    R.id.fish_name};            SimpleCursorAdapter adapter = new SimpleCursorAdapter(that,                     R.layout.text_list, cur,                     displayFields, displayViews);            ListView myList=(ListView)findViewById(android.R.id.list);            myList.setAdapter(adapter);        }         */        return false;    }};/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);   setContentView(R.layout.main);   EditText searchBar = (EditText) findViewById(R.id.fish_search);   searchBar.setOnKeyListener(search); }}</code></pre><p>The SQLite database is handled by fishDB</p><pre><code>  public class fishDB { public static final String DATABASE_NAME = ""fish.db3""; public static final int DATABASE_VERSION = 1; private SQLiteDatabase database; private Context myContext; private static boolean booFirstrun = false; fishDB(Context inContext){     myContext = inContext;     OpenHelper helper = new OpenHelper(myContext);     Log.w(""fishDB"", ""Called OpenHelper"");             // Here be the problem...     database = helper.getWritableDatabase(); } public boolean firstRun(){    return booFirstrun; }   private static class OpenHelper extends SQLiteOpenHelper {       private static final String CREATE_TABLE_FEEDS = ""create table feeds (feed_id integer primary key autoincrement, ""           + ""title text not null, url text not null);"";          OpenHelper(Context context) {             super(context, DATABASE_NAME, null, DATABASE_VERSION);             Log.w(""OpenHelper"", ""Called superconstructor"");            }          @Override          public void onCreate(SQLiteDatabase db) {              try {              Log.w(""OpenHelper"", ""in onCreate"");              booFirstrun = true;              Log.w(""OpenHelper"", ""set booFirstrun"");              db.beginTransaction();              Log.w(""OpenHelper"", ""db.beginTransaction"");              try {                  // Create tables and test data                  db.execSQL(CREATE_TABLE_FEEDS);                  Log.w(""OpenHelper"", ""execSQL"");                  db.setTransactionSuccessful();                  Log.w(""OpenHelper"", ""setTransactionSuccessful"");              } catch (SQLException e) {                  Log.e(""Error creating tables and debug data"", e.toString());                  throw e;              } finally {                  db.endTransaction();              }              } catch (Exception e) {                  Log.e(""OpenHelper"", e.toString() );              } finally {              Log.w(""OpenHelper"", ""out of onCreate"");              }          }          @Override          public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {             Log.w(""OpenHelper"", ""Upgrading database, this will drop tables and recreate."");             onCreate(db);          }       }  }</code></pre><p>Now every time ""database = helper.getWritableDatabase();"" is called the app crashes with a NullPointerException. I've managed to trace the error to the onCreate method of OpenHelper and the ""db.beginTransaction();"" line.</p><p>What am I missing?</p>","70568","","","","","2012-09-05 18:45:15","Keep getting NullPointerExceptions when attempting to call getWritableDatabase()","<android><sqlite>","2","1","2","",""
"3489513","1","","","2010-08-15 22:22:16","3","4049","<p>I am using the latest Android SDK (2.1-update1 - Level 7) but I am finding that the intellisense is rather poor in Eclipse. Is it just me or is anyone else experiencing intellisense issues with Android SDK?</p>","303347","","","","","2014-04-17 03:05:37","eclipse intellisense with Android SDK","<android>","5","6","","",""
"3489605","1","5421228","","2010-08-15 22:50:38","1","860","<p>When my Activity is loaded, I wish the txtEdit EditText widget to get focus and show the keyboard.</p><p>I tried this in the onResume() but it does not automatically show.</p><pre><code>@Overrideprotected void onResume() {    InputMethodManager mgr = (InputMethodManager)         getSystemService(Context.INPUT_METHOD_SERVICE);    mgr.showSoftInput(txtSearch, InputMethodManager.SHOW_IMPLICIT);</code></pre>","172861","","","","","2011-03-24 15:04:27","Android Form EditText Show Keyboard onResume","<android><keyboard>","1","0","","",""
"3489770","1","3490872","","2010-08-15 23:55:19","0","3404","<p>I am using a custom class based off RelativeLayout but it obviously doesn't render in the Eclipse layout editor.</p><p>I have found this article regarding LayoutInflater.Factory and it sounds like what I need to be doing but I can find no guides to using LayoutInflater.Factory.</p><p><a href=""http://www.macadamian.com/blog/post/android_-_custom_classes_from_xml_layout/"" rel=""nofollow"">http://www.macadamian.com/blog/post/android_-_custom_classes_from_xml_layout/</a></p><p>Could anyone help with exactly what and where I do this? I understand what is said in the article, but need specifics on where to declare, hook, whatever the Factory.</p><p>In case it is helpful, here is the complete console output from when I try to view main.xml in Layout view..</p><pre><code>java.lang.ClassCastException: android.view.View cannot be cast to android.view.ViewGroupat android.view.LayoutInflater.rInflate(LayoutInflater.java:619)at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)at android.view.LayoutInflater.inflate(LayoutInflater.java:407)at android.view.LayoutInflater.inflate(LayoutInflater.java:296)at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:396)at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.computeLayout(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.recomputeLayout(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.activated(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(Unknown Source)at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1076)at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:601)at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.selectDefaultPage(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.addPages(Unknown Source)at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:357)at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:662)at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462)at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256)at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209)at org.eclipse.ui.internal.PartStack.presentationSelectionChanged(PartStack.java:843)at org.eclipse.ui.internal.PartStack.access$1(PartStack.java:829)at org.eclipse.ui.internal.PartStack$1.selectPart(PartStack.java:139)at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:133)at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:270)at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:279)at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.access$1(DefaultTabFolder.java:1)at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder$2.handleEvent(DefaultTabFolder.java:87)at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1200)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1185)at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1025)at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3256)at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2045)at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:323)at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3493)at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112)at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:616)at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)at org.eclipse.equinox.launcher.Main.run(Main.java:1311)</code></pre>","414266","","414266","","2010-08-16 06:50:10","2010-08-16 07:32:53","How do I use androids LayoutInflater.Factory to create a custom view class instead of a built in class?","<android><view><factory>","2","0","","",""
"3489891","1","","","2010-08-16 00:38:26","1","332","<p>I'm having this weird issue with a custom TextView I'm working on. I'm trying to move the view by dragging it with a finger, so I get the touch position, do some math, and set the corresponding leftMargin and topMargin. It works, but I get some very weird behavior. The leftMargin part works perfectly, but the topMargin is very jumpy. It seems like it oscillates between the correct position and a position 25 pixels below it. When I only tap on the view instead of continuously dragging it, it moves down 25 pixels with every touch. Does anyone have any idea why this could be? The relevant code is here:</p><pre><code>     case MotionEvent.ACTION_MOVE : {        final float x = event.getX();  final float y = event.getY();  final float newMarginX;  final float newMarginY;  positionX = x;  positionY = y;  newMarginX = oldMarginX - (lastTouchX - positionX);  newMarginY = oldMarginY - (lastTouchY - positionY);  LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(this.getWidth(),   this.getHeight());  params.leftMargin = (int) newMarginX;  params.topMargin = (int) newMarginY;  this.setLayoutParams(params);  this.setText(Float.toString(y));  lastTouchX = positionX;  lastTouchY = positionY;  oldMarginX = newMarginX;  oldMarginY = newMarginY;  break;      }</code></pre>","421258","","","","","2013-10-16 03:44:00","Weird bug with setting LayoutParams margins","<android>","2","1","","",""
"3490220","1","","","2010-08-16 02:19:41","0","917","<p>I found these code may case memory leak on android 2.1</p><pre><code>    SoundPool soundPool = new SoundPool(10, 7, 0);    ...    ...    soundPool = null;</code></pre><p>every time after the execution, the MAT pluging tells that two String objects of ""android:unnamed_thread"" are added to the heap of the process. is that an issue?</p>","421301","","1280410","","2012-05-11 12:36:45","2012-05-11 12:36:45","does android.media.SoundPool cause memory leak?","<android><memory-leaks><soundpool>","2","0","","",""
"3490301","1","3490309","","2010-08-16 02:54:32","0","452","<p>I have a Network Client class that is receiving a large binary block and parsing it into a usable Java object. The Network Client is on a separate thread from the app's View. What is the best way to make this object available to the View? I've come up with the following solutions, but I feel like none of them are the correct one:</p><ol><li>Create the object in the Network Client and let the View access it directly<ul><li>I would send a small message in a Handler telling the View that the data has been updated</li><li>Con: requires that I synchronize the object between the threads to ensure that the Network Client doesn't replace the object while the View is accessing it</li></ul></li><li>Serialize (Parcel?) the object in the Network Client and send it through a Handler to the View<ul><li>Pro: there are no questions of ownership of the data</li><li>Con: would probably be a huge performance drain on the app</li></ul></li><li>Create a reference to the object and pass that to the View<ul><li>I come from a C++ background, and I'm not sure if this is even possible in Java. I C++, I could just send the View a pointer to the object and let it take care of it. That seems like something Java wouldn't let me do. Is this feasible? </li></ul></li></ol><p>Are any of these solutions advisable, or should I approach the problem in a completely different way?</p>","131159","","","","","2010-08-16 09:38:10","How do a share a large object within an activity in Android?","<java><android>","3","0","","",""
"3490587","1","","","2010-08-16 04:26:38","5","2801","<p>I have this in my manifest file:</p><pre><code>&lt;receiver android:name=""com.google.android.apps.analytics.AnalyticsReceiver"" android:exported=""true""&gt;&lt;intent-filter&gt;    &lt;action android:name=""com.android.vending.INSTALL_REFERRER"" /&gt;&lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>but I don't see the install data in my GA. I am wondering if I missed out something.</p>","42340","","","","","2011-08-06 11:31:53","How to track referral install from Android Market?","<android><google-analytics>","2","0","1","",""
"3490610","1","","","2010-08-16 04:34:07","1","801","<p>My code is pretty standard.. sReport contains the text I would like output to the text file, and it contains several ""\n"" line breaks that render fine in a textview, but in the text file they're non-existent. There must be something easy i'm missing..</p><pre><code>    try {        FileOutputStream fOut = new FileOutputStream(sDir + sFile);        //write          fOut.write( sReport.getBytes() );        // Close output stream        fOut.flush();        fOut.close();    } catch (IOException  e) {        e.printStackTrace();    }</code></pre>","350237","","","","","2010-08-16 15:38:56","How do I insert line breaks into a text file i'm creating on the SD Card?","<android><android-sdcard>","1","4","","",""
"3490623","1","3492075","","2010-08-16 04:39:57","2","2984","<p>I'm using  <code>MediaStore.Images.Thumbnails</code> in order to show the images the user have. But i'm not able to get an image through its path. Is there any way to look for an image using the path?</p><pre><code>String [] proj={MediaStore.Images.Thumbnails._ID, MediaStore.Images.Thumbnails.IMAGE_ID, MediaStore.Images.Media.DATA};  String selection =  MediaStore.Images.Media.DATA + "" like '%path%'"";  //this doesn't work  cursor = managedQuery( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,                       proj, // Which columns to return                          selection,       // WHERE clause;                          null,                               null); // Order-by clause </code></pre><p>Best regards!</p>","421359","","350601","","2012-01-09 07:46:00","2012-01-09 07:46:00","Is there any way to look for an image using the path? MediaStore.Images.Thumbnails (Android)","<android><image><path><mediastore>","1","0","2","",""
"3490630","1","","","2010-08-16 04:42:11","1","973","<p>I want to save the data on the web server. I have data in XML format and I know the URL String. Please tell  me how can I send the request and handle the response.</p><p>ThanksDeepak</p>","406494","","","","","2011-01-27 08:59:21","Saving data at web server","<android>","1","0","1","",""
"3490674","1","3490807","","2010-08-16 04:53:51","1","4889","<p>I have a problem.1. I have two threads 'worker' and 'UI' thread.2. worker keep on waiting for data from server, when gets it notifies to UI thread.3. On update UI Toast a msg on screen.Step 3 is problem as it says </p><p>android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</p><p>using mHandler, runOnUIThread slows down the UI thread (UI displays webview), as I have to continuously check for data from server.</p><p>Thanks in advance.</p>","385190","","","","","2010-08-16 09:18:44","observer pattern in Android","<android><observer-pattern>","2","0","","",""
"3490804","1","3490836","","2010-08-16 05:29:27","3","757","<p>Can I use any Android Phone for app development? Here in the Philippines, there are many available mobile phones with Android installed. But I want to buy the cheapest phone available (which I think is Samsung i5500 Galaxy 5). Thanks in advance!</p>","376290","","21234","","2010-12-05 20:47:05","2010-12-05 20:47:05","Can I use any Android Phone for application development?","<android>","6","0","1","",""
"3490913","1","3491406","","2010-08-16 05:59:18","37","40661","<p>I came across this term in the android documentation with the accompanying definition</p><blockquote>  <p>These are broadcasts whose data is held by the system after being finished, so that clients can quickly retrieve that data without having to wait for the next broadcast. </p></blockquote><p>What does it mean? Can someone elaborate its use with a particular example? I believe we have to request a permission for using this intent? Why so?</p><pre><code>&lt;uses-permission android:name=""android.permission.BROADCAST_STICKY""/&gt; - Allows an application to broadcast sticky intents.</code></pre>","393459","","1112882","","2014-04-15 04:43:34","2014-04-15 04:43:34","What is a Sticky Broadcast?","<android><android-intent>","4","0","23","",""
"3490938","1","","","2010-08-16 06:04:11","1","67","<p>I am developing an application for several android devices which include x10,x10 mini and nexus-one, so I have to re-szie all graphics for all 3 screen size(480,320,240), but when I deploy the application onto x10(480x854),it gets mdip files instead of hdip files, and all images become blur because using 320 pixel width image.Then, how can I let the x10 read the hdip files and don'y read mdip files anymore?</p><p>Thanks for advance!  </p>","384248","","","","","2010-08-16 06:04:11","x10 read drawable-mdip files instead of mdip","<android>","0","0","1","",""
"3490951","1","3491120","","2010-08-16 06:07:45","10","15248","<p>HI All</p><p>, i want to giv max and minimum  limit of seekbar to 50 and 20 respectively.seekbar has a direct option top provide max value,but how can i set its minimum value to 20 rather than 0??regards</p>","1497488","","21234","","2010-12-01 22:24:18","2014-02-09 09:20:17","how to limit seekbar","<android><android-sdk-2.1><seekbar>","2","0","2","",""
"3490953","1","3491125","","2010-08-16 06:08:03","1","7864","<p>Wondering if I'm going about this the right way or not. I have 3 buttons on my screen (Restart, Previous, Next). When the view loads it shows the first image which is fine. When I click the ""Next"" button I want it to load a second image and so on for up to 9 images. If I click the ""Previous"" button it should go back one image. Clicking ""Restart"" should go to the first image. I have the Restart one working. I'm having trouble with the Next button because it only shows the second image (I think because my ""a"" variable is initialized at 0). Here's my code. Grateful to anyone that can help.</p><pre><code>public class Story1 extends Activity implements View.OnClickListener </code></pre><p>{</p><pre><code>ImageView image = (ImageView) findViewById(R.id.story1_1);@Overrideprotected void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.story1);    Button restart = (Button) findViewById(R.id.restart);    restart.setOnClickListener(this);    Button previous = (Button) findViewById(R.id.previous);    previous.setOnClickListener(this);    Button next = (Button) findViewById(R.id.next);    next.setOnClickListener(this);}@Overridepublic void onClick(View view) {    int a = 0;    switch (view.getId())    {        case R.id.restart:            image.setImageResource(R.drawable.story1_1);            break;        case R.id.next:            if (a == 0)            {                image.setImageResource(R.drawable.story1_2);                a = 1;            }            else if (a == 1)            {                image.setImageResource(R.drawable.story1_3);                a = 2;            }            else if (a == 2)            {                image.setImageResource(R.drawable.story1_4);                a = 3;            }            else if (a == 3)            {                image.setImageResource(R.drawable.story1_5);                a = 4;            }            else if (a == 4)            {                image.setImageResource(R.drawable.story1_6);                a = 5;            }            else if (a == 5)            {                image.setImageResource(R.drawable.story1_7);                a = 6;            }            else if (a == 6)            {                image.setImageResource(R.drawable.story1_8);                a = 7;            }            else if (a == 7)            {                image.setImageResource(R.drawable.story1_9);                image.setClickable(false);            }            break;      }}</code></pre><p>}</p>","421399","","","","","2010-08-16 06:55:21","Changing ImageView on button click","<android><imageview>","1","0","","",""
"3491073","1","","","2010-08-16 06:34:46","2","668","<p>Is the browser application on Android open source? If so, where can I find the source code?</p>","412955","","122607","","2012-04-04 17:35:44","2012-04-04 17:35:44","Is the Android browser open source?","<android>","1","0","0","",""
"3491203","1","","","2010-08-16 07:07:00","3","6842","<p>How to customize the color of the CheckMark color in android in a dialog. Currently , By default, the color of the checkmark is green by default. I would like to customize it to a different color of choice</p>","421453","","","","","2013-10-25 19:36:50","How to customize the color of the CheckMark color in android in a dialog. : android","<android>","3","0","","",""
"3491229","1","","","2010-08-16 07:11:57","0","1224","<p>my code is this to post data to server </p><pre><code>MakeValue = (String) s2.getSelectedItem();MakeValue = MakeValue.replace("" "", ""%20"");DefaultHttpClient hc=new DefaultHttpClient();ResponseHandler res=new BasicResponseHandler();HttpPost postMethod=new HttpPost(AppUrl.AppUrl+""dealer_service.php?action=saveCreateNewInventory"");List nameValuePairs = new ArrayList(2);nameValuePairs.add(new BasicNameValuePair(""POSTDATA"", Login.GetUserID +""~""+ VinNumber.getText()</code></pre><p>. . .</p><pre><code>postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs));response=hc.execute(postMethod,res);</code></pre><p>but after executing this i have an exception of ssl not trusted so please help me to solve my probs please help i spent too many days in this. how can i remove this exception.</p>","421418","","114066","","2010-08-16 09:53:28","2010-10-25 21:10:48","Error of ssl certificate not trusted in Android","<android>","2","1","","",""
"3491235","1","","","2010-08-16 07:12:57","1","4954","<p>I have a gallery and when a image is selected, I want to start new thread (for loading other images). But I don't want to do it while the gallery is scrolling. How can I know the state of the gallery and if it is still scrolling?</p><p>I can't use ""setCallbackDuringFling(false)"" because I have a textview under the image that has to be updated during the scrolling...</p><p>Thanks!Marc</p>","421458","","421458","","2010-08-16 08:25:23","2012-03-06 04:11:40","Android How to know if a Gallery is scrolling?","<android><scrolling><gallery>","2","0","1","",""
"3491569","1","","","2010-08-16 08:22:15","1","701","<p>i want to ask about that can we convert the input source type data in android. my prob is here that i get the data from the url not in tags form. i fetch output in the inputsource type. after that i want to parse the data in meaniful form is this possible or not?</p><p>if this possible then how can i implement?</p><p>plz help</p>","421418","","","","","2010-08-16 09:00:17","conversion of the input source to meaniful data in android","<android>","1","0","1","",""
"3491608","1","3491745","","2010-08-16 08:30:12","3","994","<p>We all know that hitting the back button on the device doesn't kill the application, it merely finishes (destroys) the activity running on the foreground.</p><p>Well I have come across some code which helps me capture the back button signal so that I cannot exit the application. The only way to exit it in such cases is to press the home key.</p><p>Now this situation presents me with a unique disadvantage! The inability to <strike>kill</strike> finish the application on a time of my own choosing allows the application to keep running in the background like nothing has changed.</p><p>So in such cases is the task manager my only friend or is there a way for me to otherwise kill this application?</p><p>PS: if there is a flaw in my understanding of what happens when the home button is pressed, I would love to be corrected... =)</p>","393459","","393459","","2010-08-16 09:40:32","2010-08-16 09:40:32","How do I finish an activity in this instance?","<android><activity>","2","0","1","",""
"3491658","1","3568244","","2010-08-16 08:39:49","6","1308","<p>I am looking for a WorkQueue API offering the following features:</p><ul><li><code>java.util.Queue</code> compatible</li><li>offers (optional) Set-semantic</li><li>single- and batch-processing</li><li>concurrency (of course)</li><li>scheduling</li><li>different processing policies<ul><li>wait until next scheduled execution</li><li>pre-process, if batch size met</li><li>delayed processing (minimum time in queue, before being processed)</li></ul></li><li>persistence (optional)</li></ul><p>There are a lot of interesting implementations in the jdk, e.g. <code>java.util.DelayQueue</code> which i could use. I just wanted to make sure i am not reinventing the wheel.</p>","232539","","426671","","2012-06-12 16:59:13","2012-06-12 16:59:13","Is there a sophisticated Java WorkQueue API?","<java><android><android-asynctask><scheduled-tasks><task-queue>","4","0","0","",""
"3491747","1","3571583","","2010-08-16 08:53:10","4","2153","<p>If I call to a ContentProvider from a Activity, which thread is ContentProvider running in?</p><p>E.g. What happens if the Activity is killed and a query is executing in the ContentProvider? Say that you have a slow network query f.ex.</p>","382023","","1174526","","2012-03-19 06:28:32","2013-01-31 17:47:22","Which thread runs ContentProvider?","<android><android-contentprovider>","2","0","4","",""
"3491853","1","","","2010-08-16 09:13:23","1","664","<p>I want to block the installation of Blacklist rated applications over device either through side loading or through android Market. Does anybody has an idea how this can be done?</p><p>I already have root level access to the device</p>","292605","","1777090","","2012-11-20 07:21:04","2012-11-20 07:21:04","How to block installation of blacklist rated application over device?","<android><installation>","1","2","2","2012-11-23 10:48:21",""
"3491910","1","","","2010-08-16 09:21:40","1","1582","<p>I've been tryin to develop an app which requires to access contacts from SIM memory. Here is the code i've used but there is runtime exception.  </p><pre><code>{      Uri simUri = Uri.parse(""content://icc/adn"");    c=getContentResolver().query(simUri, null, null, null, null);    startManagingCursor(c);            getContacts();}private void getContacts(){    int i=0;    do {        // Get the field values        names[i++] = c.getString(0);            } while (c.moveToNext());</code></pre><p>Any  answers and solutions are appreciated. Along with that could you please tell me the exact URI to access sim card contacts?? And is there any name for colums in the sim's contacts memory table?</p>","421309","","114066","","2010-08-16 09:47:37","2010-08-16 09:47:37","Android: Accessing Contacts from SIM card memory","<android><mobile><contacts><sim-card>","0","2","","",""
"3491961","1","3495073","","2010-08-16 09:29:33","4","9061","<p>In my application, i have to implement native camera activity where i have to launch the camera and take photo.</p><p>In detail,my application containing, One TextView (at top) to display activity name and one Button (At bottom) and in Middle Area of the screen, Camera preview should be viewed..When user click on that Button, Snaps should be clicked and display it into Imageview of another activity.</p><p>I know that the following approach is used: </p><pre><code>Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );intent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri );startActivityForResult( intent, 0 );</code></pre><p>But this approach if i used then my textview and button view is not displayed.</p><p>(Pls note that: I am using Android SDK 1.5 with HTC Hero)</p><p>pls help me by suggestion of any article, site, or pdf.</p><p>thanx, paresh</p>","379693","","379693","","2010-08-16 11:41:55","2010-08-16 16:13:58","Android - Capture photo","<android><android-camera><android-camera-intent><android-capture>","2","0","6","",""
"3491981","1","3492024","","2010-08-16 09:33:28","0","276","<p>I have a <code>mapView</code> activity that has a <code>LocationListener</code> registered to check for a new location every two seconds.  When I press the back button to go back to the main screen of the app the GPS continues to check for a location every two seconds.  Does the listener not get stopped when the <code>Activity</code> stops?  If not how can I handle this?  I currently have not overridden <code>onStop()</code>.</p><pre><code>private final LocationListener locationListener = new LocationListener() {    public void onLocationChanged(Location location) {        updateWithNewLocation(location);    }    public void onProviderDisabled(String provider) {        //TODO do something to handle when the provider is disabled    }    public void onProviderEnabled(String provider) { }    public void onStatusChanged(String provider, int status, Bundle extras) { }};</code></pre>","336861","","638994","","2013-09-27 13:24:28","2013-09-27 13:25:26","App Keeps Pinging GPS","<android><gps><locationlistener>","1","0","1","",""
"3492001","1","19000316","","2010-08-16 09:37:01","5","5302","<p>Android's <a href=""http://developer.android.com/reference/android/app/ProgressDialog.html"">ProgressDialog</a> allows you to set the current progress and maximum value as integers. These values are shown in the dialog like this:</p><blockquote>  <p>3401/10023</p></blockquote><p>Where the first number is the current progress, and the second number is the maximum value.</p><p>I would like to also show the unit of measurement. Something like this:</p><blockquote>  <p>3401/10023 <strong>KB</strong></p></blockquote><p>Is this possible using ProgressDialog? If not, what do you recommend doing to give this information to the user? I'm trying to avoid reimplementing ProgressDialog just to include the unit.</p>","143378","","","","","2013-09-25 09:41:40","Progress unit in ProgressDialog","<android><progressdialog>","4","3","5","",""
"3492034","1","","","2010-08-16 09:42:15","0","5130","<p>I need detailed tutorial or example on Xml-Parsing In Android</p>","410871","","771300","","2012-01-10 12:44:11","2013-02-20 11:06:54","Android xml parsing","<android><xml><xml-parsing>","4","0","","",""
"3492125","1","","","2010-08-16 09:58:58","1","2659","<p>Is there any tool available to convert android dex file format to java class format?I've looked at dex2jar, but it looked very early in development. I'd like something that is stable enought for use.</p>","308175","","","","","2011-12-06 16:08:12","Android dex to convert to java class format","<java><android><dex>","0","2","1","",""
"3492196","1","","","2010-08-16 10:10:17","2","2508","<p>I have a ListView in my app that has a background image. All of the rows are a semi transparent white (#35FFFFFF). Whenever I scroll the list, the rows turn a light green that obscures the background image until I stop scrolling (usually--sort of unpredictable). Sometimes it flickers between the background image/color and the green. And yes, I have set the cache color hint to #00000000. Any advice about this would be appreciated.</p><p>ListView xml:</p><pre><code>&lt;ListView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/list""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""7px""            android:cacheColorHint=""#00000000""    android:dividerHeight=""6px""    android:""#75ffffff""    android:background=""@drawable/list_bg""    android:fastScrollEnabled=""true""    /&gt;</code></pre><p>Row xml:</p><pre><code>&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/text""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:textSize=""18px""    android:textColor=""@android:color/black""    android:gravity=""center_vertical""    android:background=""#35ffffff""    /&gt;</code></pre><p>Bitmap xml:</p><pre><code>&lt;bitmap xmlns:android=""http://schemas.android.com/apk/res/android""    android:src=""@drawable/list_bg_bitmap""    android:tileMode=""repeat""    android:dither=""true""    /&gt;</code></pre>","378272","","","","","2010-12-14 02:28:54","Strange ListView scrolling issues","<android><image><listview><background><scroll>","2","4","2","",""
"3492417","1","","","2010-08-16 10:44:46","7","13664","<p>I'm currently developing a Field-Service application that stores data in the local sqlite database on an android device. At some point, usually after completing the data collection rounds, the local sqlite db is to be synchronized to a remote sql server db on the server, also i need to update some  local table from sql server db.</p><p>Any suggestions as to how this could be achieved or engineered as a solution? Or even better, are there alternatives to synchronizing data in such an application?</p>","421577","","","","","2014-03-15 07:26:13","connect to sql server from android","<android>","2","1","2","",""
"3492470","1","","","2010-08-16 10:54:02","0","598","<p>how to create an android popup window with webpage in it.</p>","413770","","","","","2010-10-26 08:26:07","android popup window with webpage in it","<android>","1","0","","2012-08-23 12:11:48",""
"3492513","1","3492795","","2010-08-16 11:01:59","5","5661","<p>I have an activity that extends ListView.  I populate my list with the results of a query to the sqlite database. A list element consists of start_time, end_time, client_name and status. These are the 4 bits on info I need to display for each list item. </p><p>My question is: Is it possible for me to assign hidden elements to this ListView item?</p><p>For example, I want to store the _id field of the database row for that ListView item, so that when I click it I can start a new activity based on data for that database row.</p><p><strong>EDIT</strong></p><p>The Code I use to fill my list from my Cursor:</p><pre><code>String[] columns = new String[] {VisitsAdapter.KEY_CLIENT_FULL_NAME, VisitsAdapter.KEY_STATUS,VisitsAdapter.KEY_CLIENT_START_TIME, VisitsAdapter.KEY_CLIENT_END_TIME};// the XML defined views which the data will be bound toint[] to = new int[] { R.id.name_entry,R.id.number_entry,R.id.start_time_display,R.id.end_time_display  };SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(HomeScreen.this, R.layout.list_element, cur, columns, to);</code></pre><p>Where R.layout.list_item is the XML for my list item. I come from a PHP/HTML background so what I would typically do here is have a hidden field to hold my _id value that I could then access once the list item was clicked. can I do something similar in android? can I put a hidden _id field in my xml layout?</p>","409826","","114066","","2012-01-27 08:46:39","2013-11-25 19:21:01","assigning hidden values to a listview item","<android><android-listview>","3","0","4","",""
"3492534","1","","","2010-08-16 11:04:23","1","352","<p>Is it possible to develop a Youtube client app from scratch using the existing Youtube Data APIs? I would like to create one that supports Android 1.6 and above.</p>","245642","","","","","2010-08-16 11:04:23","Develop Youtube Client for Android from Scratch","<android><api><data><youtube>","0","0","","",""
"3492676","1","","","2010-08-16 11:30:09","16","25191","<p>When I click the 'run as Android application' option, it shows the following error:</p><pre><code>[2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port.[2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'.[2010-08-16 16:56:35 - Emulator] please use -help for more information</code></pre>","421645","","313758","","2011-09-16 12:56:42","2011-09-16 12:58:54","Invalid command line parameter when Android executes","<android>","10","5","3","",""
"3492683","1","3492710","","2010-08-16 11:31:00","0","399","<p>Is it possible to deploy an Android application to the google app engine environment? ie to deploy it to appspot?</p><p>If not, is there any kind of ""container"" which would allow one to do this?</p><p>I would like to create an application that can be deployed on both android, and a web based environment</p>","155695","","","","","2010-08-16 11:36:03","Can you deploy an Android application onto Google App Engine?","<android><google-app-engine>","1","0","","",""
"3492714","1","","","2010-08-16 11:36:54","2","747","<p>Android hide status bar of traslucant screen please give me the solution.</p><pre><code>&lt;style name=""Theme.Hello"" parent=""@android:style/Theme.Translucent""&gt;        &lt;item name=""android:windowFullscreen""&gt;true&lt;/item&gt;        &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;        &lt;item name=""android:windowContentOverlay""&gt;@null&lt;/item&gt;        &lt;item name=""android:windowFrame""&gt;@null&lt;/item&gt;        &lt;item name=""android:windowBackground""&gt;@android:color/transparent&lt;/item&gt;        &lt;item name=""android:windowIsTranslucent""&gt;true&lt;/item&gt;&lt;/style&gt;</code></pre><p>and I have tried only by setting the theme <code>""android:style/Theme.NoTitleBar.Fullscreen""</code> in manifest file but I'm getting background screen black color.</p>","421675","","1232277","","2013-01-03 12:00:10","2013-01-03 12:00:10","Android hide status bar of traslucant screen","<android>","0","4","","",""
"3492721","1","3492911","","2010-08-16 11:38:36","1","9245","<p>I have a RelativeLayout, and this  Layout has two childs, one is a MapView and the other a RelativeLayout that contains a button.</p><p>I want it to look like that <a href=""http://pocketjourney.files.wordpress.com/2008/03/goal.gif"" rel=""nofollow"">http://pocketjourney.files.wordpress.com/2008/03/goal.gif</a> but my transparent box (a relativelayout) is always displayed at the top of the map.</p><pre><code>&lt;RelativeLayout   android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;  &lt;com.google.android.maps.MapView    android:id=""@+id/mapView""/&gt;    &lt;test.project.TransparentPanel       android:layout_width=""fill_parent""      android:layout_width=""fill_parent""&gt;           &lt;Button           android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:text=""Click Me!""/&gt;       &lt;/test.project.TransparentPanel&gt;&lt;/RelativeLayout&gt;   </code></pre><p>(i've left out some things in the code)</p>","401025","","401025","","2011-03-13 12:51:01","2011-03-13 12:51:01","How to place a RelativeLayout at the bottom of a RelativeLayout?","<android><android-linearlayout><relativelayout>","2","0","1","",""
"3492775","1","","","2010-08-16 11:46:32","6","1284","<p>I'm trying to use the Google Data API for an installed application on Android 2.1. I don't want the user to have to enter their credentials if he already has an account configured on the device. Thus, I'm using the AccountManager with Account type ""com.google"".</p><p>But where to go from there? There are no samples from Google on how to do Google authentication (authTokenType etc.). There's a project trying to do it (http://code.google.com/p/google-authenticator-for-android) in a general way but without any success, yet.</p><p>Can it be so hard? This is really keeping back applications like Google Reader clients which have to ask the user for their Google credentials (which hopefully nobody gives them).</p><p>Any pointers/advice is appreciated.</p>","284300","","","","","2012-06-14 23:30:48","Is there an official way to authenticate for Google Data API on Android using AccountManager accounts?","<java><android><api><authentication>","3","0","4","",""
"3492823","1","","","2010-08-16 11:53:09","2","908","<p>I""m trying to set limits to the map view so the user won't be able topan it cyclic.(when panning to the right, instead of the map will cycle, I want itto stop).</p><p>is it possible?</p><p>Ori</p>","258429","","","","","2014-02-25 16:24:17","Google maps - limit panning between longitudes","<android><google-maps><google-maps-api-3>","2","0","","",""
"3493196","1","3493719","","2010-08-16 12:43:41","0","102","<p>is the below mentioned code correct</p><pre><code>public boolean checkRecipe(CharSequence recipename) throws SQLException     {        Cursor checkRecursor=rDb.query(true, DATABASE_TABLE, new String[]{KEY_TITLE},                 KEY_TITLE+""=""+recipename, null, null, null, null, null);        if(checkRecursor!=null)            return true;        else            return false;    }</code></pre><p>I'm trying to check whether a given entry is present in the table or not.  </p>","421730","","","","","2010-08-16 13:46:08","Android - Is this Code correct?","<android>","1","6","","",""
"3493287","1","","","2010-08-16 12:57:49","4","1927","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3683494/android-redirect-outgoing-calls"">Android: Redirect outgoing calls</a>  </p></blockquote><p>The requirement is to replace newly dialed number with another one. I have captured the ACTION_NEW_OUTGOING_CALL event and used Intent.EXTRA_PHONE_NUMBER to get the current outgoing number and then I have used setResultData inside my class(which extends BroadcastReceiver) to replace the dialed number. Basically code is,</p><pre><code>if (Intent.ACTION_NEW_OUTGOING_CALL.equals(action)) {   String phonenbr =     intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);   Log.d(""OutGoingNum"", ""phonenbr is "" + phonenbr);   if (phonenbr.startsWith(""00"")) {    setResultData(""12345678"");   }   }</code></pre><p>My code works fine in Android emulator but on the device the code works only on Redial. It doesnt work when you dial the number via dialpad. Please help. </p>","421740","","950931","","2012-08-21 19:53:40","2012-08-21 19:53:40","Android capture new outgoing call","<java><android><android-intent><broadcastreceiver>","1","0","1","2012-08-22 19:46:03",""
"3493342","1","","","2010-08-16 13:02:36","0","3128","<p>i want to set balloon tips in android google map...please tell me how can we set and display balloon tips ?</p>","421645","","","","","2011-09-16 00:49:50","how can we set balloon tips in android google map?","<android>","2","0","","",""
"3493528","1","3494935","","2010-08-16 13:24:00","0","383","<p>Does anybody know how to determine whether a certain git commit, for example <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=commitdiff;h=6d56b530e189d7213ec77d43d3d8af97fee04179"" rel=""nofollow"">this one</a> from <a href=""http://code.google.com/p/android/issues/detail?id=8676"" rel=""nofollow"">this issue</a>, was rolled into a particular Android release such as <a href=""http://android-developers.blogspot.com/2010/05/android-22-and-developers-goodies.html"" rel=""nofollow"">2.2 Froyo</a>?</p><p>Thanks!</p>","268803","","119963","","2010-08-16 15:47:22","2010-08-16 15:58:53","How to list git commits for Android release?","<android><git><gitweb>","1","8","","",""
"3493561","1","4634733","","2010-08-16 13:28:39","1","627","<p>I have a source that streams wav audio in alaw format which I would like to receive in Android, but Android only supports linear PCM: <a href=""http://developer.android.com/guide/appendix/media-formats.html"" rel=""nofollow"">Android Supported Media Formats</a></p><p>There are a few apps on the market that stream alaw, but I'm not sure how the developers made it happen.  What is the correct approach to adding this functionality?</p>","420474","","420474","","2010-08-16 22:09:40","2011-01-08 16:03:23","How do I stream alaw audio?","<android><wav>","1","0","","",""
"3493605","1","","","2010-08-16 13:33:42","1","2776","<p>I have a big problem using the default SQLite database via JDBC driver.I would like to use ORMLite with this.Let me expose my code: </p><pre><code>String databaseUrl = ""jdbc:sqlite:/data/data/my.package.name/db.sqlite"";Class.forName(""SQLite.JDBCDriver"");DriverManager.getConnection(databaseUrl);dataSource = DatabaseTypeUtils.createSimpleDataSource(databaseUrl);databaseType = DatabaseTypeUtils.createDatabaseType(dataSource);databaseType.loadDriver();UpDao = new UserProfileJdbcDao(databaseType);UpDao.setDataSource(dataSource);UpDao.initialize();</code></pre><p>I downloaded the ormlite2.8.jar (src) and modified the SqliteDatabaseType class so that the private final static String DRIVER_CLASS_NAME = ""SQLite.JDBCDriver"" .However when I imported all of the classes from the ormlite2.8.jar(src) , I found errors concerning the logger, specifically the CommonsLoggingLog and Log4jLog classes.Someone advised my to write my own Logger class that uses the Android logger , but I do not know how to do that.This is the ORMLite I am using for Android : <a href=""http://ormlite.sourceforge.net/sqlite_java_android_orm.html"" rel=""nofollow"">http://ormlite.sourceforge.net/sqlite_java_android_orm.html</a></p><p>I am highly appreciating any help.Thank you in advance.</p><p>Regads, Andrew</p>","421778","","179850","","2011-08-31 13:05:46","2011-10-24 13:06:58","How can I use OrmLite with Android's default SQLite","<java><android><sqlite><ormlite>","2","0","1","",""
"3493667","1","3493703","","2010-08-16 13:40:43","2","9237","<p>I'm create a download manager with listview and it will display the current downloaded by progressbar. May I know how can i update the progressbar?</p><p>for example. i have 3 class. </p><p>""main.class"" = is a listview. </p><p>""mAdapter.class"" = is extends ArrayAdapter.</p><p>""mThread.class"" = implements Runnable to start the download.</p><p>I have google, and found to update the listview, or redrawing the UI should use <code>runOnUIThread</code>. but how can i combine those 3 class together? I have try </p><pre><code>mThread.start(){   main.runOnUIThread(updated);}private updated = new Runnable(){   mAdapter.progressbar.setProgress(downloaded);}</code></pre><p>this 2 method i was put in ""mThread.class"". but it doesn't work. May I know what i was my misstake?</p><p>P/S:I'm sorry about my ugly code and bad english. Hope you guys understand what I'm talking about. Thanks </p>","409419","","","","","2010-08-16 13:44:37","runOnUIThread question","<android><progress-bar>","1","0","","",""
"3493673","1","","","2010-08-16 13:41:05","-1","317","<p>I would like to know</p><ol><li>The Audio Recording can be done within emulator </li><li>It should be stored in some other place but not in SD card.</li></ol>","410871","","21234","","2010-12-08 11:45:35","2010-12-08 11:45:35","Android-Audio Recording","<android><audio><audio-player>","1","0","","",""
"3493922","1","","","2010-08-16 14:09:04","1","115","<p>I've got a view which has an <code>onClickListener</code>, when the user clicks at a certain position I'd like to query the database and then pull data from it. Problem is I can't seem to do this in a view class because it's not an Activity.</p><p>I've tried implementing an <code>OnTouchListener</code> over the Layout in the Activity but it seems the view's layout overrides any attempt to get a touch registering from there.</p><p>So, I've tried a few approaches and they've failed. I'm wondering do any of you guys have any ideas? How would I implement it so that when the user touches the screen, I can retrieve the X Y values and then query the database?</p>","358438","","114066","","2010-08-16 14:12:49","2010-08-16 14:12:49","Making SQLite queries from a view","<android>","1","0","","",""
"3494058","1","3497970","","2010-08-16 14:26:33","0","151","<p>In the Android Mail application, when you click the checkbox next to an inbox message, a little bar with buttons (mark unread, delete, star) appears at the bottom of the screen.  I'd like to do something similar, but I don't think I'm going about it the right way.</p><p>What I've done is add a LinearLayout below my ListView and marked the visibility GONE.  When a user clicks a checkbox next to a list item, the LinearLayout's visibility is marked VISIBLE.  Unfortunately, checkboxes stop working.  By this I mean the skin on the checkbox does not change from unchecked to checked; and I can't figure out why.</p><p>(...or rather, this is the way I HAD it. I removed it once I couldn't fix it and, since trying to add it again, it just crashes, but I digress)</p><p>What is the best way to architect what I'm trying to do?</p>","406790","","114066","","2010-08-16 15:37:40","2010-08-16 22:35:40","Popup bar in Mail application","<android>","1","0","","",""
"3494162","1","3494977","","2010-08-16 14:38:45","5","3479","<p>I have a dialog with a custom layout, and I try to close it when I press a button:</p><pre><code>private void showAboutDialog() {    dialog = new Dialog(MainMenu.this);   dialog.setContentView(R.layout.about_dialog);   dialog.setCancelable(true);   dialog.setTitle(R.string.about_title);   dialog.show();   LayoutInflater inflater = (LayoutInflater)         getApplicationContext().getSystemService(LAYOUT_INFLATER_SERVICE);   View layout = inflater.inflate(R.layout.about_dialog,           (ViewGroup) findViewById(R.id.layout_root));Button closeButton = (Button) layout.findViewById(R.id.about_close_button);closeButton.setOnClickListener(new Button.OnClickListener() {             public void onClick(View view) {        dialog.dismiss();            } });}</code></pre><p>But it doesn't work.</p>","400695","","114066","","2010-08-16 16:13:47","2010-08-16 16:13:47","Dismiss Custom Dialog Problem","<android><dialog>","1","1","","",""
"3494233","1","3494327","","2010-08-16 14:44:09","1","5403","<p>I get the below error message in android.</p><p><strong>Finalizing a Cursor that has not been deactivated or closed. database = /data/data/com.example.Recipie/databases/recipedbase.db, table = recipes, query = SELECT DISTINCT title FROM recipes WHERE title=""Mysore Pa""android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened hereat android.database.sqlite.SQLiteCursor.(SQLiteCursor.java:210)</strong></p><p>I have added this in my code. But Also i get the above message. Kindly help. :)</p><pre><code>@Override    protected void onDestroy()    {        super.onDestroy();        rDbHelper.close();    }</code></pre>","421730","","","","","2012-02-01 02:24:01","How to avoid this message in Android","<android>","2","2","","",""
"3494265","1","","","2010-08-16 14:47:38","2","633","<p>I am trying to setup and global variable, but I my app fails after adding the following line to my AndroidManifest.xml</p><pre><code>&lt;application android:name="".MyApp""              android:icon=""@drawable/icon""               android:label=""@string/app_name""&gt;</code></pre><p>I am using the following code as well:</p><p>Class:    package com.mynamecompany.datahelp;</p><pre><code>import android.app.Application;class MyApp extends Application {      private String myState;      public String getState(){        return myState;      }      public void setState(String s){        myState = s;      }    }</code></pre><p>Usage:</p><pre><code>MyApp appState = ((MyApp)getApplicationContext());String state = appState.getState();Toast.makeText(getApplicationContext(), ""My Value-"" + state, Toast.LENGTH_SHORT).show();appState.setState(""Test"");Toast.makeText(getApplicationContext(), ""My Value-"" + appState.getState(), Toast.LENGTH_SHORT).show();</code></pre><p>The program starts and errors immediately on the Splash screen before the usage code can be called further in the program, on a different Activity.</p><p>Any ideas?               </p>","412317","","114066","","2010-08-17 07:11:03","2010-08-17 07:42:29","Global Variable class not working","<android>","2","3","","",""
"3494338","1","3494563","","2010-08-16 14:55:21","2","954","<p>I'm working on a simple android live wallpaper, I'm following chapter 12 from <em>Hello, Android</em> as my guide. </p><p>The bare-bones of a wallpaper service looks like this:</p><pre><code>public class MyWallpaper extends WallpaperService {    private class MyEngine extends Engine {    //...    }            //...}</code></pre><p>According to the book <code>MyEngine</code> <strong>must</strong> be an inner class of <code>MyWallpaper</code>. I have no reason to dispute this, but the book offers no explanation as to why this must be so. I prefer not to use inner classes purely for stylistic/aesthetic reasons. </p><p>I was wondering if <code>MyEngine</code> actually has to be a private inner class and, if so, why?</p>","130076","","321731","","2013-10-15 17:11:48","2013-10-15 17:11:48","Android - WallpaperService why does my Engine have to be a inner class?","<android><inner-classes><wallpaper>","2","0","","",""
"3494412","1","","","2010-08-16 15:03:34","3","347","<p>I am using a library (ARQ, with Jena), that uses <code>javax.management.ObjectName</code>. Sadly, it appears that the package <code>javax.management</code> is not included in android.</p><p>Has anyone else faced (and successfully bypassed) this issue? Pointers will be deeply appreciated.</p><p>Thanks.</p>","20386","","","","","2012-10-25 12:41:17","javax.management in Android","<java><android><jena>","1","2","","",""
"3494476","1","4275812","","2010-08-16 15:10:13","5","2683","<p>I'm playing around with some keyboard development and try to show a pop-up dialog when a certain key is pressed</p><pre><code>if (primaryCode == -301) {            AlertDialog mDialog = new AlertDialog.Builder(CONTEXT)            .setTitle(""My dialog"")            .setMessage(""Lets do it."")            .setPositiveButton(""ok"", null).create();             mDialog.show();}</code></pre><p>However, the problem is the <code>CONTEXT</code> part. In a normal application it would just be <code>this</code>. I also tried <code>getApplicationContext()</code> and <code>getBaseContext()</code>, but neither of those works -> keyboard crashes.</p><blockquote>  <p>android.view.WindowManager$BadTokenException:  Unable to add window -- token null is  not for an application</p></blockquote><p>So I'm wondering if I have to do something with <a href=""http://developer.android.com/reference/android/view/inputmethod/InputConnection.html"">InputConnection</a>:</p><blockquote>  <p>The InputConnection interface is the  communication channel from an  InputMethod back to the application  that is receiving its input. It is  used to perform such things as reading  text around the cursor, committing  text to the text box, and sending raw  key events to the application.</p></blockquote><p>So far I wasn't able to figure out how. I definitely know it's possible, since I have seen it before. I someone could point me in the right direction that would definitely be appreciated.</p><hr><p><strong>Update:</strong></p><p>To provide a better picture of what I try to achieve I uploaded a screenshot of the Swype keyboard, which does exactly that: showing a pop-up dialog when a special key gets pressed on the keyboard.</p><p><img src=""http://i.stack.imgur.com/r6Dro.png"" alt=""Swype pop-up dialog""></p>","184367","","184367","","2010-08-17 12:54:01","2011-09-15 17:39:15","Android IME: how to show a pop-up dialog?","<android><keyboard><ime>","5","1","","",""
"3494522","1","4309776","","2010-08-16 15:15:08","1","1337","<p>I'm trying to insert a new contact into the Androids contact list. Adding a name and phone numbers works fine, but adding an email address doesn't work. My code:</p><pre><code>//name is a string//phone and email are string arraysContentValues values = new ContentValues();values.put(People.NAME, name);Uri newPerson = People.createPersonInMyContactsGroup(cr, values);if (newPerson != null) {    for (i=0; i&lt;phone.length; i++) {        Log.i(""Phone"",""""+phone[i]);        values.clear();        Uri mobilesUri = Uri.withAppendedPath(newPerson,People.Phones.CONTENT_DIRECTORY);        values.put(People.Phones.NUMBER,phone[i]);        values.put(People.Phones.TYPE,People.Phones.TYPE_MOBILE);        Uri phonesUpdate = cr.insert(mobilesUri, values);    }    for (i=0; i&lt;email.length; i++) {        Log.i(""Email"",""""+email[i]);        values.clear();        Uri emailUri = Uri.withAppendedPath(newPerson,People.ContactMethods.CONTENT_DIRECTORY);        values.put(People.ContactMethods.KIND,People.ContactMethods.KIND_EMAIL);        values.put(People.ContactMethods.TYPE,People.ContactMethods.TYPE_HOME);        values.put(People.ContactMethods.DATA,email[i]);        Uri emailUpdate = cr.insert(emailUri, values);    }}</code></pre><p>I get an error in this line:</p><pre><code>values.put(People.ContactMethods.KIND,People.ContactMethods.KIND_EMAIL);</code></pre><p>of</p><blockquote>  <p>error: cannot find symbol</p></blockquote><p>Edit: I forgot to mention I use <a href=""http://en.wikipedia.org/wiki/Xcode"" rel=""nofollow"">Xcode</a>/<a href=""http://en.wikipedia.org/wiki/Apache_Ant"" rel=""nofollow"">Ant</a> and revision 8 (2.2 (<a href=""http://en.wikipedia.org/wiki/Android_%28operating_system%29#Version_history"" rel=""nofollow"">Froyo</a>)).</p>","364727","","21234","","2012-02-18 13:14:47","2012-02-18 13:14:47","Android add contact email","<android><contacts>","2","2","1","",""
"3494548","1","3494992","","2010-08-16 15:19:06","0","67","<p>Trying to assign a key to each field in android to reference in Java.</p>","421885","","","","","2010-08-16 16:04:38","How do I create a specific key for each control on a form in Android?","<java><android><xml>","1","1","","",""
"3494674","1","","","2010-08-16 15:30:58","0","7022","<p>How can I find the IP address of the an HTC incredible connected to Verizon's network? My other question - do I have to make any changes to my App to run it on a cellular network? Till now the App was running on a Nexus One connected to a local Wi-Fi network.</p><p>Thanks. </p>","306346","","306346","","2010-08-16 16:08:05","2013-10-15 19:02:55","How to find the IP Address of HTC Incredible on a CDMA Network","<android><networking><ip-address><wifi><cdma>","4","0","","",""
"3494755","1","3503803","","2010-08-16 15:37:47","1","1205","<p>i try to build an https client for android and i need do get some request of an Servletbut when i use the getInputStream method the applicaion hangs.</p><p>There is no error only hanging when i call the method.</p><pre><code>    String url = ""https://.../Servlet"";  try {   mPushLiteConnection = (HttpsURLConnection) new URL(url).openConnection();   mPushLiteConnection.setDoOutput(true);   mPushLiteConnection.setDoInput(true);   mPushLiteConnection.setRequestMethod(""POST"");   mPushLiteConnection.connect();   subscribe();   InputStream in = (InputStream)mPushLiteConnection.getInputStream();   unsubscribe();   mPushLiteConnection.disconnect();  } catch (MalformedURLException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }</code></pre><p>this is only to check the call, but it didtn work.Any idea why it hangs and tell me nothing?</p><p>the subscribe method works, when i comment out the line with the inputstream, the server show me all is correct.I can try the same with the Firefox and it works and i can see the request.</p><p>i also put the keystore into the TrustManager.</p><p>sorry for my english i hope i explain it ennougth.</p><p>THX</p>","421901","","","","","2010-08-17 14:57:27","httpsURLConnection.getInputStream() hangs","<android><https>","2","2","","",""
"3494763","1","","","2010-08-16 15:38:26","5","692","<p>To anyone who has implemented Android Licensing Verification Library</p><p>When you tested the following server response codes, did you get these two individual responses or did you get the NOT_LICENSED response code?ERROR_CONTACTING_SERVER and ERROR_CONTACTING_FAILURE</p><p>It appears that I am not getting ERROR_CONTACTING_SERVER and ERROR_CONTACTING_FAILURE.</p><p>Please tell me about your experience testing these two codes.</p><p>Thanks!</p>","291981","","","","","2011-01-17 12:10:49","Android Licensing Verification Library server response codes","<android>","1","0","","",""
"3494829","1","","","2010-08-16 15:47:12","0","112","<p>For example, is there any way to define a service to run as 'system' UID or GID?</p><p>Or any way to add your app to the 'system' group?</p>","421152","","","","","2010-08-16 21:00:54","In Android, how to execute a service as a different user?","<android>","1","6","","",""
"3494871","1","3502976","","2010-08-16 15:52:13","1","4773","<p>There does not seem to be any Android manifest permission that needs to be set for file io.</p><pre><code>public class Device extends Activity {    private static final Configuration config = new Configuration();    ...    private boolean applyMenuChoice(MenuItem item) {        switch (item.getItemId()) {        ...        case R.id.menuSave:            ...            configuration.modify(name, to, from, user);            configuration.write();            ...public class Configuration extends Activity {    private final static String CONFIG = ""config.txt"";    private static StringBuilder config = new StringBuilder();    ...    public void write() {        try {            FileOutputStream fos = openFileOutput(CONFIG, Context.MODE_PRIVATE);            fos.write(config.toString().getBytes());            ...</code></pre>","398460","","398460","","2010-08-16 18:21:11","2012-03-08 20:16:12","Why does this Android FileOutputStream throw a NullPointerException?","<android><nullpointerexception><fileoutputstream>","3","7","","",""
"3495186","1","3495315","","2010-08-16 16:29:31","1","243","<p>In android app, i want to send a php requeset, and am expecting a response in the form of xml, from the server.</p><p>Can anybody provide pointers in this case.</p>","419685","","","","","2010-08-17 01:37:08","Xml parsing in android","<android>","3","1","","",""
"3495301","1","","","2010-08-16 16:43:15","16","3629","<p>In general, I'm very impressed with Android's default text to speech engine (i.e., com.svox.pico).  As expected, it mispronounces some words (as do I) and it therefore occasionally needs some pronunciation guidance.  So I'm wondering about best practices for phonetically spelling out those words that the pico TTS engine mispronounces.</p><p>For example, the correct pronunciation of the bird Chachalaca is CHAH-chah-LAH-kah.  Here is what the TTS engine produces:</p><pre><code>mTts.speak(""Chachalaca"", TextToSpeech.QUEUE_ADD, null); // output: chuh-KAL-uh-KUHmTts.speak(""CHAH-chah-LAH-kah"", TextToSpeech.QUEUE_ADD, null); // output: CHAH-chah-EL-AY-AYCH-dash-kuhmTts.speak(""CHAHchahLAHkah"", TextToSpeech.QUEUE_ADD, null); // output: CHA-chah-LAH-kamTts.speak(""CHAH chah LOCKah"", TextToSpeech.QUEUE_ADD, null); // output: CHAH-chah-LAH-kah</code></pre><p>Here are my questions.</p><p><b></p><ul>  <li>Is there a standard phonetic spelling recognized by the Android TTS engine?</li>  <li>If not, are there some general rules for making custom pronunciation spellings that will make the spellings more likely to be correct in future TTS engines/versions?</li>  <li>It appears that the Android TTS engine ignores text case.  What is the best way to specify emphasis?</li></ul><p></b></p><p>By the way, this is what the TTS engine writes to logcat:</p><p>V/TtsService(  294): TTS processing: CHAH chah LOCKah<br>V/TtsService(  294): TtsService.setLanguage(eng, USA, )<br>I/SVOX Pico Engine(  294): Language already loaded (en-US == en-US)<br>I/SynthProxy(  294): setting speech rate to 100<br>I/SynthProxy(  294): setting pitch to 100  </p><p>[UPDATE]</p><p>I tried passing an XML document to TextToSpeech.speak() as follows:</p><pre><code>            String text = ""&lt;?xml version=\""1.0\""?&gt;"" +                ""&lt;speak version=\""1.0\"" xmlns=\""http://www.w3.org/2001/10/synthesis\"" "" +                    ""xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\"" "" +                    ""xsi:schemaLocation=\""http://www.w3.org/2001/10/synthesis "" +                        ""http://www.w3.org/TR/speech-synthesis/synthesis.xsd\"" "" +                    ""xml:lang=\""en-US\""&gt;"" +                    ""That is a big car! "" +                    ""That &lt;emphasis&gt;is&lt;/emphasis&gt; a big car! "" +                    ""That is a &lt;emphasis&gt;big&lt;/emphasis&gt; car! "" +                    ""That is a huge bank account! "" +                    ""That &lt;emphasis level=\""strong\""&gt;is&lt;/emphasis&gt; a huge bank account! "" +                    ""That is a &lt;emphasis level=\""strong\""&gt;huge&lt;/emphasis&gt; bank account!"" +                ""&lt;/speak&gt;"";            mTts.speak(text, TextToSpeech.QUEUE_ADD, null);</code></pre><p>As Android Eve suggested, the TTS engine read only the XML body (i.e., the comments about the big car and the huge bank account).  I didn't realize the TTS engine was capable of parsing XML documents.  However, I did not hear any emphasis in the TTS output.</p><p>[UPDATE 2]</p><p>I simplified the question to whether or not Android TTS supports Speech Synthesis Markup Language <a href=""http://stackoverflow.com/questions/3525424/does-android-tts-support-speech-synthesis-markup-language"">here</a>.</p>","411972","","168868","","2012-01-01 21:36:24","2012-01-01 21:36:24","best practice for specifying pronunciation for Android TTS engine?","<android><text-to-speech><ssml>","2","0","7","",""
"3495475","1","","","2010-08-16 17:07:14","6","1040","<p>A lot of new Android applications I've been seeing are using a <a href=""http://developer.android.com/guide/practices/ui_guidelines/widget_design.html#trick"">noise effect</a> on their backgrounds, usually a gradient. What interesting is that some applications use radiel gradients throughout their application with this effect, which would require a lot of disk space for the images. Now Android has GradientDrawable which can create gradients very easily. I was thinking about creating the noise effect programmatically.</p><p>Has anyone else done this before and if so, how did you go about it? Did you just use an image or write your own custom noise overlay?</p>","421978","","","","","2011-03-01 09:34:41","Noise effect on Android background","<java><android><user-interface><graphics><noise>","1","1","1","",""
"3495519","1","","","2010-08-16 17:14:47","1","1103","<p>I have a Gallery view created with a SimpleAdapter that extends BaseAdapter. It contains more items than what it can fit in the screen. </p><p>So I'm using Gallery.getFirstVisiblePosition() and Gallery.getLastVisiblePosition() to get the first and last visible position. But these functions doesn't always return the correct values especially after setting the selected position by calling mGallery.setSelection() followed by a SimpleAdapter.notifyDataChanged() call. Most of the time it getFirstVisiblePosition() returns 0 even if the first element is not visible. </p><p>Also note that the no. of visible items in Gallery is different in portrait and landscape mode. The value returned by getFirstVisiblePosition() look correct in landscape but is returned wrong in portrait mode.</p><p>Anyone has any thoughts/ideas?</p><p>Thanks!</p>","421969","","","","","2010-08-16 17:48:06","getFirstVisiblePosition() returns wrong value in Gallery View","<android><android-listview>","1","0","","",""
"3495730","1","3580436","","2010-08-16 17:40:57","3","1441","<p>I have been trying this for hours without success.</p><p><a href=""http://replicaisland.googlecode.com/svn/trunk/"" rel=""nofollow"">http://replicaisland.googlecode.com/svn/trunk/</a></p><p>I have added the repository and successfully downloaded the project into the workspace using the option ""check out as a project in the workspace"" calling it replicaisland.  I tired using the option ""check out as project using the New Configuration Wizard"" but when I selected and android project I had to enter details that I don't yet have.  </p><p>I right click on the project and select ""convert to Android project"" which gives me an error</p><pre><code>Errors occurred during the build.  Errors running builder 'Android Resource Manager' on project 'replicaisland'.  Path must include project and resource name: /replicaisland  Path must include project and resource name: /replicaisland</code></pre>","248521","","248521","","2010-08-17 03:59:06","2011-12-29 01:02:51","Error converting replicasisland from SVN in Eclipse to an Android Project","<android>","2","0","1","",""
"3495859","1","3495894","","2010-08-16 17:56:25","1","1875","<p>I have the following layout in XML (splashscreen.xml):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""   android:id=""@+id/frmLayout"" android:layout_width=""fill_parent""   android:layout_height=""fill_parent""&gt;    &lt;ImageView       android:id=""@+id/splash""       android:src=""@drawable/splash""       android:layout_width=""fill_parent"" android:layout_height=""fill_parent""       android:scaleType=""fitXY"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>SplashScreen.java:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.splashscreen);    // more code...}</code></pre><p>When I try to execute it in Android 1.5 (executes correctly in all other versions) I get these errors:</p><pre><code>08-16 19:24:04.569: ERROR/AndroidRuntime(1002): Uncaught handler: thread main exiting due to uncaught exception08-16 19:24:04.619: ERROR/AndroidRuntime(1002): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.project/com.project.SplashScreen}: android.view.InflateException: Binary XML file line #5: Error inflating class java.lang.reflect.Constructor08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.os.Handler.dispatchMessage(Handler.java:99)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.os.Looper.loop(Looper.java:123)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.app.ActivityThread.main(ActivityThread.java:3948)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at java.lang.reflect.Method.invokeNative(Native Method)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at java.lang.reflect.Method.invoke(Method.java:521)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at dalvik.system.NativeStart.main(Native Method)08-16 19:24:04.619: ERROR/AndroidRuntime(1002): Caused by: android.view.InflateException: Binary XML file line #5: Error inflating class java.lang.reflect.Constructor08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.view.LayoutInflater.createView(LayoutInflater.java:512)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:309)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.app.Activity.setContentView(Activity.java:1626)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at com.project.SplashScreen.onCreate(SplashScreen.java:34)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     ... 11 more08-16 19:24:04.619: ERROR/AndroidRuntime(1002): Caused by: java.lang.reflect.InvocationTargetException08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.widget.ImageView.&lt;init&gt;(ImageView.java:103)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at java.lang.reflect.Constructor.constructNative(Native Method)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.view.LayoutInflater.createView(LayoutInflater.java:499)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     ... 22 more08-16 19:24:04.619: ERROR/AndroidRuntime(1002): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/title_bar_shadow.9.png from drawable resource ID #0x7f02002108-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.content.res.Resources.loadDrawable(Resources.java:1641)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.content.res.TypedArray.getDrawable(TypedArray.java:548)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.widget.ImageView.&lt;init&gt;(ImageView.java:113)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     ... 26 more08-16 19:24:04.619: ERROR/AndroidRuntime(1002): Caused by: java.io.FileNotFoundException: res/drawable/title_bar_shadow.9.png08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.content.res.AssetManager.openNonAssetNative(Native Method)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.content.res.AssetManager.openNonAsset(AssetManager.java:392)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     at android.content.res.Resources.loadDrawable(Resources.java:1634)08-16 19:24:04.619: ERROR/AndroidRuntime(1002):     ... 28 more08-16 19:25:39.511: ERROR/AndroidRuntime(1045): Uncaught handler: thread main exiting due to uncaught exception</code></pre><p>Line 5 corresponds to <em>ImageView</em> line. Do you have any idea why my program executes in all Android versions except 1.5?</p><p>Thanks!</p>","100272","","100272","","2010-08-16 18:06:06","2010-08-16 18:06:06","Error inflating basic framelayout only in Android 1.5","<android><layout>","1","0","","",""
"3495890","1","3496042","","2010-08-16 18:00:58","116","71605","<p>I've searched around for solutions to this problem, and the only answer I can find seems to be ""<a href=""http://androidforums.com/android-developers/6844-using-listview-scrollview.html"">don't put a ListView into a ScrollView</a>"".  I have yet to see any real explanation for <em>why</em> though.  The only reason I can seem to find is that Google doesn't think you should want to do that.  Well I do, so I did.</p><p>So the question is, how can you place a ListView into a ScrollView without it collapsing to its minimum height?</p>","205192","","","","","2014-03-31 00:37:21","How can I put a ListView into a ScrollView without it collapsing?","<android><listview><scrollview>","15","11","58","",""
"3496036","1","3496168","","2010-08-16 18:18:54","1","10540","<p>I have some objects which I draw onto a Canvas as part of a SurfaceView. I want to be able to rotate these programmatically, e.g. <code>myParticle.setRotation(90);</code> Here's my (simplified) code to draw the Particle at the moment:</p><pre><code>public class Particle {  public void draw(Canvas canvas){    image.setBounds((int)(xPos), (int)(yPos), (int)(xPos+radius), (int)(yPos+radius));    image.draw(canvas);  }}</code></pre>","319618","","","","","2013-03-18 07:41:18","Rotate Bitmap on Android Canvas","<android>","2","1","1","",""
"3496092","1","","","2010-08-16 18:26:16","0","6116","<p>When this displays the first two rows of the listview appear under the tabs, the Mercury, and Venus planets.  How do I get the tabs to occupy the top and the listview rows to start after the tabs?</p><p><em><strong>tablistmenu.xml:</em></strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/tabhost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;            &lt;TextView                 android:id=""@+id/textview1""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                 android:text="""" /&gt;            &lt;TextView                 android:id=""@+id/textview2""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                 android:text="""" /&gt;            &lt;TextView                 android:id=""@+id/textview3""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                 android:text="""" /&gt;            &lt;TextView                 android:id=""@+id/textview4""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                 android:text="""" /&gt;        &lt;/FrameLayout&gt;     &lt;/LinearLayout&gt;         &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;&lt;ListView android:id=""@+id/lstMain"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ListView&gt;    &lt;/LinearLayout&gt;   &lt;/TabHost&gt;</code></pre><p><em><strong>tablistmenu.java:</em></strong></p><pre><code>public class tablistmenu extends TabActivity {    private ListView mainListView ;        private ArrayAdapter&lt;String&gt; listAdapter ;       public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          requestWindowFeature(Window.FEATURE_NO_TITLE);         setContentView(R.layout.tablistmenu);          TabHost mTabHost = getTabHost();          mTabHost.addTab(mTabHost.newTabSpec(""tab_test1"").setIndicator(""Contacts"", getResources().getDrawable(R.drawable.contact_32)).setContent(R.id.textview1));          mTabHost.addTab(mTabHost.newTabSpec(""tab_test2"").setIndicator(""Credit Cards"", getResources().getDrawable(R.drawable.credit_card_32)).setContent(R.id.textview2));          mTabHost.addTab(mTabHost.newTabSpec(""tab_test3"").setIndicator(""Notes/Misc"", getResources().getDrawable(R.drawable.notes_32)).setContent(R.id.textview3));          mTabHost.addTab(mTabHost.newTabSpec(""tab_test4"").setIndicator(""Websites"", getResources().getDrawable(R.drawable.globe_32)).setContent(R.id.textview4));          mTabHost.setCurrentTab(0);             // Find the ListView resource.                mainListView = (ListView) findViewById( R.id.lstMain);               // Create and populate a List of planet names.               String[] planets = new String[] { ""Mercury"", ""Venus"", ""Earth"", ""Mars"",                                                 ""Jupiter"", ""Saturn"", ""Uranus"", ""Neptune""};                 ArrayList&lt;String&gt; planetList = new ArrayList&lt;String&gt;();               planetList.addAll( Arrays.asList(planets) );               // Create ArrayAdapter using the planet list.              listAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.simplerow, planetList);               // Set the ArrayAdapter as the ListView's adapter.               mainListView.setAdapter( listAdapter );           // End       }       }         }</code></pre><p>thanks,Dean</p>","412317","","","","","2012-05-07 08:14:56","Listview items appear under tab in tabview","<android><android-widget>","2","0","","",""
"3496137","1","3496589","","2010-08-16 18:33:50","6","6225","<p>I have a ListView backed by a custom adapter based on a CursorAdapter.</p><p>The cursor I give it is based on a list of Notes in the database (each note is a DB row).</p><p>Everything works just fine until I delete a note from the database.  I'm not sure how to properly update the cursor/adapter/listview to display the new data.</p><p>I've read conflicting posts on using <code>adapter.notifyDataSetChanged()</code> vs <code>cursor.requery()</code> to refresh the UI, but neither of them seems to work in this case.  The only way I've been able to refresh it is by creating a new cursor from a new query and calling <code>adapter.changeCursor(newCursor)</code>.</p><p>Could someone demonstrate the proper way to update the backing data and then the UI (with psuedocode if possible).</p>","131871","","135152","","2011-07-05 17:54:13","2011-08-18 08:55:22","How to update a CursorAdapter tied to listview when number of items changes?","<android><listview><android-listview>","2","0","","",""
"3496191","1","3496235","","2010-08-16 18:40:36","20","19912","<p>Should I learn Java before learning Android or I can do both things in parallel? What is the best approach?</p>","397991","","","","","2012-10-03 19:44:06","Should I learn Java before learning Android","<java><android>","6","4","14","2012-10-03 19:59:07",""
"3496269","1","3496310","","2010-08-16 18:50:27","183","137345","<p>Is it possible to draw a border around a textview?</p>","69983","","","","","2014-04-06 20:40:34","how to put a border around an android textview","<android><textview>","6","0","52","",""
"3496540","1","3496655","","2010-08-16 19:22:38","1","4795","<p>I do an import of the full package name / java file, and if I do a <code>&lt;classname&gt;.&lt;method&gt;</code>, SOMETIMES I can get it to access - other times I get a lot of <code>can't use a static in a non static</code> bunch of talk.</p><p>I'll admit I'm new to Java, so what do I need to do?  Call a class instance first, then call my methods?   I'm rather confused by this, as I want to put all of my 'functions' into a FunctionsList.java file, and all of my main Activity (UI) into a MyActivity.java file.</p><p>For example:</p><pre><code>&lt;MyActivity.java&gt;import com.example.FunctionsList;private class MyActivity extends Activity {  FunctionsList.function();}</code></pre><p>9/10 times I get that static/non-static error.</p><p>If I put all of my functions into MyActivity.java, I have zero problems!   Anyone help me on what I presume is a basic Java newbie issue?</p>","421152","","185722","","2010-08-16 21:30:18","2010-08-16 21:30:18","Android / Java - How do I call upon a function in a separate *.java file?","<java><android>","2","4","2","",""
"3496548","1","3497368","","2010-08-16 19:23:36","1","352","<p>I'm looking for a way to grab trackball events while the screen is off, preferrably on a N1. I'm building my own music player and would love to add the feature to skip songs by trackball press, without having to unlock my device everytime.</p><p>I've found <a href=""http://forum.xda-developers.com/showthread.php?t=645481"" rel=""nofollow"">TrackBallSkip</a>, however the source code has been taken down and integrated into CyanogenMod. I fear that I may need to do something exotic to my phone (root it, mod it, whatever). While this isn't a problem, I would be happier if I could freely share my Music player.</p><p>Can anyone confirm that I'll need to mod the home to get access to this functionality? Or can I just straight code it (if so, any pointers in the right direction would be amazing). </p><p>Thanks!</p>","365873","","","","","2010-08-16 21:07:45","Android trackball events while screen is off","<android><trackball>","1","2","","",""
"3496635","1","3496796","","2010-08-16 19:33:13","4","2703","<p>I've tried to view the db file from the File Explorer in Eclipse but I can't open the file or copy it to another location to open. I don't have a rooted phone so I was trying to view the db from the app on my emulator.  If someone could help it would be greatly appreciated as I find it hard to find much info on this subject for some reason. Thanks!</p>","394241","","","","","2010-08-16 19:52:09","How can I view my Android Apps database information?","<android><database><view><emulator>","1","0","1","",""
"3496720","1","3496821","","2010-08-16 19:43:25","9","12648","<p>There are an EditText and a TextView in my Activity. I want to set focus on the TextView when the Activity starts. I used the following code:</p><pre><code>    TextView myTextView = (TextView) findViewById(R.id.my_text_vew);    myTextView.setFocusable(true);    myTextView.setOnClickListener(this);    myTextView.requestFocus();</code></pre><p>But the code doesn't work. The EditText always receives focus when the activity starts.</p><p>Can anyone help?</p><p>Thanks.</p>","256239","","","","","2012-09-25 21:00:56","How to set focus on a TextView when an Activity starts?","<android>","2","0","5","",""
"3496769","1","","","2010-08-16 19:49:21","0","1807","<p>I'm trying to determine the current ringer state by using the getRingerMode() method.</p><p><strong>I create a variable:</strong> private int currentRingerMode;</p><p><strong>Set my variable to:</strong> currentRingerMode = getRingerMode();</p><p><strong>And use a methods as follows:</strong><br>private int getRingerMode() {        // TODO Auto-generated method stub        return currentRingerMode;    }</p><p><strong>But when I log the value of the variable with:</strong>      Log.v(TAG, ""value="" + currentRingerMode);</p><p>A value of 0 is always returned, regardless of the the ringer state...??? What am I doing wrong?</p><p>Thanks.</p><p>-Brian</p><hr><p>-UpdateHere is my current full code.</p><pre><code>package com.DoNotDisturb.widget;</code></pre><p>import com.DoNotDisturb.widget.R;</p><p>import android.app.PendingIntent;import android.app.Service;import android.appwidget.AppWidgetManager;import android.appwidget.AppWidgetProvider;import android.content.Context;import android.content.ContextWrapper;import android.content.Intent;import android.media.AudioManager;import android.util.Log;import android.widget.RemoteViews;import android.widget.Toast;</p><p>public class DoNotDisturbWidget extends AppWidgetProvider {</p><pre><code>private static final String ACTION_WIDGET_RECEIVER = ""ActionRecieverWidget"";private static final String TAG = null;private int currentRingerMode;private int ringerMode;private RemoteViews views = new RemoteViews(""com.DoNotDisturb.widget"", R.layout.main);  private AudioManager getSystemService(String audioService) {    // TODO Auto-generated method stub    return null;    }@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    Intent intent = new Intent(context, DoNotDisturbWidget.class);    intent.setAction(ACTION_WIDGET_RECEIVER);    PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0);    views.setOnClickPendingIntent(R.id.button_one, pendingIntent);    appWidgetManager.updateAppWidget(appWidgetIds, views);    AudioManager mAudioManager = (AudioManager) getSystemService(Service.AUDIO_SERVICE);     int ringerMode = mAudioManager.getRingerMode();    Log.d(TAG, ""ringerMode value="" + ringerMode);    ContextWrapper mContext = null;    AudioManager manager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);    currentRingerMode = manager.getRingerMode();    Log.d(TAG, ""ringerMode value="" + currentRingerMode);}   @Overridepublic void onReceive(Context context, Intent intent) {    if (intent.getAction().equals(ACTION_WIDGET_RECEIVER)){        Log.d(TAG, ""ringerMode value="" + ringerMode);        try {            //Silent            if(currentRingerMode == 2){            Toast.makeText(context, ""Silent"", Toast.LENGTH_SHORT).show();            ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE)).setRingerMode(AudioManager.RINGER_MODE_SILENT);            Log.v(TAG, ""After ButtonPress value="" + currentRingerMode);            }            //Vibrate                if(currentRingerMode == 1){                Toast.makeText(context, ""Normal"", Toast.LENGTH_SHORT).show();                ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE)).setRingerMode(AudioManager.RINGER_MODE_NORMAL);                Log.v(TAG, ""After ButtonPress value="" + currentRingerMode);                 }            //Normal Mode            if(currentRingerMode == 0){                Toast.makeText(context, ""Silent"", Toast.LENGTH_SHORT).show();                ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE)).setRingerMode(AudioManager.RINGER_MODE_SILENT);                Log.v(TAG, ""After ButtonPress value="" + currentRingerMode);             }        }        finally{}     }    super.onReceive(context, intent);}</code></pre><p>}</p>","416530","","416530","","2010-08-19 12:12:48","2011-07-07 16:27:54","getRingerMode () always returns a value of 0","<android>","1","0","1","",""
"3496806","1","","","2010-08-16 19:53:31","3","869","<p>I have seen 2 methods so far in my search, both of which I am having trouble with.</p><p>Method 1)</p><pre><code>Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 100);</code></pre><p>Method 2) </p><pre><code>IHardwareService hardware = IHardwareService.Stub.asInterface(ServiceManager.getService(""hardware""));hardware.setScreenBacklight(.5);</code></pre><p>Which of these methods is correct? Or is there another that I should be using?</p><p>Thanks</p>","423405","","","","","2011-03-13 04:12:29","What is the proper way to dim the screen?","<android>","1","1","4","",""
"3496834","1","","","2010-08-16 19:56:30","4","1290","<p>On the topic of included standard icons the <a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design.html"" rel=""nofollow"">Android documentation</a> mentions that: </p><blockquote>  <p>Shown below are standard menu icons  that are used in the Android system.  Because these resources can change  between platform versions, you should  not reference the system's copy of the  resources. If you want use any icons  or other internal drawable resources,  you should store a local copy of those  icons or drawables in your application  resources, then reference the local  copy from your application code. In  that way, you can maintain control  over the appearance of your icons,  even if the system's copy changes.  Note that the list below is not  intended to be complete.</p></blockquote><p>In my application I'm using such standard icons such as ""ic_menu_sort_alphabetically"" and thus I've tried to find these icons, so that I can include them in my application.</p><p>However, in ""android-sdk/platforms/android-8/android.jar"" I only find the icons in drawable-mdpi and in drawable-hdpi - there is neither a default drawable folder with icons, nor a drawable-ldpi folder with low-resolution versions of these icons. However, such a low-resolution version would be required to provide native versions on ldpi devices such as the HTC Wildfire.</p><p>Are there any ""official"" versions of the Android icons scaled at ldpi? While it's likely that the ldpi versions are stored somewhere on my HTC Wildfire device, I assume that they are copyrighted by HTC and not under the same open-source license as the icons in the Android distribution.</p>","422055","","","","","2010-08-17 11:47:38","Low-resolution (ldpi) Android icons","<android><icons>","1","0","2","",""
"3496903","1","3514698","","2010-08-16 20:05:42","3","7161","<p>I am following the Parcelable example in the Android developer guide with the intention of having a more complex object that I send to different activities.  Right now, my class is a wrapper of a String member.   If I put the object in the intent and read it back from the Intent it reads as expected, however, on the receiver side, it is always null-pointer.</p><p>My class:</p><pre><code>package com.mobibob.android.myapp;import android.os.Parcel;import android.os.Parcelable;public class ContentItem implements Parcelable {    public String name = ""name"";    public static final String EXTRA_CONTENT_DETAIL = ""contentDetail"";    ContentItem(String n) {        name = n;    }    ContentItem(Parcel in) {            in.readParcelable(ContentItem.class.getClassLoader());  &lt;--- NEW CODE        name = in.readString();    }    @Override    public String toString() {        return name.toString();    }    @Override    public int describeContents() {        return 0;    }    @Override    public void writeToParcel(Parcel dest, int flags) {        dest.writeString(name);    }    public final Parcelable.Creator&lt;ContentItem&gt; CREATOR = new Parcelable.Creator&lt;ContentItem&gt;() {        public ContentItem createFromParcel(Parcel in) {        return new ContentItem(in);        }        public ContentItem[] newArray(int size) {        return new ContentItem[size];        }    };}</code></pre><p>My setup of intent / read-back / startActivity:</p><pre><code>    ContentItem ci = new ContentItem(""mobibob"");// Launch ...Intent i = new Intent(getApplicationContext(), ContentDetailActivity.class);i.putExtra(ContentItem.EXTRA_CONTENT_DETAIL, ci);ContentItem readbackCi = i.getParcelableExtra(ContentItem.EXTRA_CONTENT_DETAIL);Log.d(TAG, ""\n\n\t"" + readbackCi.name);startActivity(i);</code></pre><p>My receiving activity:</p><pre><code>package com.mobibob.android.myapp;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.widget.TextView;public class ContentDetailActivity extends Activity {    public static final String TAG = ""ContentDetailActivity"";    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);        setContentView(R.layout.content_detail);        try {            Intent i = getIntent();            Log.d(TAG, ""intent: "" + i.toString());            Log.d(TAG, ""extras: "" + i.getExtras());            ContentItem ci = (ContentItem) i.getParcelableExtra(ContentItem.EXTRA_CONTENT_DETAIL);            Log.d(TAG, ""content-item: "" + ci.toString());            ((TextView) findViewById(R.id.name_of_content)).setText(ci.name);        } catch (Exception e) {            Log.d(TAG, e.toString());    }    }}</code></pre><p>My log:</p><pre><code>08-16 15:03:40.121 I/HomeActivity( 9840): onItemClick - AdapterView (pos=1 id=1)08-16 15:03:40.121 D/HomeActivity( 9840): 08-16 15:03:40.121 D/HomeActivity( 9840): 08-16 15:03:40.121 D/HomeActivity( 9840):   Rock/Pop08-16 15:03:40.131 I/ActivityManager( 1186): Starting activity: Intent { cmp=com.mobibob.android.myapp/.ContentDetailActivity (has extras) }08-16 15:03:40.341 D/ContentDetailActivity( 9840): intent: Intent { cmp=com.mobibob.android.myapp/.ContentDetailActivity (has extras) }08-16 15:03:40.341 D/ContentDetailActivity( 9840): extras: Bundle[mParcelledData.dataSize=148]08-16 15:03:40.351 D/ContentDetailActivity( 9840): java.lang.NullPointerException08-16 15:03:40.653 I/ActivityManager( 1186): Displayed activity com.mobibob.android.myapp/.ContentDetailActivity: 336 ms (total 336 ms)</code></pre><p>My stack backtrace:</p><pre><code>08-16 17:19:52.170 I/HomeActivity( 3147): onItemClick - AdapterView (pos=3 id=3)08-16 17:19:52.170 D/HomeActivity( 3147): 08-16 17:19:52.170 D/HomeActivity( 3147): 08-16 17:19:52.170 D/HomeActivity( 3147):   mobibob08-16 17:19:52.170 I/ActivityManager( 1202): Starting activity: Intent { cmp=com.mobibob.android.myapp/.ContentDetailActivity (has extras) }08-16 17:19:52.410 D/ContentDetailActivity( 3147): intent: Intent { cmp=com.mobibob.android.myapp/.ContentDetailActivity (has extras) }08-16 17:19:52.410 D/ContentDetailActivity( 3147): extras: Bundle[mParcelledData.dataSize=144]08-16 17:19:52.410 D/ContentDetailActivity( 3147): java.lang.NullPointerException08-16 17:19:52.410 W/System.err( 3147): java.lang.NullPointerException08-16 17:19:52.420 W/System.err( 3147):     at java.lang.reflect.Field.getField(Native Method)08-16 17:19:52.420 W/System.err( 3147):     at java.lang.reflect.Field.get(Field.java:247)08-16 17:19:52.420 W/System.err( 3147):     at android.os.Parcel.readParcelable(Parcel.java:1811)08-16 17:19:52.420 W/System.err( 3147):     at android.os.Parcel.readValue(Parcel.java:1713)08-16 17:19:52.420 W/System.err( 3147):     at android.os.Parcel.readMapInternal(Parcel.java:1947)08-16 17:19:52.420 W/System.err( 3147):     at android.os.Bundle.unparcel(Bundle.java:169)08-16 17:19:52.420 W/System.err( 3147):     at android.os.Bundle.getParcelable(Bundle.java:1037)08-16 17:19:52.430 W/System.err( 3147):     at android.content.Intent.getParcelableExtra(Intent.java:3276)08-16 17:19:52.430 W/System.err( 3147):     at com.mobibob.android.myapp.ContentDetailActivity.onCreate(ContentDetailActivity.java:24)08-16 17:19:52.430 W/System.err( 3147):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)08-16 17:19:52.430 W/System.err( 3147):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)08-16 17:19:52.430 W/System.err( 3147):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)08-16 17:19:52.430 W/System.err( 3147):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)08-16 17:19:52.430 W/System.err( 3147):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)08-16 17:19:52.430 W/System.err( 3147):     at android.os.Handler.dispatchMessage(Handler.java:99)08-16 17:19:52.430 W/System.err( 3147):     at android.os.Looper.loop(Looper.java:123)08-16 17:19:52.430 W/System.err( 3147):     at android.app.ActivityThread.main(ActivityThread.java:4363)08-16 17:19:52.430 W/System.err( 3147):     at java.lang.reflect.Method.invokeNative(Native Method)08-16 17:19:52.430 W/System.err( 3147):     at java.lang.reflect.Method.invoke(Method.java:521)08-16 17:19:52.430 W/System.err( 3147):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-16 17:19:52.430 W/System.err( 3147):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-16 17:19:52.440 W/System.err( 3147):     at dalvik.system.NativeStart.main(Native Method)08-16 17:19:52.895 I/ActivityManager( 1202): Displayed activity com.mobibob.android.myapp/.ContentDetailActivity: 582 ms (total 582 ms)</code></pre>","157804","","157804","","2010-08-17 04:20:50","2012-04-05 12:37:57","Why is the parcelable object null in receiving activity?","<android><android-intent><parcelable>","1","6","0","",""
"3497074","1","3498178","","2010-08-16 20:32:12","3","3005","<p>I want to display a random image from the bunch of images i have stored in res/drawable.</p><p>The only technique that I know is to access a particular image if you know its resource id. Is there a way to access the images by using the filenames or something else (which can be constructed at runtime)?</p><p>I want to randomly select an image at runtime. Any suggestions/ideas appreciated :)</p><p>ThanksChinmay</p>","422146","","","","","2014-01-07 15:39:11","how to select from resources randomly (R.drawable.xxxx)","<android><android-image>","8","0","4","",""
"3497102","1","","","2010-08-16 20:37:12","0","742","<p>I have an Android application where I use HashMap where I keep my Threads (values) each executing a task (Runnable). To identify the Threads I use Strings as keys. The Threads are alive as long as they execute a task what is usually not very long. The problem is that they seem to never been released by GC after finishing and being removed from the HashMap (and they are not referenced from anywhere else). If I create a dump of my application there are as many of my tasks in memory as started through the life of the application. Have tried to use HashSet instead but with the same result. </p><p>In code I start them with this few lines:</p><pre><code>Thread image_fetch_thread = new Thread(new ImageFetchTask(image_url, this));this.running_image_fetch_threads.put(image_url, image_fetch_thread);image_fetch_thread.start();</code></pre><p>and at some point later they become removed:</p><pre><code>this.running_image_fetch_threads.remove(image_url);</code></pre><p>Why GC don't like to collect them?</p>","170448","","170448","","2010-08-17 15:44:37","2010-08-17 18:58:18","Memory leaks with HashMap/HashSet on Android","<java><android>","3","1","","",""
"3497104","1","12170001","","2010-08-16 20:37:39","3","2227","<p>I have application that communicates with web server through REST. It works fine on a phone when connected via WiFi but does not work correctly when on 3G.</p><p>Not everything stops working. I'm still able to use some functionality but for some reason some calls to rest return """" (empty response) very quickly. Once again when I'm on WiFi everything works fine.</p><p>Just to clarify:  1. I have data plan :) 2. Server I'm connecting to is accessible from Internet</p><p>Any thoughts?</p><p>ThanksRalph</p>","282882","","","","","2012-08-29 02:09:18","Application does not work when on 3G.On WiFi works fine","<android><rest>","3","2","","",""
"3497157","1","","","2010-08-16 20:43:16","0","3221","<p>Im working on changing the image being shown when I have my ImageView Clicked. Im trying to use a similar code that I used for accomplishing this with a TextView but I can't seem to find the right terms to get it to work. Here is my current code. Thanks</p><blockquote>  <p>electronconfiguration.setOnClickListener(new View.OnClickListener() {</p></blockquote><pre><code>    public void onClick(View drawable) {        if (drawable.equals(R.drawable.element_el))        electronconfiguration.setImageDrawable(R.drawable.aluminum_el);        else if (drawable.equals(R.drawable.aluminum_el))        electronconfiguration.setImageDrawable(R.drawable.element_el);    }});</code></pre>","288437","","","","","2013-02-06 13:13:04","ImageView onClickListener changing the image source","<android><imageview>","2","0","","",""
"3497176","1","","","2010-08-16 20:46:13","1","1668","<p>I want to display a listview when clicked be able to get the items key value.  How would I go about that.</p><p>thanks,Dean</p>","412317","","","","","2011-06-07 07:56:58","Listview with key field","<android>","2","1","","",""
"3497243","1","3497948","","2010-08-16 20:54:25","0","450","<p>I've got a standard <code>RelativeLayout</code> laying out my <code>Button</code>s and <code>TextArea</code>s. What I want to do now is be able to draw various sparks, flying cows etc. at arbitrary places on the screen on top of the whole thing. What's the best way to do this? Should I override <code>onDraw()</code> on the containing <code>View</code> and draw after calling <code>super.onDraw()</code>? Or is there some better way of drawing a layer on top?</p>","21399","","","","","2010-08-16 22:30:46","Rendering absolutely positioned sprites over a regular Android layout","<android><layout>","1","0","1","",""
"3497280","1","3500253","","2010-08-16 20:58:38","18","4753","<p>Working on trying out the market licensing service, and I'm running into a few problems with the sample application.</p><p>When I first ran the sample, I got an error saying that the application was not licensed. I linked my account to the simulator in order to get it to get the test response, and now I get an error saying ""Application error: NOT_MARKET_MANAGED""</p><p>Does this mean that I have to upload the app to the market in order to test to see if it works?</p>","356438","","","","","2013-07-23 04:16:19","Android ""Not_Market_Managed"" error","<android>","7","1","2","",""
"3497350","1","","","2010-08-16 21:05:29","2","2844","<p>Although I have seen several threads and tutorials on this topic, I guess I still have some confusion on how an application can be chosen from a list of applications to display a file.</p><p>I have a Activity which has a list view in it. This list view is bound with file paths (so a file browser of sorts). When we click on a specific file type, I need a list of applications that can open that file.</p><p>So far this is what I have in the OnItemClick for the list item:</p><pre><code>Intent myIntent = new Intent();myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);myIntent.setAction(Intent.ACTION_VIEW);myIntent.addCategory(""android.intent.category.DEFAULT"");myIntent.setData(Uri.fromFile(new File(filePath)));</code></pre><p>When I run this on my phone, the error is:<code>No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.DEFAULT] dat=file:///</code></p><p>When I do the same in a file browser application (downloaded from the marketplace), I get two options (QuickOffice and Word to Go), both of which I have installed on my phone.</p><p>Could someone guide me as to what else is needed here? Things I have tried besides the above:</p><ol><li><p>Add the following entries to the manifest:</p><p><code>&lt;intent-filter&gt;     &lt;action android:name=""android.intent.action.MAIN"" /&gt;     &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;&lt;/intent-filter&gt;&lt;intent-filter&gt;  &lt;action android:name=""android.intent.action.VIEW"" /&gt;  &lt;category android:name=""android.intent.category.BROWSABLE"" &gt;  &lt;category android:name=""android.intent.category.DEFAULT"" &gt;  &lt;data android:scheme=""file"" /&gt;&lt;/intent-filter&gt;</code></p></li><li><p>Explicitly set the type:</p><p><code>myIntent.setDataAndType(Uri.fromFile(new File(filePath)),""*"");</code></p></li></ol><p>Neither of this works, any help is appreciated.</p><p>Thanks!</p>","422168","","20402","","2010-08-16 21:24:11","2010-09-24 22:53:07","Android Launching an application chooser with appropriate list of applications","<android>","1","0","1","",""
"3497412","1","3497519","","2010-08-16 21:13:36","2","207","<p>I'm trying to have a ListView that will display each row in a given color, depending on the content of that row, but still allow the selector to draw. As it is now, if I call View.setBackgroundColor on a row, it colors the background properly, but the selector isn't drawn.</p>","195403","","","","","2010-08-16 21:27:45","Coloring ListView row depending on contents","<android><listview>","1","0","","",""
"3497506","1","","","2010-08-16 21:26:39","3","2468","<p>My employer is having me work on an android application with very specific UI requirements. Specifically, we need an interface that looks exactly like a TabWidget interface. However, having the tabs on the left hand side is an absolute must. We aren't going to be deploying this application to any android phones, its for an in house device, and as such don't have any problem violating any design considerations that the android platform might have.</p><p>We already have a working prototype that hacks together the functionality we need using a combination of focus listeners and list views. It isn't pretty, and we aren't very confident in it just yet, but it works for the time being. </p><p>What we'd really like is to throw all of our prototype UI code away in exchange for using the built in TabWidget. However, since TabWidget is hardcoded to only work with the tabs on top, this isn't really an option.</p><p>So, we are hoping that someone out there has a patch, or set of patches, or perhaps a custom class, that handles the TabWidget functionality with the tabs on the side instead?</p><p>The relevant code for the TabWidget is here: <a href=""http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/widget/TabWidget.java&amp;q=android%20package:git://android.git.kernel.org%20lang:java%20tabwidget&amp;sa=N&amp;cd=1&amp;ct=rc"" rel=""nofollow"">http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/widget/TabWidget.java&amp;q=android%20package:git://android.git.kernel.org%20lang:java%20tabwidget&amp;sa=N&amp;cd=1&amp;ct=rc</a></p><p>and the specific function that is hardcoded for being tabs on top is</p><pre><code>private void initTabWidget() {    setOrientation(LinearLayout.HORIZONTAL);    mGroupFlags |= FLAG_USE_CHILD_DRAWING_ORDER;    final Context context = mContext;    final Resources resources = context.getResources();    if (context.getApplicationInfo().targetSdkVersion &lt;= Build.VERSION_CODES.DONUT) {        // Donut apps get old color scheme        if (mLeftStrip == null) {            mLeftStrip = resources.getDrawable(                    com.android.internal.R.drawable.tab_bottom_left_v4);        }        if (mRightStrip == null) {            mRightStrip = resources.getDrawable(                    com.android.internal.R.drawable.tab_bottom_right_v4);        }    } else {        // Use modern color scheme for Eclair and beyond        if (mLeftStrip == null) {            mLeftStrip = resources.getDrawable(                    com.android.internal.R.drawable.tab_bottom_left);        }        if (mRightStrip == null) {            mRightStrip = resources.getDrawable(                    com.android.internal.R.drawable.tab_bottom_right);        }    }    // Deal with focus, as we don't want the focus to go by default    // to a tab other than the current tab    setFocusable(true);    setOnFocusChangeListener(this);}</code></pre><p>If anyone has any information, I'd be much obliged. </p>","422191","","21234","","2010-10-02 11:49:09","2011-07-14 00:54:10","Existing patches for android tabwidget to allow tabs on left-hand side?","<android><patch><tabwidget>","2","0","2","",""
"3497524","1","3497708","","2010-08-16 21:29:10","15","384","<p>I have a new android app I put on the marketplace a few days ago.  I did quite a bit of testing on my moto droid before publishing it and tried to be very thorough.  Well, I got some negative comments back on how it didnt run right on someone's EVO 2.2 or X10 (didnt even know what that was at first).  Well, it runs perfect on my phone.  </p><p>Any advice on how I'm supposed to fix or support an app that runs on like 100 different phones?</p><p>How are other developers approaching this? (without actually buying every phone out there).Thanks.</p>","81975","","5171","","2010-08-18 15:57:50","2011-07-01 08:01:39","Testing for the masses with only one phone and emulator","<android><testing>","4","5","4","",""
"3497542","1","3497651","","2010-08-16 21:31:36","3","3633","<p>I have a minimal program that does little more than let me set two preferences (an int and a String) using Android's <code>PreferenceActivity</code>. So I have an xml file that defines my preferences, and an activity that extends <code>PreferenceActivity</code>. My main activity has an options menu that launches my preference activity. All of that works great. I can set my preferences and the values are retained during and after my program executes.</p><p>Now, in my main activity I want to retrieve those preferences. Should be easy, right? Here's the code from every sample I've ever seen:</p><pre><code>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);int intSetting = prefs.getInt(""intSetting"", 0);String strSetting = prefs.getString(""strSetting"", """");</code></pre><p>Problem is, if I break at the <code>getInt()</code> call and step over, my stack looks like this and the app will crash if I continue:</p><blockquote>  <p>Thread [&lt;3> main] (Suspended)<br>  ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,  Intent) line: 2494<br>  ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord,  Intent) line: 2512<br>  ActivityThread.access$2200(ActivityThread,  ActivityThread$ActivityRecord, Intent)  line: 119<br>  ActivityThread$H.handleMessage(Message)  line: 1863<br>  ActivityThread$H(Handler).dispatchMessage(Message)  line: 99   Looper.loop() line: 123<br>  ActivityThread.main(String[]) line:  4363   Method.invokeNative(Object,  Object[], Class, Class[], Class, int,  boolean) line: not available [native  method]   Method.invoke(Object,  Object...) line: 521<br>  ZygoteInit$MethodAndArgsCaller.run()  line: 860   ZygoteInit.main(String[])  line: 618   NativeStart.main(String[])  line: not available [native method]</p></blockquote><p>I've tried variations on the parameter passed to getDefaultSharedPreferences(), including:</p><pre><code>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());</code></pre><p>...and probably some others in different context (i.e. when accessing preferences from my main activity vs. another activity vs. some function in a class that isn't an activity. The result is always the same.</p><p>I've read a dozen Q&amp;A posts on the Web from others with this problem who have solved it by writing code identical to mine, so I don't expect there's a solution but if anyone has any ideas, let me know.</p>","422156","","119895","","2010-08-16 21:38:18","2010-08-16 23:12:42","Can't access preferences created by PreferenceActivity","<android><android-sdk-2.1><sharedpreferences><preferenceactivity>","3","0","0","",""
"3497563","1","","","2010-08-16 21:34:55","1","991","<p>I'd like my Android app to receive notification when new messages arrive in mygmail account.I realize that the Android gmail client does not broadcastnotification when it receives messages. Instead I want to utilize thegmail server's Cloud to Device Messaging capabilities to do this. Iread the article at <a href=""http://code.google.com/android/c2dm/"" rel=""nofollow"">http://code.google.com/android/c2dm/</a> - the only""missing piece"" for me is to understand how my app sends aregistration ID to the gmail server. Can someone please point me inthe right direction?</p><p>Thanks,Tom</p>","422207","","399890","","2010-12-09 16:50:57","2012-01-05 10:42:43","Using C2DM to receive notification from gmail server","<android><android-c2dm>","2","2","1","",""
"3497593","1","","","2010-08-16 21:38:31","2","902","<p>I've searched the discussion list (not to mention the interwebs ad nauseum) and I can't seem to find an answer and/or example.</p><p>I need to be able to expose part of a ListView on the bottom portion of the screen, and then (like SlidingDrawer) have the rest of the list displayed if the user flings upwards.  </p><p>SlidingDrawer has the behavior I want, but doesn't seem to have a way of controlling how much it's open or closed (perhaps I'm just missing it).   </p><p>I've experimented with using Animations to open and close the list.  This works (mostly) except then I have to deal with list scrolling issues as animating the view doesn't seem to reset it's scrollable area to it's visible area.</p><p>Does anyone have an example of something like described above?  Or a pointer to bits and pieces to get me going the right direction again?</p><p>Thanks, in advance.  </p>","422210","","","","","2012-02-14 05:05:50","Partially ""open"" SlidingDrawer","<android>","2","0","0","",""
"3497643","1","3497682","","2010-08-16 21:45:31","-1","849","<p>I want to get started with mobile development , I know HTML,CSS,JavaScript,PHP and C#.What is the best way to get started?I know that for example, if i want to create an iphone application i need to know objective c (and get mac),Which language is the best for mobile development (and cross platform - works on Nokia,IPhone,android,palm,Blackberry).</p><p>Yosy</p>","385882","","","","","2012-03-20 08:00:58","How to get started with mobile development?","<iphone><android><mobile><nokia>","3","3","","",""
"3497920","1","","","2010-08-16 22:26:10","0","1572","<p>I'm new to Android and let me first tell you what I'm trying to achieve. Using sockets, I'm sending pictures from my computer's webcam every 50ms. In Android app, I've created my display that extends View. I've added this view to FrameLayout. Parallel thread is receiving images from server app (desktop) and refreshing my display.</p><p>On this image I want to display some accelerometer data that refreshes every... Well it's set to SENSOR_DELAY_FASTEST. So I also created another display that extends View, and also I add it to another FrameLayout. Now I set my main.xml to overlap those FrameLayouts..</p><p>I'm getting my image from desktop application, I'm drawing accelerometer data, and It's overlapped, but the issue is.. It's flickering. Can anyone help? Or suggest something.. As I've pointed out, I'm new with Android.</p><p>Thanks.. </p>","422238","","383402","","2010-08-16 22:27:54","2010-08-17 11:13:16","Android overlapping views","<android><layout>","1","1","","",""
"3497998","1","3498010","","2010-08-16 22:42:59","2","1883","<p>I think I've asked this before but I can't find the question now, and I don't think I got an answer.  </p><p>In the android manifest on the first line """"</p><p>I'm getting an error marker (with a red X).  When I mouse over the red x it says-</p><p>""Manifest attribute 'minSdkVersion' is set to '2.1'. Integer is expected.""</p><p>does anyone know what could be causing this or how I might fix it?  </p><p>Thanks</p>","416852","","","","","2010-08-16 22:44:37","why am I getting ""integer expected"" error in the Android manifest?","<android>","1","0","","",""
"3498006","1","3498043","","2010-08-16 22:44:14","4","2809","<p>I question myself what the timestamp in SensorEvent.timestamp means. Numbers like 3548712982000 occur. It is not plausible for anything: nanoseconds/milliseconds since 1970 etc. Is this maybe some overflow error? It seems as it is different on different devices at the same time!!!</p>","281535","","","","","2010-08-16 22:51:37","SensorEvent.timestamp to absolute (utc) timestamp?","<android>","1","0","4","",""
"3498034","1","3498195","","2010-08-16 22:50:32","0","351","<p>Is there a way to develop classes for Android and BlackBerry ? In this I mean that BlackBerry and Android have different collections.</p><p>So I would like to know what is the best way to develop such files (reflection, different files, ...)</p>","179872","","","","","2010-08-16 23:22:32","Develop a native source code for Android and BlackBerry","<android><blackberry><source-code>","2","1","","",""
"3498176","1","","","2010-08-16 23:16:20","1","2357","<p>Hey everyone, I'm a beginner, so I'll try my best to explain this problem succinctly.</p><p>Basically, a friend of mine and I were playing around with the Android SDK, editing a simple RSS reader. We could launch it in the emulator and even install it on our real devices. </p><p>Fast forward a few days, I'm trying to import the exact same code that was working a few days earlier into Eclipse on my laptop. </p><p>I tried both importing and new project from existing source. Both return these new errors that we never had originally.</p><p>I got an error that involved the auto generated ""R"" file, but I have solved this. Now, I'm getting 3 errors that I have never had before -</p><ol><li><p>The method onClick(View) of type new View.OnClickListener(){} must override a superclass method - displayed twice ( 2 different lines)</p></li><li><p>The method onTabChanged(String) of type new TabHost.OnTabChangeListener(){} must override a superclass method</p></li></ol><p>My question is this - What would cause the these discrepancies between importing/running on my friends computer and mine? </p><p>Also, we are both using the latest version of Java/Eclipse</p><p>Thanks in advance for any insight. </p>","422279","","","","","2011-01-08 05:51:25","Android import project errors","<java><android>","2","1","","",""
"3498418","1","3527330","","2010-08-17 00:19:17","2","1824","<p>I'm building a game which works as some type of a quiz. I ask user the question and when he submits the answer(click or touch correct answer) I need to refresh the page with some other question.</p><p>How should i implement this? How to wait for users answer and continue when onClick or OnTouch listener finishes?Should i use Handler class, intents or something else?</p><p>Thx in advance for help.</p><p>edit: I want next scenario: On the screen I have a question and 3-4 clickable ImageButtons. I'm building some of the layout dinamically from custom showQA() function.  User choose the answer and if he clicked the correct answer i should start some type of animation on the screen. I've done that from the onClickListener. Now, i need to build layout again(show new question and answers) from the showQA() function which must be called after that animation showed to the user. How can i know when the onClickListener() finished its work?</p>","240588","","240588","","2010-08-17 01:23:03","2010-08-20 00:21:57","Best way to restart activity on Android?","<android><activity><restart>","3","2","","",""
"3498458","1","","","2010-08-17 00:28:33","2","3479","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3553163/android-long-touch-event"">Android long-touch event</a>  </p></blockquote><p>I want to be able to touch (and hold) the screen, and have an event be triggered by this.This is what I have so far.</p><pre><code>class Player extends SurfaceView implements SurfaceHolder.Callback {    public boolean onTouchEvent(MotionEvent event)     {         return true;    }}</code></pre><p>Unfortunately this only recognizes when the touch is 'moving' not when its stationary and held. I don't know what to do with touch events.</p>","422312","","110707","","2011-06-16 18:27:30","2012-03-28 17:16:08","Android touch events","<android><events><sdk><touch>","0","4","","2012-03-28 18:10:03",""
"3498643","1","7516554","","2010-08-17 01:21:22","14","14807","<p>When I used BufferedInputStream and I specify a buffer size, Dalvik gives me this warning - Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.</p><p>But right now, my buffer size is already at 8k. What am I doing wrong?</p>","303347","","","","","2011-09-22 14:33:22","Dalvik message - Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required","<android>","2","0","6","",""
"3498673","1","3558811","","2010-08-17 01:29:56","1","732","<p>A Follow up to this question: <a href=""http://stackoverflow.com/questions/3488880/group-of-views-controls-on-multiple-screens"">http://stackoverflow.com/questions/3488880/group-of-views-controls-on-multiple-screens</a></p><p>I have created a parent class and a child class that inherits from it.  When I set the OnClickListener in the child class, the event fires when the button is clicked.  When I move the set OnClickListener to the parent class, the event doesn't fire.  I've got to be missing something obvious but I just don't see it.</p><p>Thanks,Cameron.</p><p>Parent Class:</p><pre><code>public class NavigationMenu extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.nav_bar);        Button loginButton = (Button) findViewById(R.id.navbtnHome);        loginButton.setOnClickListener(new View.OnClickListener()         {            public void onClick(View view)             {                Toast.makeText(getApplicationContext(), ""Cameron, Im here"", Toast.LENGTH_SHORT).show();                Intent i = new Intent(NavigationMenu.this, Login.class);                startActivity(i);            }        });    }}</code></pre><p>Child Class:</p><pre><code>public class Settings extends NavigationMenu {    @Override    protected void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.settings);    }}</code></pre>","421149","","","","","2010-08-24 16:44:27","OnClickListener not firing from Parent class","<java><android><activity>","2","0","","",""
"3498777","1","3515308","","2010-08-17 01:57:28","0","491","<p>I'm trying to add SlideLock to my app for a version that I am putting on SlideMe. I am getting an error at mainActivityInstance for some reason and I don't know why. Any ideas what is wrong? Thanks. </p><blockquote>  <p>public void onCreate(Bundle icicle) {          super.onCreate(icicle);          setContentView(R.layout.home);</p></blockquote><pre><code>    com.slideme.slidelock.License myLicense =         new com.slideme.slidelock.License(""My first license"",                                           ""4839206850342"",                                          mainActivityInstance);    // There are other constructors available also.     // This one is just the most comfortable.    try{        /*         *  You can store the fetched data in a persistent storage and retrieve         *  it from there on the next application startup, just in case you         *  want to save the end-user's networking traffic and reduce startup         *  delays. We strongly recommend you to refresh the license from         *  time to time, just in case the end-user claims a refund, or any         *  other corner case scenario        */        myLicense.digest(myLicense.fetch());    } catch(IOException ioe){        // license couldn't initialize. Handle this    }    Rights someRights = myLicense.getFullRights();    // Works even if you already reserved the SlideLock Key in the past.    if(someRights != null){        // you have granted rights.    } else {        // You don't have any rights for the feature in cause. Try        // some features. (Currently not supporting multiple 'features')    }</code></pre>","288437","","","","","2012-09-23 07:42:38","slideme slidelock","<android><copy-protection>","1","0","","",""
"3498861","1","3517407","","2010-08-17 02:18:13","0","744","<p>Im opening a ListActivity with an xml called list with a ListView named list. I have an array adapter set up and working in another activity (not a list activity though, just a normal activity) and it all works fine. When I try to open this list activity though, I get an error saying that I need a ListView with the id android.R.id.list. I have that ListView though. What is my problem?</p><p>Code for my AlertDialog I am trying to get to work.</p><p>public void onListItemClick(ListView parent, View v, int position,                long id) </p><pre><code>    {        Context mContext = getApplicationContext();        Dialog dialog = new Dialog(mContext);        dialog.setContentView(R.layout.custom_dialog);        dialog.setTitle(getText(position));        ImageView image = (ImageView) alertDialog.findViewById(R.id.image);        image.setImageResource(R.drawable.hydrogen);        }</code></pre><p>and this was another code i had trying to get it to work</p><pre><code>        public void onListItemClick(ListView parent, View v, int position,                long id) {            new AlertDialog.Builder(Anions.this);                alertDialog.setContentView(R.layout.custom_dialog);                alertDialog.setTitle(anions[position]);            ImageView image = (ImageView) alertDialog.findViewById(R.id.image);            image.setImageResource(R.drawable.hydrogen);            alertDialog.setButton(""Done"", new DialogInterface.OnClickListener(){                public void onClick(DialogInterface dialog, int which){                    return;                }            }            );            alertDialog.show();        }</code></pre>","288437","","288437","","2010-08-18 14:29:18","2010-08-18 22:57:53","ListActivity error","<android><listview><listactivity>","2","1","","",""
"3499061","1","3507225","","2010-08-17 03:12:29","5","4847","<p>I have an android activity and a service implemented using aidl. Works like a champ, I have a callback setup to pass some thread notifications back to the UI, and that appears to work fine, with the exception of lots of</p><p>GREF has increased to 101, 201,301,401, 501.. etc, and GREF has decreased. I did some searching online and found that it has to do w/ Global References. </p><pre><code>08-17 02:31:19.735: DEBUG/dalvikvm(2558): GREF has increased to 301...08-17 02:31:25.823: DEBUG/dalvikvm(2558): GREF has increased to 401...08-17 02:31:36.772: DEBUG/dalvikvm(2558): GREF has increased to 501...08-17 02:31:42.694: DEBUG/dalvikvm(2558): GREF has increased to 601...08-17 02:31:48.695: DEBUG/dalvikvm(2558): GREF has increased to 701... 08-17 02:31:59.883: DEBUG/dalvikvm(2558): GREF has decreased to 59908-17 02:31:59.912: DEBUG/dalvikvm(2558): GREF has decreased to 49908-17 02:31:59.912: DEBUG/dalvikvm(2558): GREF has decreased to 39908-17 02:31:59.912: DEBUG/dalvikvm(2558): GREF has decreased to 29908-17 02:31:59.912: DEBUG/dalvikvm(2558): GREF has decreased to 199</code></pre><p>I did some searching and see that most of the remarks on this are rather old. My concern is that I am implementing my client/service correctly, and wanted to know how I can track down what is causing GREF to increase. Any thoughts / suggestions are welcomed. Thanks!</p><p>Basic Program Flow</p><pre><code>Client -&gt; Creates CallbackClient -&gt; Starts ServiceService -&gt; Inits &amp; Starts CountDownTimerService.CountDownTimer.onFinish() -&gt; DownloadAndParse()DownloadAndParse() -&gt; initialize new saxRequest(), new Handler for this request.Service.Handler-&gt;beginBroadcast()Client.CallbackStub -&gt; updateUI()Client.CallbackStub -&gt; service.startCountDownTimer()</code></pre><p>Hopefully this makes sense. I would post code here, but there is so much in so many different files. I figured I would try and put the flow up to see if there is anything glaring... The only thing I can see is maybe re-using the saxRequest() rather than creating a new instance... I will try that now actually, but I would really like to know about the impact of the GREF and the Garbage Collection..</p>","393258","","","","","2010-08-17 21:43:52","GREF increasing / decreasing in multi-threaded service (aidl) - what does it mean?","<android><multithreading><service><ipc><aidl>","1","0","1","",""
"3499064","1","3499356","","2010-08-17 03:13:54","2","463","<p>What is the lifetime of a ContentProvider in Android? After <code>onCreate()</code> is invoked, will the ContentProvider persist unconditionally for the lifetime of the process? </p><p>My ContentProvider manages a list of records, but only 1 is designated ""active"" and will be accessed by different applications a lot. I was wondering if it's safe to cache the index of this active record in memory as a member of my ContentProvider to speed up lookup.</p>","204317","","1174526","","2012-03-14 08:10:58","2012-03-14 08:10:58","Android: What is the lifetime of a ContentProvider?","<android><android-contentprovider>","1","0","","",""
"3499095","1","3499103","","2010-08-17 03:20:46","11","8134","<p>I draw a bitmap onto a canvas using the following call:</p><pre><code>_playerImage = BitmapFactory.decodeResource(getResources(), R.drawable.player);</code></pre><p>How can I now tint this image white?I'm trying to make the image flash white like in top-scrollers when an enemy is hit by a bullet.</p><p>Do I need to use something other than BitmapFactory?</p>","386764","","","","","2010-08-17 03:22:40","How do you tint a bitmap in Android?","<android><image><bitmap>","1","0","10","",""
"3499206","1","3499347","","2010-08-17 03:53:26","2","856","<p>I'm using Eclipse 3.5.2 on win7 with latest sdk update. Every time icreate ninepatch image and copy it into drawable folders, the projectbecomes error, seems that the file cause error and not supported. I use photoshop to create PNG-24 image then edit it using draw9patch tool.</p><p>Here is my draw9patch screenshoot : <a href=""http://londatiga.net/draw9.jpg"" rel=""nofollow"">http://londatiga.net/draw9.jpg</a>. </p><p>Thanx in advance.</p>","431041","","","","","2011-10-27 00:00:53","Android ninepatch image error in eclipse 3.5.2","<android><nine-patch>","1","0","","",""
"3499365","1","","","2010-08-17 04:40:27","0","1707","<p>I keep getting the ""Activity not found Exception"" error message when I try to run the  startActivity in my MenuList.  One of the items on the list launches fine, but the other two give this same error message.  I have checked and re-checked everything and I'm really stuck.</p><p>Thanks,</p><p>Bill</p>","422432","","","","","2011-05-23 21:42:54","activity not found exception error","<android>","1","3","","",""
"3499494","1","3509186","","2010-08-17 05:09:37","0","45","<p>Android 2.1 update 1Eclipse 3.5</p><p>I have a problem reading data from my 2nd activity that is called from the 1st activity using intent. I have androidmanifest.xml setup correctly. </p><p>My First Activity has the following code:</p><p><code>Intent myIntent = new Intent(MainMenu.this, Testmenu.class);myIntent.putExtra(""com.tweaktool.MyAge"",40);myIntent.putExtra(""com.tweaktool.Enabled"", false);<br>startActivity(myIntent);</code></p><p>My 2nd Activity has the following code:</p><p><code>Bundle bun = getIntent().getExtras();<br>int myAge = bun.getInt(""MyAge"");<br>boolean enabled = bun.getBoolean(""Enabled"");</code></p><p>When I look at the above code in 2nd Activity it lists the following:enabled = false myAge = 0 </p><p>Why is this doing this??? Am I doing something simple wrong??</p>","422443","","422443","","2010-08-17 16:38:38","2010-11-24 16:15:56","My Acitivty not reading data","<android>","2","0","","",""
"3499550","1","3500861","","2010-08-17 05:25:00","2","2173","<p>guys. I am trying to build a voip app for android. I want to make use of the built-in android phone dialer. Can you guys give me some reference to it. I have been googling with no luck. Thanks</p>","422460","","","","","2012-08-20 20:43:21","using android dialer in 3rd party app","<android>","2","0","1","",""
"3499624","1","3499702","","2010-08-17 05:43:08","0","302","<p>friends,</p><p>i am facing an issue related to android phone screen orientation</p><p>If i change the orientation of the phone, then it loses the context, if i am in middle of filling a simple form. So, the phone is vertical, I am using soft keyboard, I make it horizontal, so that I can use the  keyboard easily again or something else, and kaboom, everything I have entered so far is lost. </p><p>any one guide me what is the solution to keep data and state same after changing orientation?</p><p>any help would be appriciated.</p>","249991","","","","","2010-08-17 06:01:49","android phone screen orientation related issue?","<android><screen-orientation>","1","1","","",""
"3499768","1","3500461","","2010-08-17 06:16:08","1","2697","<p>I am trying to create a ListView that will be populated with the entries from an array. </p><p>So this is my item layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""60dip"" &gt;      &lt;ImageView android:id=""@+id/list_item_image""        android:layout_height=""wrap_content""        android:padding=""2dip""         android:layout_gravity=""center_vertical|center_horizontal""         android:layout_width=""50dip""/&gt;      &lt;TextView android:id=""@+id/list_item""         android:layout_height=""fill_parent""        android:textSize=""25sp""        android:layout_width=""fill_parent""         android:ellipsize=""marquee""         android:gravity=""center_vertical""         android:padding=""5dip"" &gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>I tried changing the <code>layout_height</code> of the <code>LinearLayout</code> but I ran into some problems. If I keep the height at <code>wrap_content</code>, my list is displayed with the correct entries -- Item 1, Item 2, Item 3, and so on until Item 12. However if I change the height to <code>60dip</code>, the entries repeat after the sixth entry (I get Item 1, Item 2, Item 3, Item 4, Item 5, Item 6, Item 1, Item 2, Item 3...). If I keep on making it larger, the entries repeat more frequently.</p><p>This is a snippet from the <code>ListAdapter</code> where I set the list entries:</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {    LinearLayout layout;    if (convertView == null){         layout = (LinearLayout) LayoutInflater.from(mContext).inflate(R.layout.items_list_item, parent, false);         TextView title = (TextView) layout.findViewById(R.id.list_item);         title.setText(menuItems[position]);         ImageView icon = (ImageView) layout.findViewById(R.id.list_item_image);         int logo = getResources().getIdentifier(menuIcons[position], ""drawable"", getPackageName());         icon.setImageResource(logo);    } else {         layout = (LinearLayout) convertView;    }  return layout;}</code></pre><p>Anybody else encountered this problem?  I do not understand what is going on since I thought it should be straight-forward grabbing from the array.</p><p>EDIT: included the whole of my getView() method. Pardon the ugly way of getting the icons, I haven't figured it out yet,</p>","395576","","395576","","2010-08-17 08:22:04","2010-08-17 08:24:52","Custom list adapter repeats entries","<android><listview><listadapter>","2","0","","",""
"3499910","1","3499950","","2010-08-17 06:41:19","0","624","<p>Logcat</p><pre><code>08-17 06:37:22.264: ERROR/AndroidRuntime(1090): java.lang.RuntimeException: Unable to start activity ComponentInfo{one.two/one.two.Booking}: java.lang.NullPointerException08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at android.os.Handler.dispatchMessage(Handler.java:99)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at android.os.Looper.loop(Looper.java:123)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at android.app.ActivityThread.main(ActivityThread.java:3948)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at java.lang.reflect.Method.invokeNative(Native Method)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at java.lang.reflect.Method.invoke(Method.java:521)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at dalvik.system.NativeStart.main(Native Method)08-17 06:37:22.264: ERROR/AndroidRuntime(1090): Caused by: java.lang.NullPointerException08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at one.two.Booking.onCreate(Booking.java:50)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)08-17 06:37:22.264: ERROR/AndroidRuntime(1090):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)</code></pre><p>Booking.java</p><pre><code>public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        db = new DBAdapter(this);        this.setContentView(R.layout.booking);        txtArrivalTime = (TextView) findViewById(R.id.txtArrivalTime); // Member assignment        txtFerry = (TextView) findViewById(R.id.txtFerry);        txtStatus = (TextView) findViewById(R.id.txtStatus);        txtDestination = (TextView) findViewById(R.id.txtDestination);        colourSpinner = (Spinner) findViewById(R.id.myspinner); // Member assignment        Button btnBook = (Button) findViewById(R.id.btnBook);        db.open();        fillData();        db.close();        colourSpinner.setOnItemSelectedListener(new MyOnItemSelectedListener());        b = this.getIntent().getExtras();        s = b.getString(""DEFAULTTEXT"");              btnBook.setOnClickListener(new MyOnClickListener());    }</code></pre><p>Line 50 is s = b.getString(""DEFAULTTEXT""); </p><p>Thank you.</p>","358218","","","","","2010-08-17 06:48:21","NullPointerException error","<android><eclipse><null>","1","0","","",""
"3499914","1","","","2010-08-17 06:42:01","0","699","<p>K9 mail client is open source android application. Where can we get the source files ?</p>","398981","","","","","2010-08-17 06:45:15","where we get the source of K9 email client for android?","<android>","1","0","","",""
"3499965","1","","","2010-08-17 06:51:04","0","1153","<p>I've a border set around a drawable using LinearLayout (bg: rounded rectangle).</p><p>The drawable and the border is used as a tab view. I'd like to change the border color of the tab when it is selected.</p><p>How can I do this?</p><p>Color state list doesn't seem to work as the view being selected is not the shape (i.e border) but the tab. Drawable state list doesn't seem to work either as I'm trying to swivel between views, not drawables. Moreover, I can't find any ""onSelectedListener"" of the sort...</p>","70488","","6391","","2010-08-17 07:08:47","2010-08-18 03:03:19","How to change border color (shape) on select in Android?","<android><android-tabhost>","2","1","","",""
"3500197","1","3504538","","2010-08-17 07:25:41","61","116880","<p>I have a slider that can be pulled up and then it shows a map. I can move the slider up and down to hide or show the map. When the map is on front, I can handle touch events on that map. Everytime I touch, a AsyncTask is fired up, it downloads some data and makes a Toast that displays the data. Although I start the task on touch event no toast is displayed, not till I close the slider. When the slider is closed and the map is not displayed anymore the Toast appears.</p><p>any ideas?</p><p>well start the task</p><p><strong>EDIT:</strong></p><pre><code>public boolean onTouchEvent(MotionEvent event, MapView mapView){     if (event.getAction() == 1) {        new TestTask(this).execute();        return true;                }else{        return false;    } }</code></pre><p>and in onPostExecute make a toast</p><pre><code>Toast.makeText(app.getBaseContext(),(String)data.result,                 Toast.LENGTH_SHORT).show();</code></pre><p>In new TestTask(this), this is a reference to MapOverlay and not to MapActivity, so this was the problem.</p>","401025","","401025","","2011-04-07 20:27:57","2014-04-07 06:25:06","How to display Toast in Android?","<android><android-mapview><android-asynctask><toast>","6","1","17","",""
"3500326","1","3500397","","2010-08-17 07:45:08","1","142","<pre><code>  i have a map file which has several tile images in the form of binary data. now i have to jump my index to different location of the file and read that tile. but i could not find anything helpful for me i also checked mark() and skip() methods.but not helping me.</code></pre><p>is there any method or class which can do what exactly i want or any hint you want to give me</p><p>thanks alot</p>","397901","","","","","2010-08-17 07:53:48","moving the index to different location of binary file","<java><android>","1","0","","",""
"3500342","1","","","2010-08-17 07:47:21","1","852","<p>I created this folder, tab_bar, inside 'drawable' and added barbgnd.png. And then in my code, I tried to access it using</p><pre><code>android:background=""@drawable/tab_bar/barbgnd""</code></pre><p>However, I got this error</p><blockquote>  <p>error: Error: No resource found that  matches the given name (at  'background' with value  '@drawable/tab_bar/barbgnd').</p></blockquote><p>My objective is to further organize the files inside the drawable folder.. i.e. all images used in a Navigation Bar component in one folder, etc.</p><p>Is this not possible?</p><p>Thanks!</p>","273259","","","","","2010-08-17 07:52:10","Is it possible to add a custom folder inside 'drawable' folder of an Android app?","<android>","1","0","","",""
"3500398","1","3500630","","2010-08-17 07:54:10","4","6506","<p>I have some difficulties finding the correct way to specify that a progress bar should have the small indefinite style. </p><p>I would be glad if somebody could provide an example for me and others that do a quick search for this information.</p>","114066","","56285","","2014-01-14 14:32:17","2014-01-14 14:32:17","How can I change the style of a ProgressBar to small?","<android><android-progressbar><android-styles>","2","2","","",""
"3500515","1","3500717","","2010-08-17 08:11:02","5","4655","<p>I want to develop an application for the android platform that can download some files from my server.</p><p>How can i use android's download manager like it is used in the Android market app? I mean, the one when the user downloads something, a download status is shown in the notification bar.</p><p>Sorry about my English!</p>","422579","","50109","","2010-08-17 08:38:17","2011-11-03 21:46:28","How to use built-in download manager on Android","<android>","2","0","5","",""
"3500593","1","","","2010-08-17 08:24:07","0","992","<p>I write a sample code to discovery a bluetooth headset(jabra BT2035).referece <a href=""http://developer.android.com/guide/topics/wireless/bluetooth.html#DiscoveringDevices"" rel=""nofollow"">http://developer.android.com/guide/topics/wireless/bluetooth.html#DiscoveringDevices</a></p><p>But it can only discovery my notebook computer. If my notebook computer enables bluetooth and sets Enabling discoverability.</p><p>The SDK document snippet:</p><pre><code>android.bluetooth.device.action.FOUND""public static final String ACTION_FOUNDSince: API Level 5Broadcast Action: Remote device discovered.Sent when a remote device is found during discovery.</code></pre><p>I think the remote device means a remote notebook computer except a bluetooth headset.Could someone please help with this?</p><p>thanks alot.BR,Perrot</p>","422603","","","","","2010-08-17 08:29:13","How to discovery a bluetooth headset?","<android>","1","2","","",""
"3500616","1","3501035","","2010-08-17 08:28:17","8","3197","<p>Compared to the iPhone and Windows Phone 7 equivalents it's takes forever to start up - is it realistic to expect this to improve over time ?</p>","205546","","192308","","2010-08-17 09:24:19","2010-09-15 07:52:56","Why is the Android phone simulator so slow?","<android><android-emulator>","2","1","1","",""
"3500828","1","3500894","","2010-08-17 08:56:57","0","79","<p>In my application i want displaying the one image as half of the screen and below i am producing that image spelling   and below display that image name letters as shuffled and kid will take one image and place into into that place in above spelling.For example see following website</p><blockquote>  <p>//www.youtube.com/watch?v=_LSlYYu3F0k</p></blockquote><p>For this how can i design my layout(xml)Please gice me some code suggestions.Thanks in advance</p>","454808","","","","","2010-08-17 09:05:51","Move the ImageView to EditTextView","<android>","1","0","","",""
"3500951","1","3501055","","2010-08-17 09:14:13","1","168","<p>I am considering writing a mobile application for one of the following mobile platforms:</p><ul><li>iPhone</li><li>Android</li><li>Blackberry</li></ul><p>One area which I am struggling to get more information about is how app reviews are handled in the app stores on these platforms. In particular, I am trying to answer the following questions:</p><ul><li>Are app reviews moderated for spam/offensive language?</li><li>Are app reviews ever ""aged""? This could mean discarding old reviews or weighting them lower when calculating an average rating.</li><li>Does publishing a new version of the app cause old reviews to be discarded?</li></ul>","325129","","","","","2010-08-17 13:47:16","How are app reviews handled in the iPhone/Android/Blackberry app stores","<iphone><android><blackberry>","3","2","","",""
"3501054","1","3510958","","2010-08-17 09:26:25","0","1716","<pre><code>i am implemented to kids application i am implemented spinner in added array categeory list these are array text list now i am implement these text array list replace in drawable images in spinner how can implementedpersonalinformation = (Spinner) findViewById(R.id.SpinnerCategory);ArrayAdapter&lt;?&gt; adapterDefaultpersonal = ArrayAdapter.createFromResource(Animals.this,R.array.Animalinformation, android.R.layout.simple_spinner_item);adapterDefaultpersonal.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);personalinformation.setAdapter(adapterDefaultpersonal);personalinformation.setSelection( getSharedPreferences("""", 0).getInt(""SpinnerSelection"", 0));personalinformation.setOnItemSelectedListener(new OnItemSelectedListener(){public void onItemSelected(AdapterView&lt;?&gt; parent,View v,int position,long id){if(position==0){}});this is the spinner code i am using array of text list these text replaced to drawable items in to spinner how can implemented some solution i am new in android</code></pre>","454808","","454808","","2010-08-17 09:46:04","2012-04-05 14:20:41","Display the images as items in spinner","<android>","1","0","","",""
"3501097","1","","","2010-08-17 09:31:50","4","947","<p>How can I listen for an apk being uninstalled?</p>","350694","","345078","","2012-06-06 14:14:02","2012-06-06 14:14:02","How can I listen for uninstalling an apk?","<android>","1","0","1","",""
"3501126","1","3501210","","2010-08-17 09:37:35","30","34119","<p>So I'm drawing this triangle in android maps using the code below in my draw method:</p><pre><code>paint.setARGB(255, 153, 29, 29);paint.setStyle(Paint.Style.FILL_AND_STROKE);paint.setAntiAlias(true);Path path = new Path();path.moveTo(point1_returned.x, point1_returned.y);path.lineTo(point2_returned.x, point2_returned.y);path.moveTo(point2_returned.x, point2_returned.y);path.lineTo(point3_returned.x, point3_returned.y);path.moveTo(point3_returned.x, point3_returned.y);path.lineTo(point1_returned.x, point1_returned.y);path.close();canvas.drawPath(path, paint);</code></pre><p>The pointX_returned are the coordinates which I'm getting from the fields. They are basically latitudes and longitudes.The result is a nice triangle but the insider is empty and therefore I can see the map. Is there a way to fill it up somehow? </p>","359656","","103081","","2013-07-18 10:42:44","2013-07-18 10:57:55","How to draw a filled triangle in android canvas?","<java><android><google-maps><android-canvas>","4","0","10","",""
"3501160","1","","","2010-08-17 09:41:51","0","1884","<p>Please give me solution to hide the status bar of translucant screen, i have tries by setting Theme.NoTitleBar.Fullscreen but it works for normal activity, but its not working for the screen witch is translucant.Please give me the hint to solve the problem.</p><p>Thanks</p>","421675","","","","","2010-10-16 16:00:31","Hide the status bar","<android><frameworks>","1","0","","",""
"3501218","1","","","2010-08-17 09:51:24","0","647","<p>I have a main game thread but when the target score is achieved I have an activity that is launched called StageCleared which basically displays the stats to the user of their performance and then they can press a continue button to carry on with the game. This should switch focus back to the running thread that should continue execution, and thus display the game activity (with parameters i update after StageCleared has exectued).</p><p>It was suggested I use a package visible object that calls wait() on itself in the main game thread, and then notify() on itself from StageCleared in order to continue execution. My first problem is I can't seem to declare a package visible object that can be seen by all the classes in my package? Secondly, is this the best way to achieve what I'm intending to do or is there a better way?</p><p>Many thanks </p>","300037","","","","","2011-05-20 00:56:47","Pausing/Resuming A Game Thread Using wait() and notify() - Android","<android><wait><notify>","2","0","","",""
"3501264","1","4258629","","2010-08-17 09:58:20","7","4023","<p>While working on an an application i noticed that the thread count keeps growing all the timeAsyncTask Threads remain open for some reason (im sure they finished proccesing and exited) i have no idea why i keep creating more threads of this type and they keep running indefinitely.is there any way to verify that these threads are terminated on complition?are there any known issues with AsyncTasks threads remaing open?</p><p>When running this:</p><pre><code>public  class DoNothingTask extends AsyncTask&lt;Void, Void, Void&gt; {        @Override        protected Void doInBackground(Void... params) {            // TODO Auto-generated method stub            return null;        }    }</code></pre><p>i see in the debbuger a new thread for each time i do <code>new DoNothingTask().execute(null);</code>as folows </p><blockquote>  <p><code>Thread[&lt;ThreadNumber&gt;AsyncTask#1](running)</code></p></blockquote><p>, my question is why is this? my application relies allot on AsyncTask and i cant have a new thread created and stay alive after each task.</p><p>Thanks,  Totem</p>","274180","","274180","","2010-08-22 07:40:07","2010-11-23 16:56:37","Android AsyncTask remains in running state after completing","<android><multithreading>","3","0","3","",""
"3501339","1","","","2010-08-17 10:09:14","0","432","<p>Hi Friends im trying to take latitude and longitude value of current location.Iam moving to point A to point B.After reaching point B i start application more than 3times i got 3 diffrent lat and lang.After 3 rd time its giving the same lat and lang. </p>","422712","","","","","2010-08-17 10:25:26","How long will android take to give a latitude and longitude value of current location","<android>","1","0","","",""
"3501388","1","","","2010-08-17 10:16:06","1","546","<p>I'm attempting to create an incredibly simple widget that changes the text displayed every 5s or so. However I've had major headaches attempting to get this to work. Obviously I can't use the onUpdate call as it's a minimum of every 30min.Currently my solution uses an Timer in an extended Service class, which is as ugly as hell and tends to run like a dog after a while. Is there a ""clean"" way of doing this, ie. in a manner that doesn't require a Widget, UpdateService, Timers etc.</p><p>I'm not asking for an entire solution, just a pointer as to how to go about doing this in an efficient manner.</p><p>Thanks,John</p>","422689","","1023783","","2012-08-08 03:29:34","2012-08-08 03:29:34","Android widget with changing text","<android><animation><widget>","2","0","","",""
"3501418","1","3507186","","2010-08-17 10:20:22","0","1360","<p>I'm trying to show in Android a PopupWindow at the click location. I read that Android does not support getting the click coordinates for some reason.</p><p>I want to do something like the little popup that appears on the contacts on Android 2.1+ when you select a person's icon and a window appears at the row location showing different options to contact that person. Also in the twitter application they do something similar.</p><p>I guess it is acting more like a Context Menu, but what I read is that Context Menus cannot be customized. How are this popup windows at location done?</p><p>Thanks.</p>","308666","","","","","2010-08-17 21:38:04","How to show a PopoupWindow at the click location?","<android><contextmenu><location><popupwindow>","2","0","","",""
"3501451","1","3506250","","2010-08-17 10:24:49","2","4489","<p>I am having problem with performance of SQLite database in Android application in Samsung Galaxy GT-I9000 device. The database contains 10 tables with 3 - 8 columns each.</p><p>As soon as a database file gains about 400 KB update/instert queries need much more time to execute - 2 seconds! In comparision to other devices (HTC Magic, HTC Desire) update/insert queries take about 40 msec !</p><p>The database file is located in application data directory. Moving database file to sd card increases the speed significantly. </p><p>Periodic ANALYZE and VACUUM commands do not affect the speed. As well as PRAGMA cache_size command.</p><p>Do you have any ideas how to improve the performance? </p><p>Any idea is welcome except for keeping the database in sd card or splitting the database into many files containing one table each.</p>","387710","","","","","2010-08-18 14:22:35","SQLite is extremely slow in Samsung Galaxy GT-I9000","<android><performance><sqlite>","4","1","2","",""
"3501487","1","3502423","","2010-08-17 10:32:29","0","907","<p>friend's,   i have a problem in setting height of layout,i have three layout  with seperate xml layout,</p><p>1.header.xml            it have an textview   2.main.xml have frmelayout with listview</p><pre><code>  3.content.xml        it have field to bind in framelayout listview.</code></pre><h1>i need to know how to increase the height of the header as much i need,</h1><p>here my code for getting solution</p><p>Actually i'm facing problem here isi have gallery of menus in header ,whrn iplace this gallery view below header i'm getting it with hidded below half of the gallery,because the height of header can't being changed in any sense,</p><p>here the code for header.xml</p><pre><code> &lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""fill_parent"" android:background=""@drawable/gradient_black""    android:layout_gravity=""center_horizontal"" android:layout_width=""fill_parent""    android:orientation=""horizontal""&gt;    &lt;ImageView android:src=""@drawable/image_button1"" android:id=""@+id/back""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:layout_centerVertical=""true""/&gt;    &lt;TextView android:id=""@+id/header_text1"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:layout_toRightOf=""@+id/back""        android:textSize=""20sp"" android:textStyle=""bold"" android:textColor=""@color/white""        android:layout_marginLeft=""60dip"" android:layout_centerVertical=""true""        android:layout_centerHorizontal=""true"" android:ellipsize=""end""        android:singleLine=""true"" /&gt;    &lt;ImageView android:src=""@drawable/image_button"" android:id=""@+id/share""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:layout_toRightOf=""@+id/header_text1"" android:paddingTop=""10dip""        android:paddingLeft=""50dip"" /&gt;      &lt;Gallery android:id=""@+id/gv"" android:layout_width=""fill_parent"" android:paddingTop=""0dip""          android:layout_height=""fill_parent"" android:spacing=""15dip""             android:layout_below=""@+id/back""           android:gravity=""bottom"" android:paddingBottom=""0dip""/&gt; &lt;/RelativeLayout&gt;</code></pre><p>here the code for main.xml it have an FrameLayout have listview,have tab host and linearlayout at top</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/tabhost"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;      &lt;LinearLayout  android:layout_width=""fill_parent""        android:layout_height=""200dip"" android:id=""@+id/main_lay""&gt;    &lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical"" android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent"" android:layout_height=""100dip""        android:layout_marginTop=""100dip""&gt;    &lt;ListView android:id=""@+id/content_listview""            android:layout_width=""fill_parent"" android:layout_height=""340dip"" /&gt;&lt;/FrameLayout&gt;...&lt;/LinearLayout&gt;----&lt;/TabHost&gt;</code></pre><p>==================== code for list content field</p><p>it have linerlayout with three field to set on list...</p><p>===== here code for my activity</p><pre><code>requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.main); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.header);</code></pre><p>. ;.---- help me get the clear view of gallery in header without hidding at bottom or simply how can i increase height of header layout.</p>","407506","","407506","","2010-08-17 11:33:01","2010-08-17 12:36:08","how to set height of layouts","<android>","2","1","","",""
"3501516","1","3501572","","2010-08-17 10:38:19","39","17889","<p>I need to parse a fairly large XML file (varying between about a hundred kilobytes and several hundred kilobytes), which I'm doing using <code>Xml#parse(String, ContentHandler)</code>. I'm currently testing this with a 152KB file.</p><p>During parsing, I also insert the data in an SQLite database using calls similar to the following: <code>getWritableDatabase().insert(TABLE_NAME, ""_id"", values)</code>. All of this together takes about 80 seconds for the 152KB test file (which comes down to inserting roughly 200 rows).</p><p>When I comment out all insert statements (but leave in everything else, such as creating <code>ContentValues</code> etc.) the same file takes only 23 seconds.</p><p>Is it normal for the database operations to have such a big overhead? Can I do anything about that?</p>","279363","","121689","","2013-12-16 13:56:23","2013-12-16 13:56:23","Android SQLite database: slow insertion","<android><database><performance><sqlite><insert>","5","0","26","",""
"3501522","1","6094105","","2010-08-17 10:38:56","1","3956","<p>ok im trying to make a slider with ability to select 2 points just like selecting a range from the slider, any one did any thing like that</p>","392574","","101258","","2010-08-17 18:55:27","2011-05-23 07:26:02","2-way slider for android","<android><slider>","2","3","1","",""
"3501524","1","3501553","","2010-08-17 10:39:05","4","5872","<p>I'm trying to render a simple textured quad on Android 2.2 using <code>GLSurfaceView</code>. I'm loading a BMP image (128x128) with <code>BitmapFactory.decodeResource()</code> - this seems to work. But whenever I try to put this bitmap into an OpenGL texture using <code>GLUtils.glTexImage2D</code> I get an OpenGL error: <code>glGetError()</code> returns 1280, <code>GL_INVALID_ENUM</code>. What am I doing wrong?This is the code for my Renderer:</p><pre><code>public class MyRenderer implements GLSurfaceView.Renderer {    Context context;    int texId;    public MyRenderer(Context c) {        this.context = c;    }    @Override    public void onSurfaceCreated(GL10 gl, EGLConfig config) {        gl.glEnable(GL10.GL_TEXTURE_2D);        this.texId = loadTexture(gl);           }    int loadTexture(GL10 gl) {              int[] tmp = new int[1];        gl.glGenTextures(1, tmp, 0);        int id = tmp[0];        Bitmap bmp = BitmapFactory.decodeResource(this.context.getResources(), R.drawable.myimage);        gl.glGetError();        GLUtils.texImage2D(id, 0, bmp, 0);        int err = gl.glGetError();        if (err != 0) {            // err == 1280, prints ""invalid enum"":            System.err.println(GLU.gluErrorString(err));        }        return id;    }    @Override    public void onSurfaceChanged(GL10 gl, int width, int height) {              gl.glViewport(0, 0, width, height);        gl.glMatrixMode(GL10.GL_PROJECTION);        gl.glLoadIdentity();        GLU.gluOrtho2D(gl, 0, width, height, 0);        gl.glMatrixMode(GL10.GL_MODELVIEW);        gl.glLoadIdentity();                }    @Override    public void onDrawFrame(GL10 gl) {       // ...    }}</code></pre>","990443","","","","","2011-10-12 22:26:27","Android Opengl ES: GLUtils.glTexImage2D causing GL_INVALID_ENUM","<android><opengl-es>","1","0","2","",""
"3501570","1","3504447","","2010-08-17 10:46:49","1","985","<p>I would like to put a notification with an intent.My intent is basically action = DEFAULT and category = LAUNCHER in order to bring the activity that was launched into the front.When the app is not shown, there is no problem, the intent works perfectly and launches the last activity seen but when there is already an activity launched, onNewIntent is not called (activity is in singleTop mode).</p><p>I'm wondering how to relaunch the app from an intent to the last activity seen and call onNewIntent when the activity is already launched.</p>","179872","","","","","2010-08-17 15:57:21","Relaunch app from intent","<android><android-intent>","1","0","","",""
"3501659","1","3502238","","2010-08-17 11:00:58","1","3304","<p>I have made an application based on the android API's remote service application wich uses callbacks to notify the main activity for changes, the app works fine passing just a single int value from the remote service back to the activity. The problem is that I would like to pass some Strings and not an int back in order to update the activiti's UI, how can I do that? I have thought of returning an object but there is lack of documentation and don't know how or if it is possible.</p>","234898","","759866","","2014-02-15 21:27:08","2014-02-15 21:27:08","android service callback","<android>","3","0","3","",""
"3501796","1","","","2010-08-17 11:18:34","0","1615","<p>HelloIn an android application we are receiving a byte64 string.I need to convert these strings to images.I tried getting it but couldnot find any.Please let me know your valuable suggestions</p><p>Thanks in advance :)</p>","420261","","","","","2012-07-09 01:10:17","convert Base64 string to image in android","<android>","1","1","","",""
"3501809","1","3501910","","2010-08-17 11:20:41","1","1899","<p>What's the difference between file, class and activity in android?</p>","227943","","667810","","2012-06-16 09:03:55","2012-06-16 09:03:55","Difference between file, class and activity in Android","<android>","4","0","","",""
"3501835","1","","","2010-08-17 11:24:19","2","1233","<p>I lost the .keys.ks file, that I used to sign my Android (on the Market) app. Is there anything I could do? I really hope I won't have to republish the app with a different package name on the Market, because current users won't see my updates. If I recreate it in Eclipse with the same password can I create the same key?</p>","243225","","","","","2011-08-04 07:20:35","I lost the key I signed my Android application with","<android>","1","0","","",""
"3501964","1","","","2010-08-17 11:37:57","0","6040","<p>I'm going through the Android hello world application examples and have got stuck on the date picker example. I think I have followed the instructions properly but don't understand the following error</p><p>DatePickerDialog.OnDateSetListener(){} must implement the inherited abstract method DatePickerDialog.OnDateSetListener.onDateSet</p><p>At first I typed it in but have now I have copied the code over from the example:</p><pre><code>// the callback received when the user ""sets"" the date in the dialogprivate DatePickerDialog.OnDateSetListener mDateSetListener =        new DatePickerDialog.OnDateSetListener() {            public void onDateSet(DatePicker view, int year,                                   int monthOfYear, int dayOfMonth) {                mYear = year;                mMonth = monthOfYear;                mDay = dayOfMonth;                updateDisplay();            }        };</code></pre><p>but still get the error.</p><p>Sorry for probably newbie type error but I can't figure out what this error is trying to tell me or what I could have done wrong?</p>","422789","","","","","2013-05-01 13:18:05","Android date picker example: DatePickerDialog.OnDateSetListener(){} must implement the inherited abstract method onDateSet","<android>","3","0","","",""
"3502371","1","","","2010-08-17 12:28:41","0","543","<p>I am using org.apache.http.*; API's to make HTTP Post Connections over Internet from the Android Application. I added the Internet Permissions in the Manifest file and it works fine. Now i want my application to make the same HTTP requests over WiFi network through which the handset is connected.</p><p>Do i need to make code changes to achieve this? Do i need to add some permissions?as i am unable to make requests...</p><p>Can someone help me on this...</p><p>Thanks...</p>","422840","","","","","2011-02-20 02:36:49","http connection over WiFi on android","<android>","1","0","","",""
"3502390","1","","","2010-08-17 12:31:50","1","141","<p>I, i need to create a service that reads sensors, do a fast fourier transform and save the results in to the db, but i need to comunicate 2 values to the service when i start it (how many values to take and a string for the db). How can i comunicate this to the service?</p><p>In addition i need to start the service every a time.</p><p>Tnk'sValerio</p><p>EDIT: Here there is a good explanation -> <a href=""http://www.androidcompetencycenter.com/2009/01/basics-of-android-part-iii-android-services/"" rel=""nofollow"">http://www.androidcompetencycenter.com/2009/01/basics-of-android-part-iii-android-services/</a></p>","314554","","314554","","2010-08-21 12:05:06","2010-08-21 12:05:06","Comunicate with a Android Service","<android><service>","2","0","","",""
"3502435","1","3507874","","2010-08-17 12:37:44","5","198","<p>I've released an app to the market. It seems to work fine on some devices, and have completely weird behaviour on others. It runs fine in a VM configured to match the setup of these devices.</p><p>In general though, given that some phones behave in unexpected ways, is there any other way of getting test data for certain devices without actually buying them? How do app developers fix problems that occur on a specific device?</p>","319618","","","","","2010-08-18 10:37:40","How can you debug on a phone you don't own?","<android><testing><mobile-devices>","1","0","4","",""
"3502693","1","","","2010-08-17 13:08:47","0","637","<p>Got a trace like this:</p><pre><code>java.lang.StackOverflowErrorat android.widget.TextView.onMeasure(TextView.java:5160)at android.view.View.measure(View.java:8172)at android.widget.TableRow.getColumnsWidths(TableRow.java:308)at android.widget.TableLayout.findLargestCells(TableLayout.java:497)at android.widget.TableLayout.measureVertical(TableLayout.java:462)at android.widget.TableLayout.onMeasure(TableLayout.java:428)at android.view.View.measure(View.java:8172)at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)at android.view.View.measure(View.java:8172)at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:696)at android.widget.LinearLayout.onMeasure(LinearLayout.java:306)at android.view.View.measure(View.java:8172)at android.widget.ListView.measureScrapChild(ListView.java:1135)at android.widget.ListView.measureHeightOfChildren(ListView.java:1200)at android.widget.ListView.onMeasure(ListView.java:1109)at android.view.View.measure(View.java:8172)at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)at android.view.View.measure(View.java:8172)at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)at android.view.View.measure(View.java:8172)at android.widget.LinearLayout.measureVertical(LinearLayout.java:526)at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)at android.view.View.measure(View.java:8172)at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)at android.view.View.measure(View.java:8172)at android.view.ViewRoot.performTraversals(ViewRoot.java:805)at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:144)at android.app.ActivityThread.main(ActivityThread.java:4937)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Is there anything that can be done here?I'm getting reports of blank screens and force closes.</p>","81975","","","","","2010-08-17 13:28:29","Is there anyone of troubleshooting or dealing with stack overflow errors when the trace shows nothing?","<android>","1","5","","",""
"3502773","1","3502912","","2010-08-17 13:17:08","1","1583","<p>I want to build my own custom view which should look like the Crysis-GUI.</p><p>At first I designed a XML-based Layout and made it visible via the setContentView(int resid)-Method. Worked pretty well.</p><p>But now I wan't to go a step further and draw in my Layout. So I created a new Class, let it extend View and overrode the onDraw()-Method. So far so good. Works as expected</p><pre><code>public class RifleView extends View {public RifleView(Context context) {    super(context);}@Overrideprotected void onDraw(Canvas canvas) {    super.onDraw(canvas);    Paint p = new Paint();    p.setARGB(255, 255, 0, 0);    canvas.drawText(""Hello World"", 20, 20, p);}</code></pre><p>}</p><p>But how can I still use my XML-Layout? I can't do setContentView anymore, so how could the same effect be achieved?</p>","422883","","","","","2010-08-17 13:31:17","Custom View extending the View-Class but still based on a XML-Layout","<android><view><drawing>","1","0","","",""
"3502789","1","3502917","","2010-08-17 13:18:18","4","5953","<p>I have been working on Android for a few months. Now i want to jump to gaming in Android. So are there any resources, ebooks, or tutorial where I can study game development be it 2D or 3D.</p><p>Thanks.</p>","405521","","","","","2012-01-31 14:42:53","Android 3D animation","<android><3d>","1","0","8","",""
"3502856","1","7251545","","2010-08-17 13:25:20","7","2330","<p>I have seen apps in the Android Marketplace with regards to an app recording an ongoing phone conversation. I am interested in how this is done. Anyone knows how the call is being recorded?</p><p>Is there a way to maybe get an Audio Stream for a call in Android?</p><p>Cheers!</p>","397900","","","","","2012-06-16 02:46:58","Recording a phone call in Android","<android>","4","1","1","",""
"3502992","1","3546639","","2010-08-17 13:38:13","1","419","<p>I'd like to know if there is a way to get the elapsed time since the phone was unplugged from AC supply. I know that I can register a receiver to catch battery events - but this just works if my service is running already when the status changes.</p><p>In my case I assume that the application is started when the AC supply was already plugged out before and I then want to retrieve the time</p><p>thanks in advance,cheers</p><p>Martin</p>","415347","","","","","2010-08-23 10:24:44","Time elapsed since AC supply unplugged","<android>","2","2","","",""
"3503114","1","3852884","","2010-08-17 13:49:19","9","4154","<p>I have two buttons on a widget that change some items in a widget, if an orientation is changed on a phone, buttons do nothing. I read <a href=""http://developer.android.com/guide/topics/resources/runtime-changes.html"">http://developer.android.com/guide/topics/resources/runtime-changes.html</a> but this is all about activity not widget.</p><pre><code>    @Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);    Intent active = new Intent(context, TvWidget.class);    active.setAction(ACTION_WIDGET_RECEIVER);    mDbHelper = new DbAdapter(context);    fillChannelList(context, appWidgetIds[appWidgetIds.length-1]);    Set&lt;Integer&gt; keys = channelsImages.keySet();    Iterator&lt;Integer&gt; iter = keys.iterator();    while(iter.hasNext())      {        if(channelId == 0)         {            channelId = iter.next();            break;        }    }    SharedPreferences settings = context.getSharedPreferences(PREFS_NAME, 0);    Editor edit = settings.edit();    edit.putInt(""channelId"", channelId);    edit.putInt(""appWidgetIds"", appWidgetIds[appWidgetIds.length-1]);    edit.commit();    active.putExtra(""net.aerosoftware.tvvodic.appWidgetIds"", appWidgetIds);    PendingIntent actionPendingIntent = PendingIntent.getBroadcast(context, 0, active, 0);    remoteViews.setOnClickPendingIntent(R.id.button_next, actionPendingIntent);    Intent refresh = new Intent(context, TvWidget.class);    refresh.setAction(ACTION_WIDGET_REFRESH);    refresh.putExtra(""net.aerosoftware.tvvodic.appWidgetIds"", appWidgetIds);    PendingIntent refreshPendingIntent = PendingIntent.getBroadcast(context, 0, refresh, 0);    remoteViews.setOnClickPendingIntent(R.id.button_refresh, refreshPendingIntent);    updateView(context);    appWidgetManager.updateAppWidget(appWidgetIds, remoteViews);    super.onUpdate(context, appWidgetManager, appWidgetIds);}</code></pre>","180344","","180344","","2010-10-01 07:37:22","2012-07-22 16:39:22","After orientation change buttons on a widget are not responding","<android><widget>","3","7","6","",""
"3503123","1","3503145","","2010-08-17 13:49:42","8","2240","<p>I uploaded my app to the market last night, and after an hour or so it showed 107 installs, 88 active, 2 comments. It still says that (12+ hours later), even though when I click comments there are 10+. How often do the statistics update? Is there any way to update them manually?</p>","319618","","","","","2011-03-29 23:34:50","How often do Market app statistics update?","<android><google-play>","2","2","","",""
"3503133","1","","","2010-08-17 13:50:40","16","24350","<p>I have a ListView with an edit text and a button below it. When I click on a listView item the keyboard appears and push up the edit text and the button. I want the list to scroll to the selected item. Any idea? Thanks</p>","372287","","","","","2013-03-21 13:39:08","ListView scroll to selected item","<android>","5","0","1","",""
"3503196","1","3503271","","2010-08-17 13:58:39","-3","186","<p>can anybody give example with service in android?</p><p>Thanks</p>","386430","","398486","","2010-08-17 14:06:20","2010-08-17 15:28:55","services in android","<android><android-service>","2","3","","2011-08-29 18:22:18",""
"3503305","1","3503541","","2010-08-17 14:10:57","1","4095","<p>Currently I have an edittext field that when the user presses enter it does mostly what I want it to, validate an IP Address format and inform the user if it is wrong.  How do I make it so when the user presses enter it checks it like it is supposed to be does NOT enter the newline character?</p><p>Here is my code for it.</p><pre><code>    public boolean onEditorAction(TextView arg0, int arg1, KeyEvent arg2) {        if(validateIPaddress(m_etIPAddress.getText().toString()))        {            ConfigData.m_IPAddress = m_etIPAddress.getText().toString();        }        else        {            showAlertDialog(""Invalid IP Address\n Example: \n255.255.255.255\n0.0.0.0"",""Error: "");            m_etIPAddress.setText(ConfigData.m_IPAddress);            m_etIPAddress.requestFocus();        }           return false;    }</code></pre><p>Another problem I have is that in the false condition of the validation, that it will not bring up the soft keyboard to allow the user to reedit that text field.  If the user clicks on another edit text the window gives it focus, and allows the user to edit the second text field while still maintaining the 'green outline' around the original edittext.  Is there a way to fix this?   </p><p>EDIT:</p><p>Thanks for the response. The EditText still creates a newline. I tried calling that when I create the EditText and it shows the dialog then inserts a newline character at the beginning.. which is weird because the</p><pre><code>m_etIPAddress.setText(ConfigData.m_IPAddress); </code></pre><p>should automatically overwrite anything in that field to the static IP saved within ConfigData. (my settings class) and I think the focus might work, the problem is that after requestFocus, that EditText shows it has focus but is unresponsive.</p><p>I can click on other EditText's and modify them, while it still shows the focus outline on the IP EditText.  If I click on the IP EditText it doesn't actually do anything.  Its kind of strange.</p>","409686","","409686","","2010-08-17 14:49:20","2010-08-17 14:49:20","Android EditText: Listeners, Newline Characters, and Focus","<android><edittext><onfocus>","1","0","","",""
"3503602","1","3503657","","2010-08-17 14:37:42","0","893","<p>I have a view that has a custom ArrayAdapter as a ListAdapter.Customer is a Poco:</p><pre><code>public class Customer {    public String LastName;    public boolean IsActive;}</code></pre><p>What works: I have sucesfully bound my ArrayList to my ListView, the LastName is displayed as a text and the CheckBox is checked or not (depending on IsActive) but now I want to update the ArrayList everytime the checkbox is checked but I can't access the position in the OnClickListener:</p><pre><code>setListAdapter(new ArrayAdapter&lt;Customer&gt;(this, android.R.layout.simple_list_item_checked, items) {    @Override    public View getView(int position, View convertView, ViewGroup parent) {        View row;        if (null == convertView) {            row =  mInflater.inflate(android.R.layout.simple_list_item_checked, null);        } else {            row = convertView;        }        CheckedTextView ctv = (CheckedTextView) row.findViewById(android.R.id.text1);        ctv.setText(getItem(position).LastName);        ctv.setChecked(getItem(position).IsChecked);        ctv.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                CheckedTextView ctv = (CheckedTextView) v;                ctv.toggle();                // this does not work because I don't have the position                getItem(position).IsChecked = (ctv).isChecked();            }        });        return row;    }});</code></pre><p>I thought about inheriting from CheckedTextBox and adding a custom property <code>setPosition/getPosition</code> to store the position for later use or even add a reference to the related object but I suppose there is an existing solution I can't find atm.</p>","98491","","","","","2010-08-17 14:43:03","Android how do I get the position of a row in an ListView from an onClickHandler()","<android><listview><android-arrayadapter>","2","1","","",""
"3503735","1","3503767","","2010-08-17 14:50:44","1","16795","<p>I studied the Androidreference for hours now, but don't really get the clue how to draw something (Text, Bitmap, Path ....) on a ImageView.</p><p>Should I extend View and use the <code>onDraw()</code>-Method? If yes, how can I draw on my ImageView?</p><p>Or is there any other way to achieve my goal?</p>","422883","","","user1280616","2012-09-19 05:01:04","2013-06-18 15:03:51","Draw onto an ImageView","<android><drawing>","3","0","1","",""
"3503785","1","3503808","","2010-08-17 14:55:49","0","1001","<p>I am an android beginner.</p><p>I'm struggling to understand why startActivity runs properly when copied from a tutorial I found and fails when I make the smallest change.</p><p>Code from the tutorial:<br /></p><pre>private class ButtonHandler implements View.OnClickListener {    public void onClick(View v) {        handleButtonClick();    }   }private void handleButtonClick() {    startActivity(new Intent(this, SecondAct.class));}</pre><p>That works.  When I try to change it to what I would consider a simpler design, I am getting an error.</p><pre>private class ButtonHandler implements View.OnClickListener {    public void onClick(View v) {        startActivity(new Intent(this, SecondAct.class));    }   }</pre><p>The error is:<br />The constructor Intent(FirstTwoApps.ButtonHandler, Class) is undefined</p><p>Notice that all I did was moved the action from the handleButtonClick() method to the onClick() method.  Apparently that is not allowed, but I don't understand why.</p><p>Any help is greatly appreciated.</p>","422967","","","","","2010-08-17 14:59:23","Why does startActivity work in one method and fail in another?","<android>","2","0","","",""
"3503863","1","3513096","","2010-08-17 15:03:05","0","529","<p>I'm working on an app that, upon instillation of certain apps will send a message to them to register with a content provider. It all works fine, the strings are stored, but I can't get the byte[] blob (a bitmap .png file) to convert properly from within onRecieve() in the broadcastreciever.</p><pre><code>@Overridepublic void onReceive(Context context, Intent intent) {    Log.v(""xxxxxxxxxxxxx"", ""onReceive, from within RegisterApp"");    this.context = context;    ContentValues values = new ContentValues();    values.put(""app_name"", getAppName());    values.put(""app_description"", getAppDescription());    ByteArrayOutputStream stream = new ByteArrayOutputStream();    Bitmap b = getAppIcon();    b.compress(Bitmap.CompressFormat.PNG, 0, stream);    byte[] blob = stream.toByteArray();    values.put(""icon"", blob);    context.getContentResolver().insert(            Uri.parse(""content://blahblahblahblah""), values);}</code></pre><p>I hijack the context so that I can get a hold on the image from the getAppIcon() call (You extend this class which is an abstract class extending BroadcastReceiver)</p><p>i.e.</p><pre><code>@Overrideprotected Bitmap getAppIcon() {    Log.v(TAG, ""putting icon"");    return BitmapFactory.decodeResource(this.context.getResources(), R.drawable.icon);}</code></pre><p>But my understanding of the context is limited and I think this is what is causing it to be stored incorrectly. </p><p>I've also tried getting the bitmap from the resources when onRecieve() is called and that doesn't work either. </p><p>I'm at a loss, any assistance would be appreciated.</p>","399390","","","","","2010-08-18 14:23:43","Storing a Bitmap into a ContentProvider from a BroadcastReciever ","<java><android><database><image>","1","0","","",""
"3503892","1","","","2010-08-17 15:04:53","3","3305","<p>I currently have an app that has many activities and needs to have a way of maintaining state between these activities.</p><p>I use the Application class to do this, declaring my global variables and using getters and setters to interact with my activities. </p><p>I was hoping to place a few custom methods in there, so that when I want to do a common task like, for instance, display an error message, I can declare the method in my application class and call it from any activity that uses it </p><pre><code>EscarApplication application = (EscarApplication) this.getApplication();</code></pre><p>EscarApplication being the name of my application class above.</p><p>I have tried to include this method in my application class:</p><pre><code>public void showError(String title, String message) {        Log.i(""Application level"",message);        this.alertDialog.setTitle(title);        alertDialog.setMessage(message);        alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog,int which) {                return;            }        });        alertDialog.show();    }</code></pre><p>In the hope that I can call this method from activity without having to redeclare it, but when I call it using something like below I get an null pointer exception:</p><pre><code>Visit.this.application.showError(""Update error"", ""An error has occurred while trying to communicate with the server"");</code></pre><p>Visit being the name of my current activity above.</p><p>Should this work, or can I only use getters and setters to change global vars in an Application Class.</p><p>Stack Trace:</p><pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{escar.beedge/escar.beedge.HomeScreen}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an applicationat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)at android.app.ActivityThread.access$2100(ActivityThread.java:116)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4203)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)at dalvik.system.NativeStart.main(Native Method)ERROR/AndroidRuntime(375): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an applicationat android.view.ViewRoot.setView(ViewRoot.java:460)at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)at android.app.Dialog.show(Dialog.java:238)at escar.beedge.EscarApplication.showError(EscarApplication.java:98)at escar.beedge.HomeScreen.onCreate(HomeScreen.java:30)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)</code></pre><p>The dialog is declared as such in the application class:</p><pre><code>AlertDialog alertDialog;</code></pre><p>Created in that same class:</p><pre><code>alertDialog = new AlertDialog.Builder(this).create();</code></pre><p>and the method to call it in that class is as follows:</p><pre><code>public void showError(String title, String message) {        alertDialog.setTitle(title);        alertDialog.setMessage(message);        alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog,int which) {                return;            }        });        alertDialog.show();    }</code></pre><p>And finally, it is called from an activity like so:</p><pre><code>EscarApplication application;application = (EscarApplication) this.getApplication();application.showError(""test"", ""display this message"");</code></pre>","409826","","1288","","2013-07-06 14:02:16","2013-09-25 06:31:47","Can I create custom global methods in my Android Application class?","<android><global-variables><android-application>","4","6","","",""
"3504044","1","","","2010-08-17 15:19:33","1","287","<p>I have a list view that displays TextViews which have been spanned so that Links in the text are actionable.</p><p>When a user clicks the row, not on a link, I'd like the row to 'flash' so that the user knows they have clicked it ok.</p><p>I there a way to re-enable the row selected flash?</p>","172861","","172861","","2010-08-17 15:56:35","2010-08-17 15:56:35","Android ListView 'flash' when row clicked is off","<android><listview>","0","1","","",""
"3504146","1","3504734","","2010-08-17 15:29:11","0","1512","<p>I am using a custom ArrayAdapter in order to populate a ListView in my page. This is the initation code of that adapter:</p><pre><code>public IngredientListAdapter(Context context, int layout_resourceid, ArrayList&lt;RecipeItem&gt; items) {    super(context, layout_resourceid);    this.items = items ;    ctx = context;}</code></pre><p>To this array adapter, I pass an array of RecipeItems (inside my ListRecipeItems ListActivity class) as such: </p><pre><code>iAd = new IngredientListAdapter(this, R.layout.recipeitem_row, recipe.Ingredients );                   this.setListAdapter(iAd) ;</code></pre><p>However, I find that the ListView is not populated, despite the recipe.Ingredients ArrayList definitely being populated correctly.</p><p>A check of iAd.items.getCount() confirms that the items are there.The only way that I can get the ListView to populate is by then manually adding each item to it with .add() e.g.;</p><pre><code>for(int i=0;i&lt;recipe.Ingredients.size();i++){   iAd.add(recipe.Ingredients.get(i)); }</code></pre><p>My understanding was that passing a full array to the ArrayAdapter on initialization would automatically populate that ListView. However it seems that the getView method of the Adapater is never being called. </p><p>Could anyone shed any light on this behaviour? I am pretty new to android and java so I may have missed something obvious.</p><p>Many thanksNick</p>","423021","","","","","2010-08-17 18:19:09","Using ArrayListAdapter with ListView","<android><listview><android-widget>","2","0","","",""
"3504530","1","3504858","","2010-08-17 16:06:18","0","817","<p>I'm adapting <a href=""http://code.google.com/p/android-imagedownloader/source/browse/trunk/src/com/example/android/imagedownloader/ImageDownloader.java"" rel=""nofollow"">Image Downloader</a> from Google Android blog. I want <code>ImageDownloader</code> to be singleton since I'll be using it in multiple places in my application. I want also to be able to manipulate <code>Bitmaps</code> using different <code>Strategies</code> (eg. produce transparent bitmaps).</p><p>Context:</p><p>I want to be able to use <code>ImageDownloader</code> in one activity and set transparent bitmaps, and in another use the same <code>ImageDownloader</code> but get black&amp;white bitmaps using different strategy object.</p>","296427","","","","","2010-08-17 20:26:31","How to implement singleton with strategies?","<java><android><design-patterns><singleton><strategy-pattern>","5","0","","",""
"3504605","1","3505263","","2010-08-17 16:14:24","0","732","<p>This question is for people that has experience using flurry sdk in android applications. This sdk installs a custom exception handler. I am not satisfied with the detail of information that is logged by flurry and I would like to install my own ExceptionHandler while using flurry. Sadly the ExceptionHandler is unique per thread. Is there anyone that has found a wordaround?</p><p>Thanks,Luca</p>","368819","","","","","2010-08-17 17:39:03","Android and Flurry ExceptionHandler","<android><analytics><flurry>","1","0","","",""
"3504619","1","6496809","","2010-08-17 16:16:05","25","30840","<p>In my android app, I'm making a method that pop all activities and bring up the first activity.</p><p>I use this code:</p><pre><code>Intent intent = new Intent(this, MMConnection.class);intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);this.startActivity(intent);</code></pre><p>As I noticed that the transition was still a left to right animation, does someone know if there is a way to change system animation when starting an activity?</p><p>Actually, I'd ideally like to have a right to left transition (like when the return button is tapped)</p><p>thanks for help!</p>","334209","","","","","2012-10-22 06:37:01","Animation transition between activities using FLAG_ACTIVITY_CLEAR_TOP","<android><animation><activity><android-intent><transition>","3","0","19","",""
"3504684","1","3504962","","2010-08-17 16:22:32","2","859","<p>I'm trying to take the user input, which may or may not have a comma in it, and put a comma in the correct places upon the user deselecting the field (or at all, if that's not possible).</p><p>I would also like to know how I can subtract the commas to make the number just an integer.</p><p>Thanks in advance for your help!</p>","312390","","","","","2010-08-17 17:23:20","How to format an EditText's numeric value on unfocus (or at all!?) in Android to use commas","<java><android>","2","0","","",""
"3504700","1","","","2010-08-17 16:25:57","0","606","<pre><code>    public class Connection extends Activity implements Runnable {            public static final int CONNECTION_ERROR = 1;            public static final int CONNECTION_DONE = 3;            @Override            public void onCreate(Bundle icicle) {                super.onCreate(icicle);                createConnection();            }            public void createConnection() {                m_ProgressDialog = ProgressDialog.show(this, ""Please wait..."",""Connection ..."", true, false);                thread = new Thread(this);                thread.start();            }            public void run() {                int i = connecTion();                handler.sendEmptyMessage(i);            }            private Handler handler = new Handler() {                @Override                public void handleMessage(Message msg) {                 if (msg.what == CONNECTION_ERROR) {                                        m_ProgressDialog.dismiss();                        AlertDialog.Builder alt_bld = new AlertDialog.Builder(thisA);                        alt_bld.setMessage(""Failed to connect to the server"");                        alt_bld.setCancelable(false);                                                               alt_bld.setNegativeButton(""Quit"",new DialogInterface.OnClickListener() {public void onClick(DialogInterface dialog, int id) {finish();}});                        alt_bld.setPositiveButton(""Try Again"",new DialogInterface.OnClickListener() {                                    public void onClick(DialogInterface dialog, int id) { //HERE IS THE PROBLEM                                        /*m_ProgressDialog.show(thisA, ""Please wait..."", ""Connection ..."", true, false);                                        connecTion();*/                                    }                                });                        AlertDialog alert = alt_bld.create();                        alert.setTitle(""ChatApp"");                        alert.setIcon(R.drawable.icon);                        alert.show();                    }                    else {                              m_ProgressDialog.dismiss();                    finish();                    }                }            };            private int connecTion() {                      /** Create a connection */                        try {                           //Function to create the connection (throwing error if there is a pb)                } catch (Exception e) {                    Log.e(""App"",""Failed to connect"");                    return CONNECTION_ERROR;                }                               //If no error left, everything is OK                return CONNECTION_DONE;            }</code></pre><p>I want to realize a ""Try Again"" button which launch again the thread to create the connection and the ProgressDialog in parallel. How can I kill the ""old"" thread and create the new one properly?Is it better to keep the same thread alive and just dealing with Handler and Messages? Use service?</p><p>Thank you ! </p>","423082","","","","","2011-03-30 02:09:50","Dealing with Thread, Handler and message: ""Restart"" a thread","<android>","2","0","","",""
"3504736","1","3545462","","2010-08-17 16:29:44","5","1869","<p>According to <a href=""http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject"">this SDK guide</a>, unit-testing a Library project can be achieved by creating a standard application project, reference the Library project and then instrument the application for unit testing.</p><p>However, when I do this and launch the test application I get the message</p><blockquote>  <p>No tests found with test runner 'JUnit 3'.</p></blockquote><p>I'm using Eclipse and the Android ADT plugin, all latest versions. </p><p>Note: the projects compile just fine. The test project also installs fine to the emulator. But in the console I can see that it looks for <code>&lt;library&gt;.apk</code>, which of course doesn't exist since I'm compiling this as a library into the test project.</p><p>Anyone got this to work? And if so, what is the trickery here?</p><p><strong>Update:</strong> after discovering and fixing a problem, which was actually including the test classes (!), the test runner now can find all tests. <strong>But</strong>, all the tests fail with the following exceptions:</p><blockquote>  <p>java.lang.NoClassDefFoundError: &lt;nameOfClassInLibraryProject&gt;</p></blockquote><p><code>nameOfClassInLibraryProject</code> are classes defined in the library project. These classes should be compiled into the test project, and indeed, everything compiles just fine. But when running the test project, the runtime doesn't seem to find the library classes.</p>","35245","","35245","","2010-08-17 21:52:00","2010-08-23 07:22:30","Self-contained test library project cannot find the library classes","<android><unit-testing><junit>","1","0","0","",""
"3504903","1","","","2010-08-17 16:50:15","2","638","<p>I'm searching all over but cannot seem to find a answer to this.</p><p>I have my main HomeActivity view which contains a SlidingDrawer in the main.xml layout. The sliding drawer works fine. What I'd like to do though is that when the SlidingDrawer is opened, I want to launch a new activity in the sliding drawer view, and when the drawer closes it drops a result.</p><p>So in theory I'm looking at launching an activity with the startActivityForResult method and when the SlidingDrawer closes, processing the result? Is this at all possible or am I out to lunch? </p>","312411","","480691","","2012-05-17 20:14:39","2012-05-17 20:14:39","ANDROID: Possible to load an Activity into a SlidingDrawer view?","<android>","1","1","","",""
"3505055","1","","","2010-08-17 17:14:15","1","555","<p>I want to collect phone numbers from phone with last-name and first-name (for sorting purpose). How can I achieve that in the simplest way? Is it possible with one query?</p><p>And I need both versions: for pre 2.0 SDK and later to be compatibile. </p>","209502","","","","","2010-08-17 17:32:07","How to read phone numbers with full (not only display name) contact data (first-name, last-name, nickname)? on Android","<android><contacts>","1","0","2","",""
"3505148","1","3509360","","2010-08-17 17:25:26","0","213","<p>I have been working with dnsjava to do a lot of DNS lookups, using the Lookup class with its own resolver per lookup, and also with a single shared resolver. No matter how I invoke it, there are always collections of sockets left open at the end of the process, and eventually my process runs out of file descriptors and is killed.</p><p>Tracing the code, I found that creating a Selector object causes two additional sockets to be created, and these are the two that are never closed. The dnsjava code is calling the Selector's close() method (I have stepped over that and verified that the two sockets, sink and source, are left open after it).</p><p>Has anybody else seen this? Is there some way I can force those sockets to close? I don't see any public API to get the source and sink socket references from the Selector class, but perhaps I am missing something?</p>","423145","","","","","2010-08-18 06:02:06","Socket leak in Apache Harmony SocketImpl on Android?","<android>","1","0","","",""
"3505206","1","","","2010-08-17 17:31:09","0","723","<p>Hi everybody i am doing project on android  based application.</p><p>i am using my andriod application as client   and on the other side using java based webservice</p><p>My question is how to pass string[] parameter to java webservice using ksoap ...?</p><p>help me please...</p>","707531","","","","","2011-04-16 14:20:17","Passing string[] parameter to java webservice through ksoap","<java><android><web-services>","1","0","1","",""
"3505261","1","","","2010-08-17 17:38:48","1","2526","<pre><code>  ListView  ls=(ListView)findViewById(**R.id.list**);    ls.setOnItemClickListener(new OnItemClickListener() {     public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {     AlertDialog.Builder adb=new AlertDialog.Builder(ListAllTracks.this);     adb.setTitle(""LVSelectedItemExample"");    // adb.setMessage(""Selected Item is = ""+String.valueOf(ls.getItemIdAtPosition(position)));     adb.setPositiveButton(""Ok"", null);     adb.show();      }          });&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;&lt;ListView android:id=""@android:id/list"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre>","365860","","60261","","2010-08-17 17:58:26","2010-08-17 19:10:39","ListView I can't reference in R.id.list?","<android><listview>","2","2","","",""
"3505276","1","3532241","","2010-08-17 17:40:51","1","1147","<p>After working a while with my Mediaplayer streamer project I got the Logcat saying: ""Max cache size reached"" every second. Is it normal? And should I do something about it? It plauges me and I have to restart my emulator to get rid of it.</p><pre><code>08-17 17:34:28.772: INFO/Prefetcher(34): max cache size reached08-17 17:34:29.772: INFO/Prefetcher(34): max cache size reached08-17 17:34:30.772: INFO/Prefetcher(34): max cache size reached08-17 17:34:31.772: INFO/Prefetcher(34): max cache size reached08-17 17:34:32.775: INFO/Prefetcher(34): max cache size reached08-17 17:34:33.778: INFO/Prefetcher(34): max cache size reached08-17 17:34:34.779: INFO/Prefetcher(34): max cache size reached</code></pre>","215088","","215088","","2010-08-18 04:39:15","2010-08-20 15:14:19","Prefetcher max cache size reached","<android><caching><logcat>","1","0","1","",""
"3505283","1","3505624","","2010-08-17 17:41:38","2","9124","<p>I am trying to build a custom toggle button in Android, I want it to look like radio button but function as toggle button. Can some one help me with this? any clue hints close to answer is appreciated. </p>","357349","","357349","","2010-08-17 18:07:37","2010-10-08 23:20:19","Custom (round) toggle button","<android><button><toggle>","3","0","1","",""
"3505356","1","","","2010-08-17 17:50:00","3","806","<p>I am looking for a list of Android devices that has the following info (at least):</p><ul><li>Device Name</li><li>User Agent String</li><li>Screen Format (of the three supported Android screen sizes)</li><li>Touch Enabled?</li><li>Maximum HTML5 Database Size</li></ul><p>There are some lists online (like the one on Wikipedia), but it does not have all of this data.</p>","5512","","","","","2010-08-25 11:09:18","Need a list of Android devices with specs","<android>","2","0","","",""
"3505638","1","","","2010-08-17 18:22:27","1","2025","<p>I created a ListView that contains a row which in turn contain text and a button.The idea is to have the button function as a delete button to remove the rowfrom the list as well as the database.</p><p>I order to do this I created an adapter to handle the button click. This code is below.Deleting the database record works fine, but I have not yet succeeded in refreshingthe ListView so the record will no longer be displayed.</p><p>public class FeedArrayAdapter extends ArrayAdapter {</p><pre><code>private ARssEReaderDBAdapter dba;private String TAG = ""FeedArrayAdapter"";private View v;private ListView feedList;private OnClickListener btnDeleteFeedListener = new OnClickListener(){    public void onClick(View pView) {        dba = new ARssEReaderDBAdapter(getContext());        Integer objInt = (Integer) pView.getTag();        dba.open();        dba.deleteFeed(objInt);        dba.close();        Log.w(TAG, ""Database row, "" + pView.getTag() + "" got clicked."");    }};public FeedArrayAdapter(Context context, int textViewResourceId, List&lt;Feed&gt; items) {    super(context, textViewResourceId, items);}@Overridepublic View getView(int position, View convertView, ViewGroup parent){    Log.w(TAG, ""getView"");    v = convertView;    if (v == null) {        LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);        v = vi.inflate(R.layout.feedlistrow, null);    }    Feed feed = getItem(position);    if (feed != null){        v.setTag(feed.getFeedId());        TextView title = (TextView)v.findViewById(R.id.TextView01);        if (title != null){            title.setText(feed.getTitle());        }        Button btnDelete = (Button)v.findViewById(R.id.btnDelete);        btnDelete.setTag(feed.getFeedId());        btnDelete.setOnClickListener(btnDeleteFeedListener); //    }    return v;}</code></pre><p>} </p><p>Any help is greatly appreciated.</p><p>Richard</p>","423207","","","","","2010-08-17 18:26:06","Refreshing a listview on click of a button in a row of that listview","<android><listview><button><refresh><onclick>","1","0","1","",""
"3505741","1","","","2010-08-17 18:35:27","1","1011","<p>I have 2 EditText widgets ,one takes username and other takes password.When the user enters username in First EditText ,the text should be validated (It should accept only characters no digits) when the focus is on the first EditText. How to achieve this.It needs to display error message using setError() method in EditText when the user enters wrong data.</p>","385939","","385939","","2010-08-17 19:36:34","2014-02-25 17:44:35","Validating EditText content as soon as user enters data","<android><android-widget>","2","0","2","",""
"3505788","1","3505829","","2010-08-17 18:40:30","1","3431","<p>I want to make somethink like hyperlink. Right now, i created button, which opens new Activity with WebView. But i want to open a ""globally"" default web browser at specified url. How can i do this ?</p>","367786","","","","","2012-10-17 14:42:02","How to open default browser","<java><android><browser>","2","0","1","",""
"3505841","1","3505912","","2010-08-17 18:47:56","6","28810","<p>I used two image button for Next and Back and i used onclick event for those button i want to which image button fire on onclick and run particular function for next or back in onclick event how will i get which image button fire or onclick event at runtime</p>","410757","","2441810","","2013-06-01 00:03:54","2014-04-08 07:16:56","onclick listener in android","<android><onclicklistener>","3","0","3","",""
"3505861","1","","","2010-08-17 18:50:51","2","1000","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3423948/disable-trackball-click-in-android"">Disable trackball click in Android</a>  </p></blockquote><p>How can I disable the trackball in my app? I only want the buttons to work when you click them using the touchscreen.</p>","404784","","","","","2010-08-17 18:58:50","How can I disable the trackball?","<android>","1","1","","2010-08-18 11:26:17",""
"3505865","1","3505931","","2010-08-17 18:51:24","7","5839","<p>Hello<br>I make a BroadcastReceiver to receive Phone number of the person who call me</p><pre><code>&lt;intent-filter&gt;&lt;action    android:name=""android.intent.action.PHONE_STATE"" /&gt;&lt;/intent-filter&gt;</code></pre><p>1/How to check if the phone number receive is on my contact list ?<br>Do you have a tip to know if this phone number exist on contact list with out loading contact list ?<br>I don't want more information, just if this phone number exist.</p><p>2/if it's not possible, and i must load contact list, how to do it on BroadcastReceiver ?<br>When i try to do getContentResolver, it's not working because i'm on BroadcastReceiver and not inside Activity...</p><p>thanks for your help</p>","144587","","","","","2011-03-06 14:36:28","Android : Check phone number present in Contact List ? (Phone number retreive from phone call)","<android><contacts><broadcastreceiver>","4","0","3","",""
"3505885","1","3539333","","2010-08-17 18:53:02","0","1773","<p>I am trying to get a local time from a server UTC time. I get the UTC time form the server -- and i want to make it right for each individual Android phone whether it be in California or China. </p><p>This is the code I am using now -- however it snot working.</p><p>The time I get from the server is </p><pre><code>""2010-08-17 19:41:13.0""</code></pre><p>And the code I use to get the difference(in seconds) is the following: </p><pre><code>public static long getSecondsDifference(Timestamp timeStamp) {    final Calendar calendar = Calendar.getInstance(Locale.getDefault());    int refrenceOffset = TimeZone.getDefault().getOffset(timeStamp.getTime());    final long referenceSeconds = (timeStamp.getTime() + refrenceOffset) / 1000;    final long currentTimeSeconds = (calendar.getTimeInMillis()) / 1000;    final long differenceMinutes = (currentTimeSeconds - referenceSeconds) / 60;    return differenceMinutes;}</code></pre><p>The timestamp is from the java.sql.timestamp package.</p><p>Right now the time where I am is 11:50AM  -- and the method returns that the given server time is -53 minutes ago( so obviously doing something wrong :) )</p>","354247","","243782","","2010-08-17 19:03:32","2010-08-21 22:42:47","Convert UTC time to phone local time","<java><android><datetime><rest>","1","1","1","",""
"3505900","1","","","2010-08-17 18:54:59","33","25852","<p>I am doing my first app with a database and I am having a little trouble understanding the onUpgrade function.  My database has a table with an items and a favorite column so that the user can favorite an item.  Most implementations I see simply drop the table and reconstruct it but I don't want to do this. I want to be able to add more items to the table.  </p><p>When the app is upgraded through the android marketplace does the database know its version number?  So could I increment the version number in the code and then export it to the marketplace and when the user boots up the upgraded version for the first time then onUpgrade will be called?  </p><p>If this is the case my onUpgrade would simply pull from a file and add the database items in.  Is this a standard way of doing things or is there a better way of handling this in Android.  I am trying to stay as standard as possible.</p><p>Thanks</p>","336861","","","","","2014-04-10 22:06:55","SQLiteOpenHelper onUpgrade() Confusion Android","<android><database><sqlite>","4","4","50","",""
"3505930","1","3506039","","2010-08-17 19:00:07","123","127304","<p>I have searched everywhere but I couldn't find my answer, is there a way to make an simple HTTP request? I want to request an PHP page / script on one of my website but I don't want to show the webpage.</p><p>If possible I even want to do it in the background (in an BroadcastReceiver)</p>","355651","","615740","","2012-06-30 19:43:02","2014-01-23 11:25:44","Make an HTTP request with android","<android><httpwebrequest>","5","0","94","",""
"3505968","1","12730783","","2010-08-17 19:03:49","1","1193","<p>I would like to create my own implementation of a LocationProvider, there seems to be a way to  add a ""mock"" provider, but that isn't exactly what I want.</p><p><a href=""http://developer.android.com/reference/android/location/LocationManager.html"" rel=""nofollow"">http://developer.android.com/reference/android/location/LocationManager.html</a></p><p>There also appears to be a permission called:android.permission.INSTALL_LOCATION_PROVIDER</p><p>But there is no documentation about how to use this permission.</p><p>How do I register a new location provider?</p>","108495","","","","","2012-10-04 15:35:57","How do I add install my own LocationProvider?","<android><gps><location>","1","2","1","",""
"3506047","1","","","2010-08-17 19:12:48","0","511","<p>I need to capture events when the user clicks on a tab in a <code>TabHost</code>. Something similar to <code>OnTabChangeListener</code>, but <code>OnTabChangeListener</code> only fires when the tab changes, not when it stays the same.</p>","423253","","331473","","2011-11-24 07:19:05","2011-11-24 07:19:05","Need event for user clicking on a tab in Android","<android><tabs>","1","1","","",""
"3506066","1","","","2010-08-17 19:15:09","1","4308","<p>I've programmed my app with Eclipse and android 2.2. However I think that my app would work for previous version and so it would allow more users to use my app. The problem is that I'm not sure... for instance I'm using Gestures which I think is a more recent feature... but otherwise I'm just using some Button, ListView, and WebView.</p><p>So is there a way to detect automatically the Minimum Sdk Version needed ( by checking which function my app is using) ?</p><p>I can't download the SDK of each previous version of android and test it until it doesn't work ...</p><p>Thanks</p>","400695","","","","","2010-08-18 04:58:08","Android minSdkVersion","<android><sdk><version>","3","0","","",""
"3506067","1","","","2010-08-17 19:15:15","0","3138","<p>How to create a progress dialog without title and message?I used this code:</p><pre><code>ProgressDialog.show(MyActivity.this, """", """", true);</code></pre><p>But the progress spin was not centered well in the progress dialog view.</p><p>Thanks.</p>","256239","","256239","","2010-08-17 19:38:46","2010-08-17 19:38:46","How to create a progress dialog without title and message?","<android>","1","2","","",""
"3506103","1","3507199","","2010-08-17 19:19:45","8","6986","<p>currently i have the following layout</p><pre><code>&lt;LinearLayout     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:layout_alignParentLeft=""true""     android:layout_alignParentRight=""true""     android:layout_marginTop=""9px""     android:layout_below=""@+id/desc""     android:id=""@+id/ll_item""      android:orientation=""vertical""     android:paddingRight=""3px""     android:paddingLeft=""3px""     android:paddingBottom=""5px""     android:paddingTop=""5px""     android:background=""@drawable/rounded_corner_lists"" &gt;&lt;!--        &lt;ListView android:drawSelectorOnTop=""false"" android:id=""@+id/lv""    android:layout_height=""fill_parent"" android:layout_width=""wrap_content"" android:divider=""#ddd"" android:dividerHeight=""1px"" android:background=""@drawable/white""    /&gt;    --&gt;    &lt;/LinearLayout&gt;</code></pre><p>the listview that i have commented out, i have tried to make this in the xml, with the height set to wrap_content, fill_parent, currently i am doing this programatically with the following code</p><pre><code>LinearLayout ll_item = (LinearLayout) this.findViewById(R.id.ll_item);        if(list.length() &gt; 0)        {            ll_item.setVisibility(View.VISIBLE);            LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,calcListHeight(list));            listview = new ListView(this);            listview.setBackgroundResource(R.drawable.white);            listview.setDivider( new ColorDrawable(this.getResources().getColor(R.drawable.dividercolor)) );            listview.setDividerHeight(1);            listview.setCacheColorHint(0);            mAdapter  = new JSONAdapter( list, this );            listview.setAdapter(mAdapter);            mAdapter.notifyDataSetChanged();            ll_item.addView(listview, lp);        }</code></pre><p>this is the result</p><p><img src=""http://i.stack.imgur.com/RY1TN.jpg"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/BNsiH.jpg"" alt=""alt text""></p><p>so you can see in this image, that since i'm containing the listview in a linearlayout to get the rounded corner look, it doesn't just automatically stretch to contain the entire listview,  is there any way to have the two elements just wrap the content vertically so there is no scrolling without me programatically setting the height ? ? ? </p><p>i guess one other thing i should mention is that i have all this layout in a scrollview, because i want this listview to be a tiny subsection of the entire layout, so it would be something like </p><p>-scrollview<br>  -textview<br>  -textview<br><br>  -linearlayout<br>    -listview<br><br>  - button<br></p><p>here is a simpler layout of what i have </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:orientation=""vertical"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent""              android:background=""@drawable/bg"" xmlns:android=""http://schemas.android.com/apk/res/android""              android:id=""@+id/titlebar""&gt;    &lt;ScrollView android:id=""@+id/sv"" android:layout_width=""fill_parent"" android:background=""@drawable/bg""                android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;        &lt;RelativeLayout android:id=""@+id/widget28""                        android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:padding=""4dip""                &gt;            &lt;LinearLayout android:orientation=""vertical"" style=""@style/rounded_corner_full_width_button""                          android:id=""@+id/editfields""&gt;                &lt;ListView android:drawSelectorOnTop=""false"" android:id=""@+id/lv"" android:layout_height=""fill_parent""                          android:layout_width=""wrap_content"" android:divider=""#ddd"" android:dividerHeight=""1px""                          android:background=""@drawable/white""/&gt;            &lt;/LinearLayout&gt;        &lt;/RelativeLayout&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre>","202064","","202064","","2010-08-17 20:11:42","2010-08-17 21:39:30","how can i automatically size listview so it doesn't scroll","<android><listview><android-linearlayout>","1","0","1","",""
"3506174","1","","","2010-08-17 19:26:51","2","605","<p>A few of my apps were pulled by Google, and a few I unpublished myself, but my <a href=""http://market.android.com/publish/Home"" rel=""nofollow"">Android Market dashboard</a> still has all these apps listed. Is there any way to remove them?</p>","764272","","","","","2011-05-06 22:57:29","Clear apps from Android Market dashboard","<android><google-play>","1","0","1","",""
"3506319","1","3506500","","2010-08-17 19:45:01","25","37771","<p>I followed <a href=""http://developer.android.com/guide/topics/resources/color-list-resource.html"">this tutorial</a> to create a color state list for a particular Android view. I just want it to highlight when clicked so the user knows why the screen just changed. </p><p>When the view is rendered, I get the following error:</p><p>org.xmlpull.v1.XmlPullParserException: Binary XML file line #3:  tag requires a 'drawable' attribute or child tag defining a drawable</p><p>My color XML (in res/color/viewcolor.xml):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_pressed=""true"" android:color=""#ff33ffff""/&gt; &lt;!-- pressed --&gt;    &lt;item android:color=""#ff000000""/&gt; &lt;!-- default --&gt;&lt;/selector&gt;</code></pre><p>My layout XML (in res/layout/myview.xml):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/myview""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""top""    android:background=""@color/viewcolor""&gt;    &lt;!--crap in the layout--&gt;&lt;/LinearLayout&gt;</code></pre><p>What did I miss?</p>","136790","","","","","2012-04-12 22:06:34","Android LinearLayout with color resource: What am I doing wrong?","<android><android-layout>","2","1","19","",""
"3506322","1","","","2010-08-17 19:45:38","1","965","<p>Hope someone can help me out here.  I will try to be concise!</p><p>I have a widget which starts a service. The service registers two broadcast receivers.  I would like to send back intents from the receivers to the service, so that the service can react.</p><p>I believe I read somewhere that 'starting' the service multiple times works, e.g. do the following in the receivers:</p><pre><code>serviceIntent.setAction(""me.SERVICE"");intent.putExtra(""me.SERVICE"", somedata);context.startService(serviceIntent);</code></pre><p>I remember reading (on some blog) that this won't start a new service, but will simply pass the intent to the already running service.  Is this correct?  Is it a bad way of doing it? Is there a better way?</p><p>Thanks very much!</p><p>Jack</p>","423276","","","","","2012-09-02 01:54:26","How to communicate back to a service from a broadcast receiver?","<android>","2","0","","",""
"3506547","1","","","2010-08-17 20:13:12","0","407","<p>Android has Looper, and iPhone has Run Loops.  It seems like Blackberry would have a similar backed in facility to queue and run threads.</p><p>Does anyone know if there is?</p>","375614","","","","","2010-08-19 15:28:48","What is blackberry's equivalent to Androids Looper?","<iphone><android><multithreading><blackberry><looper>","1","0","","",""
"3506616","1","3515093","","2010-08-17 20:23:30","1","200","<p>I have a handler that receives a message on every location update, every 5 secs. From the location I can request the current city the user is moving in. Then I want to download some data once and only when city changes. How can I realize that?</p><pre><code>Handler myViewUpdateHandler = new Handler(){    public void handleMessage(Message msg) {            switch (msg.what) {            case UPDATE_LOCATION:                mc.animateTo(geosenseo.getCurrentPoint());                  mapView.invalidate();                    //a async task sets the currentCity field                  if(trigger &amp;&amp; (currentCity != """")){                   firstCity = currentCity;                   trigger = false;               }               if((currentCity != """") &amp;&amp; (firstCity != """")){                   if(firstCity != currentCity){                       //download only when city changes                       trigger = true;                   }                }           }            super.handleMessage(msg);    }};</code></pre><p>like you can see I have played around with the vars. any ideas? thanks</p>","401025","","1288","","2010-08-17 20:28:14","2010-08-18 17:57:18","UpdateHandler, do a thing only when trigger is true, Android","<java><android><handler>","1","2","1","",""
"3506653","1","","","2010-08-17 20:27:13","0","187","<p>So I'm using the jQuery plugin, RSV(real simple validation) because the client would like to use alert boxes as opposed to inline alerts for the form validation.This site is for mobile browsers.The problem I'm running into is that when there's an error, an alert dialogue comes up to tell the user about their offense. When the alert is closed, the offending field is focused.The problem with the android is that the soft keyboard doesn't show up.Here's the code that generates the error handling:</p><pre><code>function timsErrorFunction(f, errorInfo)      {        for (var i=0; i&lt;errorInfo.length; i++)        {        // errorInfo[i][1] contains the error string to display for this failed field, e.g.        alert(errorInfo[i][1]);        // errorInfo[i][0] contains the form field node that just failed the validation, e.g.        errorInfo[i][0].focus();        errorInfo[i][0].style.color = ""red"";        }        return false; // always return false! Otherwise the form will be submitted      }</code></pre>","409763","","","","","2011-07-11 00:20:29","Android Softkeyboard not showing up when form field is focused via JS","<android>","1","0","","",""
"3506666","1","","","2010-08-17 20:29:11","0","1007","<p>So I have this program that grabs the RSS feed at <a href=""http://www.muttville.org/mutts/feed"" rel=""nofollow"">http://www.muttville.org/mutts/feed</a> and displays a list of the available dogs, basically filling out each item in a ListView with an image of the dog on the left, and the headline about the dog on the right.</p><p>My application executes and grabs and parses the XML feed fine. onCreate, it stores the image URL as a string in each item. I have an RSSFeed data structure, which is basically an array of RSSItem objects. The problem is figuring out how to update the images asynchronously.</p><p>I have an imageDownloader that I actually got from the Android dev blog at Google that updates the images and stores them, but the preload is very long. I'd rather begin displaying the items immediately and updating the images as I get them. Annoyingly, the listview scrolls really unresponsively at first as well, calling my imageDownloader to retrieve the items again. Is there some way I can make the ImageViews just grab a pointer to an ImageView object in the RSSItem, and then just update that?</p><p>I'm pretty new to Android development, so there's a good chance I don't realize something basic. Here's my adapter code:</p><p>private class FeedItemAdapter extends ArrayAdapter {</p><pre><code>    private List&lt;RSSItem&gt; items;    public FeedItemAdapter(Context context, int textViewResourceId, List&lt;RSSItem&gt; items) {        super(context, textViewResourceId, items);            this.items = items;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {            View v = convertView;            if (v == null) {                LayoutInflater vi =                     (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                v = vi.inflate(R.layout.displayitem, null);            }            RSSItem o = items.get(position);            if (o != null) {                    ImageView tt = (ImageView) v.findViewById(R.id.leftimage);                    TextView bt = (TextView) v.findViewById(R.id.righttext);                    if (tt != null) {                           //get image from url string                        imageDownloader.download(o.getImageString(), tt);                    }                    if(bt != null){                          bt.setText(feed.getItem(position).getTitle());                    }            }            return v;    }}</code></pre>","423307","","","","","2010-08-17 20:38:52","Updating images dynamically from URL with Android","<android><listview><rss><adapter><imageview>","1","0","","",""
"3506684","1","3507589","","2010-08-17 20:31:17","1","228","<p>Does this feature allow you to upload an APK larger than 25MB?  For example a 32MB apk?</p>","291981","","","","","2010-08-17 22:47:45","Android API Level 8 App Install Location Feature","<android>","1","7","","",""
"3506696","1","","","2010-08-17 20:32:57","13","25987","<p>I have a <code>TextView</code> that I'm dynamically adding text to.</p><p>in my <code>main.xml</code> file I have the properties set to make my max lines 19 and scrollbars vertical.</p><p>in the <code>.java</code> file I am using <code>textview.setMovementMethod(new ScrollingMovementMethod());</code> to allow for scrolling.</p><p>The scrolling works great.  As soon as 19 lines are taken up, and more lines are added it starts scrolling just as it should.  The problem is, I want the new text to scroll into view.</p><p>I am writing out the value for <code>textview.getScrollY()</code> and it stays at <code>0</code> no matter what (even if I manually scroll it down and add a new line of text).</p><p>consequently <code>textview.scrollTo(0, textview.getScrollY());</code> does nothing for me.</p><p>Is there another method I should be using to obtain the vertical scroll amount for the <code>textview</code>?  Everything I've read says that for all intents and purposes, what I'm doing should be working :/</p>","233971","","356895","","2013-03-12 13:35:22","2014-04-02 04:30:10","auto-scrolling TextView in android to bring text into view","<android><scrolling><textview>","7","0","6","",""
"3506792","1","3506833","","2010-08-17 20:45:14","26","16105","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3423754/retrieving-android-api-version-programmatically"">Retrieving Android API version programmatically</a>  </p></blockquote><p>I am trying to retrieve the current API Version of the device my Application is Running. Is there a way i can get that and Store it on a String. This needs to Work on 1.5 Version and Up. Examples would be greatly appreciated. Thank you.</p>","423305","","","","","2013-02-28 11:13:27","Android API Version programmatically","<android>","3","0","6","2012-10-30 21:57:45",""
"3506852","1","3507007","","2010-08-17 20:52:29","0","1158","<p>I'm on my way with my first game, all design and that stuff are done, just coding left.I have successfully watched tutorials around the world wide web with information about Graphics and how to create a successfully thread-synchronization within it. </p><p>Like now I have a SurfaceView-class and a Thread-class. The thread-class have this constructor to receive the Game Engine from my SurfaceView-class.Simple code from Thread-class constructor:</p><pre><code>    public Thread(SurfaceHolder localsurfaceHolder,    Context context,    Handler handler,     SurfacefView localEngine) {    surfaceHolder = localsurfaceHolder;    this.handler = handler;    this.context = context;    engine = localEngine;}</code></pre><p>From my SurfaceView-class in the surfaceCreated-method:</p><pre><code>thread = new GameThread(getHolder(), context, new Handler(), this);</code></pre><p>And there is my code that will start trigging the thread when the surface is created.</p><p>Now to the <strong>real deal</strong>. Shortly I want a game engine that is totally separated from the view. The problem is; how to achieve this? How should the GameEngine-class constructor look like and where shall I put the drawing/calculations-methods? What does the GameEngine?</p><p>Now my GameEngine-class look like:</p><pre><code>package com.myname.mygame;public class GameEngine {      //If im right, a constructor for the engine should be placed here      //How and which parameters shall I change and send with from the view}</code></pre><p>Thanks in advance!</p>","386562","","386562","","2010-08-22 22:50:36","2010-08-22 22:50:36","Create a simple, simple, Game Engine","<java><android>","1","0","","",""
"3506865","1","3507497","","2010-08-17 20:54:48","2","504","<p>I've noticed lately that some app recommender programs seem to get data off the android market.  I'm wondering how I could retrieve information, such as screen shots, description, developer, number of downloads, rating, etc...</p><p>I've done many searches and I haven't found any solutions.  It would be nice to be able to use that info to be able to see a rating for an app inside an app chooser, for example.  Or perhaps be able to track changes and rating over time and version history, etc...</p><p>Is there an API to access that information?  Is there a way to parse the data from a website? Or is there a complicated hack involved?  Any information is appreciated...</p>","68572","","","","","2010-08-17 22:30:15","Read data about an application from the android market","<android><google-play>","2","0","3","",""
"3506941","1","","","2010-08-17 21:04:40","0","252","<p>I have a widget that appears to drain the battery on some of my users phones but it works fine on my Nexus One (Froyo). Phones that has reported battery drain are HTC Legend, SE X10 and SE X10 mini.  Anyone know if there is any known issues or something?</p><p>// Johan</p>","272736","","","","","2010-08-17 21:04:40","My widget drains battery on some phones","<android><android-widget><battery><nexus-one>","0","4","1","",""
"3506949","1","","","2010-08-17 21:05:16","1","358","<p>I have an Activity that retrieves information from a url. I have 2 textviews which are multi-line (txtTitle &amp; txtContent). If I populate them without using thread, it displays as multi-line. However, when I use a thread, the text views become single-line.</p><p>Is there anything I'm missing? Is the UI not completely ready when I tried putting text in it?</p><h1>My sample code is below:</h1><p>package com.mysite.app;</p><p>import org.json.JSONException;import org.json.JSONObject;</p><p>import android.app.Activity;import android.app.ProgressDialog;import android.content.Intent;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.text.Html;import android.text.Spanned;import android.widget.TextView;</p><p>public class ViewNewsActivity extends Activity implements Runnable{</p><pre><code>private ProgressDialog progressDialog = null; private String apiUrl = """";private String title = """";private String content = """";private Runnable viewNews;private TextView txtTitle = null;private TextView txtContent = null;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.view_news);    Intent myIntent = getIntent();    apiUrl = ""http://www.mysite.com"" + myIntent.getStringExtra(""api_url"");    Thread thread =  new Thread(this);    thread.start();    progressDialog = ProgressDialog.show(ViewNewsActivity.this,                ""Please wait..."", ""Retrieving News ..."", true);}public void run() {    txtTitle = (TextView)findViewById(R.id.view_news_title);    txtContent = (TextView)findViewById(R.id.view_news_content);    getNews(apiUrl);    handler.sendEmptyMessage(0);}private Handler handler = new Handler() {    @Override    public void handleMessage(Message msg) {        progressDialog.dismiss();        txtTitle.setText(title);        Spanned contentHtml = Html.fromHtml(content);        txtContent.setText(contentHtml.toString());    }};private void getNews(String apiUrl) {    String result = JSONUtils.getJSONResponse(apiUrl);    JSONObject jsonResponse;    try {        jsonResponse = new JSONObject(result);        title = jsonResponse.getString(""title"");        content = jsonResponse.getString(""content"");    } catch (JSONException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }}</code></pre><p>}</p>","112381","","","","","2010-08-17 21:05:16","TextViews become single-line instead of multi-line when populated in a thread","<android>","0","2","","",""
"3506976","1","4338911","","2010-08-17 21:08:07","5","7936","<p>When the user presses a ListView item (android:state_pressed=""true"") it flashes a shade of yellow (or you can press and hold).</p><p>What drawable is this?  I've created my own selector because I want my own ListView item color , but I lose the pressed color.</p><p>There's an Android doc about skinning buttons that references #ffff0000, but this produces red.</p><p>Does anyone know what it is and how to reference it?</p>","406790","","","","","2014-02-24 20:23:15","What is the default drawable for pressing a list item","<android><state><selector>","4","0","4","",""
"3507016","1","","","2010-08-17 21:16:14","8","11572","<p>I'm creating an AlertDialog. I'm using setView() to set a custom view. This enables the 'dark' theme on the dialog (grey background, and need white text).</p><p>Is there a way to set the dialog to use the 'light' theme? It looks nicer (white background, dark text).</p><p>Thanks</p>","291701","","","","","2011-05-04 07:21:58","Light theme for AlertDialog?","<android>","1","1","","",""
"3507069","1","3508147","","2010-08-17 21:23:54","1","958","<p>Is there a way to figure out if you are connected to a Bluetooth Device? </p><p>I have my app connecting, sending/receiving just fine.  However I need a way to see if I'm still connected say.. if I walk out of range and walk back into range.</p><p>I noticed there isnt an isConnected function in the Bluetooth Socket, like there is in the TCP stuff... is there a way to see if you are connected, or communicating to the device you're supposed to be connected with?</p>","409686","","","","","2012-10-03 01:39:56","Android Bluetooth: IsConnected?","<android><bluetooth>","3","0","","",""
"3507076","1","3507136","","2010-08-17 21:25:06","0","4620","<p>I've been trying to get a handle on Dialogs.  I read the android dev site info and a dozen bolg's.  It seems there are several ways of doing it and I'm able to at least get a dialog with 3 buttons (not using a custom dialog with custom layout).</p><p>If I set up the positive/negative/neutral actions with something like finish(), cancel() etc, it works with those calls.</p><p>But, what I want to do is have the buttons do something more, if only display a text using a string defined in the Maincode (not a Toast).  Eventually, I want to enter some numbers in a dialog and return them in a string. Yes, I can do that from another activity screen but, prefer not to as I like the compact size of a dialog.</p><p>Even cheating and returning an integer to the Maincode to do some switch/case stuff would be okay but, I seem not able to even return an integer.</p><p>I understand that I'll need to do a customized alert dialog to do input stuff and the following is my attempt at a start by just trying to return a string or integer - it doesn't seem to be getting me there!</p><p>This code presents the dialog with 3 buttons.  This is just one of the try's I made (integer return stuff deleted)... </p><p><strong>What can I do to return an integer to the Maincode from a dialog button?</strong>  There are no code errors or warnings, it just doesn't work as I hoped...</p><pre><code>    public class Maincode extends Activity {public static String rtndMessage = ""Push Button"";@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final TextView text = (TextView) findViewById(            R.id.TextView01);    final Button doIt = (Button) findViewById(R.id.Button01);    //  -----------------------------------------------------    doIt.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            // do something            Dialog1();          // call Dialog1        }    }); // end -----------------------------------------------// do the rest of the code (ie, display the result of doIt)text.setText(rtndMessage);  // set text w/result}//end onCreate ----------------------------------------------public void Dialog1() {AlertDialog.Builder builder = new AlertDialog.Builder(this);builder.setTitle(""Dialog Test"");builder.setIcon(R.drawable.redtest);// chain the following together  builder.setMessage(""Send text: Yes, No, Cancel"")    // the positive action ----------------------------------    .setPositiveButton(""Yes Action"", new        DialogInterface.OnClickListener(){        public void onClick(DialogInterface dialog, int id){                        Maincode.rtndMessage = ""sent Yes back"";                     }    })    // The negative action ----------------------------------    .setNegativeButton(""No Action"", new            DialogInterface.OnClickListener(){        public void onClick(DialogInterface dialog, int id){            Maincode.rtndMessage = ""sent No back"";        }    })    // The negative action ------------------------------    .setNeutralButton(""Cancel"", new            DialogInterface.OnClickListener(){        public void onClick(DialogInterface dialog, int id){            Maincode.rtndMessage = ""sent N/A back"";            dialog.cancel();    // just return to activity        }           });    </code></pre><p>builder.show();      // show the dialog    }//end Dialog     }//end activity</p>","382200","","","","","2012-01-10 14:01:01","Android Dialog - confused","<android><dialog>","3","1","1","",""
"3507101","1","3507465","","2010-08-17 21:29:19","3","2457","<p>I want to have the default android browser be able to download files of a particular file extension, .xyz, for example.</p><p>Without installing Astro (or some other file manager), users will get the error ""Cannot download. The content is not supported on this phone"". Installing the Astro application allows the android browser to download any file to the sdcard.</p><p>How does it do that? I don't want users of my app to have to download Astro, but rather, just let the OS or browser know that it's okay to download files with the extension .xyz, because my app will handle them.</p>","334856","","","","","2010-08-17 22:24:19","How do I permit the android browser to download files of a particular extension?","<android><android-intent><intentfilter>","1","0","","",""
"3507123","1","","","2010-08-17 21:30:52","0","204","<p>I'm going through the ""A Fancier Form"" chapter in Mark Murphy's ""Android Tutorials"" book (1st edition) and I can't get past step#2: Add a RadioGroup. The application compiles and installs on emulator and phone with no errors but when I try to run it I get the:</p><p>Sorry!The application LunchList(process apt.tutorial) hasstopped unexpectedly. Please tryagain.</p><p>This is the code from the book (the only code that changes in that section is the RadioGroup part):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:stretchColumns=""1""&gt;  &lt;TableRow&gt;    &lt;TextView android:text=""Name:"" /&gt;    &lt;EditText android:id=""@+id/name"" /&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;    &lt;TextView android:text=""Address:"" /&gt;    &lt;EditText android:id=""@+id/addr"" /&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;    &lt;TextView android:text=""Type:"" /&gt;    &lt;RadioGroup android:id=""@+id/types""&gt;      &lt;RadioButton android:id=""@+id/take_out"" android:text=""Take-Out"" /&gt;              &lt;RadioButton android:id=""@+id/sit_down"" android:text=""Sit-Down"" /&gt;      &lt;RadioButton android:id=""@+id/delivery"" android:text=""Delivery"" /&gt;    &lt;/RadioGroup&gt;  &lt;/TableRow&gt;  &lt;Button android:id=""@+id/save""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:text=""Save"" /&gt;&lt;/TableLayout&gt;</code></pre><p>Help please?</p><p>Thanks,~Mike </p>","423348","","366234","","2010-08-17 22:30:41","2010-08-17 22:30:41","Application crashes after adding a RadioGroup in Mark L. Murphy's ""A Fancier Form"" tutorial","<java><android>","0","4","","",""
"3507160","1","3507252","","2010-08-17 21:35:00","4","578","<p>So I have a API issue. So i am creating a class that utilizes <code>AndroidHttpClient</code> to download Bitmap images from my server. Problem is, <a href=""http://developer.android.com/reference/android/net/http/AndroidHttpClient.html"" rel=""nofollow"">its API Level is 8</a> and I want this to be used <strong>from API 1 and above</strong>. Now I know I can use <code>DefaultHttpClient</code> (the API is Level 1) but is there a way I can use both, being distinguished by Build.VERSION.SDK (btw thanx for the quick respose, Konstantin Burov and iandisme). </p><p>So for example, if my device is 2.2 I use <code>AndroidHttpClient</code>, anything else use <code>DefaultHttpClient</code>.</p><p>Of course if I import the library it will give me an error on any device 1.5 to 2.1. </p><p>Any suggestions would greatly be appreciated, because in the future I would want to set other preferences based on API.</p>","423305","","829571","","2012-06-21 14:14:51","2012-06-21 14:14:51","Is there a way to include a library based on API Level or an if statement for Android","<android>","3","0","3","",""
"3507265","1","","","2010-08-17 21:50:41","10","2016","<p>My app chains some activities. </p><p>if you press the back button, you go back through old activities then you suddenly quit the application !</p><p>so I need to show a message like ""do you really want to exit"" if it's the last activity on stack</p><p>I know how to override the back button but i can't figure how to know how many activity are in history</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event)  {    if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0) {        // Is it the last activity on stack ?         // so show confirm dialog        return true;    }    return super.onKeyDown(keyCode, event);}</code></pre><p>Please help.</p>","384873","","234938","","2010-08-17 22:48:13","2012-10-25 08:32:15","Back button and last activity","<android>","2","4","3","",""
"3507282","1","","","2010-08-17 21:53:06","3","119","<p>I have videoView , i load the video from the sdcard on method oncreate(), when i turn power off the phone and then turn the power on , the video is black screen , Any one knows why ? and what method is the activity call in this case onResume , onRestart ,... or what ?</p><p>Thanks in Advance.</p>","419979","","","","","2010-08-17 21:53:06","Video turn power off phone problem","<android>","0","2","1","",""
"3507372","1","","","2010-08-17 22:09:15","4","1890","<p>My Android app is crashing with the following error:</p><p>ERROR/dalvikvm(7051): HeapWorker is wedged: 10037ms spent inside Lcom/android/internal/os/BinderInternal$GcWatcher;.finalize()V</p><p>So it looks like the GCWatcher is taking > 10s to finalise.</p><p>This happens while an AsyncTask is retrieving/passing data from a remote server via http.  It doesn't always throw this error and it's only recently started happening... previously this has been working fine and the app code is unchanged.</p><p>Anyone know what's causing this error and how I can stopit?</p><p>Cheers</p><p>TAO</p>","220864","","","","","2010-08-18 20:20:34","Android error: HeapWorker is wedged... BinderInternal$GcWatcher","<android>","1","0","2","",""
"3507400","1","3514472","","2010-08-17 22:14:11","1","6868","<p>PrintStatusTask parses the contents of a gmail inbox looking for various items of interest to report on. But a new AsyncTask is created for each PrintStatusTask().execute() according to the debugger. Shouldn't these tasks die on exit? Do they have to be killed manually?</p><pre><code>public class Controller extends Activity {    ...    private boolean applyMenuChoice(MenuItem item) {        switch (item.getItemId()) {        case R.id.menuStatus:            new PrintStatusTask().execute();            ...    class PrintStatusTask extends AsyncTask&lt;Void, String, Void&gt; {        @Override        protected Void doInBackground(Void... unused) {            ...            return null;        }        @Override        protected void onPostExecute(Void unused) {            this.cancel(true);        }       }}</code></pre>","398460","","398460","","2010-08-17 22:52:48","2011-10-29 18:09:01","What kills an Android AsyncTask?","<android><android-asynctask>","3","0","","",""
"3507488","1","","","2010-08-17 22:27:56","1","255","<p>After recently having to implement a scroll-table in JavaScript (i.e. a table that scrolls but leaves the headers visible so that one can easier visually associate cells with the correct columns) I now seem to bump into this very same problem on Android!</p><p>I have a longish TableLayout which I therefore need to put into a ScrollView. I would, however, like the header row of the table to always remain visible. In principle this can be done using two tables (one just containing the header cells and the second containing the body cells and only putting the second table into a ScrollView). However, the issue here starts when the table columns have dynamic widths and adapt to their actual content. One then needs resize-listeners all over the place to keep the column widths of the two tables in sync, so that the headers always properly align with the content columns.</p><p>PLEASE tell me that there is already a solution for this out there for Android! I would really hate to have to re-implement this stupid thing AGAIN! Any pointers, suggestions or code snippets how to handle this most elegantly on Android?</p><p>Michael</p>","423411","","","","","2010-08-17 22:27:56","The famous scroll table problem","<android><android-widget>","0","1","","",""
"3507536","1","","","2010-08-17 22:37:08","1","1097","<p>I'm trying to establish a https connection using the classes in org.apache.http.*.  As part of my setup, I'm using the BrowserCompatHostnameVerifier() class which states:</p><blockquote>  <p><em>The hostname must match either the first CN, or any of the subject-alts. A wildcard can occur in the CN, and in any of the subject-alts.</em></p></blockquote><p>When I hit a server who's hostname doesn't match that which is specified in the CN but does match one of the entries in the subject-alts, I get the following exception:</p><pre><code>javax.net.ssl.SSLException: hostname in certificate didn't match: &lt;mtvniph1-f.akamaihd.net&gt; != &lt;a248.e.akamai.net&gt;     at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:222)     at org.apache.http.conn.ssl.BrowserCompatHostnameVerifier.verify(BrowserCompatHostnameVerifier.java:54)     at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:151)     at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:132)     at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:321)</code></pre><p>Here's the relevant code block that's causing this error:</p><pre><code>DefaultHttpClient seed = new DefaultHttpClient();SchemeRegistry registry = new SchemeRegistry();SSLSocketFactory ssf = SSLSocketFactory.getSocketFactory();// XXX: This verifier isn't working with Subject Alternative Namesssf.setHostnameVerifier(new BrowserCompatHostnameVerifier());registry.register(new Scheme(""https"", ssf, 443));SingleClientConnManager mgr = new SingleClientConnManager(seed.getParams(), registry);DefaultHttpClient http = new DefaultHttpClient(mgr, seed.getParams());// Config point, change to your preferenceString url = ""https://mtvniph1-f.akamaihd.net/e3_ubisoft_prod0.m3u8"";HttpGet method = new HttpGet(url);HttpResponse response = null;try{    response = http.execute(method);}catch (Exception e){    Log.e(TAG, ""Request failed"", e);}</code></pre><p>Compare this behavior and that when you replace the url with ""https://www.google.com"".  I can work around this by creating my own X509HostnameVerifier, but I want to know if this is a valid bug in BrowserCompatHostnameVerifier or if I'm doing something wrong.</p><p>Anyone else having similar issues?</p>","423391","","","","","2010-08-18 13:26:15","SSLException when server cert uses SAN (Subject Alternative Name)","<android><ssl>","1","2","1","",""
"3507578","1","3526170","","2010-08-17 22:43:51","0","1203","<p>I'm trying to draw a shape on a Canvas and get information about the clicks that the user performs on that Canvas.</p><p>I created a class which extends the Button class. </p><pre><code>  class CustomDrawableButton extends Button {    private final ShapeDrawable mDrawable;    int x = 50;    int y = 50;    int width = 30;    int height = 30;    public CustomDrawableButton (Context context) {       super(context);       mDrawable = new ShapeDrawable (new OvalShape ());       mDrawable.getPaint().setColor(Color.GREEN);       mDrawable.setBounds(x, y, x + width, y + height);    }    protected void onDraw(Canvas canvas) {      mDrawable.draw(canvas);    }  }</code></pre><p>Then, in a class which also extends View, I added the instantiation and a listener:</p><pre><code>  CustomDrawableButton mCustomDrawableButton = new CustomDrawableButton(getBaseContext());  layout.addView(mCustomDrawableButton);  mCustomDrawableButton.draw(canvas);  mCustomDrawableButton.setOnClickListener(new View.OnClickListener() {    public void onClick(View view) {      System.out.println(""Yey clicked"");     Toast.makeText(view.getContext(), ""Yey"", Toast.LENGTH_LONG).show();    }});</code></pre><p>When this is executed, it is not able to detect the clicks on the image / button. I have read that ShapeDrawable objects can't be ""clickable"", but I was expecting this to work since I'm extending the Button (which is a View and is ""clickable"").</p><p>Is this possible? If not this way, can you direct me to some way to get information about the screen coordinates that were pressed on a Canvas or a View ?</p><p>Thanks in advance.</p>","425749","","881229","","2013-12-12 06:03:58","2013-12-12 06:03:58","How-to create a clickable Button with a ShapeDrawable?","<android><view><android-canvas>","1","0","","",""
"3507645","1","3507679","","2010-08-17 22:59:29","0","137","<p>I mistyped the package name when I created my android project, and it took me a while to notice. I used Eclipse's Rename function on the package to change it, and sort out all the references. I've updated the Manifest, and manually checked every file for any references to the old package name. However when I launch the app (it's a live wallpaper) and click settings, I get an IllegalStateException, exactly as if the permissions were not set up correctly (which they are). I've manually uninstalled the app and restarted eclipse. Is there any way out of this?</p><p>Update:</p><p>This is an android problem, not an eclipse problem. I created a new project in eclipse, and copied everything over, and when I ran it I got the same error.</p><p>Further update:</p><p>I've managed to get it working, I had to set the Activity to export in the manifest.</p>","319618","","319618","","2010-08-23 11:44:14","2010-11-28 13:19:27","Package Name change results in permanent permissions problem","<java><android><packages>","1","1","","",""
"3507667","1","3509347","","2010-08-17 23:04:31","1","1103","<p>I am trying to create a notification that will appear in the ""ongoing"" area of the notification bar (like WeatherBug).</p><p>Here is the code that I am using:</p><pre><code>PendingIntent intent = PendingIntent.getActivity(lastContext, 0, notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT | Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR)</code></pre><p>From what I understand, FLAG_NO_CLEAR, should also prevent the notification from being cleared by pressing the Clear button, this is also not working</p><p>Any tips SO?</p>","289182","","","","","2010-08-18 06:00:52","Ongoing notifications","<android>","1","0","","",""
"3507757","1","","","2010-08-17 23:26:11","0","1096","<p>I have an app which allows the user to select a contact via an ACTION_PICK Intent using code similar to this <a href=""http://developer.android.com/resources/samples/BusinessCard/src/com/example/android/businesscard/ContactAccessor.html"" rel=""nofollow"">example</a>.</p><p>This works fine, but the user can press the Search key and choose a contact from the search results. In this case, the picker brings up the contact view where the only actions available are email, call, etc.</p><p>I'd expect the searched-for contact to be returned to the calling Activity instead of the displaying the contact details. Is this possible?</p>","104181","","104181","","2010-08-17 23:31:23","2010-08-17 23:49:13","Android contact picker and search","<android><android-intent><android-contentprovider>","2","0","","",""
"3507763","1","3507825","","2010-08-17 23:28:48","0","137","<p>As the title says, what is the method to access which item is displayed in an Android spinner, so I can have multiple spinners, then wait on a button click?</p><p>Thanks!</p>","312390","","","","","2010-08-17 23:42:22","What's the method to access whatever child item is displayed in an Android spinner, instead of just waiting for an onItemSelected() event?","<java><android>","1","0","","",""
"3507771","1","5163778","","2010-08-17 23:31:30","6","15882","<p>At the moment I am attempting to set my camera on my Motorola Droid phone to take an image that matches the size of my screen (854 x 480 pixels), and I am attempting to accomplish via the parameters for the camera as such:</p><pre><code>Camera.Parameters parameters = this.mCamera.getParameters();Log.i(TAG, ""CAMERA SIZE: ("" + this.mCameraView.getWidth() + "", "" + this.mCameraView.getHeight() + "")"");parameters.setPictureSize(this.mCameraView.getWidth(), this.mCameraView.getHeight());this.mCamera.setParameters(parameters);this.mCamera.takePicture(null, null, this);</code></pre><p>I have my activity implement the Camera.PictureCallback method of onPictureTaken (excluding log calls), so when the takePicture method is called it runs this method:</p><pre><code>@Overridepublic void onPictureTaken(byte[] data, Camera camera) {    Bitmap image = BitmapFactory.decodeByteArray(data, 0, data.length);    //Size imageSize = camera.getParameters().getPictureSize();    //image = Bitmap.createBitmap(image, 0, 0, imageSize.width, imageSize.height);    this.mCameraView.setBackgroundDrawable(new BitmapDrawable(image));}</code></pre><p>For some reason though, my camera is taking pictures in 1280 x 960.  Is this some sort of minimum size the camera can capture an image in?  From log calls I can see that the Camera's parameters are still set to have a picture size of 854 x 480, but image keeps coming out as 1280 x 960.  Am I decoding the image incorrectly, am I setting the camera's parameters incorrectly, or am I doing something else wrong?</p><p>Thanks in advance for any help you can give!</p><p>Regards, celestialorb.</p>","384386","","","","","2012-01-07 09:20:36","Setting camera image size in Android","<android><image><parameters><camera>","3","0","2","",""
"3507786","1","","","2010-08-17 23:34:28","4","1628","<p>From an Android app, I'm trying to send an email with an HTML body with an embedded img.  From what I've read, the following should work.  The email is received with HTML bold tags working correctly etc, however the img is replaced with [OBJ].  My logging tells me that I do indeed get a Drawable with the correct dimensions etc, so it seems that the local email client is not understanding the image in the Spannable.  Is there some trick such as images need to come from ""content:"" URIs?  thanks!</p><pre><code>Intent i = new Intent(Intent.ACTION_SEND);i.putExtra(Intent.EXTRA_SUBJECT, ""Sample subject"");i.setType(""text/html"");Spanned html =    Html.fromHtml(        ""&lt;html&gt;&lt;body&gt;h&lt;b&gt;ell&lt;/b&gt;o&lt;img src='http://www.pp.rhul.ac.uk/twiki/pub/TWiki/GnuPlotPlugin/RosenbrockFunctionSample.png'&gt;world&lt;/body&gt;&lt;/html&gt;"",        new ImageGetter() {            public Drawable getDrawable(String url) {                InputStream s = (InputStream) (new URL(url)).getContent();                Drawable d = Drawable.createFromStream(s, null);                LogUtil.debug(this, ""Got image: "" + d.getClass() + "", "" + d.getIntrinsicWidth() + ""x"" + d.getIntrinsicHeight());                d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());                return d;             }        ),        null    );i.putExtra(Intent.EXTRA_TEXT, html);startActivity(Intent.createChooser(i, ""Send email""));</code></pre>","423427","","119114","","2012-11-24 13:03:59","2012-11-24 13:03:59","send email from android with embedded img isn't working","<android><email>","0","4","1","",""
"3507916","1","3510883","","2010-08-17 23:58:45","2","408","<p>I'm implementing the licensing service in one of my apps.I have set the test response to LICENSED.Anyway it always invokes the dontAllow() function.Locat sais:</p><pre><code>08-17 23:44:53.956: INFO/LicenseChecker(479): Binding to licensing service.08-17 23:44:54.556: INFO/LicenseChecker(479): Calling checkLicense on service for de.goddchen.android.xy08-17 23:45:04.567: INFO/LicenseChecker(479): Check timed out.</code></pre><p>So, what am I doing wrong? I'm using a 2.2 API emulator and I configured my publisher google account on it.Any ideas?</p>","373138","","1288","","2012-08-04 17:30:14","2012-08-04 17:30:14","Android Licensing Service - LicenseChecker always times out","<android>","1","0","1","",""
"3507988","1","","","2010-08-18 00:16:30","0","1968","<p>I am building new Android system on Ubuntu 10.4 64-bit. While building, I got this error:</p><pre><code>arm-eabi-gcc: Internal error: Segmentation fault (program cc1)</code></pre><p>This command caused the error:</p><pre><code>prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc -mthumb-interwork -Ibionic/libc/private -o out/target/product/generic/obj/lib/crtbegin_dynamic.o -c bionic/libc/arch-arm/bionic/crtbegin_dynamic.S</code></pre><p>It seems gcc has some errors. I've never seen gcc segfault before.</p><p>Any help will be truly appreciated.</p>","368778","","496830","","2011-08-04 12:17:10","2011-09-03 13:39:41","arm-eabi-gcc: Internal error: Segmentation fault (program cc1)","<android><build>","3","2","","",""
"3508088","1","3511074","","2010-08-18 00:42:19","1","388","<p>How would I use the SQL DB info and such to get info about contacts and text messages?</p>","362857","","","","","2010-08-18 10:26:30","How do I get contacts and text message info","<android>","1","0","","",""
"3508302","1","3508332","","2010-08-18 01:26:17","0","312","<p><em><strong>""Important: Before you install SDK components, we recommend that you disable any antivirus programs that may be running on your computer""</em></strong></p><p>Just wondered why and whether it will render the computer vulnerable during that window...</p>","398348","","","","","2010-12-13 09:15:56","why disable virus scan when installing android sdk - won't it render the computer vulnerable during that window?","<android><install>","2","1","","",""
"3508348","1","3508356","","2010-08-18 01:38:49","3","9944","<p>I am new to both openGL and android development so please forgive me if my question is very trivial.</p><p>I am trying to build a simple little app that takes input from the user in three EditTexts representing a 0 - 100% value for each component of a RGB color to be displayed in a GLSurfaceView.</p><p>The catch is that I need this to use openGL ES 2.0 and I need to pass the data into the shading program using a uniform value so that once I get it working I can move on to what I am really trying to accomplish.</p><p>Upon running what I have written I can get the GLSurfaceView to correctly display the first solid color, but whenever I change any of the values and make calls to rebuild the uniform slot in the shading program I get this error in the LogCat:</p><p>ERROR/libEGL(14316): call to OpenGL ES API with no current context (logged once per thread)</p><p>and of course the GLSurfaceView remains the initial color.</p><p>I've been searching all over for a solution to this problem and as best I can tell I might need to be setting up an EGLContext somewhere before setting my renderer. However, I don't see anything in the API demos about this, and the only information I can find online was written before GLSurfaceView was even available.</p><p>Do I need to set up an EGLContext still or have I missed something else?</p><p><br></p><p>Additional info that may help:</p><p>-used an XML file to set up the UI (and as far as I can tell doing it in code doesn't help)</p><p>-having the same trouble when I try to load in a new texture from the sd card in a seperate program. I can get the first texture to work fine, but when using the same method to load the second I get the same error and nothing changes.</p>","423492","","","user195488","2010-08-27 21:05:40","2010-08-27 21:05:40","Why am I getting ""call to OpenGL ES API with no current context""?","<android><.net-2.0><opengl-es>","1","1","1","",""
"3508432","1","","","2010-08-18 02:00:41","0","820","<p>Greetings yet again. I have an minor issue when taking a photo. I have a button that invokes the camera, successfully takes a photo, and returns to my entry form. My only problem is the database leak that occurs when pressing the button to call the camera. My code looks a little something like this.</p><pre><code>public void takephoto(){        Intent in = new        Intent(this, takephoto.class);        startActivityForResult(in,1);    }</code></pre><p>Here's a snippet of how the database is opened:</p><pre><code> public journalDbAdapter open() throws SQLException {        mDbHelper = new DatabaseHelper(mCtx);        mDb = mDbHelper.getWritableDatabase();        return this;    }    public void close() {        mDbHelper.close();    }</code></pre><p>I run :</p><pre><code>mDbHelper = new journalDbAdapter(this);        mDbHelper.open();</code></pre><p>In the onCreate of the Activity or Class that I am calling the camera in. I have not coded in mDbHelper.close(); anywhere not sure if i should when or where. I think i would rather just leave it open while capturing one image. </p><p>Logcat:</p><pre>08-17 21:33:37.582: ERROR/Database(18297): java.lang.IllegalStateException: /data/data/com.growjournal.beta/databases/grower SQLiteDatabase created and never closed08-17 21:33:37.582: ERROR/Database(18297):     at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1785)</pre><p>What possible problems could I face if this was never fixed??</p><p>Everything seems to be working fine, but i would defiantly like to avoid any issues amongst the many android devices out there. </p>","393328","","393328","","2010-08-18 03:56:21","2010-08-18 15:40:26","Database LEAK, when taking a photo. SQLiteDatabase created and never closed. Android, Java, SQLite","<java><android><sqlite><memory-leaks>","2","4","","",""
"3508491","1","4937448","","2010-08-18 02:18:20","0","1884","<p>I know this is possible as the built in clock app and other apps are able to do it.</p><p>How do you turn off the button backlights from code?  These would be those like the softkeys on the bottom of the Nexus One screen.</p><p>Update:</p><p>Found this, but it only works on Froyo:</p><pre><code>WindowManager.LayoutParams lp = getWindow().getAttributes();lp.buttonBrightness = 0;</code></pre><p>Any other ideas?</p>","423405","","423405","","2010-08-18 02:55:38","2011-02-08 19:34:40","Turn off Button Backlight (like Nexus 1 soft buttons)","<android>","2","0","1","",""
"3508492","1","3508886","","2010-08-18 02:18:47","2","366","<p>In the Activity title bar, how do I put a spinning wait in the upper right corner?</p>","172861","","403455","","2012-05-20 02:22:17","2012-05-20 02:22:17","Android Activity Title Waiting spin","<android><busyindicator>","1","0","3","",""
"3508560","1","3508616","","2010-08-18 02:39:17","0","761","<p>I'm relatively new to programming in general so be gentle =| I'm trying to start a new activity from a basic one that displays a couple of text inputs, a checkbox, and a button. When the button is pressed I want it to switch to the new activity. The code compiles but when I press the button in Android it simply crashes. Any help would be greatly appreciated.</p><p>Here is the code sample:</p><pre><code>public class Something extends Activity implements OnClickListener{@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.login);    Button login = (Button)findViewById(R.id.login);    login.setOnClickListener(this);}@Overridepublic void onClick(View v) {    startActivity(new Intent().setClass(Something.this, That.class));}}</code></pre><p>Edit: Adding what I hope is the stack trace =/Editx2: Heres the adb logcat, hope it makes sense to someone lol</p><p>I/ActivityManager(  240): Starting activity: Intent { cmp=jano.huerta.sfgc/.HOME }D/AndroidRuntime(13612): Shutting down VMW/dalvikvm(13612): threadid=1: thread exiting with uncaught exception (group=0x40025a08)E/AndroidRuntime(13612): FATAL EXCEPTION: mainE/AndroidRuntime(13612): java.lang.RuntimeException: Unable to start activity ComponentInfo{jano.huerta.sfgc/jano.huerta.sfgc.HOME}: android.content.ActivityNotFoundException: Unable to find explicit activity class {jano.huerta.sfgc/jano.huerta.sfgc.SUMMARY}; have you declared this activity in your AndroidManifest.xml?</p><p>E/AndroidRuntime(13612):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)E/AndroidRuntime(13612):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)E/AndroidRuntime(13612):        at android.app.ActivityThread.access$2300(ActivityThread.java:135)E/AndroidRuntime(13612):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)E/AndroidRuntime(13612):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(13612):        at android.os.Looper.loop(Looper.java:144)E/AndroidRuntime(13612):        at android.app.ActivityThread.main(ActivityThread.java:4937)E/AndroidRuntime(13612):        at java.lang.reflect.Method.invokeNative(NativeMethod)E/AndroidRuntime(13612):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(13612):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(13612):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(13612):        at dalvik.system.NativeStart.main(Native Method)</p><p>E/AndroidRuntime(13612): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {jano.huerta.sfgc/jano.huerta.sfgc.SUMMARY}; have you declared this activity in your AndroidManifest.xml?E/AndroidRuntime(13612):        at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1563)E/AndroidRuntime(13612):        at android.app.ActivityThread.resolveActivityInfo(ActivityThread.java:2597)E/AndroidRuntime(13612):        at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:277)E/AndroidRuntime(13612):        at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:651)E/AndroidRuntime(13612):        at android.widget.TabHost.setCurrentTab(TabHost.java:323)E/AndroidRuntime(13612):        at android.widget.TabHost.addTab(TabHost.java:213)E/AndroidRuntime(13612):        at jano.huerta.sfgc.HOME.onCreate(HOME.java:23)E/AndroidRuntime(13612):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)E/AndroidRuntime(13612):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)E/AndroidRuntime(13612):        ... 11 moreW/ActivityManager(  240):   Force finishing activity jano.huerta.sfgc/.HOMEW/ActivityManager(  240):   Force finishing activity jano.huerta.sfgc/.SFGCW/ActivityManager(  240): Activity pause timeout for HistoryRecord{466bbec0 jano.huerta.sfgc/.HOME}D/dalvikvm(  406): GC_EXPLICIT freed 418 objects / 26008 bytes in 90msI/Process (13612): Sending signal. PID: 13612 SIG: 9I/ActivityManager(  240): Process jano.huerta.sfgc (pid 13612) has died.I/WindowManager(  240): WIN DEATH: Window{466cb800 jano.huerta.sfgc/jano.huerta.sfgc.SFGC paused=true}W/ActivityManager(  240): Activity destroy timeout for HistoryRecord{46654450 jano.huerta.sfgc/.SFGC}</p>","423519","","423519","","2010-08-18 04:24:38","2013-07-28 08:28:05","Starting a new activity","<android>","1","1","","",""
"3508634","1","","","2010-08-18 03:01:14","0","279","<p>I have 2 Activities that need to communicate with each other: <code>ActivityA</code> and <code>ActivityB</code></p><p>Say that ActivityA opens ActivityB. How do I unicast a message from <code>ActivityB</code> to <code>ActivityA</code> without closing ActivityB? </p><p><strong>Here's what I tried:</strong></p><ol><li><p>setResult() - but the intent willbe delivered only when ActivityBcloses</p></li><li><p>sendBroadcast() - but this sends the    intent to everyone listening to the    action. I only want the action to    reach <code>ActivityA</code> since it spawned    <code>ActivityB</code>. I tried having ActivityA    registering a BroadCast receiver,    but I cannot target that via    Intent's <code>SetComponentName()</code>.</p></li><li><p>startActivity() - this brings up    ActivityA, which I don't want</p></li></ol>","204317","","","","","2010-08-18 04:01:08","Android: How to unicast an intent to an Activity with inner BroadCastReceiver?","<android>","1","0","1","",""
"3508635","1","","","2010-08-18 03:01:15","0","329","<p>I'm using the Android SAX parser to search for entries in a rather large (6MB) XML file. I'm basically using a derivative of the code shown in listing 8 <a href=""http://www.ibm.com/developerworks/opensource/library/x-android/index.html#N101E0"" rel=""nofollow"">here</a>. The question I have is how do I stop parsing once my match has been found? The code shown continues parsing through the end of the file but I want to stop before then. Is this possible or do I need to use something other than SAX (e.g. XmlPullParser?)</p>","298511","","","","","2012-01-11 00:06:46","Exiting from Xml.parse when match is found","<android><sax>","3","0","","",""
"3508692","1","","","2010-08-18 03:15:31","2","1225","<p>I try to retrieve a picture from e.g</p><p><a href=""http://graph.facebook.com/btaylor/picture"" rel=""nofollow"">http://graph.facebook.com/btaylor/picture</a></p><p>using the following code:</p><pre><code>DefaultHttpClient httpClient = new DefaultHttpClient();HttpGet request = new HttpGet(urlString);HttpResponse response = httpClient.execute(request);return response.getEntity().getContent();</code></pre><p>but <em>occasionally</em> I get the exception</p><pre><code>java.net.UnknownHostException: profile.ak.fbcdn.net</code></pre><p>Why is this?</p><p>Edit: by ""occasionally"", I mean that it happens often enough that I know the reason is not ""My internet is down"" or ""Facebook is down.""</p>","70488","","70488","","2010-08-18 03:22:18","2011-06-26 12:00:55","Intermittent exception: java.net.UnknownHostException: profile.ak.fbcdn.net","<android><httpwebrequest>","3","1","1","",""
"3508697","1","3508872","","2010-08-18 03:17:41","0","929","<p>When my ListView activity loads it creates the Adapter which fills the screen as it should do. Is there an event or way to find out when the Adapter has finished getting enough data to fill the screen.</p><p>I want to show a spinner the first time the Activity loads and have it go away once the screen has its first load of data from the Adapter.</p>","172861","","","","","2010-08-18 10:19:42","Android Life Cycle - ListActivity","<android><listview>","2","1","1","",""
"3508831","1","3508866","","2010-08-18 03:48:33","3","417","<p>I have an open-source application on the Android market.  It seems to work fine for me (with over 1,000 active installs, I have to presume that it works for most people).</p><p>I recently got a <a href=""http://code.google.com/p/anddaaven/issues/detail?id=21"" rel=""nofollow"">bug report</a> that indicated a problem for at least three users on Samsung phones (Intercept and Captivate).  I have been unable to reproduce the problem on my ADP2 and on the emulator.</p><p>In order to get enough data to diagnose the problem, I first tried to add logging and then I asked users to submit logs via <a href=""http://www.appbrain.com/app/com.xtralogic.android.logcollector"" rel=""nofollow"">Log Collector</a>.  Each time a user tried to send the log (there were four attempts), it was truncated and I did not get any useful data.</p><p>I then added <a href=""http://acra.googlecode.com/"" rel=""nofollow"">ACRA</a> to the project in an attempt to get information, but I don't seem to be able to automatically detect the bug in order to send a report.</p><p>Since I don't have a Samsung phone and I can't reproduce it on anything where I could connect with the debugger, I am mostly out of ideas.  The only idea I have left is to add a button to the UI to generate a report.</p><p>Are there any other approaches to suggest?</p><p><strong>Update</strong>: since people are asking for more specifics: essentially, the app reads in text files from the assets and puts them (with some preprocessing) into a TextView in a ScrollView.  (The data is prgressively added to a SpannableStringBuffer and then that is passed to TextView's setText() function.)  Depending on the options chosen, the text displayed is between 15k-115k.  On phones with this issue, only part of the text is displayed.  The cutoff point depends on the options, but seems to be somewhere between 17k-18k.</p><p>ACRA sends a report for all uncaught exceptions and puts them into a Google Form/Spreadsheet.  I've gotten reports from my emulator and from my phone, so I know that end works.  (Actually, I've often found it faster to debug from the stack trace in that report than to attach the debugger to the process.)</p><p>Phone specs: I have exercised the app on emulators running 1.5, 1.6, 2.1, and 2.2.  My phone is ADP2 (the developer version of the MyTouch), but I've installed a <a href=""http://www.cyanogenmod.com/"" rel=""nofollow"">third-party ROM</a> to jump up to Froyo (2.2).  I am unaware of an emulator specifically for the Samsung OS build, although that would be quite helpful here.</p><p>Since the expected text length is constant, I <em>should</em> be able to detect if it is read correctly or not.  I added checks at the end of my text processing, but those never triggered, indicating that the problem was not with reading the file.  I then tried adding checks to onPostCreate and onPostResume, but those did not fail either.  It seems that the UI thread had not yet actually run at that point, though.</p><p>I've now done 6 private APK versions attached to the bug in the bug tracker.  I frankly am surprised that any users are still trying them.  This latest version has a button to force a bug report - that will only be called after the UI thread has laid out the screen.  Hopefully that will give me enough variable information to point me in the right direction.</p>","4673","","4673","","2010-08-18 04:33:51","2010-08-26 17:49:08","How can I debug a seemingly hardware-dependent issue with my Android app without access to the hardware?","<android><debugging><remote-debugging>","2","0","3","",""
"3509046","1","","","2010-08-18 04:50:10","1","4256","<p>I want to send AT commands in my Android application, but I could not find the right syntax. How can I do this?</p>","404052","","23897","","2010-08-18 05:04:18","2012-01-31 17:08:10","How to use AT commands in Android applications?","<java><android>","3","1","","",""
"3509064","1","3509269","","2010-08-18 04:54:07","0","990","<p>I tried to set up my togglebutton properties layout using style.xml.Here's my code:</p><pre><code>    &lt;ToggleButton android:id=""@+id/button_toggle_1"" style=""button_test_1""/&gt;    &lt;ToggleButton android:id=""@+id/button_toggle_2""        android:textOff=""test2""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;    &lt;ToggleButton android:id=""@+id/button_toggle_3"" style=""button_test_3""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;</code></pre><p>For ID=button_toggle_1, I apply a style (style.xml), here's the code:</p><pre><code>&lt;style name=""button_test_1""&gt;    &lt;item name=""android:textOff""&gt;test1&lt;/item&gt;    &lt;item name=""android:layout_width""&gt;wrap_content&lt;/item&gt;    &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;&lt;/style&gt;&lt;style name=""button_test_3""&gt;    &lt;item name=""android:textOff""&gt;test3&lt;/item&gt;&lt;/style&gt;</code></pre><p>I can see button 2 and 3 but the text for button 3 is different from what I set it to be. button 3 text = ""APAGADO"". From this test, I conclude that togglebutton simply cannot set its properties using style.xml. Is this true? or did I do something wrong?</p><p>If toggle button is ""special"", anyone knows the reason why? is this ""special"" condition applies to other things as well?</p><p>Thanks!</p>","423594","","","","","2010-08-18 05:44:14","Problem with Android togglebutton","<android>","1","0","","",""
"3509158","1","3509235","","2010-08-18 05:16:11","6","1759","<p>I have a <code>WebView</code> inside the <code>ScrollView</code>.</p><p>The content of <code>WebView</code> dyanamically changes when it displays different html page. </p><p>I have the following issue:</p><p>For example I have <code>A.html</code>, and <code>B.html</code>. The content of <code>B.html</code> is larger than <code>A.html</code>, so the page is longer.</p><p>When <code>WebView</code> load <code>B.html</code>, the ScrollView stretches its size to enable itself scroll for B.html, then if I go back to <code>A.html</code>, ScrollView doesn't resize itself. (The scroll area is exceed the content of <code>A.html</code>)</p><p><img src=""http://i.stack.imgur.com/zo2iK.jpg"" alt=""alt text""></p><p>What I want to have, is dynamic change the scroll area of scroll view to fit the webview's content.</p><p>Any idea or suggestion</p>","399820","","399820","","2010-08-18 05:21:58","2011-12-05 22:39:53","Scroll view does't resize when the content of child view changes","<android>","4","0","1","",""
"3509167","1","3519081","","2010-08-18 05:19:49","4","4895","<p>I've been having an issue with data integrity using an RFCOMM socket over Bluetooth in Android. I don't have any issues connecting, but the data I receive is garbled and not the same as the data that is sent. The data is sent by an RS232 device over a Bluetooth adapter, which the phone connects to. There isn't a problem with the adapter as the data is properly received if I connect with a laptop.</p><p>My Bluetooth connection is handled based off of the BluetoothChat sample application found at the Android developer site (<a href=""http://developer.android.com/resources/samples/BluetoothChat/index.html"" rel=""nofollow"">http://developer.android.com/resources/samples/BluetoothChat/index.html</a>), with no changes. The data being sent is plain text and control characters (which are stripped out before display to the user). The specific problem I have is that some of the text is missing, some of it is repeated, etc.The funny thing is if I connect to a computer with a terminal app and type in there, the data is transmitted fine. Additionally, if I connect to the device using the GetBlue app (http://www.tec-it.com/en/software/data-acquisition/getblue/android-smartphone/Default.aspx) the data is received fine.</p><p>So I guess the issue is what does GetBlue possibly do different to handle it's Bluetooth data transfer, or is there another way receive Bluetooth data over an RFCOMM socket on Android?</p>","423599","","","","","2013-04-01 10:29:12","Data Transmisison error using SPP over Bluetooth on Android","<android><bluetooth><rfcomm>","2","1","4","",""
"3509178","1","3509210","","2010-08-18 05:23:17","11","15969","<p>Alright, I'm just trying to learn about using Contact information, but I'm a bit stuck.  I would like to be able to display a picture for the contact.  Using the following code that I have, how would I be able to put the photo for the contact in the ImageView in contact_entry?</p><pre><code>ListView contacts_list = (ListView) findViewById(R.id.contacts_list);// Gets the URI of the dbUri uri = ContactsContract.Contacts.CONTENT_URI;// What to grab from the dbString[] projection = new String[] {        ContactsContract.Contacts._ID,        ContactsContract.Contacts.DISPLAY_NAME,        ContactsContract.Contacts.PHOTO_ID};String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + "" COLLATE LOCALIZED ASC"";Cursor cursor = managedQuery(uri, projection, null, null, sortOrder);String[] fields = new String[] {        ContactsContract.Data.DISPLAY_NAME};int[] values = {         R.id.contactEntryText};SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.contact_entry, cursor,        fields, values);contacts_list.setAdapter(adapter);</code></pre><p><strong>contact_entry.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""54px""&gt;    &lt;ImageView        android:id=""@+id/contactPhoto""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:src=""@drawable/ic_contact_picture_3""/&gt;    &lt;TextView         android:text=""@+id/contactEntryText""        android:id=""@+id/contactEntryText""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre>","362857","","","","","2014-04-19 15:48:19","Getting a Photo from a Contact","<android>","4","0","9","",""
"3509228","1","3509800","","2010-08-18 05:36:24","4","736","<p>I am new to the android programming environment.I am currently working on a project which deals with the user's phone battery level.I am showing the current battery level left on the phone.now i want to display the amount of duration of ""idle time, talk time, video playback, audio playback and web surfing"" that can be done based on the current battery level.Please help me.What kind of approach shall i follow.(or) What available API shall i use to get those.</p><p>Thanking You</p>","393502","","47550","","2010-08-18 05:40:07","2010-11-01 15:48:30","How to obtain the possible duration of idle time of phone based on its current battery level","<android>","2","2","3","",""
"3509391","1","","","2010-08-18 06:10:22","6","4312","<p>I am new to Android and this is my first question here so please go easy on me.</p><p>Is it possible to check some condition inside onCreate() of an Activity and display an AlertDialog?</p><p>I am creating an AlertDialog anonymously in Oncreate() and calling show on that instance but the AlertDialog is never displayed.</p>","423639","","272824","","2010-08-24 10:52:11","2012-12-14 14:35:37","Displaying alerts in Activity.onCreate(..)","<android><dialog>","3","1","","",""
"3509407","1","3509450","","2010-08-18 06:13:36","0","767","<p>I am using a Mac with Eclipse Galileo, trying to load Android code from a public repository.</p><p>I tried 'Checkout from SVN' and the URL is:</p><p><a href=""http://secrets-for-android.googlecode.com/svn/trunk/secrets-for-android-read-only"" rel=""nofollow"">http://secrets-for-android.googlecode.com/svn/trunk/secrets-for-android-read-only</a></p><p>This is from the website:<a href=""http://code.google.com/p/secrets-for-android/source/checkout"" rel=""nofollow"">http://code.google.com/p/secrets-for-android/source/checkout</a></p><p>I get the error:Error validating location: ""org.tigris.subversion.javahl.ClientException: Bad URL passed to RA layersvn: URL 'http://secrets-for-android.googlecode.com/svn/trunk/secrets-for-android-read-only' non-existent in revision 114""Keep location anyway?</p><p>I'm currently using this svn client in Eclipse to manage my own secure repository on another website, so I know it's installed correctly and works.</p><p>Any ideas why checking out the public repo doesn't work?</p>","386541","","272824","","2010-08-18 06:36:00","2010-08-18 06:36:00","Eclipse Android cannot connect to public repository - what am I doing wrong?","<android><eclipse><svn><google-code>","1","0","","",""
"3509527","1","","","2010-08-18 06:38:50","1","532","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4744187/how-to-add-new-contacts-in-android"">How to add new contacts in android</a>  </p></blockquote><p>How to add contacts in Android 2.2. Please help as I am not able to make it. I am adding contacts but it is not visible</p>","420298","","21234","","2010-08-18 07:21:56","2010-08-18 07:21:56","Code to add contacts in android by using ContentResolver","<android><android-contentresolver>","0","0","","2011-12-16 17:43:47",""
"3509530","1","3509761","","2010-08-18 06:39:18","2","1876","<p>I am trying to set a 9-patch image as the background for one of my activities but it is stretching unescessarily making everything get all wierd.  I used draw9patch to create it and added one pixel to the bottom left and one pixel to the top right.  I then save it into my drawables directory as intro_bg.9.png.  I want to stretch the very bottom and stretch the far right side but only if it has too.  If it doesn't then I would like it to stay in tact.  </p><p>When I set it as the background of the parent layout however it stretches it both horizontally and vertically and it doesn't even show my buttons when I run it on my droid.</p><p>I've done the Google searches but there is no good info on how to get something like this working.  What am I missing?</p><p>I have also tried some other configurations including using the padding sides(right and bottom) but that gave the same results.</p><p>Thanks</p><p>Code to set as background:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""@drawable/intro_bg""&gt;</code></pre><p>Looks like:<br><img src=""http://i.stack.imgur.com/gA33K.png"" alt=""alt text""></p><p>Should look like:<br><img src=""http://i.stack.imgur.com/Ht49e.png"" alt=""alt text""></p>","336861","","336861","","2010-08-18 06:50:47","2010-08-18 07:40:18","9-patch stretching when it shouldn't stretch, Android","<android><image><background><android-image>","1","6","1","",""
"3509629","1","","","2010-08-18 06:53:43","1","393","<p>Is it possible for audio recording in emulator and store it not in sdk but some where else</p>","410871","","","","","2012-01-27 05:22:02","audio recording","<android>","2","1","","",""
"3509813","1","","","2010-08-18 07:23:48","37","10212","<p>which are the top Android development blogs that you follow.</p><p>Please do not mention forums or general android products blogs</p>","285550","","","","","2011-08-17 07:55:00","Which Android Development blogs you follow","<android><blogs>","5","0","18","2011-08-17 15:26:10",""
"3509848","1","3509895","","2010-08-18 07:29:55","0","328","<p>I am doing application on autoresponder , i mean , am recieving sms and sending reply automatically , where user choose when he is busy ? my problem is , in broadcast reciever , after recieving sms , i put a toast , where user has to respond whether to respond or not ? after clicking ok , he has to send reply ? so please hep me to sort this ? how to send a rply ?</p>","414777","","","","","2010-08-18 07:38:43","Autorespond to SMS recievd through broadcast recievr?","<android><sms>","1","0","","",""
"3510035","1","3510055","","2010-08-18 08:00:59","0","366","<p>I am working on windows with JDK, Android SDK and eclipse set successfully. I download the com.android.sdk package from:<a href=""http://android.git.kernel.org/?p=platform/packages/apps/Stk.git;a=summary"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/apps/Stk.git;a=summary</a>But when I import the project to the eclipse, errors happen everywhere. Mostly is about the com.android.internal.telephony.gsm.stk.something cannot be imported. I googled to find the reason. It only says because of the these packages is internal package and cannot import with standard SDK. So the question is: How can I compile this project? Should I make a linux environment and get the whole android source code to do this?</p>","411771","","20261","","2010-08-18 08:03:15","2012-09-28 06:28:32","How to compile the com.android.sdk package?","<android>","1","0","","",""
"3510142","1","3510176","","2010-08-18 08:17:00","4","5463","<p>Android SDK is used to build the Java Apps. Android NDK is used to build the Native part of the Android Application. Then what is Android PDK? Is PDK refer the target tool chain? Please throw some light one this.</p>","423671","","","","","2010-08-18 08:22:30","What is Android PDK?","<android>","2","3","","",""
"3510164","1","","","2010-08-18 08:20:15","5","10271","<p>In Android SDK and AVD Manager, I created a new android virtual device as following:</p><ul><li>Name: myavd</li><li>Target: Android 2.2 - API Level 8.</li><li>SD Card: 50MiB.</li><li>Build-in: Default (HVGA).</li><li>Hardware: Abstracted LCD density 160.</li></ul><p>After starting this device, I can't take a picture from build-in camera. The following is the error and exception.</p><p><em>The application Camera (process com.android.camera) has stopped unexpectedly. Please try again.</em></p><blockquote>  <p>08-18 15:00:47.940: ERROR/AndroidRuntime(289): FATAL EXCEPTION: GLThread 11  08-18 15:00:47.940: ERROR/AndroidRuntime(289): java.lang.IllegalArgumentException: No configs match configSpec  08-18 15:00:47.940: ERROR/AndroidRuntime(289):     at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:760)  08-18 15:00:47.940: ERROR/AndroidRuntime(289):     at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:916)  08-18 15:00:47.940: ERROR/AndroidRuntime(289):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1246)  08-18 15:00:47.940: ERROR/AndroidRuntime(289):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)  08-18 15:00:48.369: WARN/ActivityManager(66):   Force finishing activity com.android.camera/.Camera</p></blockquote><p>Do you know what is wrong ?</p>","423715","","995926","","2012-05-05 13:45:23","2012-05-05 13:45:23","Camera doesn't work on android 2.2","<android><camera><android-2.2-froyo>","3","1","3","",""
"3510186","1","4832637","","2010-08-18 08:22:48","4","1176","<p>we have an app for Android called OnTheRoad (market://search/?q=pname:eu.inmite.prj.otr.aclient ), but for certain reason, it is not visible if I access Android Market from Vodafone 845 phone (Huawei Joy).</p><p>The phone has QVGA screen resolution and runs Android 2.1 system. The app is 1.5+ compatible and has enabled support for small screens in its manifest. Another our app has completely same settings and it is perfectly visible in the Market from VF845.</p><p>Is there any way, how can I check, based on what criteria is my app filtered for certain phone model? Thanks.</p>","97309","","","","","2011-01-30 12:21:09","How can I find why Android market is filtering my app on certain phone","<android><compatibility><android-manifest><google-play>","2","1","2","",""
"3510309","1","","","2010-08-18 08:40:24","1","273","<p>The Native Code of the Android application is going alone with application as lib file in the APK file. Suppose if I want to share a native code between two different applications, Is there any trick avail apart from the below:</p><ol><li>Adding the lib with every application</li><li>Copy the lib in to system/lib folder and dynamically link it with application. (If we build just only the applications then we cannot use this).</li></ol>","423671","","423671","","2010-08-18 10:49:25","2013-02-28 07:00:57","Sharing Android NDK Lib","<android>","2","0","","",""
"3510377","1","3510553","","2010-08-18 08:51:58","2","2436","<p>I have a problem when trying to display a GIF animation inside of a <code>WebView</code>.</p><p>What is the problem and how can I solve it?</p>","289277","","418183","","2011-11-14 15:27:43","2012-02-08 20:21:44","Animated GIF doesn't display in WebView on Android 1.6","<android><webview><animated-gif>","1","1","","",""
"3510388","1","3510774","","2010-08-18 08:53:22","1","547","<p>I'm building a game with graphic assets in hdpi resolutions (hence I put the files in drawable-hdpi directory). I don't want to have a corresponding mdpi resolution of the images, and I will code everything in 240-dpi based pixel coordinates.</p><p>Is it possible to still allow mdpi and ldpi devices to run the app, by automatically scaling the graphics from the hdpi version?</p>","11238","","","","","2012-09-24 01:50:13","Android: Optimize for high-dpi devices only but still support (small- and) medium-dpi screens","<android><resources><hdpi><mdpi>","2","0","3","",""
"3510433","1","3510531","","2010-08-18 09:00:14","1","10693","<p>Here is the link where i have discussed about a countdown timer of format(mm:ss) in Java:</p><p><a href=""http://stackoverflow.com/questions/3491027/java-console-code-for-stopwatch-timer"">http://stackoverflow.com/questions/3491027/java-console-code-for-stopwatch-timer</a></p><p>Now i want to display (and update) it in a textview in android. Any clue? </p>","2355649","","","","","2012-11-03 13:25:54","Countdown Timer required on Android","<android>","4","0","1","",""
"3510507","1","","","2010-08-18 09:10:27","1","318","<p>Referring Romain Guy's &amp; Adam Powell's talk ""<a href=""http://www.youtube.com/watch?v=wDBM6wVEO70"" rel=""nofollow"">The World of ListView</a>"", in the QA section, one person wants to implement Bi-directional Scrolling ListView. They advise him to have a look at implementation of <a href=""http://www.netmite.com/android/mydroid/packages/apps/Launcher/src/com/android/launcher/Workspace.java"" rel=""nofollow"">Workspace.java</a>.</p><p>Can anybody help me understand this source code. Which piece of code in Workspace.java is doing Bi-directional Scrolling?</p>","393792","","393792","","2010-08-19 11:28:09","2010-08-19 11:28:09","Bi-directional Scrolling in Android","<android><listview>","0","0","","",""
"3510508","1","3511728","","2010-08-18 09:10:31","2","625","<p>When I check my logs, when using ListView, I see, that getView() method of a custom adapter is continuously invoked on first 6 elements, even if I scroll to the very end of the list. Has anyone seen behaviour like this?</p>","403324","","","","","2010-08-18 11:52:13","First 6 ListView elements are continuously being invoked with getView()","<android>","1","2","1","",""
"3510544","1","","","2010-08-18 09:15:12","11","11962","<p>OK, so not entirely sure this is possible...</p><p>But trying to write an application so that I can run some code before any of the following activities are performed.</p><p>1) APK is downloaded from web and market launches installer</p><p>2) Install button is pressed on android market</p><p>Is it possible to intercept and prompt on these events, or has Google locked that stuff down quite tightly?</p>","159882","","","","","2013-01-29 04:58:23","Android - How to intercept the 'Install application' intent","<android><android-intent><google-play><apk>","3","0","10","",""
"3510545","1","","","2010-08-18 09:15:13","1","169","<p>I am receiving SMS, through Broadcast receiver and poping a toast about SMS, then in other class I had smsSenderActivity? I have to call that Activity when I click Ok on toast that poped, when SMS comes? How do I call smssender Activity?</p>","414777","","759866","","2013-12-25 20:51:45","2013-12-25 20:51:45","How to start an smsSenderactivty in Broadcast Receiver?","<android><sms>","1","0","","",""
"3510581","1","3546360","","2010-08-18 09:19:20","4","786","<p>I spend three days in find out how I can connect to an https chunked push servlet and get an inputstream.The connection with <code>HttpsURLConnection</code> works and also with <code>HttpClient</code>but in every programmed code, when I try to get the InputStream of this servlet, this line blocks! No error, no exception, nothing. The debugger only stops at this line and wait.</p><p>I know that there is no <code>Content-Length</code> in the Header of the servlet and I know that this was the reason why the method <code>getInputStream</code> of <code>URLConnection</code> blocks.</p><p>But now I have no other Idea. Is there anyone who can help me to get this <code>InputStream</code> from the servlet? All connections are fine with <code>HttpsURLConnection</code> and <code>HTTPClient</code> <strong>only getting the InputStream Fails</strong> and I don't know why.</p>","421901","","157882","","2010-08-18 12:31:01","2010-08-23 09:44:15","How to get InputStream of an https, chunked Push Servlet?","<android><servlets><ssl><https><chunked>","1","0","1","",""
"3510649","1","3510771","","2010-08-18 09:30:25","7","9763","<p>I have created an Activity with a AutuCompleteTextView[ACTV] and button. I enter some text in the ACTV then press the button.After I press the button I want the Activity to go to another Activity. In the second Activity I just want to display the text entered in ACTV(of the first actvity) as a TextView.  </p><p>I know how to start the second activity which is as below:</p><pre><code>Intent i = new Intent(this, ActivityTwo.class);startActivity(i);</code></pre><p>I have coded this to obtain the text entered from the ACTV.</p><pre><code>AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete);CharSequence getrec=textView.getText();</code></pre><p>My question here is how to pass ""getrec"" (after I press the button) from the first Activity to the second. And later recieve ""getrec"" in the second activity.</p><p>Please assume that I have created the event handler class for the button by using ""onClick(View v)""</p>","421730","","","","","2012-09-21 11:27:27","How to pass a value from one Activity to another in Android?","<android>","3","0","2","",""
"3510767","1","","","2010-08-18 09:44:09","3","1274","<p>I want to know the version of Javascript that is supported by the WebView in Android 1.6.</p><p>Thanks in advance,Parth Mehta</p>","423822","","","","","2010-08-18 09:56:01","javascript version in Android","<javascript><android>","1","1","1","",""
"3510776","1","3512214","","2010-08-18 09:45:13","2","143","<p>Friend's  I need help on loading the content alone in my page without going to new page when i selected the scroll menu.</p><p>**>  I have an</p><blockquote><pre><code>     1. header layout and      2. framelayout in another xml file have declared Listview and it</code></pre>    <p>also have tabhost<br>              <strong>and also have gallery view for scroll menu.           3. content list in another xml file.**</strong></p></blockquote><p>when i selected the scroll menu i need to load the list content alone in that activity i suppose not to load whole header and and redeclare tabhost in next that scroll menu selected activity. </p><p>Thanks in advance.</p>","407506","","","","","2010-08-18 12:49:01","how to load part of the layout content alone","<android>","1","0","","",""
"3510853","1","","","2010-08-18 09:54:16","2","941","<p>I am working on Gps based application which runs all the time in background. But in extreme low memory case(or when i open many apps) my app is killed by the android system. </p><p>I want to relaunch my app when it is killed by android system.I google it for this but don't get any solution.Any help would be appreciated.</p><p>Thanks </p>","320676","","263521","","2010-08-18 09:57:38","2010-08-18 11:33:57","How do i know when my app is going to kill","<android>","5","2","0","",""
"3510856","1","9839006","","2010-08-18 09:54:37","4","3050","<p>on Android phones, under Call -> Additional settings -> Caller ID</p><p>it is possible to hide your caller ID. I want to do that programatically from my code, but was not able to find a way to do that.</p><p>I searched through </p><p>android.provider android.telephony</p><p>for 2.1 release and was not able to find it.</p><p>Has anybody successfully solved this issue?</p><p>Thanks in advance. Best regards.</p>","423823","","423823","","2012-05-15 11:06:33","2012-05-15 11:06:33","How to programatically hide Caller ID on Android","<android>","2","0","3","",""
"3510969","1","3511015","","2010-08-18 10:12:17","2","709","<p>Trying to create a widget with custom fonts, but read that widget doesn't support custom font. </p><p>I thought that I could create 10 png's for every number(0-10, not going to use abc ect).</p><p>By using that method I need to create several imageviews... that seems a waste of views.</p><p>So if I want to have the number 1337 I need 4 ImageViews. Isn't there a way to merge the png's (R.drawable), so I get a Bitmap or something and only one 1 ImageView?</p>","423844","","","","","2010-08-18 10:17:50","Merge two/more image in Android(widget)","<java><android><image><merge><widget>","1","0","","",""
"3511202","1","","","2010-08-18 10:42:26","2","319","<p>I am trying to update contact email address using this code</p><pre><code>String selectEmail = ContactsContract.Data.CONTACT_ID + ""=? AND "" + ContactsContract.Data.MIMETYPE + ""='""  +     ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE + ""'"";    String[] emailArgs = new String[]{Id};     ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)    .withSelection(selectEmail, emailArgs)    .withValue(ContactsContract.CommonDataKinds.Email.DATA, email)    .build()); </code></pre><p>I am getting ""Id"" using this code</p><pre><code>String[] returnVals = new String[] {ContactsContract.CommonDataKinds.Phone.CONTACT_ID};   this.cur = this.cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,                returnVals,                ContactsContract.CommonDataKinds.Phone.NUMBER + "" = \"""" + phoneNumber + ""\"""",                null,                null);</code></pre><p>My questions are</p><p>1) Am I using correct way for getting Contact_ID using Phone number?2) Contacts are not updating correctly, it is changing all fields like email, name and number.Am I doing some thing wrong?</p><p>Need help</p>","265064","","265064","","2010-08-19 05:09:16","2010-08-24 19:29:02","Problem in updating contact email address","<android>","1","1","0","",""
"3511211","1","3511421","","2010-08-18 10:43:37","1","985","<pre><code>public class DrawView extends View{   private ColorBall[] colorballs = new ColorBall[3]; // array that holds the balls   private int balID = 0; // variable to know what ball is being dragged      /* protected Bitmap getImage(int id) {        return BitmapFactory.decodeResource(mContex.getResources(), id);    }*/   private Paint mBitmapPaint = new Paint();  public DrawView(Context context) {        super(context);        setFocusable(false); //necessary for getting the touch events        // setting the start point for the balls        Point point1 = new Point();        point1.x = 50;        point1.y = 400;        Point point2 = new Point();        point2.x = 100;        point2.y = 400;        Point point3 = new Point();        point3.x = 150;        point3.y = 400;        // declare each ball with the ColorBall class        colorballs[0] = new ColorBall(context,R.drawable.b, point1);       colorballs[2] = new ColorBall(context,R.drawable.t, point3);    }    // the method that draws the balls    @Override protected void onDraw(Canvas canvas) {        canvas.drawColor(0xFFCCCCCC);        setFocusable(false);        Log.v(""Images"",""3333"");        //if you want another background color               canvas.drawBitmap((BitmapFactory.decodeResource(getResources(),R.drawable.caralpha)), 10, -50, mBitmapPaint);        //draw the balls on the canvas        for (ColorBall ball : colorballs) {            canvas.drawBitmap(ball.getBitmap(), ball.getX(), ball.getY(), null);          }        //canvas.drawRect(10, 50, 10 + 2, 10 + 2,mBitmapPaint);        canvas.drawText(""A"", 10,350, mBitmapPaint);        Vector correctname=correct(""B"");        String name=""b"";        for(int i=0,xCo=20;i&lt;correctname.size();i++)        {          try {            int image=selectImage(name.charAt(i));            canvas.drawBitmap((BitmapFactory.decodeResource(getResources(),image)), 10+xCo,350, mBitmapPaint);            xCo=xCo+100;          }          catch(Exception e)          {          }        }    }    private int selectImage(char charAt) {        switch(charAt)        {        case 'a':            return R.drawable.a;        case 'b':            return R.drawable.b;        case 't':            return R.drawable.t;        }        return 0;    }    private Vector correct(String word) {         Vector al = new Vector();            for (int i = 0; i &lt; word.length(); i++)             {            al.add(word.charAt(i));            }            al.toString();            return al;    }    // events when touching the screen    public boolean onTouchEvent(MotionEvent event) {        int eventaction = event.getAction();         int X = (int)event.getX();         int Y = (int)event.getY();         switch (eventaction ) {         case MotionEvent.ACTION_DOWN: // touch down so check if the finger is on a ball            balID = 0;            for (ColorBall ball : colorballs) {                // check if inside the bounds of the ball (circle)                // get the center for the ball                int centerX = ball.getX() + 25;                int centerY = ball.getY() + 25;                // calculate the radius from the touch to the center of the ball                double radCircle  = Math.sqrt( (double) (((centerX-X)*(centerX-X)) + (centerY-Y)*(centerY-Y)));                // if the radius is smaller then 23 (radius of a ball is 22), then it must be on the ball                if (radCircle &lt; 23){                    balID = ball.getID();                    break;                }                // check all the bounds of the ball (square)                //if (X &gt; ball.getX() &amp;&amp; X &lt; ball.getX()+50 &amp;&amp; Y &gt; ball.getY() &amp;&amp; Y &lt; ball.getY()+50){                //  balID = ball.getID();                //  break;                //}              }             break;         case MotionEvent.ACTION_MOVE:   // touch drag with the ball            // move the balls the same as the finger            if (balID &gt; 0) {                Log.v(""Images"",""3333  Moving"");                colorballs[balID-1].setX(X-25);                colorballs[balID-1].setY(Y-25);            }            break;         case MotionEvent.ACTION_UP:             /*for (ColorBall ball : colorballs) {                Log.v(""y value"",""YYYYYYYYYYY  ""+ball.getY()+""XXXXXXXXXXXX ""+ball.getID());            }*/            // touch drop - just do things here after dropping//setFocusable(false);             break;         }         // redraw the canvas        invalidate();         return true;     }}</code></pre><p>Hi I am using the above code for displaying bitmap.and i also move that bitmap.Now my qusetion is  how i am compare bitmap with another bitmap.Please give me some suggestions.Thanks in advance</p>","454808","","","","","2010-08-18 11:20:48","Compare the bitmaps in canvas","<android>","2","2","","",""
"3511290","1","3511500","","2010-08-18 10:54:17","2","519","<p>I'm doing some maths calculations in android map activity and I need to find a position of a GeoPoint which user has clicked on the map. I understand that I need to use onTouch event handler. This is how it looks like at the moment:</p><pre><code>@Overridepublic boolean onTouch(View v, MotionEvent event) {    int action = event.getAction();    if(action == MotionEvent.ACTION_DOWN)    {        GeoPoint pGoal = mapView.getProjection().fromPixels(                (int) event.getX(),                (int) event.getY());        DisplayInfoMessage(""The screen has been touched!"" + event.getX() + "" AND "" + event.getY() + ""Latitude: ""+ pGoal.getLatitudeE6());   // only for displaying test popup    }    super.onTouchEvent(event);    return true;        }  </code></pre><p>It doesn't do what I want though. Any help or hint at least greatly appreciated!</p>","359656","","","","","2010-08-18 11:23:43","How to get a GeoPosition of a clicked position on the map?","<java><android><google-maps>","1","4","","",""
"3511433","1","3530381","","2010-08-18 11:13:26","4","821","<p>I just encountered the following situation. I have an Android app with a scenario which I guess may happen in multiple apps. It's about tagging/labeling/categorizing, call it as you want. I basically have the following relations in the SQLite DB</p><pre><code> --------                 --------------              ---------|  Tags  |               |  DeviceTags  |            | Devices ||--------|               |--------------|            |---------|| ID     | 1 ------ *    | ID           | * ------ 1 | ID      || NAME   |               | TAGS_ID      |            | NAME    | --------                | DEVICE_ID    |            | ...     |                          --------------              ---------</code></pre><p>Everything is exposed over a ContentProvider I've written. So far everything is fine.</p><p>On the UI part, I have an ListActivity showing all of the stored Devices (from the Devices table) and for customizing the UI a bit further, I created custom row items showing a small image in front based on the device type etc.</p><p>What I'd like to achieve now is to also show the associated tags on that list for each device. Now <strong>here comes my problem</strong>. For the simple device list I created a custom ResourceCursorAdapter where I set the according information in the bindView method</p><pre><code>@Overridepublic void bindView(final View view, final Context context, final Cursor cursor) {  final int objectId = cursor.getInt(cursor.getColumnIndex(Devices._ID));  TextView deviceName = (TextView) view.findViewById(R.id.deviceName);  deviceName.setText(...); //set it from the cursor  ...  TextView associatedTagsView = (TextView)...;  associatedTagsView.setText(...); //&lt;&lt;&lt;???? This would need a call to a different table  ...}</code></pre><p>As you can see, for being able to know what kind of tags my device has associated, I'd need to query DeviceTags. So I did:</p><pre><code>@Overridepublic void bindView(final View view, final Context context, final Cursor cursor) {   ...   TextView associatedTagsView = (TextView)view.findViewById(R.id.deviceTags);   String tagsString = retrieveTagsString(view.getContext().getContentResolver(), objectId);   ...}private String retrieveTagsString(ContentResolver contentResolver, int objectId) {    Cursor tagForDeviceCursor =  contentResolver.query(DroidSenseProviderMetaData.TABLE_JOINS.TAG_DEVICETAG,...);    if(tagForDeviceCursor != null &amp;&amp; tagForDeviceCursor.moveToFirst()){        StringBuffer result = new StringBuffer();        boolean isFirst = true;        do{            if(!isFirst)                result.append("", "");            else                isFirst = false;            result.append(retrieve name from cursor column...);        }while(tagForDeviceCursor.moveToNext());        return result.toString();    }           return null;}</code></pre><p>I tested this and it actually works just fine, but to be honest I don't feel well doing this. Somehow seems weird to me...</p><p>Are there any better solutions on how to solve this??</p><p><strong>//Edit:</strong></p><p>After CommonsWare's feedback here a bit of a clarification. I'm weird about doing the second query to the DB inside the CursorAdapter, basically this would result in one query per row and I fear this will heavily impact my performance (I've still to test it on a real device with a substantial amount of data to see how much this impacts).</p><p><strong>My question</strong> therefore is on whether there are some strategies on how to avoid this given my data model or whether I have to basically ""live"" with that :)</p>","50109","","50109","","2010-08-19 06:30:00","2011-09-11 03:16:00","Optimization proposals for ListView with data from multiple ""tables""","<android><optimization><listview>","2","0","1","",""
"3511460","1","","","2010-08-18 11:16:46","2","3773","<p>In my application I am converting base64 string to image.For that I initially converted base 64 file to byte array and later am trying to convert to images.To convert to Images I am using the below code</p><pre><code>    File sdImageMainDirectory = new File(""/data/data/com.ayansys.Base64trial"");    FileOutputStream fileOutputStream = null;    String nameFile=""Images"";    try {        BitmapFactory.Options options=new BitmapFactory.Options();        options.inSampleSize = 5;        options.inDither = true;         options.inPreferredConfig = Bitmap.Config.ARGB_8888;        Bitmap myImage = BitmapFactory.decodeByteArray(imageData, 0, imageData.length);        fileOutputStream = new FileOutputStream(                sdImageMainDirectory.toString() +""/"" + nameFile + "".jpg"");        BufferedOutputStream bos = new BufferedOutputStream(                fileOutputStream);        myImage.compress(CompressFormat.JPEG, quality, bos);        bos.flush();        bos.close();</code></pre><p>but am getting my image as null at</p><pre><code>Bitmap myImage = BitmapFactory.decodeByteArray(imageData, 0, imageData.length);</code></pre><p>Please let me know your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","82118","","2010-09-13 15:46:16","2010-09-13 15:46:16","BitmapFactory.decodeByteArray returns null in android","<android>","1","2","1","",""
"3511505","1","","","2010-08-18 11:24:24","1","402","<p>I want put delay between two flips of the same image on ImageView.i.e.(1). Image loads with Animation(2). Wait for 1 or 1.5 seconds(3). Image changes with animation on the same ImageView.</p><p>I tried to set Thread.Sleep() , didn't work.</p><p>And yes, these all things I want to be done on android.</p>","240737","","240737","","2010-08-20 08:12:28","2010-08-20 08:12:28","Want to put time gap between two events in Android application","<android><multithreading><animation><delay>","1","0","","",""
"3511530","1","3511563","","2010-08-18 11:27:07","4","6687","<p>when i click a button my app should be terminated. It must not to run at the background. that is when holding the home key, My App should not be alive. For Example, i have to redirect my app to the browser. then My App goes to as a background Task. I want to terminate before the redirection to browser. How is it Possible? Any Idea? Better I would need a Explanation on that. that helps to understand How it works to EveryBody.</p><p>Thanks in Advance.</p>","267269","","267269","","2010-08-18 11:41:49","2011-04-05 14:10:47","How to Terminate a App Programmatically in Android?","<android>","3","2","1","",""
